diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 000000000..1aa478e6b --- /dev/null +++ b/.cargo/config @@ -0,0 +1,37 @@ +[source.crates-io] +replace-with = "vendor+crates-io" + +[source."https://github.com/bjzhjing/linux-loader"] +git = "https://github.com/bjzhjing/linux-loader" +rev = "2b95f1e1958a2b6399b590f64344cab5b4a6d608" +replace-with = "vendor+https://github.com/bjzhjing/linux-loader" + +[source."https://github.com/liujing2/vmm-sys-util"] +git = "https://github.com/liujing2/vmm-sys-util" +branch = "master" +replace-with = "vendor+https://github.com/liujing2/vmm-sys-util" + +[source."https://github.com/rust-vmm/vm-memory"] +git = "https://github.com/rust-vmm/vm-memory" +rev = "281b8bd6cd2927f7a65130194b203a1c2b0ad2e3" +replace-with = "vendor+https://github.com/rust-vmm/vm-memory" + +[source."https://github.com/rust-vmm/vmm-sys-util"] +git = "https://github.com/rust-vmm/vmm-sys-util" +rev = "60fe35bea0bdce8b36c6186a740878880f944bdc" +replace-with = "vendor+https://github.com/rust-vmm/vmm-sys-util" + +[source."vendor+crates-io"] +directory = "./vendor/registry-40351f815f426200" + +[source."vendor+https://github.com/bjzhjing/linux-loader"] +directory = "./vendor/git-4af8f4552cd0d200" + +[source."vendor+https://github.com/liujing2/vmm-sys-util"] +directory = "./vendor/git-ccfa5f04f3f14300" + +[source."vendor+https://github.com/rust-vmm/vm-memory"] +directory = "./vendor/git-89548d8276566400" + +[source."vendor+https://github.com/rust-vmm/vmm-sys-util"] +directory = "./vendor/git-bad78e1967b13e00" diff --git a/.travis.yml b/.travis.yml index 86685ad9f..1d9993139 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,4 +11,4 @@ script: - cargo build --release - cargo test - cargo clippy --all-targets --all-features -- -D warnings - - find . -name "*.rs" | xargs rustfmt --check + - find . -name "*.rs" | grep -v "vendor/" | xargs rustfmt --check diff --git a/Cargo.lock b/Cargo.lock index 7dcb9818a..fbe607d25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,10 @@ name = "cloud-hypervisor" version = "0.1.0" dependencies = [ "clap 2.27.1 (registry+https://github.com/rust-lang/crates.io-index)", + "linux-loader 0.1.0 (git+https://github.com/bjzhjing/linux-loader?rev=2b95f1e1958a2b6399b590f64344cab5b4a6d608)", + "vm-memory 0.1.0 (git+https://github.com/rust-vmm/vm-memory?rev=281b8bd6cd2927f7a65130194b203a1c2b0ad2e3)", "vmm 0.1.0", + "vmm-sys-util 0.1.0 (git+https://github.com/rust-vmm/vmm-sys-util?rev=60fe35bea0bdce8b36c6186a740878880f944bdc)", ] [[package]] @@ -138,6 +141,14 @@ dependencies = [ "vm-memory 0.1.0 (git+https://github.com/rust-vmm/vm-memory)", ] +[[package]] +name = "linux-loader" +version = "0.1.0" +source = "git+https://github.com/bjzhjing/linux-loader?rev=2b95f1e1958a2b6399b590f64344cab5b4a6d608#2b95f1e1958a2b6399b590f64344cab5b4a6d608" +dependencies = [ + "vm-memory 0.1.0 (git+https://github.com/rust-vmm/vm-memory)", +] + [[package]] name = "log" version = "0.4.6" @@ -433,6 +444,14 @@ dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vm-memory" +version = "0.1.0" +source = "git+https://github.com/rust-vmm/vm-memory?rev=281b8bd6cd2927f7a65130194b203a1c2b0ad2e3#281b8bd6cd2927f7a65130194b203a1c2b0ad2e3" +dependencies = [ + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "vm-virtio" version = "0.1.0" @@ -481,6 +500,14 @@ dependencies = [ "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vmm-sys-util" +version = "0.1.0" +source = "git+https://github.com/rust-vmm/vmm-sys-util?rev=60fe35bea0bdce8b36c6186a740878880f944bdc#60fe35bea0bdce8b36c6186a740878880f944bdc" +dependencies = [ + "libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.3.7" @@ -516,6 +543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum kvm-ioctls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f87b0c7322658f94e9fcf661146c9761a487813f3154e6a67a24fc59c68f5306" "checksum libc 0.2.58 (registry+https://github.com/rust-lang/crates.io-index)" = "6281b86796ba5e4366000be6e9e18bf35580adf9e63fbe2294aadb587613a319" "checksum linux-loader 0.1.0 (git+https://github.com/bjzhjing/linux-loader)" = "" +"checksum linux-loader 0.1.0 (git+https://github.com/bjzhjing/linux-loader?rev=2b95f1e1958a2b6399b590f64344cab5b4a6d608)" = "" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" @@ -545,7 +573,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum vm-memory 0.1.0 (git+https://github.com/rust-vmm/vm-memory)" = "" +"checksum vm-memory 0.1.0 (git+https://github.com/rust-vmm/vm-memory?rev=281b8bd6cd2927f7a65130194b203a1c2b0ad2e3)" = "" "checksum vmm-sys-util 0.1.0 (git+https://github.com/liujing2/vmm-sys-util)" = "" +"checksum vmm-sys-util 0.1.0 (git+https://github.com/rust-vmm/vmm-sys-util?rev=60fe35bea0bdce8b36c6186a740878880f944bdc)" = "" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" "checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/Cargo.toml b/Cargo.toml index 2fd966169..795df403c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,4 +7,16 @@ edition = "2018" [dependencies] clap = "=2.27.1" -vmm = { path = "vmm" } \ No newline at end of file +vmm = { path = "vmm" } + +[dependencies.vm-memory] +git = "https://github.com/rust-vmm/vm-memory" +rev = "281b8bd6cd2927f7a65130194b203a1c2b0ad2e3" + +[dependencies.vmm-sys-util] +git = "https://github.com/rust-vmm/vmm-sys-util" +rev = "60fe35bea0bdce8b36c6186a740878880f944bdc" + +[dependencies.linux-loader] +git = "https://github.com/bjzhjing/linux-loader" +rev = "2b95f1e1958a2b6399b590f64344cab5b4a6d608" diff --git a/vendor/.sources b/vendor/.sources new file mode 100644 index 000000000..a69966d68 --- /dev/null +++ b/vendor/.sources @@ -0,0 +1 @@ +["git-3e7c44ea7d5fd800","git-4af8f4552cd0d200","git-89548d8276566400","git-bad78e1967b13e00","git-bda1448fb2afcb00","git-ccfa5f04f3f14300","registry-40351f815f426200"] \ No newline at end of file diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.linux.yml b/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.linux.yml new file mode 100644 index 000000000..f39aa1a54 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.linux.yml @@ -0,0 +1,155 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-x86-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-arm-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-musl-arm-mmap" + commands: + - cargo build --release --features=backend-mmap --target aarch64-unknown-linux-musl + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test --all-features + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-musl-x86" + commands: + - cargo test --all-features --target x86_64-unknown-linux-musl + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-arm" + commands: + - cargo test --all-features + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-musl-arm" + commands: + - cargo test --all-features --target aarch64-unknown-linux-musl + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "clippy-x86" + commands: + - cargo clippy --all + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "check-warnings-x86" + commands: + - RUSTFLAGS="-D warnings" cargo check --all-targets + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "check-warnings-arm" + commands: + - RUSTFLAGS="-D warnings" cargo check --all-targets + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.windows.yml b/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.windows.yml new file mode 100644 index 000000000..a1edeeb28 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/.buildkite/pipeline.windows.yml @@ -0,0 +1,79 @@ +steps: + - label: "build-msvc-x86" + commands: + - cargo build --release + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "build-msvc-x86-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "unittests-msvc-x86" + commands: + - cargo test --all-features + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "clippy-x86" + commands: + - cargo clippy --all + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "check-warnings-x86" + commands: + - cargo check --all-targets + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + environment: + - "RUSTFLAGS=-D warnings" diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo-checksum.json b/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo-checksum.json new file mode 100644 index 000000000..8cd1bfbcf --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/pipeline.linux.yml":"a792da4b923a91eb9a590da2d057f89b37b86ebcf483c344813a1abd5957854d",".buildkite/pipeline.windows.yml":"15e21819ef7321c79181ae7f04aafc0c3ceff709a800edd8994f15a9454d6405",".cargo/config":"c2f1c2fd93436e068cfb14eef3dff8a79d25d1f03c11baf6acbcfbdc9fd3a465","Cargo.toml":"459c6688ce88cac6767971e8053b03a14e05aec157a927134c34d5497c84cf68","DESIGN.md":"aa60ac0a1d59179c253c7be0e496f956344cd0bf41f01f86c9a28575ea433785","LICENSE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"2f4aa7c6dbb257a9345d17cec07b0731cae37dc216d25b41272061861bf984b8","THIRD-PARTY":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","TODO.md":"c844f03be6631843e90d13b3410df031b07ee16db4a3c7cbda7e89557e9be46b","src/address.rs":"dbc3fa642269bb6f9fb5e176dddc9fcedbe024949f32c43577f52ef04fe0cf09","src/bytes.rs":"2d0c58f53e40f51b5177a234a5062f700ea153c779661c8c34f5d9340f24dd05","src/endian.rs":"948548db28334bceeefe72b09560a700d62993372bb89f46e39990038690f516","src/guest_memory.rs":"2be506fe58244f51279c473a7d0d8e1fc41ef638e9c16cc9e6f071bcbecb3b9b","src/lib.rs":"f65c3f36632da8df7b165578bfd8db010af11c1736fd9855614435e76dd3c390","src/mmap.rs":"9f449c7dac3830128bc1875ca0cc7e7407534eeb7cc1e1db0b0d118aba8de07b","src/mmap_unix.rs":"9a1d71bf1bb7952c25e3796f992953390b6db5a32ef40f2dda1275f866dd9ff0","src/mmap_windows.rs":"bd0091dd90eddede03739ab89648a38f513310437dafdf1f449603bb15a7a2ed","src/volatile_memory.rs":"06bdb496a75f3a190b7092daffce01158acdf73654badd72e697b674eedc4fac"},"package":null} \ No newline at end of file diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo/config b/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo/config new file mode 100644 index 000000000..02cbaf3aa --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/.cargo/config @@ -0,0 +1,2 @@ +[target.aarch64-unknown-linux-musl] +rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"] diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/Cargo.toml b/vendor/git-3e7c44ea7d5fd800/vm-memory/Cargo.toml new file mode 100644 index 000000000..87a349c4d --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "vm-memory" +version = "0.1.0" +authors = ["Liu Jiang "] +repository = "https://github.com/rust-vmm/vm-memory" +license = "Apache-2.0" + +[features] +default = [] +backend-mmap = [] + +[dependencies] +libc = ">=0.2.39" + +[dev-dependencies] +matches = ">=0" +tempfile = ">=3.0.2" diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/DESIGN.md b/vendor/git-3e7c44ea7d5fd800/vm-memory/DESIGN.md new file mode 100644 index 000000000..6f20cd47b --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/DESIGN.md @@ -0,0 +1,79 @@ +## Objectives +For a typical hypervisor, there are seveval components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, that need to access VM's physical memory. The `vm-memory` crate aims to provide a set of stable traits to decouple VM memory consumers from VM memory providers. Based on these traits, VM memory consumers could access VM's physical memory without knowing the implementation details of the VM memory provider. Thus hypervisor components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, could be shared and reused by multiple hypervisors. + +## API Principles +- Define consumer side interfaces to access VM's physical memory. +- Do not define provider side interfaces to supply VM physical memory. + +The `vm-memory` crate focuses on defining consumer side interfaces to access VM's physical memory, and it dosen't define the way how the underline VM memory provider is implemented. For light-wieght hypervisors like crosvm and firecracker, they may make some assumptions about the structure of VM's physical memory and implement a light-weight backend to access VM's physical memory. For hypervisors like qemu, a high performance and full functionality backend may be implemented with less assumptions. + +## Architecture +Th `vm-memory` is derived from two upstream projects: +- [crosvm project](https://chromium.googlesource.com/chromiumos/platform/crosvm/) commit 186eb8b0db644892e8ffba8344efe3492bb2b823 +- [firecracker project](https://firecracker-microvm.github.io/) commit 80128ea61b305a27df1f751d70415b04b503eae7 + +To be hypervisor neutral, the high level abstraction has been heavily refactored. The new `vm-memory` crate could be divided into four logic parts as: + +### Abstraction of Generic Address Space +Build generic abstractions to describe and access an address space as below: +- AddressValue: Stores the raw value of an address. Typically u32, u64 or usize is used to store the raw value. But pointers, such as \*u8, can't be used because it doesn't implement the Add and Sub traits. +- Address: Encapsulates an AddressValue object and defines methods to access it. +- Bytes: Common trait for volatile access to memory. The `Bytes` trait can be parameterized with newtypes that represent addresses, in order to enforce that addresses are used with the right "kind" of volatile memory. +- VolatileMemory: Basic implementation of volatile access to memory, implements `Bytes`. + +To make the abstraction as generic as possible, all of above core traits only define methods to access the address space, and they never define methods to manage (create, delete, insert, remove etc) address spaces. By this way, the address space consumers (virtio device drivers, vhost-user drivers and boot loaders etc) may be decoupled from the address space provider (typically a hypervisor). + +### Specialization for Virtual Machine Physical Address Space +The generic address space crates are specialized to access VM's physical memory with following traits: +- GuestAddress: represents a guest physical address (GPA). On ARM64, a 32-bit hypervisor may be used to support a 64-bit VM. For simplicity, u64 is used to store the the raw value no matter if it is a 32-bit or 64-bit virtual machine. +- GuestMemoryRegion: used to represent a continuous region of VM's physical memory. +- GuestMemory: used to represent a collection of GuestMemoryRegion objects. The main responsibilities of the GuestMemory trait are: + - hide the detail of accessing VM's physical address (for example complex hierarchical structures). + - map a request address to a GuestMemoryRegion object and relay the request to it. + - handle cases where an access request spanning two or more GuestMemoryRegion objects. + +The VM memory consumers, such as virtio device drivers, vhost drivers and boot loaders etc, should only rely on traits and structs defined here to access VM's physical memory. + +### A Sample and Default Backend Implementation Based on mmap() +Provide a default and sample implementation of the GuestMemory trait by mmapping VM's physical memory into current process. Three data structures are defined here: +- MmapRegion: mmap a continous range of VM's physical memory into current and provide methods to access the mmapped memory. +- GuestRegionMmap: a wrapper structure to map VM's physical address into (mmap\_region, offset) tuple. +- GuestMemoryMmap: manage a collection of GuestRegionMmap objects for a VM. + +One of the main responsibilities of the GuestMemoryMmap object is to handle the use cases where an access request crosses the memory region boundary. This scenario may be triggered when memory hotplug is supported. So there's a tradeoff between functionality and code complexity: +- use following pattern for simplicity which fails when the request crosses region boundary. It's current default behavior in the crosvm and firecracker project. +```rust + let guest_memory_mmap: GuestMemoryMmap = ... + let addr: GuestAddress = ... + let buf = &mut [0u8; 5]; + let result = guest_memory_mmap.find_region(addr).unwrap().write(buf, addr); +``` +- use following pattern for functionality to support request crossing region boundary: +```rust + let guest_memory_mmap: GuestMemoryMmap = ... + let addr: GuestAddress = ... + let buf = &mut [0u8; 5]; + let result = guest_memory_mmap.write(buf, addr); +``` + +### Utilities and Helpers +Following utility and helper traits/macros are imported from the [crosvm project](https://chromium.googlesource.com/chromiumos/platform/crosvm/) with minor changes: +- ByteValued (originally `DataInit`): Types for which it is safe to initialize from raw data. A type `T` is `ByteValued` if and only if it can be initialized by reading its contents from a byte array. This is generally true for all plain-old-data structs. It is notably not true for any type that includes a reference. +- {Le,Be}\_{16,32,64}: Explicit endian types useful for embedding in structs or reinterpreting data. + +## Relationships between Traits, Structs and new Types +Traits: +- Address inherits AddressValue +- GuestMemoryRegion inherits Bytes (must be implemented) +- GuestMemory implements Bytes (generic implementation) + +New Types: +- GuestAddress: Address\ +- MemoryRegionAddress: Address\ + +Structs: +- MmapRegion implements VolatileMemory +- GuestRegionMmap implements Bytes + GuestMemoryRegion +- GuestMemoryMmap implements GuestMemory +- VolatileSlice: Bytes + VolatileMemory + diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/LICENSE b/vendor/git-3e7c44ea7d5fd800/vm-memory/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/LICENSE @@ -0,0 +1,202 @@ + + 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/vendor/git-3e7c44ea7d5fd800/vm-memory/README.md b/vendor/git-3e7c44ea7d5fd800/vm-memory/README.md new file mode 100644 index 000000000..fa711e5d9 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/README.md @@ -0,0 +1,47 @@ +# vm-memory +A library to access virtual machine's physical memory. + +For a typical hypervisor, there are seveval components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, need to access VM's physical memory. The `vm-memory` crate provides a set of traits to decouple VM memory consumers from VM memory providers. Based on these traits, VM memory consumers could access VM's physical memory without knowing the implementation details of the VM memory provider. Thus hypervisor components based on these traits could be shared and reused by multiple hypervisors. + +## Platform Support +- Arch: x86, AMD64, ARM64 +- OS: Linux/Unix/Windows + +## Usage +First, add the following to your `Cargo.toml`: +```toml +vm-memory = "0.1" +``` +Next, add this to your crate root: +```rust +extern crate vm_memory; +``` + +## Example +- Create VM physical memory objects in hypervisor specific ways. Use the default GuestMemoryMmap as an example: +``` + fn provide_mem_to_virt_dev() { + let gm = GuestMemoryMmap::new(&[(GuestAddress(0), 0x1000), (GuestAddress(0x1000), 0x1000)]).unwrap(); + virt_device_io(&gm); + } +``` + +- Consumers access VM's physical memory +``` + fn virt_device_io(mem: &T) { + let sample_buf = &[1, 2, 3, 4, 5]; + assert_eq!(mem.write(sample_buf, GuestAddress(0xffc)).unwrap(), 5); + let buf = &mut [0u8; 5]; + assert_eq!(mem.read(buf, GuestAddress(0xffc)).unwrap(), 5); + assert_eq!(buf, sample_buf); + } +``` + +## Documentations & References +- [Design of The `vm-memory` Crate](DESIGN.md) +- [TODO List](TODO.md) +- [The rust-vmm Project](https://github.com/rust-vmm/) + +## License +This project is licensed under +- Apache License, Version 2.0, (LICENSE or http://www.apache.org/licenses/LICENSE-2.0) diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/THIRD-PARTY b/vendor/git-3e7c44ea7d5fd800/vm-memory/THIRD-PARTY new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/THIRD-PARTY @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/TODO.md b/vendor/git-3e7c44ea7d5fd800/vm-memory/TODO.md new file mode 100644 index 000000000..e52bb072d --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/TODO.md @@ -0,0 +1,3 @@ +### TODO List +- Abstraction layer to seperate VM memory management from VM memory accessor. +- Help needed to refine documentation and usage examples. diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/address.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/address.rs new file mode 100644 index 000000000..d84771865 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/address.rs @@ -0,0 +1,170 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits to represent an address within an address space. +//! +//! Two traits are defined to present an address within an address space: +//! - [AddressValue](trait.AddressValue.html): stores the raw value of an address. Typically u32, +//! u64 or usize is used to store the raw value. But pointers, such as *u8, can't be used because +//! it doesn't implement the Add and Sub traits. +//! - [Address](trait.Address.html): encapsulates an AddressValue object and defines methods to +//! access and manipulate it. + +use std::cmp::{Eq, Ord, PartialEq, PartialOrd}; +use std::ops::{Add, BitAnd, BitOr, Sub}; + +/// Simple helper trait used to store a raw address value. +pub trait AddressValue { + /// Type of the address raw value. + type V: Copy + + PartialEq + + Eq + + PartialOrd + + Ord + + Add + + Sub + + BitAnd + + BitOr; +} + +/// Trait to represent an address within an address space. +/// +/// To simplify the design and implementation, assume the same raw data type (AddressValue::V) +/// could be used to store address, size and offset for the address space. Thus the Address trait +/// could be used to manage address, size and offset. On the other hand, type aliases may be +/// defined to improve code readability. +/// +/// One design rule is applied to the Address trait that operators (+, -, &, | etc) are not +/// supported and it forces clients to explicitly invoke corresponding methods. But there are +/// always exceptions: +/// Address (BitAnd|BitOr) AddressValue are supported. +pub trait Address: + AddressValue + + Sized + + Default + + Copy + + Eq + + PartialEq + + Ord + + PartialOrd + + BitAnd<::V, Output = Self> + + BitOr<::V, Output = Self> +{ + /// Create an address from a raw address value. + fn new(addr: Self::V) -> Self; + + /// Get the raw value of the address. + fn raw_value(&self) -> Self::V; + + /// Returns the bitwise and of the address with the given mask. + fn mask(&self, mask: Self::V) -> Self::V { + self.raw_value() & mask + } + + /// Returns the offset from this address to the given base address and None if there is + /// underflow. + fn checked_offset_from(&self, base: Self) -> Option; + + /// Returns the offset from this address to the given base address. + /// Only use this when `base` is guaranteed not to overflow. + fn unchecked_offset_from(&self, base: Self) -> Self::V { + self.raw_value() - base.raw_value() + } + + /// Returns the result of the add or None if there is overflow. + fn checked_add(&self, other: Self::V) -> Option; + + /// Returns the result of the add and a flag identifying whether there was overflow + fn overflowing_add(&self, other: Self::V) -> (Self, bool); + + /// Returns the result of the base address + the size. + /// Only use this when `offset` is guaranteed not to overflow. + fn unchecked_add(&self, offset: Self::V) -> Self; + + /// Returns the result of the subtraction or None if there is underflow. + fn checked_sub(&self, other: Self::V) -> Option; + + /// Returns the result of the subtraction and a flag identifying whether there was overflow + fn overflowing_sub(&self, other: Self::V) -> (Self, bool); + + /// Returns the result of the subtraction. + /// Only use this when `other` is guaranteed not to underflow. + fn unchecked_sub(&self, other: Self::V) -> Self; +} + +macro_rules! impl_address_ops { + ($T:ident, $V:ty) => { + impl AddressValue for $T { + type V = $V; + } + + impl Address for $T { + fn new(value: $V) -> $T { + $T(value) + } + + fn raw_value(&self) -> $V { + self.0 + } + + fn checked_offset_from(&self, base: $T) -> Option<$V> { + self.0.checked_sub(base.0) + } + + fn checked_add(&self, other: $V) -> Option<$T> { + self.0.checked_add(other).map($T) + } + + fn overflowing_add(&self, other: $V) -> ($T, bool) { + let (t, ovf) = self.0.overflowing_add(other); + ($T(t), ovf) + } + + fn unchecked_add(&self, offset: $V) -> $T { + $T(self.0 + offset) + } + + fn checked_sub(&self, other: $V) -> Option<$T> { + self.0.checked_sub(other).map($T) + } + + fn overflowing_sub(&self, other: $V) -> ($T, bool) { + let (t, ovf) = self.0.overflowing_sub(other); + ($T(t), ovf) + } + + fn unchecked_sub(&self, other: $V) -> $T { + $T(self.0 - other) + } + } + + impl Default for $T { + fn default() -> $T { + Self::new(0 as $V) + } + } + + impl BitAnd<$V> for $T { + type Output = $T; + + fn bitand(self, other: $V) -> $T { + $T(self.0 & other) + } + } + + impl BitOr<$V> for $T { + type Output = $T; + + fn bitor(self, other: $V) -> $T { + $T(self.0 | other) + } + } + }; +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/bytes.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/bytes.rs new file mode 100644 index 000000000..8d66e93b1 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/bytes.rs @@ -0,0 +1,285 @@ +// Portions Copyright 2019 Red Hat, Inc. +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Define the ByteValued trait to mark that it is safe to instantiate the struct with random data. + +use std::io::{Read, Write}; +use std::mem::size_of; +use std::result::Result; +use std::slice::{from_raw_parts, from_raw_parts_mut}; + +/// Types for which it is safe to initialize from raw data. +/// +/// A type `T` is `ByteValued` if and only if it can be initialized by reading its contents from a +/// byte array. This is generally true for all plain-old-data structs. It is notably not true for +/// any type that includes a reference. +/// +/// Implementing this trait guarantees that it is safe to instantiate the struct with random data. +pub unsafe trait ByteValued: Copy + Default + Send + Sync { + /// Converts a slice of raw data into a reference of `Self`. + /// + /// The value of `data` is not copied. Instead a reference is made from the given slice. The + /// value of `Self` will depend on the representation of the type in memory, and may change in + /// an unstable fashion. + /// + /// This will return `None` if the length of data does not match the size of `Self`, or if the + /// data is not aligned for the type of `Self`. + fn from_slice(data: &[u8]) -> Option<&Self> { + // Early out to avoid an unneeded `align_to` call. + if data.len() != size_of::() { + return None; + } + + // Safe because the ByteValued trait asserts any data is valid for this type, and we ensured + // the size of the pointer's buffer is the correct size. The `align_to` method ensures that + // we don't have any unaligned references. This aliases a pointer, but because the pointer + // is from a const slice reference, there are no mutable aliases. Finally, the reference + // returned can not outlive data because they have equal implicit lifetime constraints. + match unsafe { data.align_to::() } { + ([], [mid], []) => Some(mid), + _ => None, + } + } + + /// Converts a mutable slice of raw data into a mutable reference of `Self`. + /// + /// Because `Self` is made from a reference to the mutable slice`, mutations to the returned + /// reference are immediately reflected in `data`. The value of the returned `Self` will depend + /// on the representation of the type in memory, and may change in an unstable fashion. + /// + /// This will return `None` if the length of data does not match the size of `Self`, or if the + /// data is not aligned for the type of `Self`. + fn from_mut_slice(data: &mut [u8]) -> Option<&mut Self> { + // Early out to avoid an unneeded `align_to_mut` call. + if data.len() != size_of::() { + return None; + } + + // Safe because the ByteValued trait asserts any data is valid for this type, and we ensured + // the size of the pointer's buffer is the correct size. The `align_to` method ensures that + // we don't have any unaligned references. This aliases a pointer, but because the pointer + // is from a mut slice reference, we borrow the passed in mutable reference. Finally, the + // reference returned can not outlive data because they have equal implicit lifetime + // constraints. + match unsafe { data.align_to_mut::() } { + ([], [mid], []) => Some(mid), + _ => None, + } + } + + /// Converts a reference to `self` into a slice of bytes. + /// + /// The value of `self` is not copied. Instead, the slice is made from a reference to `self`. + /// The value of bytes in the returned slice will depend on the representation of the type in + /// memory, and may change in an unstable fashion. + fn as_slice(&self) -> &[u8] { + // Safe because the entire size of self is accessible as bytes because the trait guarantees + // it. The lifetime of the returned slice is the same as the passed reference, so that no + // dangling pointers will result from this pointer alias. + unsafe { from_raw_parts(self as *const Self as *const u8, size_of::()) } + } + + /// Converts a mutable reference to `self` into a mutable slice of bytes. + /// + /// Because the slice is made from a reference to `self`, mutations to the returned slice are + /// immediately reflected in `self`. The value of bytes in the returned slice will depend on + /// the representation of the type in memory, and may change in an unstable fashion. + fn as_mut_slice(&mut self) -> &mut [u8] { + // Safe because the entire size of self is accessible as bytes because the trait guarantees + // it. The trait also guarantees that any combination of bytes is valid for this type, so + // modifying them in the form of a byte slice is valid. The lifetime of the returned slice + // is the same as the passed reference, so that no dangling pointers will result from this + // pointer alias. Although this does alias a mutable pointer, we do so by exclusively + // borrowing the given mutable reference. + unsafe { from_raw_parts_mut(self as *mut Self as *mut u8, size_of::()) } + } +} + +/// A container to host a range of bytes and access its content. +/// +/// Candidates which may implement this trait include: +/// - anonymous memory areas +/// - mmapped memory areas +/// - data files +/// - a proxy to access memory on remote +pub trait Bytes { + /// Associated error codes + type E; + + /// Writes a slice into the container at the specified address. + /// Returns the number of bytes written. The number of bytes written can + /// be less than the length of the slice if there isn't enough room in the + /// container. + fn write(&self, buf: &[u8], addr: A) -> Result; + + /// Reads to a slice from the container at the specified address. + /// Returns the number of bytes read. The number of bytes read can be less than the length + /// of the slice if there isn't enough room within the container. + fn read(&self, buf: &mut [u8], addr: A) -> Result; + + /// Writes the entire contents of a slice into the container at the specified address. + /// + /// Returns an error if there isn't enough room within the container to complete the entire + /// write. Part of the data may have been written nevertheless. + fn write_slice(&self, buf: &[u8], addr: A) -> Result<(), Self::E>; + + /// Reads from the container at the specified address to fill the entire buffer. + /// + /// Returns an error if there isn't enough room within the container to fill the entire buffer. + /// Part of the buffer may have been filled nevertheless. + fn read_slice(&self, buf: &mut [u8], addr: A) -> Result<(), Self::E>; + + /// Writes an object into the container at the specified address. + /// Returns Ok(()) if the object fits, or Err if it extends past the end. + fn write_obj(&self, val: T, addr: A) -> Result<(), Self::E> { + self.write_slice(val.as_slice(), addr) + } + + /// Reads an object from the container at the given address. + /// Reading from a volatile area isn't strictly safe as it could change mid-read. + /// However, as long as the type T is plain old data and can handle random initialization, + /// everything will be OK. + fn read_obj(&self, addr: A) -> Result { + let mut result: T = Default::default(); + self.read_slice(result.as_mut_slice(), addr).map(|_| result) + } + + /// Writes data from a readable object like a File and writes it into the container. + /// + /// # Arguments + /// * `addr` - Begin writing at this address. + /// * `src` - Copy from `src` into the container. + /// * `count` - Copy `count` bytes from `src` into the container. + fn read_from(&self, addr: A, src: &mut F, count: usize) -> Result + where + F: Read; + + /// Writes data from a readable object like a File and writes it into the container. + /// + /// # Arguments + /// * `addr` - Begin writing at this address. + /// * `src` - Copy from `src` into the container. + /// * `count` - Copy `count` bytes from `src` into the container. + fn read_exact_from(&self, addr: A, src: &mut F, count: usize) -> Result<(), Self::E> + where + F: Read; + + /// Reads data from the container to a writable object. + /// + /// # Arguments + /// * `addr` - Begin reading from this addr. + /// * `dst` - Copy from the container to `dst`. + /// * `count` - Copy `count` bytes from the container to `dst`. + fn write_to(&self, addr: A, dst: &mut F, count: usize) -> Result + where + F: Write; + + /// Reads data from the container to a writable object. + /// + /// # Arguments + /// * `addr` - Begin reading from this addr. + /// * `dst` - Copy from the container to `dst`. + /// * `count` - Copy `count` bytes from the container to `dst`. + fn write_all_to(&self, addr: A, dst: &mut F, count: usize) -> Result<(), Self::E> + where + F: Write; +} + +// All intrinsic types and arrays of intrinsic types are ByteValued. They are just numbers. +macro_rules! array_data_init { + ($T:ty, $($N:expr)+) => { + $( + unsafe impl ByteValued for [$T; $N] {} + )+ + } +} +macro_rules! data_init_type { + ($T:ty) => { + unsafe impl ByteValued for $T {} + array_data_init! { + $T, + 0 1 2 3 4 5 6 7 8 9 + 10 11 12 13 14 15 16 17 18 19 + 20 21 22 23 24 25 26 27 28 29 + 30 31 32 + } + }; +} +data_init_type!(u8); +data_init_type!(u16); +data_init_type!(u32); +data_init_type!(u64); +data_init_type!(usize); +data_init_type!(i8); +data_init_type!(i16); +data_init_type!(i32); +data_init_type!(i64); +data_init_type!(isize); + +#[cfg(test)] +mod tests { + use std::fmt::Debug; + use std::mem::{align_of, size_of}; + use ByteValued; + + fn from_slice_alignment() + where + T: ByteValued + PartialEq + Debug + Default, + { + let mut v = [0u8; 32]; + let pre_len = { + let (pre, _, _) = unsafe { v.align_to::() }; + pre.len() + }; + { + let aligned_v = &mut v[pre_len..pre_len + size_of::()]; + { + let from_aligned = T::from_slice(aligned_v); + let val: T = Default::default(); + assert_eq!(from_aligned, Some(&val)); + } + { + let from_aligned_mut = T::from_mut_slice(aligned_v); + let mut val: T = Default::default(); + assert_eq!(from_aligned_mut, Some(&mut val)); + } + } + for i in 1..size_of::() { + let begin = pre_len + i; + let end = begin + size_of::(); + let unaligned_v = &mut v[begin..end]; + { + let from_unaligned = T::from_slice(unaligned_v); + if align_of::() != 1 { + assert_eq!(from_unaligned, None); + } + } + { + let from_unaligned_mut = T::from_mut_slice(unaligned_v); + if align_of::() != 1 { + assert_eq!(from_unaligned_mut, None); + } + } + } + } + + #[test] + fn test_slice_alignment() { + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + } +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/endian.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/endian.rs new file mode 100644 index 000000000..ec37acad4 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/endian.rs @@ -0,0 +1,148 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Explicit endian types useful for embedding in structs or reinterpreting data. +//! +//! Each endian type is guaarnteed to have the same size and alignment as a regular unsigned +//! primitive of the equal size. +//! +//! # Examples +//! +//! ``` +//! # use vm_memory::*; +//! let b: Be32 = From::from(3); +//! let l: Le32 = From::from(3); +//! +//! assert_eq!(b.to_native(), 3); +//! assert_eq!(l.to_native(), 3); +//! assert!(b == 3); +//! assert!(l == 3); +//! +//! let b_trans: u32 = unsafe { std::mem::transmute(b) }; +//! let l_trans: u32 = unsafe { std::mem::transmute(l) }; +//! +//! #[cfg(target_endian = "little")] +//! assert_eq!(l_trans, 3); +//! #[cfg(target_endian = "big")] +//! assert_eq!(b_trans, 3); +//! +//! assert_ne!(b_trans, l_trans); +//! ``` + +use std::mem::{align_of, size_of}; + +use bytes::ByteValued; + +macro_rules! const_assert { + ($condition:expr) => { + let _ = [(); 0 - !$condition as usize]; + }; +} + +macro_rules! endian_type { + ($old_type:ident, $new_type:ident, $to_new:ident, $from_new:ident) => { + /// An unsigned integer type of with an explicit endianness. + /// + /// See module level documentation for examples. + #[derive(Copy, Clone, Eq, PartialEq, Debug, Default)] + pub struct $new_type($old_type); + + impl $new_type { + fn _assert() { + const_assert!(align_of::<$new_type>() == align_of::<$old_type>()); + const_assert!(size_of::<$new_type>() == size_of::<$old_type>()); + } + + /// Converts `self` to the native endianness. + pub fn to_native(self) -> $old_type { + $old_type::$from_new(self.0) + } + } + + unsafe impl ByteValued for $new_type {} + + impl PartialEq<$old_type> for $new_type { + fn eq(&self, other: &$old_type) -> bool { + self.0 == $old_type::$to_new(*other) + } + } + + impl PartialEq<$new_type> for $old_type { + fn eq(&self, other: &$new_type) -> bool { + $old_type::$to_new(other.0) == *self + } + } + + impl Into<$old_type> for $new_type { + fn into(self) -> $old_type { + $old_type::$from_new(self.0) + } + } + + impl From<$old_type> for $new_type { + fn from(v: $old_type) -> $new_type { + $new_type($old_type::$to_new(v)) + } + } + }; +} + +endian_type!(u16, Le16, to_le, from_le); +endian_type!(u32, Le32, to_le, from_le); +endian_type!(u64, Le64, to_le, from_le); +endian_type!(usize, LeSize, to_le, from_le); +endian_type!(u16, Be16, to_be, from_be); +endian_type!(u32, Be32, to_be, from_be); +endian_type!(u64, Be64, to_be, from_be); +endian_type!(usize, BeSize, to_be, from_be); + +#[cfg(test)] +mod tests { + use super::*; + + use std::convert::From; + use std::mem::transmute; + + #[cfg(target_endian = "little")] + const NATIVE_LITTLE: bool = true; + #[cfg(target_endian = "big")] + const NATIVE_LITTLE: bool = false; + const NATIVE_BIG: bool = !NATIVE_LITTLE; + + macro_rules! endian_test { + ($old_type:ty, $new_type:ty, $test_name:ident, $native:expr) => { + mod $test_name { + use super::*; + + #[allow(overflowing_literals)] + #[test] + fn equality() { + let v = 0x0123_4567_89AB_CDEF as $old_type; + let endian_v: $new_type = From::from(v); + let endian_into: $old_type = endian_v.into(); + let endian_transmute: $old_type = unsafe { transmute(endian_v) }; + + if $native { + assert_eq!(endian_v, endian_transmute); + } else { + assert_eq!(endian_v, endian_transmute.swap_bytes()); + } + + assert_eq!(v, endian_into); + assert!(v == endian_v); + assert!(endian_v == v); + } + } + }; + } + + endian_test!(u16, Le16, test_le16, NATIVE_LITTLE); + endian_test!(u32, Le32, test_le32, NATIVE_LITTLE); + endian_test!(u64, Le64, test_le64, NATIVE_LITTLE); + endian_test!(usize, LeSize, test_le_size, NATIVE_LITTLE); + endian_test!(u16, Be16, test_be16, NATIVE_BIG); + endian_test!(u32, Be32, test_be32, NATIVE_BIG); + endian_test!(u64, Be64, test_be64, NATIVE_BIG); + endian_test!(usize, BeSize, test_be_size, NATIVE_BIG); +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/guest_memory.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/guest_memory.rs new file mode 100644 index 000000000..5e97a2849 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/guest_memory.rs @@ -0,0 +1,515 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits to track and access guest's physical memory. +//! +//! To make the abstraction as generic as possible, all the core traits declared here only define +//! methods to access guest's memory, and never define methods to manage (create, delete, insert, +//! remove etc) guest's memory. By this way, the guest memory consumers (virtio device drivers, +//! vhost drivers and boot loaders etc) may be decoupled from the guest memory provider (typically +//! a hypervisor). +//! +//! Traits and Structs +//! - [GuestAddress](struct.GuestAddress.html): represents a guest physical address (GPA). +//! - [MemoryRegionAddress](struct.MemoryRegionAddress.html): represents an offset inside a region. +//! - [GuestMemoryRegion](trait.GuestMemoryRegion.html): represent a continuous region of guest's +//! physical memory. +//! - [GuestMemory](trait.GuestMemroy.html): represent a collection of GuestMemoryRegion objects. +//! The main responsibilities of the GuestMemory trait are: +//! - hide the detail of accessing guest's physical address. +//! - map a request address to a GuestMemoryRegion object and relay the request to it. +//! - handle cases where an access request spanning two or more GuestMemoryRegion objects. + +use std::convert::From; +use std::fmt::{self, Display}; +use std::io::{self, Read, Write}; +use std::ops::{BitAnd, BitOr}; + +use address::{Address, AddressValue}; +use bytes::Bytes; +use volatile_memory; + +static MAX_ACCESS_CHUNK: usize = 4096; + +/// Errors associated with handling guest memory accesses. +#[allow(missing_docs)] +#[derive(Debug)] +pub enum Error { + /// Failure in finding a guest address in any memory regions mapped by this guest. + InvalidGuestAddress(GuestAddress), + /// Couldn't read/write from the given source. + IOError(io::Error), + /// Incomplete read or write + PartialBuffer { expected: usize, completed: usize }, + /// Requested backend address is out of range. + InvalidBackendAddress, +} + +impl From for Error { + fn from(e: volatile_memory::Error) -> Self { + match e { + volatile_memory::Error::OutOfBounds { .. } => Error::InvalidBackendAddress, + volatile_memory::Error::Overflow { .. } => Error::InvalidBackendAddress, + volatile_memory::Error::IOError(e) => Error::IOError(e), + volatile_memory::Error::PartialBuffer { + expected, + completed, + } => Error::PartialBuffer { + expected, + completed, + }, + } + } +} + +/// Result of guest memory operations +pub type Result = std::result::Result; + +impl std::error::Error for Error {} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Guest memory error: ")?; + match self { + Error::InvalidGuestAddress(addr) => { + write!(f, "invalid guest address {}", addr.raw_value()) + } + Error::IOError(error) => write!(f, "{}", error), + Error::PartialBuffer { + expected, + completed, + } => write!( + f, + "only used {} bytes in {} long buffer", + completed, expected, + ), + Error::InvalidBackendAddress => write!(f, "invalid backend address"), + } + } +} + +/// Represents a guest physical address (GPA). +/// +/// Notes: +/// - On ARM64, a 32-bit hypervisor may be used to support a 64-bit guest. For simplicity, +/// u64 is used to store the the raw value no matter if the guest a 32-bit or 64-bit virtual +/// machine. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub struct GuestAddress(pub u64); +impl_address_ops!(GuestAddress, u64); + +/// Represents an offset inside a region. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub struct MemoryRegionAddress(pub u64); +impl_address_ops!(MemoryRegionAddress, u64); + +/// Type of the raw value stored in a GuestAddress object. +pub type GuestUsize = ::V; + +/// Represents a continuous region of guest physical memory. +#[allow(clippy::len_without_is_empty)] +pub trait GuestMemoryRegion: Bytes { + /// Get the size of the region. + fn len(&self) -> GuestUsize; + + /// Get minimum (inclusive) address managed by the region. + fn start_addr(&self) -> GuestAddress; + + /// Get maximum (inclusive) address managed by the region. + fn end_addr(&self) -> GuestAddress { + // unchecked_add is safe as the region bounds were checked when it was created. + self.start_addr().unchecked_add(self.len() - 1) + } + + /// Returns the given address if it is within the memory range accessible + /// through this region. + fn check_address(&self, addr: MemoryRegionAddress) -> Option { + if self.address_in_range(addr) { + Some(addr) + } else { + None + } + } + + /// Returns true if the given address is within the memory range accessible + /// through this region. + fn address_in_range(&self, addr: MemoryRegionAddress) -> bool { + addr.raw_value() < self.len() + } + + /// Returns the address plus the offset if it is in range. + fn checked_offset( + &self, + base: MemoryRegionAddress, + offset: usize, + ) -> Option { + base.checked_add(offset as u64) + .and_then(|addr| self.check_address(addr)) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a relative address within this region, or return an error if + /// it is out of bounds. + fn to_region_addr(&self, addr: GuestAddress) -> Option { + addr.checked_offset_from(self.start_addr()) + .and_then(|offset| self.check_address(MemoryRegionAddress(offset))) + } + + /// Return a slice corresponding to the data in the region; unsafe because of + /// possible aliasing. Return None if the region does not support slice-based + /// access. + unsafe fn as_slice(&self) -> Option<&[u8]> { + None + } + + /// Return a mutable slice corresponding to the data in the region; unsafe because of + /// possible aliasing. Return None if the region does not support slice-based + /// access. + unsafe fn as_mut_slice(&self) -> Option<&mut [u8]> { + None + } +} + +/// Represents a container for a collection of GuestMemoryRegion objects. +/// +/// The main responsibilities of the GuestMemory trait are: +/// - hide the detail of accessing guest's physical address. +/// - map a request address to a GuestMemoryRegion object and relay the request to it. +/// - handle cases where an access request spanning two or more GuestMemoryRegion objects. +/// +/// Note: all regions in a GuestMemory object must not intersect with each other. +pub trait GuestMemory { + /// Type of objects hosted by the address space. + type R: GuestMemoryRegion; + + /// Returns the number of regions in the collection. + fn num_regions(&self) -> usize; + + /// Return the region containing the specified address or None. + fn find_region(&self, addr: GuestAddress) -> Option<&Self::R>; + + /// Perform the specified action on each region. + /// It only walks children of current region and do not step into sub regions. + fn with_regions(&self, cb: F) -> std::result::Result<(), E> + where + F: Fn(usize, &Self::R) -> std::result::Result<(), E>; + + /// Perform the specified action on each region mutably. + /// It only walks children of current region and do not step into sub regions. + fn with_regions_mut(&self, cb: F) -> std::result::Result<(), E> + where + F: FnMut(usize, &Self::R) -> std::result::Result<(), E>; + + /// Applies two functions, specified as callbacks, on the inner memory regions. + /// + /// # Arguments + /// * `init` - Starting value of the accumulator for the `foldf` function. + /// * `mapf` - "Map" function, applied to all the inner memory regions. It returns an array of + /// the same size as the memory regions array, containing the function's results + /// for each region. + /// * `foldf` - "Fold" function, applied to the array returned by `mapf`. It acts as an + /// operator, applying itself to the `init` value and to each subsequent elemnent + /// in the array returned by `mapf`. + /// + /// # Examples + /// + /// * Compute the total size of all memory mappings in KB by iterating over the memory regions + /// and dividing their sizes to 1024, then summing up the values in an accumulator. + /// + /// ``` + /// # #[cfg(feature = "backend-mmap")] + /// # fn test_map_fold() -> Result<(), ()> { + /// # use vm_memory::{GuestAddress, GuestMemory, GuestMemoryRegion, mmap::GuestMemoryMmap}; + /// let start_addr1 = GuestAddress(0x0); + /// let start_addr2 = GuestAddress(0x400); + /// let mem = GuestMemoryMmap::new(&vec![(start_addr1, 1024), (start_addr2, 2048)]).unwrap(); + /// let total_size = mem.map_and_fold( + /// 0, + /// |(_, region)| region.len() / 1024, + /// |acc, size| acc + size + /// ); + /// println!("Total memory size = {} KB", total_size); + /// Ok(()) + /// # } + /// ``` + fn map_and_fold(&self, init: T, mapf: F, foldf: G) -> T + where + F: Fn((usize, &Self::R)) -> T, + G: Fn(T, T) -> T; + + /// Get maximum (inclusive) address managed by the region. + fn end_addr(&self) -> GuestAddress { + self.map_and_fold( + GuestAddress(0), + |(_, region)| region.end_addr(), + std::cmp::max, + ) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a relative address within this region, or return None if + /// it is out of bounds. + fn to_region_addr(&self, addr: GuestAddress) -> Option<(&Self::R, MemoryRegionAddress)> { + self.find_region(addr) + .map(|r| (r, r.to_region_addr(addr).unwrap())) + } + + /// Returns true if the given address is within the memory range available to the guest. + fn address_in_range(&self, addr: GuestAddress) -> bool { + self.find_region(addr).is_some() + } + + /// Returns the given address if it is within the memory range available to the guest. + fn check_address(&self, addr: GuestAddress) -> Option { + self.find_region(addr).map(|_| addr) + } + + /// Returns the address plus the offset if it is in range. + fn checked_offset(&self, base: GuestAddress, offset: usize) -> Option { + base.checked_add(offset as u64) + .and_then(|addr| self.check_address(addr)) + } + + /// Invoke callback `f` to handle data in the address range [addr, addr + count). + /// + /// The address range [addr, addr + count) may span more than one GuestMemoryRegion objects, or + /// even has holes within it. So try_access() invokes the callback 'f' for each GuestMemoryRegion + /// object involved and returns: + /// - error code returned by the callback 'f' + /// - size of data already handled when encountering the first hole + /// - size of data already handled when the whole range has been handled + fn try_access(&self, count: usize, addr: GuestAddress, mut f: F) -> Result + where + F: FnMut(usize, usize, MemoryRegionAddress, &Self::R) -> Result, + { + let mut cur = addr; + let mut total = 0; + while let Some(region) = self.find_region(cur) { + let start = region.to_region_addr(cur).unwrap(); + let cap = region.len() as usize; + let len = std::cmp::min(cap, count - total); + match f(total, len, start, region) { + // no more data + Ok(0) => break, + // made some progress + Ok(len) => { + total += len; + if total == count { + break; + } + cur = match cur.overflowing_add(len as GuestUsize) { + (GuestAddress(0), _) => GuestAddress(0), + (result, false) => result, + (_, true) => panic!("guest address overflow"), + } + } + // error happened + e => return e, + } + } + if total == 0 { + Err(Error::InvalidGuestAddress(addr)) + } else { + Ok(total) + } + } +} + +impl Bytes for T { + type E = Error; + + fn write(&self, buf: &[u8], addr: GuestAddress) -> Result { + self.try_access( + buf.len(), + addr, + |offset, _count, caddr, region| -> Result { + region.write(&buf[offset as usize..], caddr) + }, + ) + } + + fn read(&self, buf: &mut [u8], addr: GuestAddress) -> Result { + self.try_access( + buf.len(), + addr, + |offset, _count, caddr, region| -> Result { + region.read(&mut buf[offset as usize..], caddr) + }, + ) + } + + fn write_slice(&self, buf: &[u8], addr: GuestAddress) -> Result<()> { + let res = self.write(buf, addr)?; + if res != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: res, + }); + } + Ok(()) + } + + fn read_slice(&self, buf: &mut [u8], addr: GuestAddress) -> Result<()> { + let res = self.read(buf, addr)?; + if res != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: res, + }); + } + Ok(()) + } + + fn read_from(&self, addr: GuestAddress, src: &mut F, count: usize) -> Result + where + F: Read, + { + self.try_access(count, addr, |offset, len, caddr, region| -> Result { + // Check if something bad happened before doing unsafe things. + assert!(offset < count); + if let Some(dst) = unsafe { region.as_mut_slice() } { + // This is safe cause `start` and `len` are within the `region`. + let start = caddr.raw_value() as usize; + let end = start + len; + src.read_exact(&mut dst[start..end]) + .map_err(Error::IOError)?; + Ok(len) + } else { + let len = std::cmp::min(len, MAX_ACCESS_CHUNK); + let mut buf = vec![0u8; len].into_boxed_slice(); + let bytes_read = src.read(&mut buf[..]).map_err(Error::IOError)?; + let bytes_written = region.write(&buf[0..bytes_read], caddr)?; + assert_eq!(bytes_written, bytes_read); + Ok(len) + } + }) + } + + fn read_exact_from(&self, addr: GuestAddress, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let res = self.read_from(addr, src, count)?; + if res != count { + return Err(Error::PartialBuffer { + expected: count, + completed: res, + }); + } + Ok(()) + } + + fn write_to(&self, addr: GuestAddress, dst: &mut F, count: usize) -> Result + where + F: Write, + { + self.try_access(count, addr, |offset, len, caddr, region| -> Result { + // Check if something bad happened before doing unsafe things. + assert!(offset < count); + if let Some(src) = unsafe { region.as_slice() } { + // This is safe cause `start` and `len` are within the `region`. + let start = caddr.raw_value() as usize; + let end = start + len; + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let bytes_written = dst.write(&src[start..end]).map_err(Error::IOError)?; + Ok(bytes_written) + } else { + let len = std::cmp::min(len, MAX_ACCESS_CHUNK); + let mut buf = vec![0u8; len].into_boxed_slice(); + let bytes_read = region.read(&mut buf, caddr)?; + assert_eq!(bytes_read, len); + let bytes_written = dst.write(&buf).map_err(Error::IOError)?; + Ok(bytes_written) + } + }) + } + + fn write_all_to(&self, addr: GuestAddress, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let res = self.write_to(addr, dst, count)?; + if res != count { + return Err(Error::PartialBuffer { + expected: count, + completed: res, + }); + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn offset_from() { + let base = GuestAddress(0x100); + let addr = GuestAddress(0x150); + assert_eq!(addr.unchecked_offset_from(base), 0x50u64); + assert_eq!(addr.checked_offset_from(base), Some(0x50u64)); + assert_eq!(base.checked_offset_from(addr), None); + } + + #[test] + fn equals() { + let a = GuestAddress(0x300); + let b = GuestAddress(0x300); + let c = GuestAddress(0x301); + assert_eq!(a, GuestAddress(a.raw_value())); + assert_eq!(a, b); + assert_eq!(b, a); + assert_ne!(a, c); + assert_ne!(c, a); + } + + #[test] + #[allow(clippy::eq_op)] + fn cmp() { + let a = GuestAddress(0x300); + let b = GuestAddress(0x301); + assert!(a < b); + assert!(b > a); + assert!(!(a < a)); + } + + #[test] + fn mask() { + let a = GuestAddress(0x5050); + assert_eq!(GuestAddress(0x5000), a & 0xff00u64); + assert_eq!(0x5000, a.mask(0xff00u64)); + assert_eq!(GuestAddress(0x5055), a | 0x0005u64); + } + + #[test] + fn add_sub() { + let a = GuestAddress(0x50); + let b = GuestAddress(0x60); + assert_eq!(Some(GuestAddress(0xb0)), a.checked_add(0x60)); + assert_eq!(0x10, b.unchecked_offset_from(a)); + } + + #[test] + fn checked_add_overflow() { + let a = GuestAddress(0xffff_ffff_ffff_ff55); + assert_eq!(Some(GuestAddress(0xffff_ffff_ffff_ff57)), a.checked_add(2)); + assert!(a.checked_add(0xf0).is_none()); + } + + #[test] + fn checked_sub_underflow() { + let a = GuestAddress(0xff); + assert_eq!(Some(GuestAddress(0x0f)), a.checked_sub(0xf0)); + assert!(a.checked_sub(0xffff).is_none()); + } +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/lib.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/lib.rs new file mode 100644 index 000000000..2fc57ffad --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/lib.rs @@ -0,0 +1,57 @@ +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits for allocating, handling and interacting with the VM's physical memory. +//! +//! For a typical hypervisor, there are seveval components, such as boot loader, virtual device +//! drivers, virtio backend drivers and vhost drivers etc, that need to access VM's physical memory. +//! This crate aims to provide a set of stable traits to decouple VM memory consumers from VM +//! memory providers. Based on these traits, VM memory consumers could access VM's physical memory +//! without knowing the implementation details of the VM memory provider. Thus hypervisor +//! components, such as boot loader, virtual device drivers, virtio backend drivers and vhost +//! drivers etc, could be shared and reused by multiple hypervisors. + +#![deny(missing_docs)] + +extern crate libc; + +#[cfg(test)] +#[macro_use] +extern crate matches; + +#[macro_use] +pub mod address; +pub use address::{Address, AddressValue}; + +pub mod bytes; +pub use bytes::{ByteValued, Bytes}; + +pub mod endian; +pub use endian::{Be16, Be32, Be64, BeSize, Le16, Le32, Le64, LeSize}; + +pub mod guest_memory; +pub use guest_memory::{ + Error as GuestMemoryError, GuestAddress, GuestMemory, GuestMemoryRegion, GuestUsize, + MemoryRegionAddress, Result as GuestMemoryResult, +}; + +#[cfg(all(feature = "backend-mmap", unix))] +mod mmap_unix; + +#[cfg(all(feature = "backend-mmap", windows))] +mod mmap_windows; + +#[cfg(feature = "backend-mmap")] +pub mod mmap; +#[cfg(feature = "backend-mmap")] +pub use mmap::{GuestMemoryMmap, GuestRegionMmap, MmapError, MmapRegion}; + +pub mod volatile_memory; +pub use volatile_memory::{ + Error as VolatileMemoryError, Result as VolatileMemoryResult, VolatileMemory, VolatileRef, + VolatileSlice, +}; diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap.rs new file mode 100644 index 000000000..1a60e57e4 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap.rs @@ -0,0 +1,681 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! A default implementation of the GuestMemory trait by mmap()-ing guest's memory into the current +//! process. +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use std::io::{self, Read, Write}; +use std::ops::Deref; +use std::sync::Arc; + +use address::Address; +use guest_memory::*; +use volatile_memory::VolatileMemory; +use Bytes; + +#[cfg(unix)] +pub use mmap_unix::MmapRegion; + +#[cfg(windows)] +pub use mmap_windows::MmapRegion; + +// For MmapRegion +pub(crate) trait AsSlice { + unsafe fn as_slice(&self) -> &[u8]; + + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8]; +} + +/// Errors that can happen when creating a memory map +#[derive(Debug)] +pub enum MmapError { + /// Syscall returned the given error. + SystemCallFailed(io::Error), + /// No memory region found. + NoMemoryRegion, + /// Some of the memory regions intersect with each other. + MemoryRegionOverlap, +} + +/// Tracks a mapping of memory in the current process and the corresponding base address +/// in the guest's memory space. +#[derive(Debug)] +pub struct GuestRegionMmap { + mapping: MmapRegion, + guest_base: GuestAddress, +} + +impl GuestRegionMmap { + /// Create a new memory-mapped memory region for guest's physical memory. + /// Note: caller needs to ensure that (mapping.len() + guest_base) doesn't wrapping around. + pub fn new(mapping: MmapRegion, guest_base: GuestAddress) -> Self { + GuestRegionMmap { + mapping, + guest_base, + } + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a host pointer, or return None if it is out of bounds. + pub fn get_host_address(&self, addr: MemoryRegionAddress) -> Option<*mut u8> { + // Not sure why wrapping_offset is not unsafe. Anyway this + // is safe because we've just range-checked addr using check_address. + self.check_address(addr) + .map(|addr| self.as_ptr().wrapping_offset(addr.raw_value() as isize)) + } +} + +impl Deref for GuestRegionMmap { + type Target = MmapRegion; + + fn deref(&self) -> &MmapRegion { + &self.mapping + } +} + +impl Bytes for GuestRegionMmap { + type E = Error; + + /// # Examples + /// * Write a slice at guest address 0x1200. + /// + /// ``` + /// # use vm_memory::{Bytes, GuestAddress, GuestMemoryMmap}; + /// # let start_addr = GuestAddress(0x1000); + /// # let mut gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let res = gm.write(&[1,2,3,4,5], GuestAddress(0x1200)).unwrap(); + /// assert_eq!(5, res); + /// ``` + fn write(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write(buf, maddr) + .map_err(Into::into) + } + + /// # Examples + /// * Read a slice of length 16 at guestaddress 0x1200. + /// + /// ``` + /// # use vm_memory::{Bytes, GuestAddress, GuestMemoryMmap}; + /// # let start_addr = GuestAddress(0x1000); + /// # let mut gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let buf = &mut [0u8; 16]; + /// let res = gm.read(buf, GuestAddress(0x1200)).unwrap(); + /// assert_eq!(16, res); + /// ``` + fn read(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read(buf, maddr) + .map_err(Into::into) + } + + fn write_slice(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<()> { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_slice(buf, maddr) + .map_err(Into::into) + } + + fn read_slice(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<()> { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_slice(buf, maddr) + .map_err(Into::into) + } + + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = if cfg!(unix) { + /// File::open(Path::new("/dev/urandom")).unwrap() + /// } else { + /// File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + /// }; + /// let addr = GuestAddress(0x1010); + /// gm.read_from(addr, &mut file, 128).unwrap(); + /// let read_addr = addr.checked_add(8).unwrap(); + /// let _: u32 = gm.read_obj(read_addr).unwrap(); + /// ``` + fn read_from(&self, addr: MemoryRegionAddress, src: &mut F, count: usize) -> Result + where + F: Read, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_from::(maddr, src, count) + .map_err(Into::into) + } + + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = if cfg!(unix) { + /// File::open(Path::new("/dev/urandom")).unwrap() + /// } else { + /// File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + /// }; + /// let addr = GuestAddress(0x1010); + /// gm.read_exact_from(addr, &mut file, 128).unwrap(); + /// let read_addr = addr.checked_add(8).unwrap(); + /// let _: u32 = gm.read_obj(read_addr).unwrap(); + /// ``` + fn read_exact_from(&self, addr: MemoryRegionAddress, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_exact_from::(maddr, src, count) + .map_err(Into::into) + } + + /// Writes data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to a temp file + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::OpenOptions; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = tempfile().unwrap(); + /// let mut mem = [0u8; 1024]; + /// gm.write_to(start_addr, &mut file, 128).unwrap(); + /// ``` + fn write_to(&self, addr: MemoryRegionAddress, dst: &mut F, count: usize) -> Result + where + F: Write, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_to::(maddr, dst, count) + .map_err(Into::into) + } + + /// Writes data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to a temp file + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::OpenOptions; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = tempfile().unwrap(); + /// let mut mem = [0u8; 1024]; + /// gm.write_all_to(start_addr, &mut file, 128).unwrap(); + /// ``` + fn write_all_to(&self, addr: MemoryRegionAddress, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_all_to::(maddr, dst, count) + .map_err(Into::into) + } +} + +impl GuestMemoryRegion for GuestRegionMmap { + fn len(&self) -> GuestUsize { + self.mapping.len() as GuestUsize + } + + fn start_addr(&self) -> GuestAddress { + self.guest_base + } + + unsafe fn as_slice(&self) -> Option<&[u8]> { + Some(self.mapping.as_slice()) + } + + unsafe fn as_mut_slice(&self) -> Option<&mut [u8]> { + Some(self.mapping.as_mut_slice()) + } +} + +/// Tracks memory regions allocated/mapped for the guest in the current process. +#[derive(Clone, Debug)] +pub struct GuestMemoryMmap { + regions: Arc>, +} + +impl GuestMemoryMmap { + /// Creates a container and allocates anonymous memory for guest memory regions. + /// Valid memory regions are specified as a Vec of (Address, Size) tuples sorted by Address. + pub fn new(ranges: &[(GuestAddress, usize)]) -> std::result::Result { + if ranges.is_empty() { + return Err(MmapError::NoMemoryRegion); + } + + let mut regions = Vec::::new(); + for range in ranges.iter() { + if let Some(last) = regions.last() { + if last + .guest_base + .checked_add(last.mapping.len() as GuestUsize) + .map_or(true, |a| a > range.0) + { + return Err(MmapError::MemoryRegionOverlap); + } + } + + let mapping = MmapRegion::new(range.1).map_err(MmapError::SystemCallFailed)?; + regions.push(GuestRegionMmap { + mapping, + guest_base: range.0, + }); + } + + Ok(Self { + regions: Arc::new(regions), + }) + } + + /// Creates a container and adds an existing set of mappings to it. + pub fn from_regions(ranges: Vec) -> std::result::Result { + if ranges.is_empty() { + return Err(MmapError::NoMemoryRegion); + } + + for rangei in 1..ranges.len() { + let range = &ranges[rangei]; + let last = &ranges[rangei - 1]; + if last + .guest_base + .checked_add(last.mapping.len() as GuestUsize) + .map_or(true, |a| a > range.start_addr()) + { + return Err(MmapError::MemoryRegionOverlap); + } + } + + Ok(Self { + regions: Arc::new(ranges), + }) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a host pointer, or return None if it is out of bounds. + pub fn get_host_address(&self, addr: GuestAddress) -> Option<*mut u8> { + self.to_region_addr(addr) + .and_then(|(r, addr)| r.get_host_address(addr)) + } +} + +impl GuestMemory for GuestMemoryMmap { + type R = GuestRegionMmap; + + fn num_regions(&self) -> usize { + self.regions.len() + } + + fn find_region(&self, addr: GuestAddress) -> Option<&GuestRegionMmap> { + for region in self.regions.iter() { + if addr >= region.start_addr() && addr <= region.end_addr() { + return Some(region); + } + } + None + } + + fn with_regions(&self, cb: F) -> std::result::Result<(), E> + where + F: Fn(usize, &Self::R) -> std::result::Result<(), E>, + { + for (index, region) in self.regions.iter().enumerate() { + cb(index, region)?; + } + Ok(()) + } + + fn with_regions_mut(&self, mut cb: F) -> std::result::Result<(), E> + where + F: FnMut(usize, &Self::R) -> std::result::Result<(), E>, + { + for (index, region) in self.regions.iter().enumerate() { + cb(index, region)?; + } + Ok(()) + } + + fn map_and_fold(&self, init: T, mapf: F, foldf: G) -> T + where + F: Fn((usize, &Self::R)) -> T, + G: Fn(T, T) -> T, + { + self.regions.iter().enumerate().map(mapf).fold(init, foldf) + } +} + +#[cfg(test)] +mod tests { + extern crate tempfile; + + use self::tempfile::tempfile; + use super::*; + use std::fs::File; + use std::mem; + use std::path::Path; + + use Bytes; + + #[test] + fn basic_map() { + let m = MmapRegion::new(1024).unwrap(); + assert_eq!(1024, m.len()); + } + + #[test] + fn map_invalid_size() { + let e = MmapRegion::new(0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EINVAL)); + } + + #[test] + fn slice_addr() { + let m = MmapRegion::new(5).unwrap(); + let s = m.get_slice(2, 3).unwrap(); + assert_eq!(s.as_ptr(), unsafe { m.as_ptr().offset(2) }); + } + + #[test] + fn mapped_file_read() { + let mut f = tempfile().unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + assert!(f.write_all(sample_buf).is_ok()); + + let mem_map = MmapRegion::from_fd(&f, sample_buf.len(), 0).unwrap(); + let buf = &mut [0u8; 16]; + assert_eq!( + mem_map.as_volatile_slice().read(buf, 0).unwrap(), + sample_buf.len() + ); + assert_eq!(buf[0..sample_buf.len()], sample_buf[..]); + } + + #[test] + fn test_regions() { + // No regions provided should return error. + assert_eq!( + format!("{:?}", GuestMemoryMmap::new(&[]).err().unwrap()), + format!("{:?}", MmapError::NoMemoryRegion) + ); + + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert_eq!(guest_mem.num_regions(), 2); + assert_eq!(guest_mem.end_addr(), GuestAddress(0xbff)); + assert!(guest_mem.find_region(GuestAddress(0x200)).is_some()); + assert!(guest_mem.find_region(GuestAddress(0x600)).is_none()); + assert!(guest_mem.find_region(GuestAddress(0xa00)).is_some()); + assert!(guest_mem.find_region(GuestAddress(0xc00)).is_none()); + } + + #[test] + fn test_address_in_range() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.address_in_range(GuestAddress(0x200))); + assert!(!guest_mem.address_in_range(GuestAddress(0x600))); + assert!(guest_mem.address_in_range(GuestAddress(0xa00))); + assert!(!guest_mem.address_in_range(GuestAddress(0xc00))); + } + + #[test] + fn test_check_address() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert_eq!( + guest_mem.check_address(GuestAddress(0x200)), + Some(GuestAddress(0x200)) + ); + assert_eq!(guest_mem.check_address(GuestAddress(0x600)), None); + assert_eq!( + guest_mem.check_address(GuestAddress(0xa00)), + Some(GuestAddress(0xa00)) + ); + assert_eq!(guest_mem.check_address(GuestAddress(0xc00)), None); + } + + #[test] + fn test_to_region_addr() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.to_region_addr(GuestAddress(0x600)).is_none()); + let (r0, addr0) = guest_mem.to_region_addr(GuestAddress(0x800)).unwrap(); + let (r1, addr1) = guest_mem.to_region_addr(GuestAddress(0xa00)).unwrap(); + assert!(r0.as_ptr() == r1.as_ptr()); + assert_eq!(addr0, MemoryRegionAddress(0)); + assert_eq!(addr1, MemoryRegionAddress(0x200)); + } + + #[test] + fn test_get_host_address() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.get_host_address(GuestAddress(0x600)).is_none()); + let ptr0 = guest_mem.get_host_address(GuestAddress(0x800)).unwrap(); + let ptr1 = guest_mem.get_host_address(GuestAddress(0xa00)).unwrap(); + assert_eq!( + ptr0, + guest_mem.find_region(GuestAddress(0x800)).unwrap().as_ptr() + ); + assert_eq!(unsafe { ptr0.offset(0x200) }, ptr1); + } + + #[test] + fn test_deref() { + let start_addr = GuestAddress(0x0); + let guest_mem = GuestMemoryMmap::new(&[(start_addr, 0x400)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + + assert_eq!(guest_mem.write(sample_buf, start_addr).unwrap(), 5); + let slice = guest_mem + .find_region(GuestAddress(0)) + .unwrap() + .as_volatile_slice(); + + let buf = &mut [0, 0, 0, 0, 0]; + assert_eq!(slice.read(buf, 0).unwrap(), 5); + assert_eq!(buf, sample_buf); + } + + #[test] + fn mapped_file_regions() { + let mut f = tempfile().unwrap(); + let empty_buf = &[0; 16384]; + assert!(f.write_all(empty_buf).is_ok()); + + let mem_map = MmapRegion::from_fd(&f, empty_buf.len(), 0).unwrap(); + let guest_reg = GuestRegionMmap::new(mem_map, GuestAddress(0x8000)); + let mut region_vec = Vec::new(); + region_vec.push(guest_reg); + let guest_mem = GuestMemoryMmap::from_regions(region_vec).unwrap(); + assert_eq!(guest_mem.num_regions(), 1); + assert!(guest_mem.find_region(GuestAddress(0)).is_none()); + assert!(guest_mem.find_region(GuestAddress(0x8000)).is_some()); + } + + #[test] + fn overlap_memory() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let res = GuestMemoryMmap::new(&[(start_addr1, 0x2000), (start_addr2, 0x2000)]); + assert_eq!( + format!("{:?}", res.err().unwrap()), + format!("{:?}", MmapError::MemoryRegionOverlap) + ); + } + + #[test] + fn test_read_u64() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let bad_addr = GuestAddress(0x2001); + let bad_addr2 = GuestAddress(0x1ffc); + let max_addr = GuestAddress(0x2000); + + let gm = GuestMemoryMmap::new(&[(start_addr1, 0x1000), (start_addr2, 0x1000)]).unwrap(); + + let val1: u64 = 0xaa55_aa55_aa55_aa55; + let val2: u64 = 0x55aa_55aa_55aa_55aa; + assert_eq!( + format!("{:?}", gm.write_obj(val1, bad_addr).err().unwrap()), + format!("InvalidGuestAddress({:?})", bad_addr,) + ); + assert_eq!( + format!("{:?}", gm.write_obj(val1, bad_addr2).err().unwrap()), + format!( + "PartialBuffer {{ expected: {:?}, completed: {:?} }}", + mem::size_of::(), + max_addr.checked_offset_from(bad_addr2).unwrap() + ) + ); + + gm.write_obj(val1, GuestAddress(0x500)).unwrap(); + gm.write_obj(val2, GuestAddress(0x1000 + 32)).unwrap(); + let num1: u64 = gm.read_obj(GuestAddress(0x500)).unwrap(); + let num2: u64 = gm.read_obj(GuestAddress(0x1000 + 32)).unwrap(); + assert_eq!(val1, num1); + assert_eq!(val2, num2); + } + + #[test] + fn write_and_read() { + let mut start_addr = GuestAddress(0x1000); + let gm = GuestMemoryMmap::new(&[(start_addr, 0x400)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + + assert_eq!(gm.write(sample_buf, start_addr).unwrap(), 5); + + let buf = &mut [0u8; 5]; + assert_eq!(gm.read(buf, start_addr).unwrap(), 5); + assert_eq!(buf, sample_buf); + + start_addr = GuestAddress(0x13ff); + assert_eq!(gm.write(sample_buf, start_addr).unwrap(), 1); + assert_eq!(gm.read(buf, start_addr).unwrap(), 1); + assert_eq!(buf[0], sample_buf[0]); + } + + #[test] + fn read_to_and_write_from_mem() { + let gm = GuestMemoryMmap::new(&[(GuestAddress(0x1000), 0x400)]).unwrap(); + let addr = GuestAddress(0x1010); + let mut file = if cfg!(unix) { + File::open(Path::new("/dev/zero")).unwrap() + } else { + File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + }; + gm.write_obj(!0u32, addr).unwrap(); + gm.read_exact_from(addr, &mut file, mem::size_of::()) + .unwrap(); + let value: u32 = gm.read_obj(addr).unwrap(); + if cfg!(unix) { + assert_eq!(value, 0); + } else { + assert_eq!(value, 0x0090_5a4d); + } + + let mut sink = Vec::new(); + gm.write_all_to(addr, &mut sink, mem::size_of::()) + .unwrap(); + if cfg!(unix) { + assert_eq!(sink, vec![0; mem::size_of::()]); + } else { + assert_eq!(sink, vec![0x4d, 0x5a, 0x90, 0x00]); + }; + } + + #[test] + fn create_vec_with_regions() { + let region_size = 0x400; + let regions = vec![ + (GuestAddress(0x0), region_size), + (GuestAddress(0x1000), region_size), + ]; + let mut iterated_regions = Vec::new(); + let gm = GuestMemoryMmap::new(®ions).unwrap(); + + let res: Result<()> = gm.with_regions(|_, region| { + assert_eq!(region.len(), region_size as GuestUsize); + Ok(()) + }); + assert!(res.is_ok()); + + let res: Result<()> = gm.with_regions_mut(|_, region| { + iterated_regions.push((region.start_addr(), region.len() as usize)); + Ok(()) + }); + assert!(res.is_ok()); + assert_eq!(regions, iterated_regions); + assert_eq!(gm.clone().regions[0].guest_base, regions[0].0); + assert_eq!(gm.clone().regions[1].guest_base, regions[1].0); + } + + #[test] + fn test_access_cross_boundary() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let gm = GuestMemoryMmap::new(&[(start_addr1, 0x1000), (start_addr2, 0x1000)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + assert_eq!(gm.write(sample_buf, GuestAddress(0xffc)).unwrap(), 5); + let buf = &mut [0u8; 5]; + assert_eq!(gm.read(buf, GuestAddress(0xffc)).unwrap(), 5); + assert_eq!(buf, sample_buf); + } +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_unix.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_unix.rs new file mode 100644 index 000000000..4ebf8f412 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_unix.rs @@ -0,0 +1,168 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! A default Unix implementation of the GuestMemory trait by mmap()-ing guest's memory into +//! the current process. +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use libc; +use std::io; +use std::ptr::null_mut; + +use mmap::AsSlice; +use volatile_memory::{self, compute_offset, VolatileMemory, VolatileSlice}; + +use std::os::unix::io::AsRawFd; + +/// A backend driver to access guest's physical memory by mmapping guest's memory into the current +/// process. +/// For a combination of 32-bit hypervisor and 64-bit virtual machine, only partial of guest's +/// physical memory may be mapped into current process due to limited process virtual address +/// space size. +#[derive(Debug)] +pub struct MmapRegion { + addr: *mut u8, + size: usize, +} + +// Send and Sync aren't automatically inherited for the raw address pointer. +// Accessing that pointer is only done through the stateless interface which +// allows the object to be shared by multiple threads without a decrease in +// safety. +unsafe impl Send for MmapRegion {} +unsafe impl Sync for MmapRegion {} + +impl MmapRegion { + /// Creates an anonymous shared mapping of `size` bytes. + /// + /// # Arguments + /// * `size` - Size of memory region in bytes. + pub fn new(size: usize) -> io::Result { + // This is safe because we are creating an anonymous mapping in a place not already used by + // any other area in this process. + let addr = unsafe { + libc::mmap( + null_mut(), + size, + libc::PROT_READ | libc::PROT_WRITE, + libc::MAP_ANONYMOUS | libc::MAP_SHARED | libc::MAP_NORESERVE, + -1, + 0, + ) + }; + if addr == libc::MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Maps the `size` bytes starting at `offset` bytes of the given `fd`. + /// + /// # Arguments + /// * `fd` - File descriptor to mmap from. + /// * `size` - Size of memory region in bytes. + /// * `offset` - Offset in bytes from the beginning of `fd` to start the mmap. + pub fn from_fd(fd: &AsRawFd, size: usize, offset: libc::off_t) -> io::Result { + // This is safe because we are creating a mapping in a place not already used by any other + // area in this process. + let addr = unsafe { + libc::mmap( + null_mut(), + size, + libc::PROT_READ | libc::PROT_WRITE, + libc::MAP_SHARED, + fd.as_raw_fd(), + offset, + ) + }; + if addr == libc::MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Returns a pointer to the beginning of the memory region. Should only be + /// used for passing this region to ioctls for setting guest memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } +} + +impl AsSlice for MmapRegion { + // Returns the region as a slice + // used to do crap + unsafe fn as_slice(&self) -> &[u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts_mut(self.addr, self.size) + } +} + +impl VolatileMemory for MmapRegion { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> volatile_memory::Result { + let end = compute_offset(offset, count)?; + if end > self.size { + return Err(volatile_memory::Error::OutOfBounds { addr: end }); + } + + // Safe because we checked that offset + count was within our range and we only ever hand + // out volatile accessors. + Ok(unsafe { VolatileSlice::new((self.addr as usize + offset) as *mut _, count) }) + } +} + +impl Drop for MmapRegion { + fn drop(&mut self) { + // This is safe because we mmap the area at addr ourselves, and nobody + // else is holding a reference to it. + unsafe { + libc::munmap(self.addr as *mut libc::c_void, self.size); + } + } +} + +#[cfg(test)] +mod tests { + use mmap_unix::MmapRegion; + use std::os::unix::io::FromRawFd; + + #[test] + fn map_invalid_fd() { + let fd = unsafe { std::fs::File::from_raw_fd(-1) }; + let e = MmapRegion::from_fd(&fd, 1024, 0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EBADF)); + } +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_windows.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_windows.rs new file mode 100644 index 000000000..70233582f --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/mmap_windows.rs @@ -0,0 +1,225 @@ +// Copyright (C) 2019 CrowdStrike, Inc. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// + +//! A default Windows implementation of the GuestMemory trait using VirtualAlloc() and MapViewOfFile(). +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use libc; +use std::io; +use std::ptr::null_mut; + +use mmap::AsSlice; +use volatile_memory::{self, compute_offset, VolatileMemory, VolatileSlice}; + +use libc::{c_void, size_t}; +use std; +use std::os::windows::io::{AsRawHandle, RawHandle}; +use std::ptr::null; + +#[allow(non_snake_case)] +#[link(name = "kernel32")] +extern "stdcall" { + pub fn VirtualAlloc( + lpAddress: *mut c_void, + dwSize: size_t, + flAllocationType: u32, + flProtect: u32, + ) -> *mut c_void; + + pub fn VirtualFree(lpAddress: *mut c_void, dwSize: size_t, dwFreeType: u32) -> u32; + + pub fn CreateFileMappingA( + hFile: RawHandle, // HANDLE + lpFileMappingAttributes: *const c_void, // LPSECURITY_ATTRIBUTES + flProtect: u32, // DWORD + dwMaximumSizeHigh: u32, // DWORD + dwMaximumSizeLow: u32, // DWORD + lpName: *const u8, // LPCSTR + ) -> RawHandle; // HANDLE + + pub fn MapViewOfFile( + hFileMappingObject: RawHandle, + dwDesiredAccess: u32, + dwFileOffsetHigh: u32, + dwFileOffsetLow: u32, + dwNumberOfBytesToMap: size_t, + ) -> *mut c_void; + + pub fn CloseHandle(hObject: RawHandle) -> u32; // BOOL +} + +const MM_HIGHEST_VAD_ADDRESS: u64 = 0x000007FFFFFDFFFF; + +const MEM_COMMIT: u32 = 0x00001000; +const MEM_RELEASE: u32 = 0x00008000; +const FILE_MAP_ALL_ACCESS: u32 = 0xf001f; +const PAGE_READWRITE: u32 = 0x04; + +pub const MAP_FAILED: *mut c_void = 0 as *mut c_void; +pub const INVALID_HANDLE_VALUE: RawHandle = (-1isize) as RawHandle; +#[allow(dead_code)] +pub const ERROR_INVALID_PARAMETER: i32 = 87; + +/// A backend driver to access guest's physical memory by mmapping guest's memory into the current +/// process. +/// For a combination of 32-bit hypervisor and 64-bit virtual machine, only partial of guest's +/// physical memory may be mapped into current process due to limited process virtual address +/// space size. +#[derive(Debug)] +pub struct MmapRegion { + addr: *mut u8, + size: usize, +} + +// Send and Sync aren't automatically inherited for the raw address pointer. +// Accessing that pointer is only done through the stateless interface which +// allows the object to be shared by multiple threads without a decrease in +// safety. +unsafe impl Send for MmapRegion {} +unsafe impl Sync for MmapRegion {} + +impl MmapRegion { + /// Creates an anonymous shared mapping of `size` bytes. + /// + /// # Arguments + /// * `size` - Size of memory region in bytes. + pub fn new(size: usize) -> io::Result { + if (size == 0) || (size > MM_HIGHEST_VAD_ADDRESS as usize) { + return Err(io::Error::from_raw_os_error(libc::EINVAL)); + } + // This is safe because we are creating an anonymous mapping in a place not already used by + // any other area in this process. + let addr = unsafe { VirtualAlloc(0 as *mut c_void, size, MEM_COMMIT, PAGE_READWRITE) }; + if addr == MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Maps the `size` bytes starting at `offset` bytes of the given `fd`. + /// + /// # Arguments + /// * `file` - Raw handle to a file to map into the address space. + /// * `size` - Size of memory region in bytes. + /// * `offset` - Offset in bytes from the beginning of `file` to start the mapping. + pub fn from_fd(file: &AsRawHandle, size: usize, offset: libc::off_t) -> io::Result { + let handle = file.as_raw_handle(); + if handle == INVALID_HANDLE_VALUE { + return Err(io::Error::from_raw_os_error(libc::EBADF)); + } + + let mapping = unsafe { + CreateFileMappingA( + handle, + null(), + PAGE_READWRITE, + (size >> 32) as u32, + size as u32, + null(), + ) + }; + if mapping == 0 as RawHandle { + return Err(io::Error::last_os_error()); + } + + // This is safe because we are creating a mapping in a place not already used by any other + // area in this process. + let addr = unsafe { + MapViewOfFile( + mapping, + FILE_MAP_ALL_ACCESS, + (offset as u64 >> 32) as u32, + offset as u32, + size, + ) + }; + + unsafe { + CloseHandle(mapping); + } + + if addr == null_mut() { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Returns a pointer to the beginning of the memory region. Should only be + /// used for passing this region to ioctls for setting guest memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } +} + +impl AsSlice for MmapRegion { + // Returns the region as a slice + // used to do crap + unsafe fn as_slice(&self) -> &[u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts_mut(self.addr, self.size) + } +} + +impl VolatileMemory for MmapRegion { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> volatile_memory::Result { + let end = compute_offset(offset, count)?; + if end > self.size { + return Err(volatile_memory::Error::OutOfBounds { addr: end }); + } + + // Safe because we checked that offset + count was within our range and we only ever hand + // out volatile accessors. + Ok(unsafe { VolatileSlice::new((self.addr as usize + offset) as *mut _, count) }) + } +} + +impl Drop for MmapRegion { + fn drop(&mut self) { + // This is safe because we mmap the area at addr ourselves, and nobody + // else is holding a reference to it. + unsafe { + VirtualFree(self.addr as *mut libc::c_void, self.size, MEM_RELEASE); + } + } +} + +#[cfg(test)] +mod tests { + use mmap_windows::{MmapRegion, INVALID_HANDLE_VALUE}; + use std::os::windows::io::FromRawHandle; + + #[test] + fn map_invalid_handle() { + let fd = unsafe { std::fs::File::from_raw_handle(INVALID_HANDLE_VALUE) }; + let e = MmapRegion::from_fd(&fd, 1024, 0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EBADF)); + } +} diff --git a/vendor/git-3e7c44ea7d5fd800/vm-memory/src/volatile_memory.rs b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/volatile_memory.rs new file mode 100644 index 000000000..fdc91f775 --- /dev/null +++ b/vendor/git-3e7c44ea7d5fd800/vm-memory/src/volatile_memory.rs @@ -0,0 +1,967 @@ +// Portions Copyright 2019 Red Hat, Inc. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRT-PARTY file. + +//! Types for volatile access to memory. +//! +//! Two of the core rules for safe rust is no data races and no aliased mutable references. +//! `VolatileRef` and `VolatileSlice`, along with types that produce those which implement +//! `VolatileMemory`, allow us to sidestep that rule by wrapping pointers that absolutely have to be +//! accessed volatile. Some systems really do need to operate on shared memory and can't have the +//! compiler reordering or eliding access because it has no visibility into what other systems are +//! doing with that hunk of memory. +//! +//! For the purposes of maintaining safety, volatile memory has some rules of its own: +//! 1. No references or slices to volatile memory (`&` or `&mut`). +//! 2. Access should always been done with a volatile read or write. +//! The First rule is because having references of any kind to memory considered volatile would +//! violate pointer aliasing. The second is because unvolatile accesses are inherently undefined if +//! done concurrently without synchronization. With volatile access we know that the compiler has +//! not reordered or elided the access. + +use std::cmp::min; +use std::fmt; +use std::io::{self, Read, Write}; +use std::marker::PhantomData; +use std::mem::size_of; +use std::ptr::copy; +use std::ptr::{read_volatile, write_volatile}; +use std::result; +use std::slice::{from_raw_parts, from_raw_parts_mut}; +use std::usize; + +use bytes::{ByteValued, Bytes}; + +/// VolatileMemory related error codes +#[allow(missing_docs)] +#[derive(Debug)] +pub enum Error { + /// `addr` is out of bounds of the volatile memory slice. + OutOfBounds { addr: usize }, + /// Taking a slice at `base` with `offset` would overflow `usize`. + Overflow { base: usize, offset: usize }, + /// Writing to memory failed + IOError(io::Error), + /// Incomplete read or write + PartialBuffer { expected: usize, completed: usize }, +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Error::OutOfBounds { addr } => write!(f, "address 0x{:x} is out of bounds", addr), + Error::Overflow { base, offset } => write!( + f, + "address 0x{:x} offset by 0x{:x} would overflow", + base, offset + ), + Error::IOError(error) => write!(f, "{}", error), + Error::PartialBuffer { + expected, + completed, + } => write!( + f, + "only used {} bytes in {} long buffer", + completed, expected + ), + } + } +} + +/// Result of volatile memory operations +pub type Result = result::Result; + +/// Convenience function for computing `base + offset` which returns +/// `Err(Error::Overflow)` instead of panicking in the case `base + offset` exceeds +/// `usize::MAX`. +/// +/// # Examples +/// +/// ``` +/// # use vm_memory::volatile_memory::*; +/// # fn get_slice(offset: usize, count: usize) -> Result<()> { +/// let mem_end = compute_offset(offset, count)?; +/// if mem_end > 100 { +/// return Err(Error::OutOfBounds{addr: mem_end}); +/// } +/// # Ok(()) +/// # } +/// ``` +pub fn compute_offset(base: usize, offset: usize) -> Result { + match base.checked_add(offset) { + None => Err(Error::Overflow { base, offset }), + Some(m) => Ok(m), + } +} + +/// Trait for types that support raw volatile access to their data. +pub trait VolatileMemory { + /// Gets the size of this slice. + fn len(&self) -> usize; + + /// Check whether the region is empty. + fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Gets a slice of memory at `offset` that is `count` bytes in length and supports volatile + /// access. + fn get_slice(&self, offset: usize, count: usize) -> Result; + + /// Gets a slice of memory for the entire region that supports volatile access. + fn as_volatile_slice(&self) -> VolatileSlice { + self.get_slice(0, self.len()).unwrap() + } + + /// Gets a `VolatileRef` at `offset`. + fn get_ref(&self, offset: usize) -> Result> { + let slice = self.get_slice(offset, size_of::())?; + unsafe { + // This is safe because the pointer is range-checked by get_slice, and + // the lifetime is the same as self. + Ok(VolatileRef::::new(slice.addr)) + } + } + + /// Check that addr + count is valid and return the sum. + fn compute_end_offset(&self, base: usize, offset: usize) -> Result { + let mem_end = compute_offset(base, offset)?; + if mem_end > self.len() { + return Err(Error::OutOfBounds { addr: mem_end }); + } + Ok(mem_end) + } +} + +impl<'a> VolatileMemory for &'a mut [u8] { + fn len(&self) -> usize { + <[u8]>::len(self) + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + unsafe { + // This is safe because the pointer is range-checked by compute_end_offset, and + // the lifetime is the same as the original slice. + Ok(VolatileSlice::new( + (self.as_ptr() as usize + offset) as *mut _, + count, + )) + } + } +} + +#[repr(C, packed)] +struct Packed(T); + +/// A slice of raw memory that supports volatile access. +#[derive(Copy, Clone, Debug)] +pub struct VolatileSlice<'a> { + addr: *mut u8, + size: usize, + phantom: PhantomData<&'a u8>, +} + +impl<'a> VolatileSlice<'a> { + /// Creates a slice of raw memory that must support volatile access. + /// + /// To use this safely, the caller must guarantee that the memory at `addr` is `size` bytes long + /// and is available for the duration of the lifetime of the new `VolatileSlice`. The caller + /// must also guarantee that all other users of the given chunk of memory are using volatile + /// accesses. + pub unsafe fn new(addr: *mut u8, size: usize) -> VolatileSlice<'a> { + VolatileSlice { + addr, + size, + phantom: PhantomData, + } + } + + /// Gets the address of this slice's memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } + + /// Gets the size of this slice. + pub fn len(&self) -> usize { + self.size + } + + /// Check whether the slice is empty. + pub fn is_empty(&self) -> bool { + self.size == 0 + } + + /// Creates a copy of this slice with the address increased by `count` bytes, and the size + /// reduced by `count` bytes. + pub fn offset(self, count: usize) -> Result> { + let new_addr = (self.addr as usize) + .checked_add(count) + .ok_or(Error::Overflow { + base: self.addr as usize, + offset: count, + })?; + let new_size = self + .size + .checked_sub(count) + .ok_or(Error::OutOfBounds { addr: new_addr })?; + unsafe { + // Safe because the memory has the same lifetime and points to a subset of the + // memory of the original slice. + Ok(VolatileSlice::new(new_addr as *mut u8, new_size)) + } + } + + /// Copies `self.len()` or `buf.len()` times the size of `T` bytes, whichever is smaller, to + /// `buf`. + /// + /// The copy happens from smallest to largest address in `T` sized chunks using volatile reads. + /// + /// # Examples + /// + /// ``` + /// # use std::fs::File; + /// # use std::path::Path; + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// let mut buf = [5u8; 16]; + /// vslice.copy_to(&mut buf[..]); + /// for v in &buf[..] { + /// assert_eq!(buf[0], 0); + /// } + /// # Ok(()) + /// # } + /// ``` + pub fn copy_to(&self, buf: &mut [T]) -> usize + where + T: ByteValued, + { + let mut addr = self.addr; + let mut i = 0; + for v in buf.iter_mut().take(self.size / size_of::()) { + unsafe { + *v = read_volatile(addr as *const Packed).0; + addr = addr.add(size_of::()); + }; + i += 1; + } + i + } + + /// Copies `self.len()` or `slice.len()` bytes, whichever is smaller, to `slice`. + /// + /// The copies happen in an undefined order. + /// # Examples + /// + /// ``` + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// vslice.copy_to_volatile_slice(vslice.get_slice(16, 16).map_err(|_| ())?); + /// # Ok(()) + /// # } + /// ``` + pub fn copy_to_volatile_slice(&self, slice: VolatileSlice) { + unsafe { + // Safe because the pointers are range-checked when the slices + // are created, and they never escape the VolatileSlices. + // FIXME: ... however, is it really okay to mix non-volatile + // operations such as copy with read_volatile and write_volatile? + copy(self.addr, slice.addr, min(self.size, slice.size)); + } + } + + /// Copies `self.len()` or `buf.len()` times the size of `T` bytes, whichever is smaller, to + /// this slice's memory. + /// + /// The copy happens from smallest to largest address in `T` sized chunks using volatile writes. + /// + /// # Examples + /// + /// ``` + /// # use std::fs::File; + /// # use std::path::Path; + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// let buf = [5u8; 64]; + /// vslice.copy_from(&buf[..]); + /// for i in 0..4 { + /// assert_eq!(vslice.get_ref::(i * 4).map_err(|_| ())?.load(), 0x05050505); + /// } + /// # Ok(()) + /// # } + /// ``` + pub fn copy_from(&self, buf: &[T]) + where + T: ByteValued, + { + let mut addr = self.addr; + for &v in buf.iter().take(self.size / size_of::()) { + unsafe { + // Safe because the pointers are range-checked when the slices + // are created, and they never escape the VolatileSlices. + write_volatile(addr as *mut Packed, Packed::(v)); + addr = addr.add(size_of::()); + } + } + } + + // These function are private and only used for the read/write functions. It is not valid in + // general to take slices of volatile memory. + unsafe fn as_slice(&self) -> &[u8] { + from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + from_raw_parts_mut(self.addr, self.size) + } +} + +impl<'a> Bytes for VolatileSlice<'a> { + type E = Error; + + /// Writes a slice to the region at the specified address. + /// Returns the number of bytes written. The number of bytes written can + /// be less than the length of the slice if there isn't enough room in the + /// region. + /// + /// # Examples + /// * Write a slice at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let res = vslice.write(&[1,2,3,4,5], 1020); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), 4); + /// ``` + fn write(&self, buf: &[u8], addr: usize) -> Result { + if addr >= self.size { + return Err(Error::OutOfBounds { addr }); + } + unsafe { + // Guest memory can't strictly be modeled as a slice because it is + // volatile. Writing to it with what compiles down to a memcpy + // won't hurt anything as long as we get the bounds checks right. + let mut slice: &mut [u8] = &mut self.as_mut_slice()[addr..]; + Ok(slice.write(buf).map_err(Error::IOError)?) + } + } + + /// Reads to a slice from the region at the specified address. + /// Returns the number of bytes read. The number of bytes read can be less than the length + /// of the slice if there isn't enough room in the region. + /// + /// # Examples + /// * Read a slice of size 16 at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let buf = &mut [0u8; 16]; + /// let res = vslice.read(buf, 1010); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), 14); + /// ``` + fn read(&self, mut buf: &mut [u8], addr: usize) -> Result { + if addr >= self.size { + return Err(Error::OutOfBounds { addr }); + } + unsafe { + // Guest memory can't strictly be modeled as a slice because it is + // volatile. Writing to it with what compiles down to a memcpy + // won't hurt anything as long as we get the bounds checks right. + let slice: &[u8] = &self.as_slice()[addr..]; + Ok(buf.write(slice).map_err(Error::IOError)?) + } + } + + /// Writes a slice to the region at the specified address. + /// + /// # Examples + /// * Write a slice at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let res = vslice.write_slice(&[1,2,3,4,5], 256); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), ()); + /// ``` + fn write_slice(&self, buf: &[u8], addr: usize) -> Result<()> { + let len = self.write(buf, addr)?; + if len != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: len, + }); + } + Ok(()) + } + + /// Reads to a slice from the region at the specified address. + /// + /// # Examples + /// * Read a slice of size 16 at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let buf = &mut [0u8; 16]; + /// let res = vslice.read_slice(buf, 256); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), ()); + /// ``` + fn read_slice(&self, buf: &mut [u8], addr: usize) -> Result<()> { + let len = self.read(buf, addr)?; + if len != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: len, + }); + } + Ok(()) + } + + /// Writes data from a readable object like a File and writes it to the region. + /// + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_read_random() -> Result { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/urandom")).map_err(|_| ())?; + /// vslice.read_from(32, &mut file, 128).map_err(|_| ())?; + /// let rand_val: u32 = vslice.read_obj(40).map_err(|_| ())?; + /// # Ok(rand_val) + /// # } + /// ``` + fn read_from(&self, addr: usize, src: &mut F, count: usize) -> Result + where + F: Read, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to overwrite the volatile memory. Accessing the guest + // memory as a mutable slice is OK because nothing assumes another + // thread won't change what is loaded. + let dst = &mut self.as_mut_slice()[addr..end]; + src.read(dst).map_err(Error::IOError) + } + } + + /// Writes data from a readable object like a File and writes it to the region. + /// + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_read_random() -> Result { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/urandom")).map_err(|_| ())?; + /// vslice.read_exact_from(32, &mut file, 128).map_err(|_| ())?; + /// let rand_val: u32 = vslice.read_obj(40).map_err(|_| ())?; + /// # Ok(rand_val) + /// # } + /// ``` + fn read_exact_from(&self, addr: usize, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to overwrite the volatile memory. Accessing the guest + // memory as a mutable slice is OK because nothing assumes another + // thread won't change what is loaded. + let dst = &mut self.as_mut_slice()[addr..end]; + src.read_exact(dst).map_err(Error::IOError)?; + } + Ok(()) + } + + /// Reads data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to /dev/null + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_write_null() -> Result<(), ()> { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/null")).map_err(|_| ())?; + /// vslice.write_to(32, &mut file, 128).map_err(|_| ())?; + /// # Ok(()) + /// # } + /// ``` + fn write_to(&self, addr: usize, dst: &mut F, count: usize) -> Result + where + F: Write, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let src = &self.as_mut_slice()[addr..end]; + dst.write(src).map_err(Error::IOError) + } + } + + /// Reads data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to /dev/null + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_write_null() -> Result<(), ()> { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/null")).map_err(|_| ())?; + /// vslice.write_all_to(32, &mut file, 128).map_err(|_| ())?; + /// # Ok(()) + /// # } + /// ``` + fn write_all_to(&self, addr: usize, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let src = &self.as_mut_slice()[addr..end]; + dst.write_all(src).map_err(Error::IOError)?; + } + Ok(()) + } +} + +impl<'a> VolatileMemory for VolatileSlice<'a> { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + Ok(unsafe { + // This is safe because the pointer is range-checked by compute_end_offset, and + // the lifetime is the same as self. + VolatileSlice::new((self.addr as usize + offset) as *mut u8, count) + }) + } +} + +/// A memory location that supports volatile access of a `T`. +/// +/// # Examples +/// +/// ``` +/// # use vm_memory::VolatileRef; +/// let mut v = 5u32; +/// assert_eq!(v, 5); +/// let v_ref = unsafe { VolatileRef::::new(&mut v as *mut u32 as *mut u8) }; +/// assert_eq!(v_ref.load(), 5); +/// v_ref.store(500); +/// assert_eq!(v, 500); +#[derive(Debug)] +pub struct VolatileRef<'a, T: ByteValued> +where + T: 'a, +{ + addr: *mut Packed, + phantom: PhantomData<&'a T>, +} + +#[allow(clippy::len_without_is_empty)] +impl<'a, T: ByteValued> VolatileRef<'a, T> { + /// Creates a reference to raw memory that must support volatile access of `T` sized chunks. + /// + /// To use this safely, the caller must guarantee that the memory at `addr` is big enough for a + /// `T` and is available for the duration of the lifetime of the new `VolatileRef`. The caller + /// must also guarantee that all other users of the given chunk of memory are using volatile + /// accesses. + pub unsafe fn new(addr: *mut u8) -> VolatileRef<'a, T> { + VolatileRef { + addr: addr as *mut Packed, + phantom: PhantomData, + } + } + + /// Gets the address of this slice's memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr as *mut u8 + } + + /// Gets the size of this slice. + /// + /// # Examples + /// + /// ``` + /// # use std::mem::size_of; + /// # use vm_memory::VolatileRef; + /// let v_ref = unsafe { VolatileRef::::new(0 as *mut _) }; + /// assert_eq!(v_ref.len(), size_of::() as usize); + /// ``` + pub fn len(&self) -> usize { + size_of::() + } + + /// Does a volatile write of the value `v` to the address of this ref. + #[inline(always)] + pub fn store(&self, v: T) { + unsafe { write_volatile(self.addr, Packed::(v)) }; + } + + /// Does a volatile read of the value at the address of this ref. + #[inline(always)] + pub fn load(&self) -> T { + // For the purposes of demonstrating why read_volatile is necessary, try replacing the code + // in this function with the commented code below and running `cargo test --release`. + // unsafe { *(self.addr as *const T) } + unsafe { read_volatile(self.addr).0 } + } + + /// Converts this `T` reference to a raw slice with the same size and address. + pub fn to_slice(&self) -> VolatileSlice<'a> { + unsafe { VolatileSlice::new(self.addr as *mut u8, size_of::()) } + } +} + +#[cfg(test)] +mod tests { + extern crate tempfile; + + use super::*; + + use self::tempfile::tempfile; + use std::sync::Arc; + use std::thread::{sleep, spawn}; + use std::time::Duration; + + use std::fs::File; + use std::path::Path; + + #[derive(Clone)] + struct VecMem { + mem: Arc>, + } + + impl VecMem { + fn new(size: usize) -> VecMem { + let mut mem = Vec::new(); + mem.resize(size, 0); + VecMem { mem: Arc::new(mem) } + } + } + + impl VolatileMemory for VecMem { + fn len(&self) -> usize { + self.mem.len() + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + Ok(unsafe { + VolatileSlice::new((self.mem.as_ptr() as usize + offset) as *mut _, count) + }) + } + } + + #[test] + fn ref_store() { + let mut a = [0u8; 1]; + { + let a_ref = &mut a[..]; + let v_ref = a_ref.get_ref(0).unwrap(); + v_ref.store(2u8); + } + assert_eq!(a[0], 2); + } + + #[test] + fn ref_load() { + let mut a = [5u8; 1]; + { + let a_ref = &mut a[..]; + let c = { + let v_ref = a_ref.get_ref::(0).unwrap(); + assert_eq!(v_ref.load(), 5u8); + v_ref + }; + // To make sure we can take a v_ref out of the scope we made it in: + c.load(); + // but not too far: + // c + } //.load() + ; + } + + #[test] + fn ref_to_slice() { + let mut a = [1u8; 5]; + let a_ref = &mut a[..]; + let v_ref = a_ref.get_ref(1).unwrap(); + v_ref.store(0x1234_5678u32); + let ref_slice = v_ref.to_slice(); + assert_eq!(v_ref.as_ptr() as usize, ref_slice.as_ptr() as usize); + assert_eq!(v_ref.len(), ref_slice.len()); + assert!(!ref_slice.is_empty()); + } + + #[test] + fn observe_mutate() { + let a = VecMem::new(1); + let a_clone = a.clone(); + let v_ref = a.get_ref::(0).unwrap(); + v_ref.store(99); + spawn(move || { + sleep(Duration::from_millis(10)); + let clone_v_ref = a_clone.get_ref::(0).unwrap(); + clone_v_ref.store(0); + }); + + // Technically this is a race condition but we have to observe the v_ref's value changing + // somehow and this helps to ensure the sleep actually happens before the store rather then + // being reordered by the compiler. + assert_eq!(v_ref.load(), 99); + + // Granted we could have a machine that manages to perform this many volatile loads in the + // amount of time the spawned thread sleeps, but the most likely reason the retry limit will + // get reached is because v_ref.load() is not actually performing the required volatile read + // or v_ref.store() is not doing a volatile write. A timer based solution was avoided + // because that might use a syscall which could hint the optimizer to reload v_ref's pointer + // regardless of volatile status. Note that we use a longer retry duration for optimized + // builds. + #[cfg(debug_assertions)] + const RETRY_MAX: usize = 500_000_000; + #[cfg(not(debug_assertions))] + const RETRY_MAX: usize = 10_000_000_000; + + let mut retry = 0; + while v_ref.load() == 99 && retry < RETRY_MAX { + retry += 1; + } + + assert_ne!(retry, RETRY_MAX, "maximum retry exceeded"); + assert_eq!(v_ref.load(), 0); + } + + #[test] + fn slice_len() { + let a = VecMem::new(100); + let s = a.get_slice(0, 27).unwrap(); + assert_eq!(s.len(), 27); + + let s = a.get_slice(34, 27).unwrap(); + assert_eq!(s.len(), 27); + + let s = s.get_slice(20, 5).unwrap(); + assert_eq!(s.len(), 5); + } + + #[test] + fn slice_is_empty() { + let a = VecMem::new(100); + let s = a.get_slice(0, 27).unwrap(); + assert!(!s.is_empty()); + + let s = a.get_slice(34, 0).unwrap(); + assert!(s.is_empty()); + } + + #[test] + fn slice_overflow_error() { + use std::usize::MAX; + let a = VecMem::new(1); + let res = a.get_slice(MAX, 1).unwrap_err(); + assert_matches!( + res, + Error::Overflow { + base: MAX, + offset: 1, + } + ); + } + + #[test] + fn slice_oob_error() { + let a = VecMem::new(100); + a.get_slice(50, 50).unwrap(); + let res = a.get_slice(55, 50).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 105 }); + } + + #[test] + fn ref_overflow_error() { + use std::usize::MAX; + let a = VecMem::new(1); + let res = a.get_ref::(MAX).unwrap_err(); + assert_matches!( + res, + Error::Overflow { + base: MAX, + offset: 1, + } + ); + } + + #[test] + fn ref_oob_error() { + let a = VecMem::new(100); + a.get_ref::(99).unwrap(); + let res = a.get_ref::(99).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 101 }); + } + + #[test] + fn ref_oob_too_large() { + let a = VecMem::new(3); + let res = a.get_ref::(0).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 4 }); + } + + #[test] + fn slice_store() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let r = a.get_ref(2).unwrap(); + r.store(9u16); + assert_eq!(s.read_obj::(2).unwrap(), 9); + } + + #[test] + fn test_write_past_end() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let res = s.write(&[1, 2, 3, 4, 5, 6], 0); + assert!(res.is_ok()); + assert_eq!(res.unwrap(), 5); + } + + #[test] + fn slice_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let sample_buf = [1, 2, 3]; + assert!(s.write(&sample_buf, 5).is_err()); + assert!(s.write(&sample_buf, 2).is_ok()); + let mut buf = [0u8; 3]; + assert!(s.read(&mut buf, 5).is_err()); + assert!(s.read_slice(&mut buf, 2).is_ok()); + assert_eq!(buf, sample_buf); + } + + #[test] + fn obj_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + assert!(s.write_obj(55u16, 4).is_err()); + assert!(s.write_obj(55u16, core::usize::MAX).is_err()); + assert!(s.write_obj(55u16, 2).is_ok()); + assert_eq!(s.read_obj::(2).unwrap(), 55u16); + assert!(s.read_obj::(4).is_err()); + assert!(s.read_obj::(core::usize::MAX).is_err()); + } + + #[test] + fn mem_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + assert!(s.write_obj(!0u32, 1).is_ok()); + let mut file = if cfg!(unix) { + File::open(Path::new("/dev/zero")).unwrap() + } else { + File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + }; + assert!(s.read_exact_from(2, &mut file, size_of::()).is_err()); + assert!(s + .read_exact_from(core::usize::MAX, &mut file, size_of::()) + .is_err()); + + assert!(s.read_exact_from(1, &mut file, size_of::()).is_ok()); + + let mut f = tempfile().unwrap(); + assert!(s.read_exact_from(1, &mut f, size_of::()).is_err()); + format!("{:?}", s.read_exact_from(1, &mut f, size_of::())); + + let value = s.read_obj::(1).unwrap(); + if cfg!(unix) { + assert_eq!(value, 0); + } else { + assert_eq!(value, 0x0090_5a4d); + } + + let mut sink = Vec::new(); + assert!(s.write_all_to(1, &mut sink, size_of::()).is_ok()); + assert!(s.write_all_to(2, &mut sink, size_of::()).is_err()); + assert!(s + .write_all_to(core::usize::MAX, &mut sink, size_of::()) + .is_err()); + format!("{:?}", s.write_all_to(2, &mut sink, size_of::())); + if cfg!(unix) { + assert_eq!(sink, vec![0; size_of::()]); + } else { + assert_eq!(sink, vec![0x4d, 0x5a, 0x90, 0x00]); + }; + } + + #[test] + fn unaligned_read_and_write() { + let a = VecMem::new(7); + let s = a.as_volatile_slice(); + let sample_buf: [u8; 7] = [1, 2, 0xAA, 0xAA, 0xAA, 0xAA, 4]; + assert!(s.write_slice(&sample_buf, 0).is_ok()); + let r = a.get_ref::(2).unwrap(); + assert_eq!(r.load(), 0xAAAA_AAAA); + + r.store(0x5555_5555); + let sample_buf: [u8; 7] = [1, 2, 0x55, 0x55, 0x55, 0x55, 4]; + let mut buf: [u8; 7] = Default::default(); + assert!(s.read_slice(&mut buf, 0).is_ok()); + assert_eq!(buf, sample_buf); + } +} diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/.buildkite/pipeline.yml b/vendor/git-4af8f4552cd0d200/linux-loader/.buildkite/pipeline.yml new file mode 100644 index 000000000..8a0726605 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/.buildkite/pipeline.yml @@ -0,0 +1,61 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "clippy-x86" + commands: + - cargo clippy --all -- -D warnings + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "coverage-x86" + commands: + - pytest tests/test_coverage.py + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/.cargo-checksum.json b/vendor/git-4af8f4552cd0d200/linux-loader/.cargo-checksum.json new file mode 100644 index 000000000..e9b3551b5 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/pipeline.yml":"95725fe62c2dc4076b32df9b26c828bcf4e3876092c0401e718e16ce4f513be0",".gitignore/.gitignore":"6b937008e0a58a438c32574627db6961a4d2aff4bf5c703d4e45cb56ef3b168a","Cargo.toml":"f2754a32f2dacc0f8695ee9780193badc85995954ed452d0df4ca1ef8517d089","DESIGN.md":"d877f3093cf94402528a54a97e833fc79d4cbc07934031035f60a2d8d0a542d4","LICENSE-APACHE":"000b4962e6b27176a0ff89cce4be555b16472cafb5671eb2804a8fdac6854793","LICENSE-BSD-3-Clause":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","README.md":"3e585f0ceb915bf4734075d2f0a91b626ff2363079baebcf7592a8d51d2c7931","src/cmdline/mod.rs":"30f57b492618155be6129311d0182688e5d1ecd9a3b5fdc9b742cd0c0e1f85da","src/lib.rs":"67d3e4a9ed48495c00fe6698fc606693b15a006fb0599cb18b946ea3929cd0f6","src/loader/bootparam.rs":"054b5a196873965cb48b9e9fa99c2505f523f9c71ca8ca0fad3af02491811fe6","src/loader/elf.rs":"f4e4eb6ffcb114bbf3242a9c72ea7e99631487d63bbbfbcf641bea42b3aba2e1","src/loader/mod.rs":"555c8214415955ab2e47bac0dbc392cd8ed4155e54099767de93e1136cfddd12","src/loader/struct_util.rs":"a98c2854ebd3a0c0ed11e01e474f2da15fb9200754129223710d62cc88ab253a","src/loader/test_elf.bin":"dda390f7546c7ba36bab412a93add96533806154824b77aafc8c153231f3f161","tests/conftest.py":"ee2baacd9da7ac04ffbfd580a7d4fe8a8b166a16e1eeed2d488f7b820abab433","tests/coverage":"69eaa47e0089d5a3e2844fe7ca823b67ff712e382f6c34b0300797a415b7f3e9","tests/test_coverage.py":"2f4bbb571bf52ad796f9f47a3aaace61ee92ab9788980496bb1652826f224150"},"package":null} \ No newline at end of file diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/.gitignore/.gitignore b/vendor/git-4af8f4552cd0d200/linux-loader/.gitignore/.gitignore new file mode 100644 index 000000000..693699042 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/.gitignore/.gitignore @@ -0,0 +1,3 @@ +/target +**/*.rs.bk +Cargo.lock diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/Cargo.toml b/vendor/git-4af8f4552cd0d200/linux-loader/Cargo.toml new file mode 100644 index 000000000..d180f24e4 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "linux-loader" +version = "0.1.0" +authors = ["cathy "] +edition = "2018" +license = "Apache-2.0 AND BSD-3-Clause" + +[features] +default = ["elf"] +elf = [] +bzImage = [] + + +[dependencies.vm-memory] +git = "https://github.com/rust-vmm/vm-memory" +features = ["backend-mmap"] diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/DESIGN.md b/vendor/git-4af8f4552cd0d200/linux-loader/DESIGN.md new file mode 100644 index 000000000..f84fb9368 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/DESIGN.md @@ -0,0 +1,64 @@ +# ELF Image parsing and loading + +The boot process is explained from the following two sides. + +## Loader side + +It follows ELF standard which is specified in elf.rs. The entry header and program headers will be inerpreted, and PT_LOAD segments will be loaded into guest memory. + +### Where kernel is loaded + +There are two ways on deciding where the program segments will be loaded. + +- One way is to provide an option and allow vmm to specify where to load the image, considering its memory layout. +- The other way is to load image into phdr.p_paddr by default. + +## Vmm side + +### Construct zero page + +According to the 64-bit boot protocol, the boot parameters (traditionally known as "zero page") should be setup, including setup_header, e820 table and other stuff. However, ELF has no setup_header, nothing returned from ELF loader could be used to fill boot parameters, vmm is totally responsible for the construction. + +### Configure vcpu + +- RIP, the start offset of guest memory where kernel is loaded, which is returned from loader +- 64 bit mode with paging enabled +- GDT must be configured and loaded + +# bzImage + +The boot process is also explained from the following two sides. + +## Loader side + +### What will be returned from loader + +bzImage includes two parts, the setup and the compressed kernel. The compressed kernel part will be loaded into guest memory, and the following three parts will returned to vmm by loader. +- The start address of loaded kernel +- The offset of memory where kernel is end of loading +- The setup header begin at the offset 0x01f1 of bzImage, this one is an extra compared to the return of ELF loader. + +### Where kernel is loaded + +The same as ELF image loader, there are two ways for deciding where the compressed kernel will be loaded. + +- Vmm specify where to load kernel image. +- Load into code32_start (Boot load address) by default. + +### Additional checking + +As what the boot protocol said, the kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 bit(LOAD_HIGH) is the loadflags field is set. Add this checking to validate the bzImage. + +## Vmm side + +### Construct zero page + +While vmm build "zero page" with e820 table and other stuff, bzImage loader will return the setup header to fill the boot parameters. Meanwhile, setup_header.init_size is a must to be filled into zero page, which will be used during head_64.S boot process. + +### Configure vcpu + +- RIP, the start address of loaded 64-bit kernel returned from loader + 0x200. Regarding to the 64-bit boot protocol, kernel is started by jumping to the 64-bit kernel entry point, which is the start address of loaded 64-bit kernel plus 0x200. +- 64 bit mode with paging enabled +- GDT must be configured and loaded + + diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/LICENSE-APACHE b/vendor/git-4af8f4552cd0d200/linux-loader/LICENSE-APACHE new file mode 100644 index 000000000..6f756351a --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/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/vendor/git-4af8f4552cd0d200/linux-loader/LICENSE-BSD-3-Clause b/vendor/git-4af8f4552cd0d200/linux-loader/LICENSE-BSD-3-Clause new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/LICENSE-BSD-3-Clause @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/README.md b/vendor/git-4af8f4552cd0d200/linux-loader/README.md new file mode 100644 index 000000000..0c8920db4 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/README.md @@ -0,0 +1,105 @@ +# Linux-loader + +## Short-description + +* Parsing and loading vmlinux (raw ELF image) and bzImage images +* Linux command line parsing and generation +* Definitions and helpers for the Linux boot protocol + +## How to build + +``` +cd linux-loader +cargo build +``` + +## Tests + +Our Continuous Integration (CI) pipeline is implemented on top of +[Buildkite](https://buildkite.com/). +For the complete list of tests, check our +[CI pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci). + +Each individual test runs in a container. To reproduce a test locally, you can +use the dev-container on both x86 and arm64. + +```bash +docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +cd linux-loader/ +cargo test +``` + +### Test Profiles + +The integration tests support two test profiles: +- **devel**: this is the recommended profile for running the integration tests + on a local development machine. +- **ci** (default option): this is the profile used when running the + integration tests as part of the the Continuous Integration (CI). + +The test profiles are applicable to tests that run using pytest. Currently only +the [coverage test](tests/test_coverage.py) follows this model as all the other +integration tests are run using the +[Buildkite pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci). + +The difference between is declaring tests as passed or failed: +- with the **devel** profile the coverage test passes if the current coverage + is equal or higher than the upstream coverage value. In case the current + coverage is higher, the coverage file is updated to the new coverage value. +- with the **ci** profile the coverage test passes only if the current coverage + is equal to the upstream coverage value. + +Further details about the coverage test can be found in the +[Adaptive Coverage](#adaptive-coverage) section. + +### Adaptive Coverage + +The line coverage is saved in [tests/coverage](tests/coverage). To update the +coverage before submitting a PR, run the coverage test: + +```bash +docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +cd linux-loader/ +pytest --profile=devel tests/test_coverage.py +``` + +If the PR coverage is higher than the upstream coverage, the coverage file +needs to be manually added to the commit before submitting the PR: + +```bash +git add tests/coverage +``` + +Failing to do so will generate a fail on the CI pipeline when publishing the +PR. + +**NOTE:** The coverage file is only updated in the `devel` test profile. In +the `ci` profile the coverage test will fail if the current coverage is higher +than the coverage reported in [tests/coverage](tests/coverage). + +### bzImage test + +As we don't want to distribute an entire kernel bzImage, the `load_bzImage` test is ignored by +default. In order to test the bzImage support, one needs to locally build a bzImage, copy it +to the `src/loader` directory and run the ignored test: + +```shell +# Assuming your linux-loader and linux-stable are both under $LINUX_LOADER +$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $LINUX_LOADER/linux-stable +$ cd linux-stable +$ make bzImage +$ cp linux-stable/arch/x86/boot/bzImage $LINUX_LOADER/linux-loader/src/loader/ +$ cd $LINUX_LOADER/linux-loader +$ docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +$ cd linux-loader/ +$ cargo test -- --ignored +``` diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/cmdline/mod.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/cmdline/mod.rs new file mode 100644 index 000000000..d9991f69f --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/cmdline/mod.rs @@ -0,0 +1,235 @@ +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause +// +//! Helper for creating valid kernel command line strings. + +use std::fmt; +use std::result; + +/// The error type for command line building operations. +#[derive(PartialEq, Debug)] +pub enum Error { + /// Operation would have resulted in a non-printable ASCII character. + InvalidAscii, + /// Key/Value Operation would have had a space in it. + HasSpace, + /// Key/Value Operation would have had an equals sign in it. + HasEquals, + /// Operation would have made the command line too large. + TooLarge, +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "{}", + match *self { + Error::InvalidAscii => "string contains non-printable ASCII character", + Error::HasSpace => "string contains a space", + Error::HasEquals => "string contains an equals sign", + Error::TooLarge => "inserting string would make command line too long", + } + ) + } +} + +/// Specialized Result type for command line operations. +pub type Result = result::Result; + +fn valid_char(c: char) -> bool { + match c { + ' '...'~' => true, + _ => false, + } +} + +fn valid_str(s: &str) -> Result<()> { + if s.chars().all(valid_char) { + Ok(()) + } else { + Err(Error::InvalidAscii) + } +} + +fn valid_element(s: &str) -> Result<()> { + if !s.chars().all(valid_char) { + Err(Error::InvalidAscii) + } else if s.contains(' ') { + Err(Error::HasSpace) + } else if s.contains('=') { + Err(Error::HasEquals) + } else { + Ok(()) + } +} + +/// A builder for a kernel command line string that validates the string as its being built. A +/// `CString` can be constructed from this directly using `CString::new`. +#[derive(Clone)] +pub struct Cmdline { + line: String, + capacity: usize, +} + +impl Cmdline { + /// Constructs an empty Cmdline with the given capacity, which includes the nul terminator. + /// Capacity must be greater than 0. + pub fn new(capacity: usize) -> Cmdline { + assert_ne!(capacity, 0); + Cmdline { + line: String::with_capacity(capacity), + capacity, + } + } + + fn has_capacity(&self, more: usize) -> Result<()> { + let needs_space = if self.line.is_empty() { 0 } else { 1 }; + if self.line.len() + more + needs_space < self.capacity { + Ok(()) + } else { + Err(Error::TooLarge) + } + } + + fn start_push(&mut self) { + if !self.line.is_empty() { + self.line.push(' '); + } + } + + fn end_push(&mut self) { + // This assert is always true because of the `has_capacity` check that each insert method + // uses. + assert!(self.line.len() < self.capacity); + } + + /// Validates and inserts a key value pair into this command line + pub fn insert>(&mut self, key: T, val: T) -> Result<()> { + let k = key.as_ref(); + let v = val.as_ref(); + + valid_element(k)?; + valid_element(v)?; + self.has_capacity(k.len() + v.len() + 1)?; + + self.start_push(); + self.line.push_str(k); + self.line.push('='); + self.line.push_str(v); + self.end_push(); + + Ok(()) + } + + /// Validates and inserts a string to the end of the current command line + pub fn insert_str>(&mut self, slug: T) -> Result<()> { + let s = slug.as_ref(); + valid_str(s)?; + + self.has_capacity(s.len())?; + + self.start_push(); + self.line.push_str(s); + self.end_push(); + + Ok(()) + } + + /// Returns the cmdline in progress without nul termination + pub fn as_str(&self) -> &str { + self.line.as_str() + } +} + +impl Into> for Cmdline { + fn into(self) -> Vec { + self.line.into_bytes() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::ffi::CString; + + #[test] + fn insert_hello_world() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.as_str(), ""); + assert!(cl.insert("hello", "world").is_ok()); + assert_eq!(cl.as_str(), "hello=world"); + + let s = CString::new(cl).expect("failed to create CString from Cmdline"); + assert_eq!(s, CString::new("hello=world").unwrap()); + } + + #[test] + fn insert_multi() { + let mut cl = Cmdline::new(100); + assert!(cl.insert("hello", "world").is_ok()); + assert!(cl.insert("foo", "bar").is_ok()); + assert_eq!(cl.as_str(), "hello=world foo=bar"); + } + + #[test] + fn insert_space() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("a ", "b"), Err(Error::HasSpace)); + assert_eq!(cl.insert("a", "b "), Err(Error::HasSpace)); + assert_eq!(cl.insert("a ", "b "), Err(Error::HasSpace)); + assert_eq!(cl.insert(" a", "b"), Err(Error::HasSpace)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_equals() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("a=", "b"), Err(Error::HasEquals)); + assert_eq!(cl.insert("a", "b="), Err(Error::HasEquals)); + assert_eq!(cl.insert("a=", "b "), Err(Error::HasEquals)); + assert_eq!(cl.insert("=a", "b"), Err(Error::HasEquals)); + assert_eq!(cl.insert("a", "=b"), Err(Error::HasEquals)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_emoji() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("heart", "💖"), Err(Error::InvalidAscii)); + assert_eq!(cl.insert("💖", "love"), Err(Error::InvalidAscii)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_string() { + let mut cl = Cmdline::new(13); + assert_eq!(cl.as_str(), ""); + assert!(cl.insert_str("noapic").is_ok()); + assert_eq!(cl.as_str(), "noapic"); + assert!(cl.insert_str("nopci").is_ok()); + assert_eq!(cl.as_str(), "noapic nopci"); + } + + #[test] + fn insert_too_large() { + let mut cl = Cmdline::new(4); + assert_eq!(cl.insert("hello", "world"), Err(Error::TooLarge)); + assert_eq!(cl.insert("a", "world"), Err(Error::TooLarge)); + assert_eq!(cl.insert("hello", "b"), Err(Error::TooLarge)); + assert!(cl.insert("a", "b").is_ok()); + assert_eq!(cl.insert("a", "b"), Err(Error::TooLarge)); + assert_eq!(cl.insert_str("a"), Err(Error::TooLarge)); + assert_eq!(cl.as_str(), "a=b"); + + let mut cl = Cmdline::new(10); + assert!(cl.insert("ab", "ba").is_ok()); // adds 5 length + assert_eq!(cl.insert("c", "da"), Err(Error::TooLarge)); // adds 5 (including space) length + assert!(cl.insert("c", "d").is_ok()); // adds 4 (including space) length + } +} diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/lib.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/lib.rs new file mode 100644 index 000000000..4cb50e9eb --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/lib.rs @@ -0,0 +1,13 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +pub mod cmdline; +pub mod loader; + +extern crate vm_memory; diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/bootparam.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/bootparam.rs new file mode 100644 index 000000000..f19663ff6 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/bootparam.rs @@ -0,0 +1,3870 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +/* + * automatically generated by rust-bindgen + * From upstream linux bootparam.h at commit: + * 806276b7f07a39a1cc3f38bb1ef5c573d4594a38 + */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData); +impl __IncompleteArrayField { + #[inline] + pub fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ptr(&self) -> *const T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +impl ::std::clone::Clone for __IncompleteArrayField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::std::marker::Copy for __IncompleteArrayField {} +#[repr(C)] +pub struct __BindgenUnionField(::std::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub fn new() -> Self { + __BindgenUnionField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::std::mem::transmute(self) + } +} +impl ::std::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::std::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::std::marker::Copy for __BindgenUnionField {} +impl ::std::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +pub const SETUP_NONE: ::std::os::raw::c_uint = 0; +pub const SETUP_E820_EXT: ::std::os::raw::c_uint = 1; +pub const SETUP_DTB: ::std::os::raw::c_uint = 2; +pub const SETUP_PCI: ::std::os::raw::c_uint = 3; +pub const SETUP_EFI: ::std::os::raw::c_uint = 4; +pub const RAMDISK_IMAGE_START_MASK: ::std::os::raw::c_uint = 2047; +pub const RAMDISK_PROMPT_FLAG: ::std::os::raw::c_uint = 32768; +pub const RAMDISK_LOAD_FLAG: ::std::os::raw::c_uint = 16384; +pub const LOADED_HIGH: ::std::os::raw::c_uint = 1; +pub const QUIET_FLAG: ::std::os::raw::c_uint = 32; +pub const KEEP_SEGMENTS: ::std::os::raw::c_uint = 64; +pub const CAN_USE_HEAP: ::std::os::raw::c_uint = 128; +pub const XLF_KERNEL_64: ::std::os::raw::c_uint = 1; +pub const XLF_CAN_BE_LOADED_ABOVE_4G: ::std::os::raw::c_uint = 2; +pub const XLF_EFI_HANDOVER_32: ::std::os::raw::c_uint = 4; +pub const XLF_EFI_HANDOVER_64: ::std::os::raw::c_uint = 8; +pub const XLF_EFI_KEXEC: ::std::os::raw::c_uint = 16; +pub const __BITS_PER_LONG: ::std::os::raw::c_uint = 64; +pub const __FD_SETSIZE: ::std::os::raw::c_uint = 1024; +pub const VIDEO_TYPE_MDA: ::std::os::raw::c_uint = 16; +pub const VIDEO_TYPE_CGA: ::std::os::raw::c_uint = 17; +pub const VIDEO_TYPE_EGAM: ::std::os::raw::c_uint = 32; +pub const VIDEO_TYPE_EGAC: ::std::os::raw::c_uint = 33; +pub const VIDEO_TYPE_VGAC: ::std::os::raw::c_uint = 34; +pub const VIDEO_TYPE_VLFB: ::std::os::raw::c_uint = 35; +pub const VIDEO_TYPE_PICA_S3: ::std::os::raw::c_uint = 48; +pub const VIDEO_TYPE_MIPS_G364: ::std::os::raw::c_uint = 49; +pub const VIDEO_TYPE_SGI: ::std::os::raw::c_uint = 51; +pub const VIDEO_TYPE_TGAC: ::std::os::raw::c_uint = 64; +pub const VIDEO_TYPE_SUN: ::std::os::raw::c_uint = 80; +pub const VIDEO_TYPE_SUNPCI: ::std::os::raw::c_uint = 81; +pub const VIDEO_TYPE_PMAC: ::std::os::raw::c_uint = 96; +pub const VIDEO_TYPE_EFI: ::std::os::raw::c_uint = 112; +pub const VIDEO_FLAGS_NOCURSOR: ::std::os::raw::c_uint = 1; +pub const VIDEO_CAPABILITY_SKIP_QUIRKS: ::std::os::raw::c_uint = 1; +pub const APM_STATE_READY: ::std::os::raw::c_uint = 0; +pub const APM_STATE_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_STATE_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_STATE_OFF: ::std::os::raw::c_uint = 3; +pub const APM_STATE_BUSY: ::std::os::raw::c_uint = 4; +pub const APM_STATE_REJECT: ::std::os::raw::c_uint = 5; +pub const APM_STATE_OEM_SYS: ::std::os::raw::c_uint = 32; +pub const APM_STATE_OEM_DEV: ::std::os::raw::c_uint = 64; +pub const APM_STATE_DISABLE: ::std::os::raw::c_uint = 0; +pub const APM_STATE_ENABLE: ::std::os::raw::c_uint = 1; +pub const APM_STATE_DISENGAGE: ::std::os::raw::c_uint = 0; +pub const APM_STATE_ENGAGE: ::std::os::raw::c_uint = 1; +pub const APM_SYS_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_SYS_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_NORMAL_RESUME: ::std::os::raw::c_uint = 3; +pub const APM_CRITICAL_RESUME: ::std::os::raw::c_uint = 4; +pub const APM_LOW_BATTERY: ::std::os::raw::c_uint = 5; +pub const APM_POWER_STATUS_CHANGE: ::std::os::raw::c_uint = 6; +pub const APM_UPDATE_TIME: ::std::os::raw::c_uint = 7; +pub const APM_CRITICAL_SUSPEND: ::std::os::raw::c_uint = 8; +pub const APM_USER_STANDBY: ::std::os::raw::c_uint = 9; +pub const APM_USER_SUSPEND: ::std::os::raw::c_uint = 10; +pub const APM_STANDBY_RESUME: ::std::os::raw::c_uint = 11; +pub const APM_CAPABILITY_CHANGE: ::std::os::raw::c_uint = 12; +pub const APM_USER_HIBERNATION: ::std::os::raw::c_uint = 13; +pub const APM_HIBERNATION_RESUME: ::std::os::raw::c_uint = 14; +pub const APM_SUCCESS: ::std::os::raw::c_uint = 0; +pub const APM_DISABLED: ::std::os::raw::c_uint = 1; +pub const APM_CONNECTED: ::std::os::raw::c_uint = 2; +pub const APM_NOT_CONNECTED: ::std::os::raw::c_uint = 3; +pub const APM_16_CONNECTED: ::std::os::raw::c_uint = 5; +pub const APM_16_UNSUPPORTED: ::std::os::raw::c_uint = 6; +pub const APM_32_CONNECTED: ::std::os::raw::c_uint = 7; +pub const APM_32_UNSUPPORTED: ::std::os::raw::c_uint = 8; +pub const APM_BAD_DEVICE: ::std::os::raw::c_uint = 9; +pub const APM_BAD_PARAM: ::std::os::raw::c_uint = 10; +pub const APM_NOT_ENGAGED: ::std::os::raw::c_uint = 11; +pub const APM_BAD_FUNCTION: ::std::os::raw::c_uint = 12; +pub const APM_RESUME_DISABLED: ::std::os::raw::c_uint = 13; +pub const APM_NO_ERROR: ::std::os::raw::c_uint = 83; +pub const APM_BAD_STATE: ::std::os::raw::c_uint = 96; +pub const APM_NO_EVENTS: ::std::os::raw::c_uint = 128; +pub const APM_NOT_PRESENT: ::std::os::raw::c_uint = 134; +pub const APM_DEVICE_BIOS: ::std::os::raw::c_uint = 0; +pub const APM_DEVICE_ALL: ::std::os::raw::c_uint = 1; +pub const APM_DEVICE_DISPLAY: ::std::os::raw::c_uint = 256; +pub const APM_DEVICE_STORAGE: ::std::os::raw::c_uint = 512; +pub const APM_DEVICE_PARALLEL: ::std::os::raw::c_uint = 768; +pub const APM_DEVICE_SERIAL: ::std::os::raw::c_uint = 1024; +pub const APM_DEVICE_NETWORK: ::std::os::raw::c_uint = 1280; +pub const APM_DEVICE_PCMCIA: ::std::os::raw::c_uint = 1536; +pub const APM_DEVICE_BATTERY: ::std::os::raw::c_uint = 32768; +pub const APM_DEVICE_OEM: ::std::os::raw::c_uint = 57344; +pub const APM_DEVICE_OLD_ALL: ::std::os::raw::c_uint = 65535; +pub const APM_DEVICE_CLASS: ::std::os::raw::c_uint = 255; +pub const APM_DEVICE_MASK: ::std::os::raw::c_uint = 65280; +pub const APM_MAX_BATTERIES: ::std::os::raw::c_uint = 2; +pub const APM_CAP_GLOBAL_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_CAP_GLOBAL_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_CAP_RESUME_STANDBY_TIMER: ::std::os::raw::c_uint = 4; +pub const APM_CAP_RESUME_SUSPEND_TIMER: ::std::os::raw::c_uint = 8; +pub const APM_CAP_RESUME_STANDBY_RING: ::std::os::raw::c_uint = 16; +pub const APM_CAP_RESUME_SUSPEND_RING: ::std::os::raw::c_uint = 32; +pub const APM_CAP_RESUME_STANDBY_PCMCIA: ::std::os::raw::c_uint = 64; +pub const APM_CAP_RESUME_SUSPEND_PCMCIA: ::std::os::raw::c_uint = 128; +pub const _IOC_NRBITS: ::std::os::raw::c_uint = 8; +pub const _IOC_TYPEBITS: ::std::os::raw::c_uint = 8; +pub const _IOC_SIZEBITS: ::std::os::raw::c_uint = 14; +pub const _IOC_DIRBITS: ::std::os::raw::c_uint = 2; +pub const _IOC_NRMASK: ::std::os::raw::c_uint = 255; +pub const _IOC_TYPEMASK: ::std::os::raw::c_uint = 255; +pub const _IOC_SIZEMASK: ::std::os::raw::c_uint = 16383; +pub const _IOC_DIRMASK: ::std::os::raw::c_uint = 3; +pub const _IOC_NRSHIFT: ::std::os::raw::c_uint = 0; +pub const _IOC_TYPESHIFT: ::std::os::raw::c_uint = 8; +pub const _IOC_SIZESHIFT: ::std::os::raw::c_uint = 16; +pub const _IOC_DIRSHIFT: ::std::os::raw::c_uint = 30; +pub const _IOC_NONE: ::std::os::raw::c_uint = 0; +pub const _IOC_WRITE: ::std::os::raw::c_uint = 1; +pub const _IOC_READ: ::std::os::raw::c_uint = 2; +pub const IOC_IN: ::std::os::raw::c_uint = 1073741824; +pub const IOC_OUT: ::std::os::raw::c_uint = 2147483648; +pub const IOC_INOUT: ::std::os::raw::c_uint = 3221225472; +pub const IOCSIZE_MASK: ::std::os::raw::c_uint = 1073676288; +pub const IOCSIZE_SHIFT: ::std::os::raw::c_uint = 16; +pub const EDDNR: ::std::os::raw::c_uint = 489; +pub const EDDBUF: ::std::os::raw::c_uint = 3328; +pub const EDDMAXNR: ::std::os::raw::c_uint = 6; +pub const EDDEXTSIZE: ::std::os::raw::c_uint = 8; +pub const EDDPARMSIZE: ::std::os::raw::c_uint = 74; +pub const CHECKEXTENSIONSPRESENT: ::std::os::raw::c_uint = 65; +pub const GETDEVICEPARAMETERS: ::std::os::raw::c_uint = 72; +pub const LEGACYGETDEVICEPARAMETERS: ::std::os::raw::c_uint = 8; +pub const EDDMAGIC1: ::std::os::raw::c_uint = 21930; +pub const EDDMAGIC2: ::std::os::raw::c_uint = 43605; +pub const READ_SECTORS: ::std::os::raw::c_uint = 2; +pub const EDD_MBR_SIG_OFFSET: ::std::os::raw::c_uint = 440; +pub const EDD_MBR_SIG_BUF: ::std::os::raw::c_uint = 656; +pub const EDD_MBR_SIG_MAX: ::std::os::raw::c_uint = 16; +pub const EDD_MBR_SIG_NR_BUF: ::std::os::raw::c_uint = 490; +pub const EDD_EXT_FIXED_DISK_ACCESS: ::std::os::raw::c_uint = 1; +pub const EDD_EXT_DEVICE_LOCKING_AND_EJECTING: ::std::os::raw::c_uint = 2; +pub const EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT: ::std::os::raw::c_uint = 4; +pub const EDD_EXT_64BIT_EXTENSIONS: ::std::os::raw::c_uint = 8; +pub const EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT: ::std::os::raw::c_uint = 1; +pub const EDD_INFO_GEOMETRY_VALID: ::std::os::raw::c_uint = 2; +pub const EDD_INFO_REMOVABLE: ::std::os::raw::c_uint = 4; +pub const EDD_INFO_WRITE_VERIFY: ::std::os::raw::c_uint = 8; +pub const EDD_INFO_MEDIA_CHANGE_NOTIFICATION: ::std::os::raw::c_uint = 16; +pub const EDD_INFO_LOCKABLE: ::std::os::raw::c_uint = 32; +pub const EDD_INFO_NO_MEDIA_PRESENT: ::std::os::raw::c_uint = 64; +pub const EDD_INFO_USE_INT13_FN50: ::std::os::raw::c_uint = 128; +pub const E820MAP: ::std::os::raw::c_uint = 720; +pub const E820MAX: ::std::os::raw::c_uint = 128; +pub const E820_X_MAX: ::std::os::raw::c_uint = 128; +pub const E820NR: ::std::os::raw::c_uint = 488; +pub const E820_RAM: ::std::os::raw::c_uint = 1; +pub const E820_RESERVED: ::std::os::raw::c_uint = 2; +pub const E820_ACPI: ::std::os::raw::c_uint = 3; +pub const E820_NVS: ::std::os::raw::c_uint = 4; +pub const E820_UNUSABLE: ::std::os::raw::c_uint = 5; +pub const E820_RESERVED_KERN: ::std::os::raw::c_uint = 128; +pub const ISA_START_ADDRESS: ::std::os::raw::c_uint = 655360; +pub const ISA_END_ADDRESS: ::std::os::raw::c_uint = 1048576; +pub const BIOS_BEGIN: ::std::os::raw::c_uint = 655360; +pub const BIOS_END: ::std::os::raw::c_uint = 1048576; +pub const BIOS_ROM_BASE: ::std::os::raw::c_uint = 4292870144; +pub const BIOS_ROM_END: ::std::os::raw::c_uint = 4294967295; +pub type __s8 = ::std::os::raw::c_schar; +pub type __u8 = ::std::os::raw::c_uchar; +pub type __s16 = ::std::os::raw::c_short; +pub type __u16 = ::std::os::raw::c_ushort; +pub type __s32 = ::std::os::raw::c_int; +pub type __u32 = ::std::os::raw::c_uint; +pub type __s64 = ::std::os::raw::c_longlong; +pub type __u64 = ::std::os::raw::c_ulonglong; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct __kernel_fd_set { + pub fds_bits: [::std::os::raw::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___kernel_fd_set() { + assert_eq!( + ::std::mem::size_of::<__kernel_fd_set>(), + 128usize, + concat!("Size of: ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + ::std::mem::align_of::<__kernel_fd_set>(), + 8usize, + concat!("Alignment of ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + unsafe { &(*(0 as *const __kernel_fd_set)).fds_bits as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(__kernel_fd_set), + "::", + stringify!(fds_bits) + ) + ); +} +impl Clone for __kernel_fd_set { + fn clone(&self) -> Self { + *self + } +} +pub type __kernel_sighandler_t = + ::std::option::Option; +pub type __kernel_key_t = ::std::os::raw::c_int; +pub type __kernel_mqd_t = ::std::os::raw::c_int; +pub type __kernel_old_uid_t = ::std::os::raw::c_ushort; +pub type __kernel_old_gid_t = ::std::os::raw::c_ushort; +pub type __kernel_old_dev_t = ::std::os::raw::c_ulong; +pub type __kernel_long_t = ::std::os::raw::c_long; +pub type __kernel_ulong_t = ::std::os::raw::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = ::std::os::raw::c_uint; +pub type __kernel_pid_t = ::std::os::raw::c_int; +pub type __kernel_ipc_pid_t = ::std::os::raw::c_int; +pub type __kernel_uid_t = ::std::os::raw::c_uint; +pub type __kernel_gid_t = ::std::os::raw::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = ::std::os::raw::c_int; +pub type __kernel_uid32_t = ::std::os::raw::c_uint; +pub type __kernel_gid32_t = ::std::os::raw::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct __kernel_fsid_t { + pub val: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___kernel_fsid_t() { + assert_eq!( + ::std::mem::size_of::<__kernel_fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + ::std::mem::align_of::<__kernel_fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + unsafe { &(*(0 as *const __kernel_fsid_t)).val as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(__kernel_fsid_t), + "::", + stringify!(val) + ) + ); +} +impl Clone for __kernel_fsid_t { + fn clone(&self) -> Self { + *self + } +} +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = ::std::os::raw::c_longlong; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = ::std::os::raw::c_int; +pub type __kernel_clockid_t = ::std::os::raw::c_int; +pub type __kernel_caddr_t = *mut ::std::os::raw::c_char; +pub type __kernel_uid16_t = ::std::os::raw::c_ushort; +pub type __kernel_gid16_t = ::std::os::raw::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct screen_info { + pub orig_x: __u8, + pub orig_y: __u8, + pub ext_mem_k: __u16, + pub orig_video_page: __u16, + pub orig_video_mode: __u8, + pub orig_video_cols: __u8, + pub flags: __u8, + pub unused2: __u8, + pub orig_video_ega_bx: __u16, + pub unused3: __u16, + pub orig_video_lines: __u8, + pub orig_video_isVGA: __u8, + pub orig_video_points: __u16, + pub lfb_width: __u16, + pub lfb_height: __u16, + pub lfb_depth: __u16, + pub lfb_base: __u32, + pub lfb_size: __u32, + pub cl_magic: __u16, + pub cl_offset: __u16, + pub lfb_linelength: __u16, + pub red_size: __u8, + pub red_pos: __u8, + pub green_size: __u8, + pub green_pos: __u8, + pub blue_size: __u8, + pub blue_pos: __u8, + pub rsvd_size: __u8, + pub rsvd_pos: __u8, + pub vesapm_seg: __u16, + pub vesapm_off: __u16, + pub pages: __u16, + pub vesa_attributes: __u16, + pub capabilities: __u32, + pub _reserved: [__u8; 6usize], +} +#[test] +fn bindgen_test_layout_screen_info() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(screen_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(screen_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_x as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_x) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_y as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_y) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).ext_mem_k as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(ext_mem_k) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_page as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_page) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_mode as *const _ as usize }, + 6usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_mode) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_cols as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_cols) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).flags as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).unused2 as *const _ as usize }, + 9usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(unused2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_ega_bx as *const _ as usize }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_ega_bx) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).unused3 as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(unused3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_lines as *const _ as usize }, + 14usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_lines) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_isVGA as *const _ as usize }, + 15usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_isVGA) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_points as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_points) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_width as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_width) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_height as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_height) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_depth as *const _ as usize }, + 22usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_depth) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_base as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_base) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_size as *const _ as usize }, + 28usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).cl_magic as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(cl_magic) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).cl_offset as *const _ as usize }, + 34usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(cl_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_linelength as *const _ as usize }, + 36usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_linelength) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).red_size as *const _ as usize }, + 38usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(red_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).red_pos as *const _ as usize }, + 39usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(red_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).green_size as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(green_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).green_pos as *const _ as usize }, + 41usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(green_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).blue_size as *const _ as usize }, + 42usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(blue_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).blue_pos as *const _ as usize }, + 43usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(blue_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).rsvd_size as *const _ as usize }, + 44usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(rsvd_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).rsvd_pos as *const _ as usize }, + 45usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(rsvd_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesapm_seg as *const _ as usize }, + 46usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesapm_seg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesapm_off as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesapm_off) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).pages as *const _ as usize }, + 50usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(pages) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesa_attributes as *const _ as usize }, + 52usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesa_attributes) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).capabilities as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(capabilities) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info))._reserved as *const _ as usize }, + 58usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(_reserved) + ) + ); +} +impl Clone for screen_info { + fn clone(&self) -> Self { + *self + } +} +pub type apm_event_t = ::std::os::raw::c_ushort; +pub type apm_eventinfo_t = ::std::os::raw::c_ushort; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct apm_bios_info { + pub version: __u16, + pub cseg: __u16, + pub offset: __u32, + pub cseg_16: __u16, + pub dseg: __u16, + pub flags: __u16, + pub cseg_len: __u16, + pub cseg_16_len: __u16, + pub dseg_len: __u16, +} +#[test] +fn bindgen_test_layout_apm_bios_info() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(apm_bios_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(apm_bios_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).version as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).offset as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_16 as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_16) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).dseg as *const _ as usize }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(dseg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).flags as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_len as *const _ as usize }, + 14usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_16_len as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_16_len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).dseg_len as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(dseg_len) + ) + ); +} +impl Clone for apm_bios_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params { + pub length: __u16, + pub info_flags: __u16, + pub num_default_cylinders: __u32, + pub num_default_heads: __u32, + pub sectors_per_track: __u32, + pub number_of_sectors: __u64, + pub bytes_per_sector: __u16, + pub dpte_ptr: __u32, + pub key: __u16, + pub device_path_info_length: __u8, + pub reserved2: __u8, + pub reserved3: __u16, + pub host_bus_type: [__u8; 4usize], + pub interface_type: [__u8; 8usize], + pub interface_path: edd_device_params__bindgen_ty_1, + pub device_path: edd_device_params__bindgen_ty_2, + pub reserved4: __u8, + pub checksum: __u8, +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1 { + pub isa: __BindgenUnionField, + pub pci: __BindgenUnionField, + pub ibnd: __BindgenUnionField, + pub xprs: __BindgenUnionField, + pub htpt: __BindgenUnionField, + pub unknown: __BindgenUnionField, + pub bindgen_union_field: [u8; 8usize], +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_1 { + pub base_address: __u16, + pub reserved1: __u16, + pub reserved2: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).base_address as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(base_address) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).reserved1 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).reserved2 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_2 { + pub bus: __u8, + pub slot: __u8, + pub function: __u8, + pub channel: __u8, + pub reserved: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).bus as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(bus) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).slot as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(slot) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).function as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(function) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).channel as *const _ + as usize + }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(channel) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).reserved as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_3 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_3)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_3 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_4 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_4() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_4)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_4 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_5 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_5() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_5)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_5 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_6 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_6() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_6)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_6 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(edd_device_params__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params__bindgen_ty_1)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).isa as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(isa) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).pci as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(pci) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).ibnd as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(ibnd) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).xprs as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(xprs) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).htpt as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(htpt) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).unknown as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(unknown) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2 { + pub ata: __BindgenUnionField, + pub atapi: __BindgenUnionField, + pub scsi: __BindgenUnionField, + pub usb: __BindgenUnionField, + pub i1394: __BindgenUnionField, + pub fibre: __BindgenUnionField, + pub i2o: __BindgenUnionField, + pub raid: __BindgenUnionField, + pub sata: __BindgenUnionField, + pub unknown: __BindgenUnionField, + pub bindgen_union_field: [u8; 16usize], +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_1 { + pub device: __u8, + pub reserved1: __u8, + pub reserved2: __u16, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved1 as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved2 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_2 { + pub device: __u8, + pub lun: __u8, + pub reserved1: __u8, + pub reserved2: __u8, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).lun as *const _ as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(lun) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved1 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved2 as *const _ + as usize + }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_3 { + pub id: __u16, + pub lun: __u64, + pub reserved1: __u16, + pub reserved2: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).id as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).lun as *const _ as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(lun) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).reserved1 as *const _ + as usize + }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).reserved2 as *const _ + as usize + }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_3 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_4 { + pub serial_number: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_4() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_4)).serial_number + as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4), + "::", + stringify!(serial_number) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_4)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_4 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_5 { + pub eui: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_5() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_5)).eui as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5), + "::", + stringify!(eui) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_5)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_5 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_6 { + pub wwid: __u64, + pub lun: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_6() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_6)).wwid as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6), + "::", + stringify!(wwid) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_6)).lun as *const _ as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6), + "::", + stringify!(lun) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_6 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_7 { + pub identity_tag: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_7() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_7)).identity_tag as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7), + "::", + stringify!(identity_tag) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_7)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_7 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_8 { + pub array_number: __u32, + pub reserved1: __u32, + pub reserved2: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_8() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).array_number as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(array_number) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).reserved1 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).reserved2 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_8 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_9 { + pub device: __u8, + pub reserved1: __u8, + pub reserved2: __u16, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_9() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved1 as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved2 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_9 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_10 { + pub reserved1: __u64, + pub reserved2: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_10() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_10)).reserved1 as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_10)).reserved2 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_10 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(edd_device_params__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params__bindgen_ty_2)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).ata as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(ata) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).atapi as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(atapi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).scsi as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(scsi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).usb as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(usb) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).i1394 as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(i1394) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).fibre as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(fibre) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).i2o as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(i2o) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).raid as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(raid) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).sata as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(sata) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).unknown as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(unknown) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params() { + assert_eq!( + ::std::mem::size_of::(), + 74usize, + concat!("Size of: ", stringify!(edd_device_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).length as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).info_flags as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(info_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).num_default_cylinders as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(num_default_cylinders) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).num_default_heads as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(num_default_heads) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).sectors_per_track as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(sectors_per_track) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).number_of_sectors as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(number_of_sectors) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).bytes_per_sector as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(bytes_per_sector) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).dpte_ptr as *const _ as usize }, + 26usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(dpte_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).key as *const _ as usize }, + 30usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).device_path_info_length as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(device_path_info_length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved2 as *const _ as usize }, + 33usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved3 as *const _ as usize }, + 34usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).host_bus_type as *const _ as usize }, + 36usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(host_bus_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).interface_type as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(interface_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).interface_path as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(interface_path) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).device_path as *const _ as usize }, + 56usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(device_path) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved4 as *const _ as usize }, + 72usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved4) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).checksum as *const _ as usize }, + 73usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(checksum) + ) + ); +} +impl Clone for edd_device_params { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_info { + pub device: __u8, + pub version: __u8, + pub interface_support: __u16, + pub legacy_max_cylinder: __u16, + pub legacy_max_head: __u8, + pub legacy_sectors_per_track: __u8, + pub params: edd_device_params, +} +#[test] +fn bindgen_test_layout_edd_info() { + assert_eq!( + ::std::mem::size_of::(), + 82usize, + concat!("Size of: ", stringify!(edd_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).device as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).version as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).interface_support as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(interface_support) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_max_cylinder as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_max_cylinder) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_max_head as *const _ as usize }, + 6usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_max_head) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_sectors_per_track as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_sectors_per_track) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).params as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(params) + ) + ); +} +impl Clone for edd_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd { + pub mbr_signature: [::std::os::raw::c_uint; 16usize], + pub edd_info: [edd_info; 6usize], + pub mbr_signature_nr: ::std::os::raw::c_uchar, + pub edd_info_nr: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_edd() { + assert_eq!( + ::std::mem::size_of::(), + 560usize, + concat!("Size of: ", stringify!(edd)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(edd)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).mbr_signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(mbr_signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).edd_info as *const _ as usize }, + 64usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(edd_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).mbr_signature_nr as *const _ as usize }, + 556usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(mbr_signature_nr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).edd_info_nr as *const _ as usize }, + 557usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(edd_info_nr) + ) + ); +} +impl Clone for edd { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct e820entry { + pub addr: __u64, + pub size: __u64, + pub type_: __u32, +} +#[test] +fn bindgen_test_layout_e820entry() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(e820entry)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(e820entry)) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).addr as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).size as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).type_ as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(type_) + ) + ); +} +impl Clone for e820entry { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +pub struct e820map { + pub nr_map: __u32, + pub map: [e820entry; 128usize], +} +#[test] +fn bindgen_test_layout_e820map() { + assert_eq!( + ::std::mem::size_of::(), + 2564usize, + concat!("Size of: ", stringify!(e820map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(e820map)) + ); + assert_eq!( + unsafe { &(*(0 as *const e820map)).nr_map as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(e820map), + "::", + stringify!(nr_map) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820map)).map as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(e820map), + "::", + stringify!(map) + ) + ); +} +impl Default for e820map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct ist_info { + pub signature: __u32, + pub command: __u32, + pub event: __u32, + pub perf_level: __u32, +} +#[test] +fn bindgen_test_layout_ist_info() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(ist_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ist_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).command as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(command) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).event as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(event) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).perf_level as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(perf_level) + ) + ); +} +impl Clone for ist_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct edid_info { + pub dummy: [::std::os::raw::c_uchar; 128usize], +} +#[test] +fn bindgen_test_layout_edid_info() { + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(edid_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edid_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const edid_info)).dummy as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edid_info), + "::", + stringify!(dummy) + ) + ); +} +impl Default for edid_info { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct setup_data { + pub next: __u64, + pub type_: __u32, + pub len: __u32, + pub data: __IncompleteArrayField<__u8>, +} +#[test] +fn bindgen_test_layout_setup_data() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(setup_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(setup_data)) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).next as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).type_ as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).len as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).data as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(data) + ) + ); +} +impl Clone for setup_data { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct setup_header { + pub setup_sects: __u8, + pub root_flags: __u16, + pub syssize: __u32, + pub ram_size: __u16, + pub vid_mode: __u16, + pub root_dev: __u16, + pub boot_flag: __u16, + pub jump: __u16, + pub header: __u32, + pub version: __u16, + pub realmode_swtch: __u32, + pub start_sys: __u16, + pub kernel_version: __u16, + pub type_of_loader: __u8, + pub loadflags: __u8, + pub setup_move_size: __u16, + pub code32_start: __u32, + pub ramdisk_image: __u32, + pub ramdisk_size: __u32, + pub bootsect_kludge: __u32, + pub heap_end_ptr: __u16, + pub ext_loader_ver: __u8, + pub ext_loader_type: __u8, + pub cmd_line_ptr: __u32, + pub initrd_addr_max: __u32, + pub kernel_alignment: __u32, + pub relocatable_kernel: __u8, + pub min_alignment: __u8, + pub xloadflags: __u16, + pub cmdline_size: __u32, + pub hardware_subarch: __u32, + pub hardware_subarch_data: __u64, + pub payload_offset: __u32, + pub payload_length: __u32, + pub setup_data: __u64, + pub pref_address: __u64, + pub init_size: __u32, + pub handover_offset: __u32, +} +#[test] +fn bindgen_test_layout_setup_header() { + assert_eq!( + ::std::mem::size_of::(), + 119usize, + concat!("Size of: ", stringify!(setup_header)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(setup_header)) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_sects as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_sects) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).root_flags as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(root_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).syssize as *const _ as usize }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(syssize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ram_size as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ram_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).vid_mode as *const _ as usize }, + 9usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(vid_mode) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).root_dev as *const _ as usize }, + 11usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(root_dev) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).boot_flag as *const _ as usize }, + 13usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(boot_flag) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).jump as *const _ as usize }, + 15usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(jump) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).header as *const _ as usize }, + 17usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(header) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).version as *const _ as usize }, + 21usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).realmode_swtch as *const _ as usize }, + 23usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(realmode_swtch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).start_sys as *const _ as usize }, + 27usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(start_sys) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).kernel_version as *const _ as usize }, + 29usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(kernel_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).type_of_loader as *const _ as usize }, + 31usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(type_of_loader) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).loadflags as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(loadflags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_move_size as *const _ as usize }, + 33usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_move_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).code32_start as *const _ as usize }, + 35usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(code32_start) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ramdisk_image as *const _ as usize }, + 39usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ramdisk_image) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ramdisk_size as *const _ as usize }, + 43usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ramdisk_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).bootsect_kludge as *const _ as usize }, + 47usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(bootsect_kludge) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).heap_end_ptr as *const _ as usize }, + 51usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(heap_end_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ext_loader_ver as *const _ as usize }, + 53usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ext_loader_ver) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ext_loader_type as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ext_loader_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).cmd_line_ptr as *const _ as usize }, + 55usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(cmd_line_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).initrd_addr_max as *const _ as usize }, + 59usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(initrd_addr_max) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).kernel_alignment as *const _ as usize }, + 63usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(kernel_alignment) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).relocatable_kernel as *const _ as usize }, + 67usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(relocatable_kernel) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).min_alignment as *const _ as usize }, + 68usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(min_alignment) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).xloadflags as *const _ as usize }, + 69usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(xloadflags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).cmdline_size as *const _ as usize }, + 71usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(cmdline_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).hardware_subarch as *const _ as usize }, + 75usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(hardware_subarch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).hardware_subarch_data as *const _ as usize }, + 79usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(hardware_subarch_data) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).payload_offset as *const _ as usize }, + 87usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(payload_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).payload_length as *const _ as usize }, + 91usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(payload_length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_data as *const _ as usize }, + 95usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_data) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).pref_address as *const _ as usize }, + 103usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(pref_address) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).init_size as *const _ as usize }, + 111usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(init_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).handover_offset as *const _ as usize }, + 115usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(handover_offset) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct sys_desc_table { + pub length: __u16, + pub table: [__u8; 14usize], +} +#[test] +fn bindgen_test_layout_sys_desc_table() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(sys_desc_table)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(sys_desc_table)) + ); + assert_eq!( + unsafe { &(*(0 as *const sys_desc_table)).length as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(sys_desc_table), + "::", + stringify!(length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const sys_desc_table)).table as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(sys_desc_table), + "::", + stringify!(table) + ) + ); +} +impl Clone for sys_desc_table { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct olpc_ofw_header { + pub ofw_magic: __u32, + pub ofw_version: __u32, + pub cif_handler: __u32, + pub irq_desc_table: __u32, +} +#[test] +fn bindgen_test_layout_olpc_ofw_header() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(olpc_ofw_header)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(olpc_ofw_header)) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).ofw_magic as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(ofw_magic) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).ofw_version as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(ofw_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).cif_handler as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(cif_handler) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).irq_desc_table as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(irq_desc_table) + ) + ); +} +impl Clone for olpc_ofw_header { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct efi_info { + pub efi_loader_signature: __u32, + pub efi_systab: __u32, + pub efi_memdesc_size: __u32, + pub efi_memdesc_version: __u32, + pub efi_memmap: __u32, + pub efi_memmap_size: __u32, + pub efi_systab_hi: __u32, + pub efi_memmap_hi: __u32, +} +#[test] +fn bindgen_test_layout_efi_info() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(efi_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(efi_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_loader_signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_loader_signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_systab as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_systab) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memdesc_size as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memdesc_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memdesc_version as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memdesc_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap_size as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_systab_hi as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_systab_hi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap_hi as *const _ as usize }, + 28usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap_hi) + ) + ); +} +impl Clone for efi_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct boot_params { + pub screen_info: screen_info, + pub apm_bios_info: apm_bios_info, + pub _pad2: [__u8; 4usize], + pub tboot_addr: __u64, + pub ist_info: ist_info, + pub _pad3: [__u8; 16usize], + pub hd0_info: [__u8; 16usize], + pub hd1_info: [__u8; 16usize], + pub sys_desc_table: sys_desc_table, + pub olpc_ofw_header: olpc_ofw_header, + pub ext_ramdisk_image: __u32, + pub ext_ramdisk_size: __u32, + pub ext_cmd_line_ptr: __u32, + pub _pad4: [__u8; 116usize], + pub edid_info: edid_info, + pub efi_info: efi_info, + pub alt_mem_k: __u32, + pub scratch: __u32, + pub e820_entries: __u8, + pub eddbuf_entries: __u8, + pub edd_mbr_sig_buf_entries: __u8, + pub kbd_status: __u8, + pub _pad5: [__u8; 3usize], + pub sentinel: __u8, + pub _pad6: [__u8; 1usize], + pub hdr: setup_header, + pub _pad7: [__u8; 40usize], + pub edd_mbr_sig_buffer: [__u32; 16usize], + pub e820_map: [e820entry; 128usize], + pub _pad8: [__u8; 48usize], + pub eddbuf: [edd_info; 6usize], + pub _pad9: [__u8; 276usize], +} +#[test] +fn bindgen_test_layout_boot_params() { + assert_eq!( + ::std::mem::size_of::(), + 4096usize, + concat!("Size of: ", stringify!(boot_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(boot_params)) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).screen_info as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(screen_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).apm_bios_info as *const _ as usize }, + 64usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(apm_bios_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad2 as *const _ as usize }, + 84usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).tboot_addr as *const _ as usize }, + 88usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(tboot_addr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ist_info as *const _ as usize }, + 96usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ist_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad3 as *const _ as usize }, + 112usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hd0_info as *const _ as usize }, + 128usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hd0_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hd1_info as *const _ as usize }, + 144usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hd1_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).sys_desc_table as *const _ as usize }, + 160usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(sys_desc_table) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).olpc_ofw_header as *const _ as usize }, + 176usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(olpc_ofw_header) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_ramdisk_image as *const _ as usize }, + 192usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_ramdisk_image) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_ramdisk_size as *const _ as usize }, + 196usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_ramdisk_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_cmd_line_ptr as *const _ as usize }, + 200usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_cmd_line_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad4 as *const _ as usize }, + 204usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad4) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edid_info as *const _ as usize }, + 320usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edid_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).efi_info as *const _ as usize }, + 448usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(efi_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).alt_mem_k as *const _ as usize }, + 480usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(alt_mem_k) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).scratch as *const _ as usize }, + 484usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(scratch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).e820_entries as *const _ as usize }, + 488usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(e820_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).eddbuf_entries as *const _ as usize }, + 489usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(eddbuf_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edd_mbr_sig_buf_entries as *const _ as usize }, + 490usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edd_mbr_sig_buf_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).kbd_status as *const _ as usize }, + 491usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(kbd_status) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad5 as *const _ as usize }, + 492usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad5) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).sentinel as *const _ as usize }, + 495usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(sentinel) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad6 as *const _ as usize }, + 496usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad6) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hdr as *const _ as usize }, + 497usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hdr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad7 as *const _ as usize }, + 616usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad7) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edd_mbr_sig_buffer as *const _ as usize }, + 656usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edd_mbr_sig_buffer) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).e820_map as *const _ as usize }, + 720usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(e820_map) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad8 as *const _ as usize }, + 3280usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad8) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).eddbuf as *const _ as usize }, + 3328usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(eddbuf) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad9 as *const _ as usize }, + 3820usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad9) + ) + ); +} +impl Default for boot_params { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const X86_SUBARCH_PC: _bindgen_ty_1 = 0; +pub const X86_SUBARCH_LGUEST: _bindgen_ty_1 = 1; +pub const X86_SUBARCH_XEN: _bindgen_ty_1 = 2; +pub const X86_SUBARCH_INTEL_MID: _bindgen_ty_1 = 3; +pub const X86_SUBARCH_CE4100: _bindgen_ty_1 = 4; +pub const X86_NR_SUBARCHS: _bindgen_ty_1 = 5; +pub type _bindgen_ty_1 = ::std::os::raw::c_uint; diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/elf.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/elf.rs new file mode 100644 index 000000000..b7d71d7a2 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/elf.rs @@ -0,0 +1,340 @@ +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +/* + * automatically generated by rust-bindgen + * From upstream linux include/uapi/linux/elf.h at commit: + * 806276b7f07a39a1cc3f38bb1ef5c573d4594a38 + */ +pub const EI_MAG0: ::std::os::raw::c_uint = 0; +pub const EI_MAG1: ::std::os::raw::c_uint = 1; +pub const EI_MAG2: ::std::os::raw::c_uint = 2; +pub const EI_MAG3: ::std::os::raw::c_uint = 3; +pub const EI_DATA: ::std::os::raw::c_uint = 5; + +pub const ELFMAG0: ::std::os::raw::c_uint = 127; + +pub const ELFDATA2LSB: ::std::os::raw::c_uint = 1; +pub const PT_LOAD: ::std::os::raw::c_uint = 1; + +pub const ELFMAG1: u8 = b'E'; +pub const ELFMAG2: u8 = b'L'; +pub const ELFMAG3: u8 = b'F'; + +type Elf64_Addr = __u64; +type Elf64_Half = __u16; +type Elf64_Off = __u64; +type Elf64_Word = __u32; +type Elf64_Xword = __u64; + +type __s8 = ::std::os::raw::c_schar; +type __u8 = ::std::os::raw::c_uchar; +type __s16 = ::std::os::raw::c_short; +type __u16 = ::std::os::raw::c_ushort; +type __s32 = ::std::os::raw::c_int; +type __u32 = ::std::os::raw::c_uint; +type __s64 = ::std::os::raw::c_longlong; +type __u64 = ::std::os::raw::c_ulonglong; + +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct elf64_hdr { + pub e_ident: [::std::os::raw::c_uchar; 16usize], + 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, +} +impl Clone for elf64_hdr { + fn clone(&self) -> Self { + *self + } +} +pub type Elf64_Ehdr = elf64_hdr; + +#[repr(C)] +#[derive(Debug, Default, Copy)] +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, +} + +impl Clone for elf64_phdr { + fn clone(&self) -> Self { + *self + } +} +pub type Elf64_Phdr = elf64_phdr; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn bindgen_test_layout_elf64_phdr() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(elf64_phdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(elf64_phdr)) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_type as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_flags as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_offset as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_vaddr as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_vaddr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_paddr as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_paddr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_filesz as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_filesz) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_memsz as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_memsz) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_align as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_align) + ) + ); + } + + #[test] + fn bindgen_test_layout_elf64_hdr() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(elf64_hdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(elf64_hdr)) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_ident as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_ident) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_type as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_machine as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_machine) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_version as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_entry as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_entry) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phoff as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phoff) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shoff as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shoff) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_flags as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_ehsize as *const _ as usize }, + 52usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_ehsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phentsize as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phentsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phnum as *const _ as usize }, + 56usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phnum) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shentsize as *const _ as usize }, + 58usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shentsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shnum as *const _ as usize }, + 60usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shnum) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shstrndx as *const _ as usize }, + 62usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shstrndx) + ) + ); + } +} diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/mod.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/mod.rs new file mode 100644 index 000000000..79a472880 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/mod.rs @@ -0,0 +1,596 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +//! Traits and Structs +//! - [KernelLoader](trait.KernelLoader.html): load kernel image into guest memory +//! - [KernelLoaderResult](struct.KernelLoaderResult.html): the structure which loader +//! returns to VMM to assist zero page construction and boot environment setup +//! - [Elf](struct.Elf.html): elf image loader +//! - [BzImage](struct.BzImage.html): bzImage loader + +extern crate vm_memory; + +use std::error::{self, Error as KernelLoaderError}; +use std::ffi::CStr; +use std::fmt::{self, Display}; +use std::io::{Read, Seek, SeekFrom}; +use std::mem; + +use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestUsize}; + +#[allow(dead_code)] +#[allow(non_camel_case_types)] +#[allow(non_snake_case)] +#[allow(non_upper_case_globals)] +#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))] +pub mod bootparam; +#[allow(dead_code)] +#[allow(non_camel_case_types)] +#[allow(non_snake_case)] +#[allow(non_upper_case_globals)] +#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))] +mod elf; +mod struct_util; + +#[derive(Debug, PartialEq)] +pub enum Error { + BigEndianElfOnLittle, + CommandLineCopy, + CommandLineOverflow, + InvalidElfMagicNumber, + InvalidProgramHeaderSize, + InvalidProgramHeaderOffset, + InvalidProgramHeaderAddress, + InvalidEntryAddress, + InvalidBzImage, + InvalidKernelStartAddress, + InitrdImageSizeTooLarge, + MemoryOverflow, + ReadElfHeader, + ReadKernelImage, + ReadProgramHeader, + ReadBzImageHeader, + ReadBzImageCompressedKernel, + ReadInitrdImage, + SeekKernelStart, + SeekElfStart, + SeekProgramHeader, + SeekBzImageEnd, + SeekBzImageHeader, + SeekBzImageCompressedKernel, + SeekInitrdImage, +} +pub type Result = std::result::Result; + +impl error::Error for Error { + fn description(&self) -> &str { + match self { + Error::BigEndianElfOnLittle => { + "Trying to load big-endian binary on little-endian machine" + } + Error::CommandLineCopy => "Failed writing command line to guest memory", + Error::CommandLineOverflow => "Command line overflowed guest memory", + Error::InvalidElfMagicNumber => "Invalid Elf magic number", + Error::InvalidProgramHeaderSize => "Invalid program header size", + Error::InvalidProgramHeaderOffset => "Invalid program header offset", + Error::InvalidProgramHeaderAddress => "Invalid Program Header Address", + Error::InvalidEntryAddress => "Invalid entry address", + Error::InvalidBzImage => "Invalid bzImage", + Error::InvalidKernelStartAddress => "Invalid kernel start address", + Error::InitrdImageSizeTooLarge => "Initrd image size too large", + Error::MemoryOverflow => "Memory to load kernel image is not enough", + Error::ReadElfHeader => "Unable to read elf header", + Error::ReadKernelImage => "Unable to read kernel image", + Error::ReadProgramHeader => "Unable to read program header", + Error::ReadBzImageHeader => "Unable to read bzImage header", + Error::ReadBzImageCompressedKernel => "Unable to read bzImage compressed kernel", + Error::ReadInitrdImage => "Unable to read initrd image", + Error::SeekKernelStart => "Unable to seek to kernel start", + Error::SeekElfStart => "Unable to seek to elf start", + Error::SeekProgramHeader => "Unable to seek to program header", + Error::SeekBzImageEnd => "Unable to seek bzImage end", + Error::SeekBzImageHeader => "Unable to seek bzImage header", + Error::SeekBzImageCompressedKernel => "Unable to seek bzImage compressed kernel", + Error::SeekInitrdImage => "Unable to seek initrd image", + } + } +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Kernel Loader Error: {}", Error::description(self)) + } +} + +/// * `kernel_load` - The actual `guest_mem` address where kernel image is loaded start. +/// * `kernel_end` - The offset of `guest_mem` where kernel image load is loaded finish, return +/// in case of loading initrd adjacent to kernel image. +/// * `setup_header` - The setup_header belongs to linux boot protocol, only for bzImage, vmm +/// will use it to setup setup_header.init_size, which is a must for bzImage +/// direct boot. +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct KernelLoaderResult { + pub kernel_load: GuestAddress, + pub kernel_end: GuestUsize, + pub setup_header: Option, +} + +pub trait KernelLoader { + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + lowest_kernel_start: Option, + ) -> Result<(KernelLoaderResult)> + where + F: Read + Seek; +} + +#[cfg(feature = "elf")] +pub struct Elf; + +#[cfg(feature = "elf")] +impl KernelLoader for Elf { + /// Loads a kernel from a vmlinux elf image to a slice + /// + /// kernel is loaded into guest memory at offset phdr.p_paddr specified by elf image. + /// + /// # Arguments + /// + /// * `guest_mem` - The guest memory region the kernel is written to. + /// * `kernel_start` - The offset into 'guest _mem' at which to load the kernel. + /// * `kernel_image` - Input vmlinux image. + /// * `lowest_kernel_start` - This is the start of the high memory, kernel should above it. + /// + /// # Returns + /// * KernelLoaderResult + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + lowest_kernel_start: Option, + ) -> Result<(KernelLoaderResult)> + where + F: Read + Seek, + { + let mut ehdr: elf::Elf64_Ehdr = Default::default(); + kernel_image + .seek(SeekFrom::Start(0)) + .map_err(|_| Error::SeekElfStart)?; + unsafe { + // read_struct is safe when reading a POD struct. It can be used and dropped without issue. + struct_util::read_struct(kernel_image, &mut ehdr).map_err(|_| Error::ReadElfHeader)?; + } + + // Sanity checks + if ehdr.e_ident[elf::EI_MAG0 as usize] != elf::ELFMAG0 as u8 + || ehdr.e_ident[elf::EI_MAG1 as usize] != elf::ELFMAG1 + || ehdr.e_ident[elf::EI_MAG2 as usize] != elf::ELFMAG2 + || ehdr.e_ident[elf::EI_MAG3 as usize] != elf::ELFMAG3 + { + return Err(Error::InvalidElfMagicNumber); + } + if ehdr.e_ident[elf::EI_DATA as usize] != elf::ELFDATA2LSB as u8 { + return Err(Error::BigEndianElfOnLittle); + } + if ehdr.e_phentsize as usize != mem::size_of::() { + return Err(Error::InvalidProgramHeaderSize); + } + if (ehdr.e_phoff as usize) < mem::size_of::() { + // If the program header is backwards, bail. + return Err(Error::InvalidProgramHeaderOffset); + } + if (lowest_kernel_start.is_some()) + && ((ehdr.e_entry as u64) < lowest_kernel_start.unwrap().raw_value()) + { + return Err(Error::InvalidEntryAddress); + } + + let mut loader_result: KernelLoaderResult = Default::default(); + // where the kernel will be start loaded. + loader_result.kernel_load = match kernel_start { + Some(start) => GuestAddress(start.raw_value() + (ehdr.e_entry as u64)), + None => GuestAddress(ehdr.e_entry as u64), + }; + + kernel_image + .seek(SeekFrom::Start(ehdr.e_phoff)) + .map_err(|_| Error::SeekProgramHeader)?; + let phdrs: Vec = unsafe { + // Reading the structs is safe for a slice of POD structs. + struct_util::read_struct_slice(kernel_image, ehdr.e_phnum as usize) + .map_err(|_| Error::ReadProgramHeader)? + }; + + // Read in each section pointed to by the program headers. + for phdr in &phdrs { + if phdr.p_type != elf::PT_LOAD || phdr.p_filesz == 0 { + continue; + } + + kernel_image + .seek(SeekFrom::Start(phdr.p_offset)) + .map_err(|_| Error::SeekKernelStart)?; + + // vmm does not specify where the kernel should be loaded, just + // load it to the physical address p_paddr for each segment. + let mem_offset = match kernel_start { + Some(start) => start + .checked_add(phdr.p_paddr as u64) + .ok_or(Error::InvalidProgramHeaderAddress)?, + None => GuestAddress(phdr.p_paddr as u64), + }; + + guest_mem + .read_exact_from(mem_offset, kernel_image, phdr.p_filesz as usize) + .map_err(|_| Error::ReadKernelImage)?; + + loader_result.kernel_end = mem_offset.raw_value() + .checked_add(phdr.p_memsz as GuestUsize) + .ok_or(Error::MemoryOverflow)?; + } + + loader_result.setup_header = None; + + Ok(loader_result) + } +} + +#[cfg(feature = "bzImage")] +pub struct BzImage; + +#[cfg(feature = "bzImage")] +impl KernelLoader for BzImage { + /// Loads a bzImage + /// + /// kernel is loaded into guest memory at code32_start the default load address + /// stored in bzImage setup header. + /// + /// # Arguments + /// + /// * `guest_mem` - The guest memory region the kernel is written to. + /// * `kernel_start` - The offset into 'guest _mem' at which to load the kernel. + /// * `kernel_image` - Input bzImage image. + /// * `lowest_kernel_start` - This is the start of the high memory, kernel should above it. + /// + /// # Returns + /// * KernelLoaderResult + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + lowest_kernel_start: Option, + ) -> Result<(KernelLoaderResult)> + where + F: Read + Seek, + { + let mut kernel_size = kernel_image + .seek(SeekFrom::End(0)) + .map_err(|_| Error::SeekBzImageEnd)? as usize; + let mut boot_header: bootparam::setup_header = Default::default(); + kernel_image + .seek(SeekFrom::Start(0x1F1)) + .map_err(|_| Error::SeekBzImageHeader)?; + unsafe { + // read_struct is safe when reading a POD struct. It can be used and dropped without issue. + struct_util::read_struct(kernel_image, &mut boot_header) + .map_err(|_| Error::ReadBzImageHeader)?; + } + + // if the HdrS magic number is not found at offset 0x202, the boot protocol version is "old", + // the image type is assumed as zImage, not bzImage. + if boot_header.header != 0x5372_6448 { + return Err(Error::InvalidBzImage); + } + + // follow section of loading the rest of the kernel in linux boot protocol + if (boot_header.version < 0x0200) || ((boot_header.loadflags & 0x1) == 0x0) { + return Err(Error::InvalidBzImage); + } + + let mut setup_size = boot_header.setup_sects as usize; + if setup_size == 0 { + setup_size = 4; + } + setup_size = (setup_size + 1) * 512; + kernel_size -= setup_size; + + // verify bzImage validation by checking if code32_start, the defaults to the address of + // the kernel is not lower than high memory. + if (lowest_kernel_start.is_some()) + && (u64::from(boot_header.code32_start) < lowest_kernel_start.unwrap().raw_value()) + { + return Err(Error::InvalidKernelStartAddress); + } + + let mem_offset = match kernel_start { + Some(start) => start, + None => GuestAddress(u64::from(boot_header.code32_start)), + }; + + boot_header.code32_start = mem_offset.raw_value() as u32; + + let mut loader_result: KernelLoaderResult = Default::default(); + loader_result.setup_header = Some(boot_header); + loader_result.kernel_load = mem_offset; + + //seek the compressed vmlinux.bin and read to memory + kernel_image + .seek(SeekFrom::Start(setup_size as u64)) + .map_err(|_| Error::SeekBzImageCompressedKernel)?; + guest_mem + .read_exact_from(mem_offset, kernel_image, kernel_size) + .map_err(|_| Error::ReadBzImageCompressedKernel)?; + + loader_result.kernel_end = mem_offset.raw_value() + .checked_add(kernel_size as GuestUsize) + .ok_or(Error::MemoryOverflow)?; + + Ok(loader_result) + } +} + +/// Writes the command line string to the given memory slice. +/// +/// # Arguments +/// +/// * `guest_mem` - A u8 slice that will be partially overwritten by the command line. +/// * `guest_addr` - The address in `guest_mem` at which to load the command line. +/// * `cmdline` - The kernel command line. +pub fn load_cmdline( + guest_mem: &M, + guest_addr: GuestAddress, + cmdline: &CStr, +) -> Result<()> { + let len = cmdline.to_bytes().len(); + if len == 0 { + return Ok(()); + } + + let end = guest_addr + .checked_add(len as u64 + 1) + .ok_or(Error::CommandLineOverflow)?; // Extra for null termination. + if end > guest_mem.end_addr() { + return Err(Error::CommandLineOverflow)?; + } + + guest_mem + .write_slice(cmdline.to_bytes_with_nul(), guest_addr) + .map_err(|_| Error::CommandLineCopy)?; + + Ok(()) +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::Cursor; + use vm_memory::{Address, GuestAddress, GuestMemoryMmap}; + + const MEM_SIZE: u64 = 0x1000000; + + fn create_guest_mem() -> GuestMemoryMmap { + GuestMemoryMmap::new(&[(GuestAddress(0x0), (MEM_SIZE as usize))]).unwrap() + } + + #[allow(non_snake_case)] + #[cfg(feature = "bzImage")] + fn make_bzImage() -> Vec { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("bzImage")); + v + } + + // Elf64 image that prints hello world on x86_64. + fn make_elf_bin() -> Vec { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("test_elf.bin")); + v + } + + #[allow(safe_packed_borrows)] + #[allow(non_snake_case)] + #[test] + #[ignore] + #[cfg(feature = "bzImage")] + fn load_bzImage() { + let gm = create_guest_mem(); + let image = make_bzImage(); + let mut kernel_start = GuestAddress(0x200000); + let mut lowest_kernel_start = GuestAddress(0x0); + + // load bzImage with good kernel_start and himem_start setting + let mut loader_result = BzImage::load( + &gm, + Some(kernel_start), + &mut Cursor::new(&image), + Some(lowest_kernel_start), + ) + .unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + println!( + "bzImage version is {:2x} \n", + loader_result.setup_header.unwrap().version + ); + println!( + "bzImage loadflags is {:x} \n", + loader_result.setup_header.unwrap().loadflags + ); + println!( + "bzImage kernel size is {:4x} \n", + (loader_result.kernel_end as u32) + ); + + // load bzImage without kernel_start + loader_result = BzImage::load( + &gm, + None, + &mut Cursor::new(&image), + Some(lowest_kernel_start), + ) + .unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + // load bzImage withouth himem_start + loader_result = BzImage::load(&gm, None, &mut Cursor::new(&image), None).unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + // load bzImage with a bad himem setting + kernel_start = GuestAddress(0x1000); + lowest_kernel_start = GuestAddress(0x200000); + let x = BzImage::load( + &gm, + Some(kernel_start), + &mut Cursor::new(&image), + Some(lowest_kernel_start), + ); + assert_eq!(x.is_ok(), false); + println!("load bzImage with bad himem setting \n"); + } + + #[test] + fn load_elf() { + let gm = create_guest_mem(); + let image = make_elf_bin(); + let kernel_addr = GuestAddress(0x200000); + let mut lowest_kernel_start = GuestAddress(0x0); + let mut loader_result = Elf::load( + &gm, + Some(kernel_addr), + &mut Cursor::new(&image), + Some(lowest_kernel_start), + ) + .unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + loader_result = Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&image), None).unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + loader_result = Elf::load( + &gm, + None, + &mut Cursor::new(&image), + Some(lowest_kernel_start), + ) + .unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + lowest_kernel_start = GuestAddress(0xa00000); + assert_eq!( + Err(Error::InvalidEntryAddress), + Elf::load( + &gm, + None, + &mut Cursor::new(&image), + Some(lowest_kernel_start) + ) + ); + } + + #[test] + fn cmdline_overflow() { + let gm = create_guest_mem(); + let cmdline_address = GuestAddress(MEM_SIZE - 5); + assert_eq!( + Err(Error::CommandLineOverflow), + load_cmdline( + &gm, + cmdline_address, + CStr::from_bytes_with_nul(b"12345\0").unwrap() + ) + ); + } + + #[test] + fn cmdline_write_end() { + let gm = create_guest_mem(); + let mut cmdline_address = GuestAddress(45); + assert_eq!( + Ok(()), + load_cmdline( + &gm, + cmdline_address, + CStr::from_bytes_with_nul(b"1234\0").unwrap() + ) + ); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '1' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '2' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '3' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '4' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '\0' as u8); + } + + #[test] + fn bad_magic() { + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x1] = 0x33; + assert_eq!( + Err(Error::InvalidElfMagicNumber), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } + + #[test] + fn bad_endian() { + // Only little endian is supported + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x5] = 2; + assert_eq!( + Err(Error::BigEndianElfOnLittle), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } + + #[test] + fn bad_phoff() { + // program header has to be past the end of the elf header + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x20] = 0x10; + assert_eq!( + Err(Error::InvalidProgramHeaderOffset), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } +} diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/struct_util.rs b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/struct_util.rs new file mode 100644 index 000000000..a2ef60bfa --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/struct_util.rs @@ -0,0 +1,152 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +use std; +use std::io::Read; +use std::mem; + +#[derive(Debug)] +pub enum Error { + ReadStruct, +} +pub type Result = std::result::Result; + +/// Reads a struct from an input buffer. +/// This is unsafe because the struct is initialized to unverified data read from the input. +/// `read_struct` should only be called to fill plain old data structs. It is not endian safe. +/// +/// # Arguments +/// +/// * `f` - The input to read from. Often this is a file. +/// * `out` - The struct to fill with data read from `f`. +pub unsafe fn read_struct(f: &mut F, out: &mut T) -> Result<()> { + let out_slice = std::slice::from_raw_parts_mut(out as *mut T as *mut u8, mem::size_of::()); + f.read_exact(out_slice).map_err(|_| Error::ReadStruct)?; + Ok(()) +} + +/// Reads an array of structs from an input buffer. Returns a Vec of structs initialized with data +/// from the specified input. +/// This is unsafe because the structs are initialized to unverified data read from the input. +/// `read_struct_slice` should only be called for plain old data structs. It is not endian safe. +/// +/// # Arguments +/// +/// * `f` - The input to read from. Often this is a file. +/// * `len` - The number of structs to fill with data read from `f`. +pub unsafe fn read_struct_slice(f: &mut F, len: usize) -> Result> { + let mut out: Vec = Vec::with_capacity(len); + out.set_len(len); + let out_slice = std::slice::from_raw_parts_mut( + out.as_ptr() as *mut T as *mut u8, + mem::size_of::() * len, + ); + f.read_exact(out_slice).map_err(|_| Error::ReadStruct)?; + Ok(out) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::io::Cursor; + use std::mem; + + #[derive(Clone, Copy, Debug, Default, PartialEq)] + struct TestRead { + a: u64, + b: u8, + c: u8, + d: u8, + e: u8, + } + + #[test] + fn struct_basic_read() { + let orig = TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + &orig as *const _ as *const u8, + std::mem::size_of::(), + ) + }; + assert_eq!(mem::size_of::(), mem::size_of_val(&source)); + let mut tr: TestRead = Default::default(); + unsafe { + read_struct(&mut Cursor::new(source), &mut tr).unwrap(); + } + assert_eq!(orig, tr); + } + + #[test] + fn struct_read_past_end() { + let orig = TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + &orig as *const _ as *const u8, + std::mem::size_of::() - 1, + ) + }; + let mut tr: TestRead = Default::default(); + unsafe { + assert!(read_struct(&mut Cursor::new(source), &mut tr).is_err()); + format!("{:?}", read_struct(&mut Cursor::new(source), &mut tr)); + } + } + + #[test] + fn struct_slice_read() { + let orig = vec![ + TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }, + TestRead { + a: 0x7867564534231201, + b: 0x02, + c: 0x13, + d: 0x24, + e: 0x35, + }, + TestRead { + a: 0x7a69584736251403, + b: 0x04, + c: 0x15, + d: 0x26, + e: 0x37, + }, + ]; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + orig.as_ptr() as *const u8, + std::mem::size_of::() * 3, + ) + }; + + let tr: Vec = unsafe { read_struct_slice(&mut Cursor::new(source), 3).unwrap() }; + assert_eq!(orig, tr); + } +} diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/test_elf.bin b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/test_elf.bin new file mode 100644 index 000000000..2e75f639f Binary files /dev/null and b/vendor/git-4af8f4552cd0d200/linux-loader/src/loader/test_elf.bin differ diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/tests/conftest.py b/vendor/git-4af8f4552cd0d200/linux-loader/tests/conftest.py new file mode 100644 index 000000000..58aef2d74 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/tests/conftest.py @@ -0,0 +1,28 @@ +import pytest + + +PROFILE_CI="ci" +PROFILE_DEVEL="devel" + + +def pytest_addoption(parser): + parser.addoption( + "--profile", + default=PROFILE_CI, + choices=[PROFILE_CI, PROFILE_DEVEL], + help="Profile for running the test: {} or {}".format( + PROFILE_CI, + PROFILE_DEVEL + ) + ) + + +@pytest.fixture +def profile(request): + return request.config.getoption("--profile") + + +# This is used for defining global variables in pytest. +def pytest_configure(): + pytest.profile_ci = PROFILE_CI + pytest.profile_devel = PROFILE_DEVEL diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/tests/coverage b/vendor/git-4af8f4552cd0d200/linux-loader/tests/coverage new file mode 100644 index 000000000..4e569a97e --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/tests/coverage @@ -0,0 +1 @@ +67.0 diff --git a/vendor/git-4af8f4552cd0d200/linux-loader/tests/test_coverage.py b/vendor/git-4af8f4552cd0d200/linux-loader/tests/test_coverage.py new file mode 100644 index 000000000..c009f8e04 --- /dev/null +++ b/vendor/git-4af8f4552cd0d200/linux-loader/tests/test_coverage.py @@ -0,0 +1,108 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +"""Test the coverage and update the threshold when coverage is increased.""" + +import os, re, shutil, subprocess +import pytest + +def _get_current_coverage(): + """Helper function that returns the coverage computed with kcov.""" + kcov_ouput_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "kcov_output" + ) + + # By default the build output for kcov and unit tests are both in the debug + # directory. This causes some linker errors that I haven't investigated. + # Error: error: linking with `cc` failed: exit code: 1 + # An easy fix is to have separate build directories for kcov & unit tests. + kcov_build_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "kcov_build" + ) + + # Remove kcov output and build directory to be sure we are always working + # on a clean environment. + shutil.rmtree(kcov_ouput_dir, ignore_errors=True) + shutil.rmtree(kcov_build_dir, ignore_errors=True) + + exclude_pattern = ( + '${CARGO_HOME:-$HOME/.cargo/},' + 'usr/lib/,' + 'lib/' + ) + exclude_region = "'mod tests {'" + + kcov_cmd = "CARGO_TARGET_DIR={} cargo kcov --all " \ + "--output {} -- " \ + "--exclude-region={} " \ + "--exclude-pattern={} " \ + "--verify".format( + kcov_build_dir, + kcov_ouput_dir, + exclude_region, + exclude_pattern + ) + + subprocess.run(kcov_cmd, shell=True, check=True) + + # Read the coverage reported by kcov. + coverage_file = os.path.join(kcov_ouput_dir, 'index.js') + with open(coverage_file) as cov_output: + coverage = float(re.findall( + r'"covered":"(\d+\.\d)"', + cov_output.read() + )[0]) + + # Remove coverage related directories. + shutil.rmtree(kcov_ouput_dir, ignore_errors=True) + shutil.rmtree(kcov_build_dir, ignore_errors=True) + + return coverage + + +def _get_previous_coverage(): + """Helper function that returns the last reported coverage.""" + coverage_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'coverage' + ) + + # The first and only line of the file contains the coverage. + with open(coverage_path) as f: + coverage = f.readline() + return float(coverage.strip()) + +def _update_coverage(cov_value): + """Updates the coverage in the coverage file.""" + coverage_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'coverage' + ) + + with open(coverage_path, "w") as f: + f.write(str(cov_value)) + +def test_coverage(profile): + current_coverage = _get_current_coverage() + previous_coverage = _get_previous_coverage() + if previous_coverage < current_coverage: + if profile == pytest.profile_ci: + # In the CI Profile we expect the coverage to be manually updated. + assert False, "Coverage is increased from {} to {}. " \ + "Please update the coverage in " \ + "tests/coverage.".format( + previous_coverage, + current_coverage + ) + elif profile == pytest.profile_devel: + _update_coverage(current_coverage) + else: + # This should never happen because pytest should only accept + # the valid test profiles specified with `choices` in + # `pytest_addoption`. + assert False, "Invalid test profile." + elif previous_coverage > current_coverage: + diff = float(previous_coverage - current_coverage) + assert False, "Coverage drops by {:.2f}%. Please add unit tests for" \ + "the uncovered lines.".format(diff) diff --git a/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.linux.yml b/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.linux.yml new file mode 100644 index 000000000..f39aa1a54 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.linux.yml @@ -0,0 +1,155 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-x86-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-arm-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-musl-arm-mmap" + commands: + - cargo build --release --features=backend-mmap --target aarch64-unknown-linux-musl + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test --all-features + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-musl-x86" + commands: + - cargo test --all-features --target x86_64-unknown-linux-musl + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-arm" + commands: + - cargo test --all-features + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-musl-arm" + commands: + - cargo test --all-features --target aarch64-unknown-linux-musl + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "clippy-x86" + commands: + - cargo clippy --all + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "check-warnings-x86" + commands: + - RUSTFLAGS="-D warnings" cargo check --all-targets + retry: + automatic: false + agents: + platform: x86_64.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "check-warnings-arm" + commands: + - RUSTFLAGS="-D warnings" cargo check --all-targets + retry: + automatic: false + agents: + platform: arm.metal + os: linux + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.windows.yml b/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.windows.yml new file mode 100644 index 000000000..a1edeeb28 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/.buildkite/pipeline.windows.yml @@ -0,0 +1,79 @@ +steps: + - label: "build-msvc-x86" + commands: + - cargo build --release + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "build-msvc-x86-mmap" + commands: + - cargo build --release --features=backend-mmap + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "unittests-msvc-x86" + commands: + - cargo test --all-features + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "clippy-x86" + commands: + - cargo clippy --all + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + + - label: "check-warnings-x86" + commands: + - cargo check --all-targets + retry: + automatic: true + agents: + platform: x86_64 + os: windows + plugins: + - petrutlucian94/docker#v3.1.1: + image: "lpetrut/rust_win_buildtools" + always-pull: true + environment: + - "RUSTFLAGS=-D warnings" diff --git a/vendor/git-89548d8276566400/vm-memory/.cargo-checksum.json b/vendor/git-89548d8276566400/vm-memory/.cargo-checksum.json new file mode 100644 index 000000000..8cd1bfbcf --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/pipeline.linux.yml":"a792da4b923a91eb9a590da2d057f89b37b86ebcf483c344813a1abd5957854d",".buildkite/pipeline.windows.yml":"15e21819ef7321c79181ae7f04aafc0c3ceff709a800edd8994f15a9454d6405",".cargo/config":"c2f1c2fd93436e068cfb14eef3dff8a79d25d1f03c11baf6acbcfbdc9fd3a465","Cargo.toml":"459c6688ce88cac6767971e8053b03a14e05aec157a927134c34d5497c84cf68","DESIGN.md":"aa60ac0a1d59179c253c7be0e496f956344cd0bf41f01f86c9a28575ea433785","LICENSE":"cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30","README.md":"2f4aa7c6dbb257a9345d17cec07b0731cae37dc216d25b41272061861bf984b8","THIRD-PARTY":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","TODO.md":"c844f03be6631843e90d13b3410df031b07ee16db4a3c7cbda7e89557e9be46b","src/address.rs":"dbc3fa642269bb6f9fb5e176dddc9fcedbe024949f32c43577f52ef04fe0cf09","src/bytes.rs":"2d0c58f53e40f51b5177a234a5062f700ea153c779661c8c34f5d9340f24dd05","src/endian.rs":"948548db28334bceeefe72b09560a700d62993372bb89f46e39990038690f516","src/guest_memory.rs":"2be506fe58244f51279c473a7d0d8e1fc41ef638e9c16cc9e6f071bcbecb3b9b","src/lib.rs":"f65c3f36632da8df7b165578bfd8db010af11c1736fd9855614435e76dd3c390","src/mmap.rs":"9f449c7dac3830128bc1875ca0cc7e7407534eeb7cc1e1db0b0d118aba8de07b","src/mmap_unix.rs":"9a1d71bf1bb7952c25e3796f992953390b6db5a32ef40f2dda1275f866dd9ff0","src/mmap_windows.rs":"bd0091dd90eddede03739ab89648a38f513310437dafdf1f449603bb15a7a2ed","src/volatile_memory.rs":"06bdb496a75f3a190b7092daffce01158acdf73654badd72e697b674eedc4fac"},"package":null} \ No newline at end of file diff --git a/vendor/git-89548d8276566400/vm-memory/.cargo/config b/vendor/git-89548d8276566400/vm-memory/.cargo/config new file mode 100644 index 000000000..02cbaf3aa --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/.cargo/config @@ -0,0 +1,2 @@ +[target.aarch64-unknown-linux-musl] +rustflags = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc"] diff --git a/vendor/git-89548d8276566400/vm-memory/Cargo.toml b/vendor/git-89548d8276566400/vm-memory/Cargo.toml new file mode 100644 index 000000000..87a349c4d --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "vm-memory" +version = "0.1.0" +authors = ["Liu Jiang "] +repository = "https://github.com/rust-vmm/vm-memory" +license = "Apache-2.0" + +[features] +default = [] +backend-mmap = [] + +[dependencies] +libc = ">=0.2.39" + +[dev-dependencies] +matches = ">=0" +tempfile = ">=3.0.2" diff --git a/vendor/git-89548d8276566400/vm-memory/DESIGN.md b/vendor/git-89548d8276566400/vm-memory/DESIGN.md new file mode 100644 index 000000000..6f20cd47b --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/DESIGN.md @@ -0,0 +1,79 @@ +## Objectives +For a typical hypervisor, there are seveval components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, that need to access VM's physical memory. The `vm-memory` crate aims to provide a set of stable traits to decouple VM memory consumers from VM memory providers. Based on these traits, VM memory consumers could access VM's physical memory without knowing the implementation details of the VM memory provider. Thus hypervisor components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, could be shared and reused by multiple hypervisors. + +## API Principles +- Define consumer side interfaces to access VM's physical memory. +- Do not define provider side interfaces to supply VM physical memory. + +The `vm-memory` crate focuses on defining consumer side interfaces to access VM's physical memory, and it dosen't define the way how the underline VM memory provider is implemented. For light-wieght hypervisors like crosvm and firecracker, they may make some assumptions about the structure of VM's physical memory and implement a light-weight backend to access VM's physical memory. For hypervisors like qemu, a high performance and full functionality backend may be implemented with less assumptions. + +## Architecture +Th `vm-memory` is derived from two upstream projects: +- [crosvm project](https://chromium.googlesource.com/chromiumos/platform/crosvm/) commit 186eb8b0db644892e8ffba8344efe3492bb2b823 +- [firecracker project](https://firecracker-microvm.github.io/) commit 80128ea61b305a27df1f751d70415b04b503eae7 + +To be hypervisor neutral, the high level abstraction has been heavily refactored. The new `vm-memory` crate could be divided into four logic parts as: + +### Abstraction of Generic Address Space +Build generic abstractions to describe and access an address space as below: +- AddressValue: Stores the raw value of an address. Typically u32, u64 or usize is used to store the raw value. But pointers, such as \*u8, can't be used because it doesn't implement the Add and Sub traits. +- Address: Encapsulates an AddressValue object and defines methods to access it. +- Bytes: Common trait for volatile access to memory. The `Bytes` trait can be parameterized with newtypes that represent addresses, in order to enforce that addresses are used with the right "kind" of volatile memory. +- VolatileMemory: Basic implementation of volatile access to memory, implements `Bytes`. + +To make the abstraction as generic as possible, all of above core traits only define methods to access the address space, and they never define methods to manage (create, delete, insert, remove etc) address spaces. By this way, the address space consumers (virtio device drivers, vhost-user drivers and boot loaders etc) may be decoupled from the address space provider (typically a hypervisor). + +### Specialization for Virtual Machine Physical Address Space +The generic address space crates are specialized to access VM's physical memory with following traits: +- GuestAddress: represents a guest physical address (GPA). On ARM64, a 32-bit hypervisor may be used to support a 64-bit VM. For simplicity, u64 is used to store the the raw value no matter if it is a 32-bit or 64-bit virtual machine. +- GuestMemoryRegion: used to represent a continuous region of VM's physical memory. +- GuestMemory: used to represent a collection of GuestMemoryRegion objects. The main responsibilities of the GuestMemory trait are: + - hide the detail of accessing VM's physical address (for example complex hierarchical structures). + - map a request address to a GuestMemoryRegion object and relay the request to it. + - handle cases where an access request spanning two or more GuestMemoryRegion objects. + +The VM memory consumers, such as virtio device drivers, vhost drivers and boot loaders etc, should only rely on traits and structs defined here to access VM's physical memory. + +### A Sample and Default Backend Implementation Based on mmap() +Provide a default and sample implementation of the GuestMemory trait by mmapping VM's physical memory into current process. Three data structures are defined here: +- MmapRegion: mmap a continous range of VM's physical memory into current and provide methods to access the mmapped memory. +- GuestRegionMmap: a wrapper structure to map VM's physical address into (mmap\_region, offset) tuple. +- GuestMemoryMmap: manage a collection of GuestRegionMmap objects for a VM. + +One of the main responsibilities of the GuestMemoryMmap object is to handle the use cases where an access request crosses the memory region boundary. This scenario may be triggered when memory hotplug is supported. So there's a tradeoff between functionality and code complexity: +- use following pattern for simplicity which fails when the request crosses region boundary. It's current default behavior in the crosvm and firecracker project. +```rust + let guest_memory_mmap: GuestMemoryMmap = ... + let addr: GuestAddress = ... + let buf = &mut [0u8; 5]; + let result = guest_memory_mmap.find_region(addr).unwrap().write(buf, addr); +``` +- use following pattern for functionality to support request crossing region boundary: +```rust + let guest_memory_mmap: GuestMemoryMmap = ... + let addr: GuestAddress = ... + let buf = &mut [0u8; 5]; + let result = guest_memory_mmap.write(buf, addr); +``` + +### Utilities and Helpers +Following utility and helper traits/macros are imported from the [crosvm project](https://chromium.googlesource.com/chromiumos/platform/crosvm/) with minor changes: +- ByteValued (originally `DataInit`): Types for which it is safe to initialize from raw data. A type `T` is `ByteValued` if and only if it can be initialized by reading its contents from a byte array. This is generally true for all plain-old-data structs. It is notably not true for any type that includes a reference. +- {Le,Be}\_{16,32,64}: Explicit endian types useful for embedding in structs or reinterpreting data. + +## Relationships between Traits, Structs and new Types +Traits: +- Address inherits AddressValue +- GuestMemoryRegion inherits Bytes (must be implemented) +- GuestMemory implements Bytes (generic implementation) + +New Types: +- GuestAddress: Address\ +- MemoryRegionAddress: Address\ + +Structs: +- MmapRegion implements VolatileMemory +- GuestRegionMmap implements Bytes + GuestMemoryRegion +- GuestMemoryMmap implements GuestMemory +- VolatileSlice: Bytes + VolatileMemory + diff --git a/vendor/git-89548d8276566400/vm-memory/LICENSE b/vendor/git-89548d8276566400/vm-memory/LICENSE new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/LICENSE @@ -0,0 +1,202 @@ + + 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/vendor/git-89548d8276566400/vm-memory/README.md b/vendor/git-89548d8276566400/vm-memory/README.md new file mode 100644 index 000000000..fa711e5d9 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/README.md @@ -0,0 +1,47 @@ +# vm-memory +A library to access virtual machine's physical memory. + +For a typical hypervisor, there are seveval components, such as boot loader, virtual device drivers, virtio backend drivers and vhost drivers etc, need to access VM's physical memory. The `vm-memory` crate provides a set of traits to decouple VM memory consumers from VM memory providers. Based on these traits, VM memory consumers could access VM's physical memory without knowing the implementation details of the VM memory provider. Thus hypervisor components based on these traits could be shared and reused by multiple hypervisors. + +## Platform Support +- Arch: x86, AMD64, ARM64 +- OS: Linux/Unix/Windows + +## Usage +First, add the following to your `Cargo.toml`: +```toml +vm-memory = "0.1" +``` +Next, add this to your crate root: +```rust +extern crate vm_memory; +``` + +## Example +- Create VM physical memory objects in hypervisor specific ways. Use the default GuestMemoryMmap as an example: +``` + fn provide_mem_to_virt_dev() { + let gm = GuestMemoryMmap::new(&[(GuestAddress(0), 0x1000), (GuestAddress(0x1000), 0x1000)]).unwrap(); + virt_device_io(&gm); + } +``` + +- Consumers access VM's physical memory +``` + fn virt_device_io(mem: &T) { + let sample_buf = &[1, 2, 3, 4, 5]; + assert_eq!(mem.write(sample_buf, GuestAddress(0xffc)).unwrap(), 5); + let buf = &mut [0u8; 5]; + assert_eq!(mem.read(buf, GuestAddress(0xffc)).unwrap(), 5); + assert_eq!(buf, sample_buf); + } +``` + +## Documentations & References +- [Design of The `vm-memory` Crate](DESIGN.md) +- [TODO List](TODO.md) +- [The rust-vmm Project](https://github.com/rust-vmm/) + +## License +This project is licensed under +- Apache License, Version 2.0, (LICENSE or http://www.apache.org/licenses/LICENSE-2.0) diff --git a/vendor/git-89548d8276566400/vm-memory/THIRD-PARTY b/vendor/git-89548d8276566400/vm-memory/THIRD-PARTY new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/THIRD-PARTY @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-89548d8276566400/vm-memory/TODO.md b/vendor/git-89548d8276566400/vm-memory/TODO.md new file mode 100644 index 000000000..e52bb072d --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/TODO.md @@ -0,0 +1,3 @@ +### TODO List +- Abstraction layer to seperate VM memory management from VM memory accessor. +- Help needed to refine documentation and usage examples. diff --git a/vendor/git-89548d8276566400/vm-memory/src/address.rs b/vendor/git-89548d8276566400/vm-memory/src/address.rs new file mode 100644 index 000000000..d84771865 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/address.rs @@ -0,0 +1,170 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits to represent an address within an address space. +//! +//! Two traits are defined to present an address within an address space: +//! - [AddressValue](trait.AddressValue.html): stores the raw value of an address. Typically u32, +//! u64 or usize is used to store the raw value. But pointers, such as *u8, can't be used because +//! it doesn't implement the Add and Sub traits. +//! - [Address](trait.Address.html): encapsulates an AddressValue object and defines methods to +//! access and manipulate it. + +use std::cmp::{Eq, Ord, PartialEq, PartialOrd}; +use std::ops::{Add, BitAnd, BitOr, Sub}; + +/// Simple helper trait used to store a raw address value. +pub trait AddressValue { + /// Type of the address raw value. + type V: Copy + + PartialEq + + Eq + + PartialOrd + + Ord + + Add + + Sub + + BitAnd + + BitOr; +} + +/// Trait to represent an address within an address space. +/// +/// To simplify the design and implementation, assume the same raw data type (AddressValue::V) +/// could be used to store address, size and offset for the address space. Thus the Address trait +/// could be used to manage address, size and offset. On the other hand, type aliases may be +/// defined to improve code readability. +/// +/// One design rule is applied to the Address trait that operators (+, -, &, | etc) are not +/// supported and it forces clients to explicitly invoke corresponding methods. But there are +/// always exceptions: +/// Address (BitAnd|BitOr) AddressValue are supported. +pub trait Address: + AddressValue + + Sized + + Default + + Copy + + Eq + + PartialEq + + Ord + + PartialOrd + + BitAnd<::V, Output = Self> + + BitOr<::V, Output = Self> +{ + /// Create an address from a raw address value. + fn new(addr: Self::V) -> Self; + + /// Get the raw value of the address. + fn raw_value(&self) -> Self::V; + + /// Returns the bitwise and of the address with the given mask. + fn mask(&self, mask: Self::V) -> Self::V { + self.raw_value() & mask + } + + /// Returns the offset from this address to the given base address and None if there is + /// underflow. + fn checked_offset_from(&self, base: Self) -> Option; + + /// Returns the offset from this address to the given base address. + /// Only use this when `base` is guaranteed not to overflow. + fn unchecked_offset_from(&self, base: Self) -> Self::V { + self.raw_value() - base.raw_value() + } + + /// Returns the result of the add or None if there is overflow. + fn checked_add(&self, other: Self::V) -> Option; + + /// Returns the result of the add and a flag identifying whether there was overflow + fn overflowing_add(&self, other: Self::V) -> (Self, bool); + + /// Returns the result of the base address + the size. + /// Only use this when `offset` is guaranteed not to overflow. + fn unchecked_add(&self, offset: Self::V) -> Self; + + /// Returns the result of the subtraction or None if there is underflow. + fn checked_sub(&self, other: Self::V) -> Option; + + /// Returns the result of the subtraction and a flag identifying whether there was overflow + fn overflowing_sub(&self, other: Self::V) -> (Self, bool); + + /// Returns the result of the subtraction. + /// Only use this when `other` is guaranteed not to underflow. + fn unchecked_sub(&self, other: Self::V) -> Self; +} + +macro_rules! impl_address_ops { + ($T:ident, $V:ty) => { + impl AddressValue for $T { + type V = $V; + } + + impl Address for $T { + fn new(value: $V) -> $T { + $T(value) + } + + fn raw_value(&self) -> $V { + self.0 + } + + fn checked_offset_from(&self, base: $T) -> Option<$V> { + self.0.checked_sub(base.0) + } + + fn checked_add(&self, other: $V) -> Option<$T> { + self.0.checked_add(other).map($T) + } + + fn overflowing_add(&self, other: $V) -> ($T, bool) { + let (t, ovf) = self.0.overflowing_add(other); + ($T(t), ovf) + } + + fn unchecked_add(&self, offset: $V) -> $T { + $T(self.0 + offset) + } + + fn checked_sub(&self, other: $V) -> Option<$T> { + self.0.checked_sub(other).map($T) + } + + fn overflowing_sub(&self, other: $V) -> ($T, bool) { + let (t, ovf) = self.0.overflowing_sub(other); + ($T(t), ovf) + } + + fn unchecked_sub(&self, other: $V) -> $T { + $T(self.0 - other) + } + } + + impl Default for $T { + fn default() -> $T { + Self::new(0 as $V) + } + } + + impl BitAnd<$V> for $T { + type Output = $T; + + fn bitand(self, other: $V) -> $T { + $T(self.0 & other) + } + } + + impl BitOr<$V> for $T { + type Output = $T; + + fn bitor(self, other: $V) -> $T { + $T(self.0 | other) + } + } + }; +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/bytes.rs b/vendor/git-89548d8276566400/vm-memory/src/bytes.rs new file mode 100644 index 000000000..8d66e93b1 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/bytes.rs @@ -0,0 +1,285 @@ +// Portions Copyright 2019 Red Hat, Inc. +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Define the ByteValued trait to mark that it is safe to instantiate the struct with random data. + +use std::io::{Read, Write}; +use std::mem::size_of; +use std::result::Result; +use std::slice::{from_raw_parts, from_raw_parts_mut}; + +/// Types for which it is safe to initialize from raw data. +/// +/// A type `T` is `ByteValued` if and only if it can be initialized by reading its contents from a +/// byte array. This is generally true for all plain-old-data structs. It is notably not true for +/// any type that includes a reference. +/// +/// Implementing this trait guarantees that it is safe to instantiate the struct with random data. +pub unsafe trait ByteValued: Copy + Default + Send + Sync { + /// Converts a slice of raw data into a reference of `Self`. + /// + /// The value of `data` is not copied. Instead a reference is made from the given slice. The + /// value of `Self` will depend on the representation of the type in memory, and may change in + /// an unstable fashion. + /// + /// This will return `None` if the length of data does not match the size of `Self`, or if the + /// data is not aligned for the type of `Self`. + fn from_slice(data: &[u8]) -> Option<&Self> { + // Early out to avoid an unneeded `align_to` call. + if data.len() != size_of::() { + return None; + } + + // Safe because the ByteValued trait asserts any data is valid for this type, and we ensured + // the size of the pointer's buffer is the correct size. The `align_to` method ensures that + // we don't have any unaligned references. This aliases a pointer, but because the pointer + // is from a const slice reference, there are no mutable aliases. Finally, the reference + // returned can not outlive data because they have equal implicit lifetime constraints. + match unsafe { data.align_to::() } { + ([], [mid], []) => Some(mid), + _ => None, + } + } + + /// Converts a mutable slice of raw data into a mutable reference of `Self`. + /// + /// Because `Self` is made from a reference to the mutable slice`, mutations to the returned + /// reference are immediately reflected in `data`. The value of the returned `Self` will depend + /// on the representation of the type in memory, and may change in an unstable fashion. + /// + /// This will return `None` if the length of data does not match the size of `Self`, or if the + /// data is not aligned for the type of `Self`. + fn from_mut_slice(data: &mut [u8]) -> Option<&mut Self> { + // Early out to avoid an unneeded `align_to_mut` call. + if data.len() != size_of::() { + return None; + } + + // Safe because the ByteValued trait asserts any data is valid for this type, and we ensured + // the size of the pointer's buffer is the correct size. The `align_to` method ensures that + // we don't have any unaligned references. This aliases a pointer, but because the pointer + // is from a mut slice reference, we borrow the passed in mutable reference. Finally, the + // reference returned can not outlive data because they have equal implicit lifetime + // constraints. + match unsafe { data.align_to_mut::() } { + ([], [mid], []) => Some(mid), + _ => None, + } + } + + /// Converts a reference to `self` into a slice of bytes. + /// + /// The value of `self` is not copied. Instead, the slice is made from a reference to `self`. + /// The value of bytes in the returned slice will depend on the representation of the type in + /// memory, and may change in an unstable fashion. + fn as_slice(&self) -> &[u8] { + // Safe because the entire size of self is accessible as bytes because the trait guarantees + // it. The lifetime of the returned slice is the same as the passed reference, so that no + // dangling pointers will result from this pointer alias. + unsafe { from_raw_parts(self as *const Self as *const u8, size_of::()) } + } + + /// Converts a mutable reference to `self` into a mutable slice of bytes. + /// + /// Because the slice is made from a reference to `self`, mutations to the returned slice are + /// immediately reflected in `self`. The value of bytes in the returned slice will depend on + /// the representation of the type in memory, and may change in an unstable fashion. + fn as_mut_slice(&mut self) -> &mut [u8] { + // Safe because the entire size of self is accessible as bytes because the trait guarantees + // it. The trait also guarantees that any combination of bytes is valid for this type, so + // modifying them in the form of a byte slice is valid. The lifetime of the returned slice + // is the same as the passed reference, so that no dangling pointers will result from this + // pointer alias. Although this does alias a mutable pointer, we do so by exclusively + // borrowing the given mutable reference. + unsafe { from_raw_parts_mut(self as *mut Self as *mut u8, size_of::()) } + } +} + +/// A container to host a range of bytes and access its content. +/// +/// Candidates which may implement this trait include: +/// - anonymous memory areas +/// - mmapped memory areas +/// - data files +/// - a proxy to access memory on remote +pub trait Bytes { + /// Associated error codes + type E; + + /// Writes a slice into the container at the specified address. + /// Returns the number of bytes written. The number of bytes written can + /// be less than the length of the slice if there isn't enough room in the + /// container. + fn write(&self, buf: &[u8], addr: A) -> Result; + + /// Reads to a slice from the container at the specified address. + /// Returns the number of bytes read. The number of bytes read can be less than the length + /// of the slice if there isn't enough room within the container. + fn read(&self, buf: &mut [u8], addr: A) -> Result; + + /// Writes the entire contents of a slice into the container at the specified address. + /// + /// Returns an error if there isn't enough room within the container to complete the entire + /// write. Part of the data may have been written nevertheless. + fn write_slice(&self, buf: &[u8], addr: A) -> Result<(), Self::E>; + + /// Reads from the container at the specified address to fill the entire buffer. + /// + /// Returns an error if there isn't enough room within the container to fill the entire buffer. + /// Part of the buffer may have been filled nevertheless. + fn read_slice(&self, buf: &mut [u8], addr: A) -> Result<(), Self::E>; + + /// Writes an object into the container at the specified address. + /// Returns Ok(()) if the object fits, or Err if it extends past the end. + fn write_obj(&self, val: T, addr: A) -> Result<(), Self::E> { + self.write_slice(val.as_slice(), addr) + } + + /// Reads an object from the container at the given address. + /// Reading from a volatile area isn't strictly safe as it could change mid-read. + /// However, as long as the type T is plain old data and can handle random initialization, + /// everything will be OK. + fn read_obj(&self, addr: A) -> Result { + let mut result: T = Default::default(); + self.read_slice(result.as_mut_slice(), addr).map(|_| result) + } + + /// Writes data from a readable object like a File and writes it into the container. + /// + /// # Arguments + /// * `addr` - Begin writing at this address. + /// * `src` - Copy from `src` into the container. + /// * `count` - Copy `count` bytes from `src` into the container. + fn read_from(&self, addr: A, src: &mut F, count: usize) -> Result + where + F: Read; + + /// Writes data from a readable object like a File and writes it into the container. + /// + /// # Arguments + /// * `addr` - Begin writing at this address. + /// * `src` - Copy from `src` into the container. + /// * `count` - Copy `count` bytes from `src` into the container. + fn read_exact_from(&self, addr: A, src: &mut F, count: usize) -> Result<(), Self::E> + where + F: Read; + + /// Reads data from the container to a writable object. + /// + /// # Arguments + /// * `addr` - Begin reading from this addr. + /// * `dst` - Copy from the container to `dst`. + /// * `count` - Copy `count` bytes from the container to `dst`. + fn write_to(&self, addr: A, dst: &mut F, count: usize) -> Result + where + F: Write; + + /// Reads data from the container to a writable object. + /// + /// # Arguments + /// * `addr` - Begin reading from this addr. + /// * `dst` - Copy from the container to `dst`. + /// * `count` - Copy `count` bytes from the container to `dst`. + fn write_all_to(&self, addr: A, dst: &mut F, count: usize) -> Result<(), Self::E> + where + F: Write; +} + +// All intrinsic types and arrays of intrinsic types are ByteValued. They are just numbers. +macro_rules! array_data_init { + ($T:ty, $($N:expr)+) => { + $( + unsafe impl ByteValued for [$T; $N] {} + )+ + } +} +macro_rules! data_init_type { + ($T:ty) => { + unsafe impl ByteValued for $T {} + array_data_init! { + $T, + 0 1 2 3 4 5 6 7 8 9 + 10 11 12 13 14 15 16 17 18 19 + 20 21 22 23 24 25 26 27 28 29 + 30 31 32 + } + }; +} +data_init_type!(u8); +data_init_type!(u16); +data_init_type!(u32); +data_init_type!(u64); +data_init_type!(usize); +data_init_type!(i8); +data_init_type!(i16); +data_init_type!(i32); +data_init_type!(i64); +data_init_type!(isize); + +#[cfg(test)] +mod tests { + use std::fmt::Debug; + use std::mem::{align_of, size_of}; + use ByteValued; + + fn from_slice_alignment() + where + T: ByteValued + PartialEq + Debug + Default, + { + let mut v = [0u8; 32]; + let pre_len = { + let (pre, _, _) = unsafe { v.align_to::() }; + pre.len() + }; + { + let aligned_v = &mut v[pre_len..pre_len + size_of::()]; + { + let from_aligned = T::from_slice(aligned_v); + let val: T = Default::default(); + assert_eq!(from_aligned, Some(&val)); + } + { + let from_aligned_mut = T::from_mut_slice(aligned_v); + let mut val: T = Default::default(); + assert_eq!(from_aligned_mut, Some(&mut val)); + } + } + for i in 1..size_of::() { + let begin = pre_len + i; + let end = begin + size_of::(); + let unaligned_v = &mut v[begin..end]; + { + let from_unaligned = T::from_slice(unaligned_v); + if align_of::() != 1 { + assert_eq!(from_unaligned, None); + } + } + { + let from_unaligned_mut = T::from_mut_slice(unaligned_v); + if align_of::() != 1 { + assert_eq!(from_unaligned_mut, None); + } + } + } + } + + #[test] + fn test_slice_alignment() { + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + from_slice_alignment::(); + } +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/endian.rs b/vendor/git-89548d8276566400/vm-memory/src/endian.rs new file mode 100644 index 000000000..ec37acad4 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/endian.rs @@ -0,0 +1,148 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +//! Explicit endian types useful for embedding in structs or reinterpreting data. +//! +//! Each endian type is guaarnteed to have the same size and alignment as a regular unsigned +//! primitive of the equal size. +//! +//! # Examples +//! +//! ``` +//! # use vm_memory::*; +//! let b: Be32 = From::from(3); +//! let l: Le32 = From::from(3); +//! +//! assert_eq!(b.to_native(), 3); +//! assert_eq!(l.to_native(), 3); +//! assert!(b == 3); +//! assert!(l == 3); +//! +//! let b_trans: u32 = unsafe { std::mem::transmute(b) }; +//! let l_trans: u32 = unsafe { std::mem::transmute(l) }; +//! +//! #[cfg(target_endian = "little")] +//! assert_eq!(l_trans, 3); +//! #[cfg(target_endian = "big")] +//! assert_eq!(b_trans, 3); +//! +//! assert_ne!(b_trans, l_trans); +//! ``` + +use std::mem::{align_of, size_of}; + +use bytes::ByteValued; + +macro_rules! const_assert { + ($condition:expr) => { + let _ = [(); 0 - !$condition as usize]; + }; +} + +macro_rules! endian_type { + ($old_type:ident, $new_type:ident, $to_new:ident, $from_new:ident) => { + /// An unsigned integer type of with an explicit endianness. + /// + /// See module level documentation for examples. + #[derive(Copy, Clone, Eq, PartialEq, Debug, Default)] + pub struct $new_type($old_type); + + impl $new_type { + fn _assert() { + const_assert!(align_of::<$new_type>() == align_of::<$old_type>()); + const_assert!(size_of::<$new_type>() == size_of::<$old_type>()); + } + + /// Converts `self` to the native endianness. + pub fn to_native(self) -> $old_type { + $old_type::$from_new(self.0) + } + } + + unsafe impl ByteValued for $new_type {} + + impl PartialEq<$old_type> for $new_type { + fn eq(&self, other: &$old_type) -> bool { + self.0 == $old_type::$to_new(*other) + } + } + + impl PartialEq<$new_type> for $old_type { + fn eq(&self, other: &$new_type) -> bool { + $old_type::$to_new(other.0) == *self + } + } + + impl Into<$old_type> for $new_type { + fn into(self) -> $old_type { + $old_type::$from_new(self.0) + } + } + + impl From<$old_type> for $new_type { + fn from(v: $old_type) -> $new_type { + $new_type($old_type::$to_new(v)) + } + } + }; +} + +endian_type!(u16, Le16, to_le, from_le); +endian_type!(u32, Le32, to_le, from_le); +endian_type!(u64, Le64, to_le, from_le); +endian_type!(usize, LeSize, to_le, from_le); +endian_type!(u16, Be16, to_be, from_be); +endian_type!(u32, Be32, to_be, from_be); +endian_type!(u64, Be64, to_be, from_be); +endian_type!(usize, BeSize, to_be, from_be); + +#[cfg(test)] +mod tests { + use super::*; + + use std::convert::From; + use std::mem::transmute; + + #[cfg(target_endian = "little")] + const NATIVE_LITTLE: bool = true; + #[cfg(target_endian = "big")] + const NATIVE_LITTLE: bool = false; + const NATIVE_BIG: bool = !NATIVE_LITTLE; + + macro_rules! endian_test { + ($old_type:ty, $new_type:ty, $test_name:ident, $native:expr) => { + mod $test_name { + use super::*; + + #[allow(overflowing_literals)] + #[test] + fn equality() { + let v = 0x0123_4567_89AB_CDEF as $old_type; + let endian_v: $new_type = From::from(v); + let endian_into: $old_type = endian_v.into(); + let endian_transmute: $old_type = unsafe { transmute(endian_v) }; + + if $native { + assert_eq!(endian_v, endian_transmute); + } else { + assert_eq!(endian_v, endian_transmute.swap_bytes()); + } + + assert_eq!(v, endian_into); + assert!(v == endian_v); + assert!(endian_v == v); + } + } + }; + } + + endian_test!(u16, Le16, test_le16, NATIVE_LITTLE); + endian_test!(u32, Le32, test_le32, NATIVE_LITTLE); + endian_test!(u64, Le64, test_le64, NATIVE_LITTLE); + endian_test!(usize, LeSize, test_le_size, NATIVE_LITTLE); + endian_test!(u16, Be16, test_be16, NATIVE_BIG); + endian_test!(u32, Be32, test_be32, NATIVE_BIG); + endian_test!(u64, Be64, test_be64, NATIVE_BIG); + endian_test!(usize, BeSize, test_be_size, NATIVE_BIG); +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/guest_memory.rs b/vendor/git-89548d8276566400/vm-memory/src/guest_memory.rs new file mode 100644 index 000000000..5e97a2849 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/guest_memory.rs @@ -0,0 +1,515 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits to track and access guest's physical memory. +//! +//! To make the abstraction as generic as possible, all the core traits declared here only define +//! methods to access guest's memory, and never define methods to manage (create, delete, insert, +//! remove etc) guest's memory. By this way, the guest memory consumers (virtio device drivers, +//! vhost drivers and boot loaders etc) may be decoupled from the guest memory provider (typically +//! a hypervisor). +//! +//! Traits and Structs +//! - [GuestAddress](struct.GuestAddress.html): represents a guest physical address (GPA). +//! - [MemoryRegionAddress](struct.MemoryRegionAddress.html): represents an offset inside a region. +//! - [GuestMemoryRegion](trait.GuestMemoryRegion.html): represent a continuous region of guest's +//! physical memory. +//! - [GuestMemory](trait.GuestMemroy.html): represent a collection of GuestMemoryRegion objects. +//! The main responsibilities of the GuestMemory trait are: +//! - hide the detail of accessing guest's physical address. +//! - map a request address to a GuestMemoryRegion object and relay the request to it. +//! - handle cases where an access request spanning two or more GuestMemoryRegion objects. + +use std::convert::From; +use std::fmt::{self, Display}; +use std::io::{self, Read, Write}; +use std::ops::{BitAnd, BitOr}; + +use address::{Address, AddressValue}; +use bytes::Bytes; +use volatile_memory; + +static MAX_ACCESS_CHUNK: usize = 4096; + +/// Errors associated with handling guest memory accesses. +#[allow(missing_docs)] +#[derive(Debug)] +pub enum Error { + /// Failure in finding a guest address in any memory regions mapped by this guest. + InvalidGuestAddress(GuestAddress), + /// Couldn't read/write from the given source. + IOError(io::Error), + /// Incomplete read or write + PartialBuffer { expected: usize, completed: usize }, + /// Requested backend address is out of range. + InvalidBackendAddress, +} + +impl From for Error { + fn from(e: volatile_memory::Error) -> Self { + match e { + volatile_memory::Error::OutOfBounds { .. } => Error::InvalidBackendAddress, + volatile_memory::Error::Overflow { .. } => Error::InvalidBackendAddress, + volatile_memory::Error::IOError(e) => Error::IOError(e), + volatile_memory::Error::PartialBuffer { + expected, + completed, + } => Error::PartialBuffer { + expected, + completed, + }, + } + } +} + +/// Result of guest memory operations +pub type Result = std::result::Result; + +impl std::error::Error for Error {} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Guest memory error: ")?; + match self { + Error::InvalidGuestAddress(addr) => { + write!(f, "invalid guest address {}", addr.raw_value()) + } + Error::IOError(error) => write!(f, "{}", error), + Error::PartialBuffer { + expected, + completed, + } => write!( + f, + "only used {} bytes in {} long buffer", + completed, expected, + ), + Error::InvalidBackendAddress => write!(f, "invalid backend address"), + } + } +} + +/// Represents a guest physical address (GPA). +/// +/// Notes: +/// - On ARM64, a 32-bit hypervisor may be used to support a 64-bit guest. For simplicity, +/// u64 is used to store the the raw value no matter if the guest a 32-bit or 64-bit virtual +/// machine. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub struct GuestAddress(pub u64); +impl_address_ops!(GuestAddress, u64); + +/// Represents an offset inside a region. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd)] +pub struct MemoryRegionAddress(pub u64); +impl_address_ops!(MemoryRegionAddress, u64); + +/// Type of the raw value stored in a GuestAddress object. +pub type GuestUsize = ::V; + +/// Represents a continuous region of guest physical memory. +#[allow(clippy::len_without_is_empty)] +pub trait GuestMemoryRegion: Bytes { + /// Get the size of the region. + fn len(&self) -> GuestUsize; + + /// Get minimum (inclusive) address managed by the region. + fn start_addr(&self) -> GuestAddress; + + /// Get maximum (inclusive) address managed by the region. + fn end_addr(&self) -> GuestAddress { + // unchecked_add is safe as the region bounds were checked when it was created. + self.start_addr().unchecked_add(self.len() - 1) + } + + /// Returns the given address if it is within the memory range accessible + /// through this region. + fn check_address(&self, addr: MemoryRegionAddress) -> Option { + if self.address_in_range(addr) { + Some(addr) + } else { + None + } + } + + /// Returns true if the given address is within the memory range accessible + /// through this region. + fn address_in_range(&self, addr: MemoryRegionAddress) -> bool { + addr.raw_value() < self.len() + } + + /// Returns the address plus the offset if it is in range. + fn checked_offset( + &self, + base: MemoryRegionAddress, + offset: usize, + ) -> Option { + base.checked_add(offset as u64) + .and_then(|addr| self.check_address(addr)) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a relative address within this region, or return an error if + /// it is out of bounds. + fn to_region_addr(&self, addr: GuestAddress) -> Option { + addr.checked_offset_from(self.start_addr()) + .and_then(|offset| self.check_address(MemoryRegionAddress(offset))) + } + + /// Return a slice corresponding to the data in the region; unsafe because of + /// possible aliasing. Return None if the region does not support slice-based + /// access. + unsafe fn as_slice(&self) -> Option<&[u8]> { + None + } + + /// Return a mutable slice corresponding to the data in the region; unsafe because of + /// possible aliasing. Return None if the region does not support slice-based + /// access. + unsafe fn as_mut_slice(&self) -> Option<&mut [u8]> { + None + } +} + +/// Represents a container for a collection of GuestMemoryRegion objects. +/// +/// The main responsibilities of the GuestMemory trait are: +/// - hide the detail of accessing guest's physical address. +/// - map a request address to a GuestMemoryRegion object and relay the request to it. +/// - handle cases where an access request spanning two or more GuestMemoryRegion objects. +/// +/// Note: all regions in a GuestMemory object must not intersect with each other. +pub trait GuestMemory { + /// Type of objects hosted by the address space. + type R: GuestMemoryRegion; + + /// Returns the number of regions in the collection. + fn num_regions(&self) -> usize; + + /// Return the region containing the specified address or None. + fn find_region(&self, addr: GuestAddress) -> Option<&Self::R>; + + /// Perform the specified action on each region. + /// It only walks children of current region and do not step into sub regions. + fn with_regions(&self, cb: F) -> std::result::Result<(), E> + where + F: Fn(usize, &Self::R) -> std::result::Result<(), E>; + + /// Perform the specified action on each region mutably. + /// It only walks children of current region and do not step into sub regions. + fn with_regions_mut(&self, cb: F) -> std::result::Result<(), E> + where + F: FnMut(usize, &Self::R) -> std::result::Result<(), E>; + + /// Applies two functions, specified as callbacks, on the inner memory regions. + /// + /// # Arguments + /// * `init` - Starting value of the accumulator for the `foldf` function. + /// * `mapf` - "Map" function, applied to all the inner memory regions. It returns an array of + /// the same size as the memory regions array, containing the function's results + /// for each region. + /// * `foldf` - "Fold" function, applied to the array returned by `mapf`. It acts as an + /// operator, applying itself to the `init` value and to each subsequent elemnent + /// in the array returned by `mapf`. + /// + /// # Examples + /// + /// * Compute the total size of all memory mappings in KB by iterating over the memory regions + /// and dividing their sizes to 1024, then summing up the values in an accumulator. + /// + /// ``` + /// # #[cfg(feature = "backend-mmap")] + /// # fn test_map_fold() -> Result<(), ()> { + /// # use vm_memory::{GuestAddress, GuestMemory, GuestMemoryRegion, mmap::GuestMemoryMmap}; + /// let start_addr1 = GuestAddress(0x0); + /// let start_addr2 = GuestAddress(0x400); + /// let mem = GuestMemoryMmap::new(&vec![(start_addr1, 1024), (start_addr2, 2048)]).unwrap(); + /// let total_size = mem.map_and_fold( + /// 0, + /// |(_, region)| region.len() / 1024, + /// |acc, size| acc + size + /// ); + /// println!("Total memory size = {} KB", total_size); + /// Ok(()) + /// # } + /// ``` + fn map_and_fold(&self, init: T, mapf: F, foldf: G) -> T + where + F: Fn((usize, &Self::R)) -> T, + G: Fn(T, T) -> T; + + /// Get maximum (inclusive) address managed by the region. + fn end_addr(&self) -> GuestAddress { + self.map_and_fold( + GuestAddress(0), + |(_, region)| region.end_addr(), + std::cmp::max, + ) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a relative address within this region, or return None if + /// it is out of bounds. + fn to_region_addr(&self, addr: GuestAddress) -> Option<(&Self::R, MemoryRegionAddress)> { + self.find_region(addr) + .map(|r| (r, r.to_region_addr(addr).unwrap())) + } + + /// Returns true if the given address is within the memory range available to the guest. + fn address_in_range(&self, addr: GuestAddress) -> bool { + self.find_region(addr).is_some() + } + + /// Returns the given address if it is within the memory range available to the guest. + fn check_address(&self, addr: GuestAddress) -> Option { + self.find_region(addr).map(|_| addr) + } + + /// Returns the address plus the offset if it is in range. + fn checked_offset(&self, base: GuestAddress, offset: usize) -> Option { + base.checked_add(offset as u64) + .and_then(|addr| self.check_address(addr)) + } + + /// Invoke callback `f` to handle data in the address range [addr, addr + count). + /// + /// The address range [addr, addr + count) may span more than one GuestMemoryRegion objects, or + /// even has holes within it. So try_access() invokes the callback 'f' for each GuestMemoryRegion + /// object involved and returns: + /// - error code returned by the callback 'f' + /// - size of data already handled when encountering the first hole + /// - size of data already handled when the whole range has been handled + fn try_access(&self, count: usize, addr: GuestAddress, mut f: F) -> Result + where + F: FnMut(usize, usize, MemoryRegionAddress, &Self::R) -> Result, + { + let mut cur = addr; + let mut total = 0; + while let Some(region) = self.find_region(cur) { + let start = region.to_region_addr(cur).unwrap(); + let cap = region.len() as usize; + let len = std::cmp::min(cap, count - total); + match f(total, len, start, region) { + // no more data + Ok(0) => break, + // made some progress + Ok(len) => { + total += len; + if total == count { + break; + } + cur = match cur.overflowing_add(len as GuestUsize) { + (GuestAddress(0), _) => GuestAddress(0), + (result, false) => result, + (_, true) => panic!("guest address overflow"), + } + } + // error happened + e => return e, + } + } + if total == 0 { + Err(Error::InvalidGuestAddress(addr)) + } else { + Ok(total) + } + } +} + +impl Bytes for T { + type E = Error; + + fn write(&self, buf: &[u8], addr: GuestAddress) -> Result { + self.try_access( + buf.len(), + addr, + |offset, _count, caddr, region| -> Result { + region.write(&buf[offset as usize..], caddr) + }, + ) + } + + fn read(&self, buf: &mut [u8], addr: GuestAddress) -> Result { + self.try_access( + buf.len(), + addr, + |offset, _count, caddr, region| -> Result { + region.read(&mut buf[offset as usize..], caddr) + }, + ) + } + + fn write_slice(&self, buf: &[u8], addr: GuestAddress) -> Result<()> { + let res = self.write(buf, addr)?; + if res != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: res, + }); + } + Ok(()) + } + + fn read_slice(&self, buf: &mut [u8], addr: GuestAddress) -> Result<()> { + let res = self.read(buf, addr)?; + if res != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: res, + }); + } + Ok(()) + } + + fn read_from(&self, addr: GuestAddress, src: &mut F, count: usize) -> Result + where + F: Read, + { + self.try_access(count, addr, |offset, len, caddr, region| -> Result { + // Check if something bad happened before doing unsafe things. + assert!(offset < count); + if let Some(dst) = unsafe { region.as_mut_slice() } { + // This is safe cause `start` and `len` are within the `region`. + let start = caddr.raw_value() as usize; + let end = start + len; + src.read_exact(&mut dst[start..end]) + .map_err(Error::IOError)?; + Ok(len) + } else { + let len = std::cmp::min(len, MAX_ACCESS_CHUNK); + let mut buf = vec![0u8; len].into_boxed_slice(); + let bytes_read = src.read(&mut buf[..]).map_err(Error::IOError)?; + let bytes_written = region.write(&buf[0..bytes_read], caddr)?; + assert_eq!(bytes_written, bytes_read); + Ok(len) + } + }) + } + + fn read_exact_from(&self, addr: GuestAddress, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let res = self.read_from(addr, src, count)?; + if res != count { + return Err(Error::PartialBuffer { + expected: count, + completed: res, + }); + } + Ok(()) + } + + fn write_to(&self, addr: GuestAddress, dst: &mut F, count: usize) -> Result + where + F: Write, + { + self.try_access(count, addr, |offset, len, caddr, region| -> Result { + // Check if something bad happened before doing unsafe things. + assert!(offset < count); + if let Some(src) = unsafe { region.as_slice() } { + // This is safe cause `start` and `len` are within the `region`. + let start = caddr.raw_value() as usize; + let end = start + len; + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let bytes_written = dst.write(&src[start..end]).map_err(Error::IOError)?; + Ok(bytes_written) + } else { + let len = std::cmp::min(len, MAX_ACCESS_CHUNK); + let mut buf = vec![0u8; len].into_boxed_slice(); + let bytes_read = region.read(&mut buf, caddr)?; + assert_eq!(bytes_read, len); + let bytes_written = dst.write(&buf).map_err(Error::IOError)?; + Ok(bytes_written) + } + }) + } + + fn write_all_to(&self, addr: GuestAddress, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let res = self.write_to(addr, dst, count)?; + if res != count { + return Err(Error::PartialBuffer { + expected: count, + completed: res, + }); + } + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn offset_from() { + let base = GuestAddress(0x100); + let addr = GuestAddress(0x150); + assert_eq!(addr.unchecked_offset_from(base), 0x50u64); + assert_eq!(addr.checked_offset_from(base), Some(0x50u64)); + assert_eq!(base.checked_offset_from(addr), None); + } + + #[test] + fn equals() { + let a = GuestAddress(0x300); + let b = GuestAddress(0x300); + let c = GuestAddress(0x301); + assert_eq!(a, GuestAddress(a.raw_value())); + assert_eq!(a, b); + assert_eq!(b, a); + assert_ne!(a, c); + assert_ne!(c, a); + } + + #[test] + #[allow(clippy::eq_op)] + fn cmp() { + let a = GuestAddress(0x300); + let b = GuestAddress(0x301); + assert!(a < b); + assert!(b > a); + assert!(!(a < a)); + } + + #[test] + fn mask() { + let a = GuestAddress(0x5050); + assert_eq!(GuestAddress(0x5000), a & 0xff00u64); + assert_eq!(0x5000, a.mask(0xff00u64)); + assert_eq!(GuestAddress(0x5055), a | 0x0005u64); + } + + #[test] + fn add_sub() { + let a = GuestAddress(0x50); + let b = GuestAddress(0x60); + assert_eq!(Some(GuestAddress(0xb0)), a.checked_add(0x60)); + assert_eq!(0x10, b.unchecked_offset_from(a)); + } + + #[test] + fn checked_add_overflow() { + let a = GuestAddress(0xffff_ffff_ffff_ff55); + assert_eq!(Some(GuestAddress(0xffff_ffff_ffff_ff57)), a.checked_add(2)); + assert!(a.checked_add(0xf0).is_none()); + } + + #[test] + fn checked_sub_underflow() { + let a = GuestAddress(0xff); + assert_eq!(Some(GuestAddress(0x0f)), a.checked_sub(0xf0)); + assert!(a.checked_sub(0xffff).is_none()); + } +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/lib.rs b/vendor/git-89548d8276566400/vm-memory/src/lib.rs new file mode 100644 index 000000000..2fc57ffad --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/lib.rs @@ -0,0 +1,57 @@ +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! Traits for allocating, handling and interacting with the VM's physical memory. +//! +//! For a typical hypervisor, there are seveval components, such as boot loader, virtual device +//! drivers, virtio backend drivers and vhost drivers etc, that need to access VM's physical memory. +//! This crate aims to provide a set of stable traits to decouple VM memory consumers from VM +//! memory providers. Based on these traits, VM memory consumers could access VM's physical memory +//! without knowing the implementation details of the VM memory provider. Thus hypervisor +//! components, such as boot loader, virtual device drivers, virtio backend drivers and vhost +//! drivers etc, could be shared and reused by multiple hypervisors. + +#![deny(missing_docs)] + +extern crate libc; + +#[cfg(test)] +#[macro_use] +extern crate matches; + +#[macro_use] +pub mod address; +pub use address::{Address, AddressValue}; + +pub mod bytes; +pub use bytes::{ByteValued, Bytes}; + +pub mod endian; +pub use endian::{Be16, Be32, Be64, BeSize, Le16, Le32, Le64, LeSize}; + +pub mod guest_memory; +pub use guest_memory::{ + Error as GuestMemoryError, GuestAddress, GuestMemory, GuestMemoryRegion, GuestUsize, + MemoryRegionAddress, Result as GuestMemoryResult, +}; + +#[cfg(all(feature = "backend-mmap", unix))] +mod mmap_unix; + +#[cfg(all(feature = "backend-mmap", windows))] +mod mmap_windows; + +#[cfg(feature = "backend-mmap")] +pub mod mmap; +#[cfg(feature = "backend-mmap")] +pub use mmap::{GuestMemoryMmap, GuestRegionMmap, MmapError, MmapRegion}; + +pub mod volatile_memory; +pub use volatile_memory::{ + Error as VolatileMemoryError, Result as VolatileMemoryResult, VolatileMemory, VolatileRef, + VolatileSlice, +}; diff --git a/vendor/git-89548d8276566400/vm-memory/src/mmap.rs b/vendor/git-89548d8276566400/vm-memory/src/mmap.rs new file mode 100644 index 000000000..1a60e57e4 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/mmap.rs @@ -0,0 +1,681 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! A default implementation of the GuestMemory trait by mmap()-ing guest's memory into the current +//! process. +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use std::io::{self, Read, Write}; +use std::ops::Deref; +use std::sync::Arc; + +use address::Address; +use guest_memory::*; +use volatile_memory::VolatileMemory; +use Bytes; + +#[cfg(unix)] +pub use mmap_unix::MmapRegion; + +#[cfg(windows)] +pub use mmap_windows::MmapRegion; + +// For MmapRegion +pub(crate) trait AsSlice { + unsafe fn as_slice(&self) -> &[u8]; + + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8]; +} + +/// Errors that can happen when creating a memory map +#[derive(Debug)] +pub enum MmapError { + /// Syscall returned the given error. + SystemCallFailed(io::Error), + /// No memory region found. + NoMemoryRegion, + /// Some of the memory regions intersect with each other. + MemoryRegionOverlap, +} + +/// Tracks a mapping of memory in the current process and the corresponding base address +/// in the guest's memory space. +#[derive(Debug)] +pub struct GuestRegionMmap { + mapping: MmapRegion, + guest_base: GuestAddress, +} + +impl GuestRegionMmap { + /// Create a new memory-mapped memory region for guest's physical memory. + /// Note: caller needs to ensure that (mapping.len() + guest_base) doesn't wrapping around. + pub fn new(mapping: MmapRegion, guest_base: GuestAddress) -> Self { + GuestRegionMmap { + mapping, + guest_base, + } + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a host pointer, or return None if it is out of bounds. + pub fn get_host_address(&self, addr: MemoryRegionAddress) -> Option<*mut u8> { + // Not sure why wrapping_offset is not unsafe. Anyway this + // is safe because we've just range-checked addr using check_address. + self.check_address(addr) + .map(|addr| self.as_ptr().wrapping_offset(addr.raw_value() as isize)) + } +} + +impl Deref for GuestRegionMmap { + type Target = MmapRegion; + + fn deref(&self) -> &MmapRegion { + &self.mapping + } +} + +impl Bytes for GuestRegionMmap { + type E = Error; + + /// # Examples + /// * Write a slice at guest address 0x1200. + /// + /// ``` + /// # use vm_memory::{Bytes, GuestAddress, GuestMemoryMmap}; + /// # let start_addr = GuestAddress(0x1000); + /// # let mut gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let res = gm.write(&[1,2,3,4,5], GuestAddress(0x1200)).unwrap(); + /// assert_eq!(5, res); + /// ``` + fn write(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write(buf, maddr) + .map_err(Into::into) + } + + /// # Examples + /// * Read a slice of length 16 at guestaddress 0x1200. + /// + /// ``` + /// # use vm_memory::{Bytes, GuestAddress, GuestMemoryMmap}; + /// # let start_addr = GuestAddress(0x1000); + /// # let mut gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let buf = &mut [0u8; 16]; + /// let res = gm.read(buf, GuestAddress(0x1200)).unwrap(); + /// assert_eq!(16, res); + /// ``` + fn read(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read(buf, maddr) + .map_err(Into::into) + } + + fn write_slice(&self, buf: &[u8], addr: MemoryRegionAddress) -> Result<()> { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_slice(buf, maddr) + .map_err(Into::into) + } + + fn read_slice(&self, buf: &mut [u8], addr: MemoryRegionAddress) -> Result<()> { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_slice(buf, maddr) + .map_err(Into::into) + } + + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = if cfg!(unix) { + /// File::open(Path::new("/dev/urandom")).unwrap() + /// } else { + /// File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + /// }; + /// let addr = GuestAddress(0x1010); + /// gm.read_from(addr, &mut file, 128).unwrap(); + /// let read_addr = addr.checked_add(8).unwrap(); + /// let _: u32 = gm.read_obj(read_addr).unwrap(); + /// ``` + fn read_from(&self, addr: MemoryRegionAddress, src: &mut F, count: usize) -> Result + where + F: Read, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_from::(maddr, src, count) + .map_err(Into::into) + } + + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = if cfg!(unix) { + /// File::open(Path::new("/dev/urandom")).unwrap() + /// } else { + /// File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + /// }; + /// let addr = GuestAddress(0x1010); + /// gm.read_exact_from(addr, &mut file, 128).unwrap(); + /// let read_addr = addr.checked_add(8).unwrap(); + /// let _: u32 = gm.read_obj(read_addr).unwrap(); + /// ``` + fn read_exact_from(&self, addr: MemoryRegionAddress, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .read_exact_from::(maddr, src, count) + .map_err(Into::into) + } + + /// Writes data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to a temp file + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::OpenOptions; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = tempfile().unwrap(); + /// let mut mem = [0u8; 1024]; + /// gm.write_to(start_addr, &mut file, 128).unwrap(); + /// ``` + fn write_to(&self, addr: MemoryRegionAddress, dst: &mut F, count: usize) -> Result + where + F: Write, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_to::(maddr, dst, count) + .map_err(Into::into) + } + + /// Writes data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to a temp file + /// + /// ``` + /// # extern crate tempfile; + /// # use self::tempfile::tempfile; + /// # use vm_memory::{Address, Bytes, GuestAddress, GuestMemoryMmap}; + /// # use std::fs::OpenOptions; + /// # let start_addr = GuestAddress(0x1000); + /// # let gm = GuestMemoryMmap::new(&vec![(start_addr, 0x400)]).unwrap(); + /// let mut file = tempfile().unwrap(); + /// let mut mem = [0u8; 1024]; + /// gm.write_all_to(start_addr, &mut file, 128).unwrap(); + /// ``` + fn write_all_to(&self, addr: MemoryRegionAddress, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let maddr = addr.raw_value() as usize; + self.as_volatile_slice() + .write_all_to::(maddr, dst, count) + .map_err(Into::into) + } +} + +impl GuestMemoryRegion for GuestRegionMmap { + fn len(&self) -> GuestUsize { + self.mapping.len() as GuestUsize + } + + fn start_addr(&self) -> GuestAddress { + self.guest_base + } + + unsafe fn as_slice(&self) -> Option<&[u8]> { + Some(self.mapping.as_slice()) + } + + unsafe fn as_mut_slice(&self) -> Option<&mut [u8]> { + Some(self.mapping.as_mut_slice()) + } +} + +/// Tracks memory regions allocated/mapped for the guest in the current process. +#[derive(Clone, Debug)] +pub struct GuestMemoryMmap { + regions: Arc>, +} + +impl GuestMemoryMmap { + /// Creates a container and allocates anonymous memory for guest memory regions. + /// Valid memory regions are specified as a Vec of (Address, Size) tuples sorted by Address. + pub fn new(ranges: &[(GuestAddress, usize)]) -> std::result::Result { + if ranges.is_empty() { + return Err(MmapError::NoMemoryRegion); + } + + let mut regions = Vec::::new(); + for range in ranges.iter() { + if let Some(last) = regions.last() { + if last + .guest_base + .checked_add(last.mapping.len() as GuestUsize) + .map_or(true, |a| a > range.0) + { + return Err(MmapError::MemoryRegionOverlap); + } + } + + let mapping = MmapRegion::new(range.1).map_err(MmapError::SystemCallFailed)?; + regions.push(GuestRegionMmap { + mapping, + guest_base: range.0, + }); + } + + Ok(Self { + regions: Arc::new(regions), + }) + } + + /// Creates a container and adds an existing set of mappings to it. + pub fn from_regions(ranges: Vec) -> std::result::Result { + if ranges.is_empty() { + return Err(MmapError::NoMemoryRegion); + } + + for rangei in 1..ranges.len() { + let range = &ranges[rangei]; + let last = &ranges[rangei - 1]; + if last + .guest_base + .checked_add(last.mapping.len() as GuestUsize) + .map_or(true, |a| a > range.start_addr()) + { + return Err(MmapError::MemoryRegionOverlap); + } + } + + Ok(Self { + regions: Arc::new(ranges), + }) + } + + /// Convert an absolute address into an address space (GuestMemory) + /// to a host pointer, or return None if it is out of bounds. + pub fn get_host_address(&self, addr: GuestAddress) -> Option<*mut u8> { + self.to_region_addr(addr) + .and_then(|(r, addr)| r.get_host_address(addr)) + } +} + +impl GuestMemory for GuestMemoryMmap { + type R = GuestRegionMmap; + + fn num_regions(&self) -> usize { + self.regions.len() + } + + fn find_region(&self, addr: GuestAddress) -> Option<&GuestRegionMmap> { + for region in self.regions.iter() { + if addr >= region.start_addr() && addr <= region.end_addr() { + return Some(region); + } + } + None + } + + fn with_regions(&self, cb: F) -> std::result::Result<(), E> + where + F: Fn(usize, &Self::R) -> std::result::Result<(), E>, + { + for (index, region) in self.regions.iter().enumerate() { + cb(index, region)?; + } + Ok(()) + } + + fn with_regions_mut(&self, mut cb: F) -> std::result::Result<(), E> + where + F: FnMut(usize, &Self::R) -> std::result::Result<(), E>, + { + for (index, region) in self.regions.iter().enumerate() { + cb(index, region)?; + } + Ok(()) + } + + fn map_and_fold(&self, init: T, mapf: F, foldf: G) -> T + where + F: Fn((usize, &Self::R)) -> T, + G: Fn(T, T) -> T, + { + self.regions.iter().enumerate().map(mapf).fold(init, foldf) + } +} + +#[cfg(test)] +mod tests { + extern crate tempfile; + + use self::tempfile::tempfile; + use super::*; + use std::fs::File; + use std::mem; + use std::path::Path; + + use Bytes; + + #[test] + fn basic_map() { + let m = MmapRegion::new(1024).unwrap(); + assert_eq!(1024, m.len()); + } + + #[test] + fn map_invalid_size() { + let e = MmapRegion::new(0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EINVAL)); + } + + #[test] + fn slice_addr() { + let m = MmapRegion::new(5).unwrap(); + let s = m.get_slice(2, 3).unwrap(); + assert_eq!(s.as_ptr(), unsafe { m.as_ptr().offset(2) }); + } + + #[test] + fn mapped_file_read() { + let mut f = tempfile().unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + assert!(f.write_all(sample_buf).is_ok()); + + let mem_map = MmapRegion::from_fd(&f, sample_buf.len(), 0).unwrap(); + let buf = &mut [0u8; 16]; + assert_eq!( + mem_map.as_volatile_slice().read(buf, 0).unwrap(), + sample_buf.len() + ); + assert_eq!(buf[0..sample_buf.len()], sample_buf[..]); + } + + #[test] + fn test_regions() { + // No regions provided should return error. + assert_eq!( + format!("{:?}", GuestMemoryMmap::new(&[]).err().unwrap()), + format!("{:?}", MmapError::NoMemoryRegion) + ); + + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert_eq!(guest_mem.num_regions(), 2); + assert_eq!(guest_mem.end_addr(), GuestAddress(0xbff)); + assert!(guest_mem.find_region(GuestAddress(0x200)).is_some()); + assert!(guest_mem.find_region(GuestAddress(0x600)).is_none()); + assert!(guest_mem.find_region(GuestAddress(0xa00)).is_some()); + assert!(guest_mem.find_region(GuestAddress(0xc00)).is_none()); + } + + #[test] + fn test_address_in_range() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.address_in_range(GuestAddress(0x200))); + assert!(!guest_mem.address_in_range(GuestAddress(0x600))); + assert!(guest_mem.address_in_range(GuestAddress(0xa00))); + assert!(!guest_mem.address_in_range(GuestAddress(0xc00))); + } + + #[test] + fn test_check_address() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert_eq!( + guest_mem.check_address(GuestAddress(0x200)), + Some(GuestAddress(0x200)) + ); + assert_eq!(guest_mem.check_address(GuestAddress(0x600)), None); + assert_eq!( + guest_mem.check_address(GuestAddress(0xa00)), + Some(GuestAddress(0xa00)) + ); + assert_eq!(guest_mem.check_address(GuestAddress(0xc00)), None); + } + + #[test] + fn test_to_region_addr() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.to_region_addr(GuestAddress(0x600)).is_none()); + let (r0, addr0) = guest_mem.to_region_addr(GuestAddress(0x800)).unwrap(); + let (r1, addr1) = guest_mem.to_region_addr(GuestAddress(0xa00)).unwrap(); + assert!(r0.as_ptr() == r1.as_ptr()); + assert_eq!(addr0, MemoryRegionAddress(0)); + assert_eq!(addr1, MemoryRegionAddress(0x200)); + } + + #[test] + fn test_get_host_address() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x800); + let guest_mem = + GuestMemoryMmap::new(&[(start_addr1, 0x400), (start_addr2, 0x400)]).unwrap(); + assert!(guest_mem.get_host_address(GuestAddress(0x600)).is_none()); + let ptr0 = guest_mem.get_host_address(GuestAddress(0x800)).unwrap(); + let ptr1 = guest_mem.get_host_address(GuestAddress(0xa00)).unwrap(); + assert_eq!( + ptr0, + guest_mem.find_region(GuestAddress(0x800)).unwrap().as_ptr() + ); + assert_eq!(unsafe { ptr0.offset(0x200) }, ptr1); + } + + #[test] + fn test_deref() { + let start_addr = GuestAddress(0x0); + let guest_mem = GuestMemoryMmap::new(&[(start_addr, 0x400)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + + assert_eq!(guest_mem.write(sample_buf, start_addr).unwrap(), 5); + let slice = guest_mem + .find_region(GuestAddress(0)) + .unwrap() + .as_volatile_slice(); + + let buf = &mut [0, 0, 0, 0, 0]; + assert_eq!(slice.read(buf, 0).unwrap(), 5); + assert_eq!(buf, sample_buf); + } + + #[test] + fn mapped_file_regions() { + let mut f = tempfile().unwrap(); + let empty_buf = &[0; 16384]; + assert!(f.write_all(empty_buf).is_ok()); + + let mem_map = MmapRegion::from_fd(&f, empty_buf.len(), 0).unwrap(); + let guest_reg = GuestRegionMmap::new(mem_map, GuestAddress(0x8000)); + let mut region_vec = Vec::new(); + region_vec.push(guest_reg); + let guest_mem = GuestMemoryMmap::from_regions(region_vec).unwrap(); + assert_eq!(guest_mem.num_regions(), 1); + assert!(guest_mem.find_region(GuestAddress(0)).is_none()); + assert!(guest_mem.find_region(GuestAddress(0x8000)).is_some()); + } + + #[test] + fn overlap_memory() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let res = GuestMemoryMmap::new(&[(start_addr1, 0x2000), (start_addr2, 0x2000)]); + assert_eq!( + format!("{:?}", res.err().unwrap()), + format!("{:?}", MmapError::MemoryRegionOverlap) + ); + } + + #[test] + fn test_read_u64() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let bad_addr = GuestAddress(0x2001); + let bad_addr2 = GuestAddress(0x1ffc); + let max_addr = GuestAddress(0x2000); + + let gm = GuestMemoryMmap::new(&[(start_addr1, 0x1000), (start_addr2, 0x1000)]).unwrap(); + + let val1: u64 = 0xaa55_aa55_aa55_aa55; + let val2: u64 = 0x55aa_55aa_55aa_55aa; + assert_eq!( + format!("{:?}", gm.write_obj(val1, bad_addr).err().unwrap()), + format!("InvalidGuestAddress({:?})", bad_addr,) + ); + assert_eq!( + format!("{:?}", gm.write_obj(val1, bad_addr2).err().unwrap()), + format!( + "PartialBuffer {{ expected: {:?}, completed: {:?} }}", + mem::size_of::(), + max_addr.checked_offset_from(bad_addr2).unwrap() + ) + ); + + gm.write_obj(val1, GuestAddress(0x500)).unwrap(); + gm.write_obj(val2, GuestAddress(0x1000 + 32)).unwrap(); + let num1: u64 = gm.read_obj(GuestAddress(0x500)).unwrap(); + let num2: u64 = gm.read_obj(GuestAddress(0x1000 + 32)).unwrap(); + assert_eq!(val1, num1); + assert_eq!(val2, num2); + } + + #[test] + fn write_and_read() { + let mut start_addr = GuestAddress(0x1000); + let gm = GuestMemoryMmap::new(&[(start_addr, 0x400)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + + assert_eq!(gm.write(sample_buf, start_addr).unwrap(), 5); + + let buf = &mut [0u8; 5]; + assert_eq!(gm.read(buf, start_addr).unwrap(), 5); + assert_eq!(buf, sample_buf); + + start_addr = GuestAddress(0x13ff); + assert_eq!(gm.write(sample_buf, start_addr).unwrap(), 1); + assert_eq!(gm.read(buf, start_addr).unwrap(), 1); + assert_eq!(buf[0], sample_buf[0]); + } + + #[test] + fn read_to_and_write_from_mem() { + let gm = GuestMemoryMmap::new(&[(GuestAddress(0x1000), 0x400)]).unwrap(); + let addr = GuestAddress(0x1010); + let mut file = if cfg!(unix) { + File::open(Path::new("/dev/zero")).unwrap() + } else { + File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + }; + gm.write_obj(!0u32, addr).unwrap(); + gm.read_exact_from(addr, &mut file, mem::size_of::()) + .unwrap(); + let value: u32 = gm.read_obj(addr).unwrap(); + if cfg!(unix) { + assert_eq!(value, 0); + } else { + assert_eq!(value, 0x0090_5a4d); + } + + let mut sink = Vec::new(); + gm.write_all_to(addr, &mut sink, mem::size_of::()) + .unwrap(); + if cfg!(unix) { + assert_eq!(sink, vec![0; mem::size_of::()]); + } else { + assert_eq!(sink, vec![0x4d, 0x5a, 0x90, 0x00]); + }; + } + + #[test] + fn create_vec_with_regions() { + let region_size = 0x400; + let regions = vec![ + (GuestAddress(0x0), region_size), + (GuestAddress(0x1000), region_size), + ]; + let mut iterated_regions = Vec::new(); + let gm = GuestMemoryMmap::new(®ions).unwrap(); + + let res: Result<()> = gm.with_regions(|_, region| { + assert_eq!(region.len(), region_size as GuestUsize); + Ok(()) + }); + assert!(res.is_ok()); + + let res: Result<()> = gm.with_regions_mut(|_, region| { + iterated_regions.push((region.start_addr(), region.len() as usize)); + Ok(()) + }); + assert!(res.is_ok()); + assert_eq!(regions, iterated_regions); + assert_eq!(gm.clone().regions[0].guest_base, regions[0].0); + assert_eq!(gm.clone().regions[1].guest_base, regions[1].0); + } + + #[test] + fn test_access_cross_boundary() { + let start_addr1 = GuestAddress(0x0); + let start_addr2 = GuestAddress(0x1000); + let gm = GuestMemoryMmap::new(&[(start_addr1, 0x1000), (start_addr2, 0x1000)]).unwrap(); + let sample_buf = &[1, 2, 3, 4, 5]; + assert_eq!(gm.write(sample_buf, GuestAddress(0xffc)).unwrap(), 5); + let buf = &mut [0u8; 5]; + assert_eq!(gm.read(buf, GuestAddress(0xffc)).unwrap(), 5); + assert_eq!(buf, sample_buf); + } +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/mmap_unix.rs b/vendor/git-89548d8276566400/vm-memory/src/mmap_unix.rs new file mode 100644 index 000000000..4ebf8f412 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/mmap_unix.rs @@ -0,0 +1,168 @@ +// Copyright (C) 2019 Alibaba Cloud Computing. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRD-PARTY file. + +//! A default Unix implementation of the GuestMemory trait by mmap()-ing guest's memory into +//! the current process. +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use libc; +use std::io; +use std::ptr::null_mut; + +use mmap::AsSlice; +use volatile_memory::{self, compute_offset, VolatileMemory, VolatileSlice}; + +use std::os::unix::io::AsRawFd; + +/// A backend driver to access guest's physical memory by mmapping guest's memory into the current +/// process. +/// For a combination of 32-bit hypervisor and 64-bit virtual machine, only partial of guest's +/// physical memory may be mapped into current process due to limited process virtual address +/// space size. +#[derive(Debug)] +pub struct MmapRegion { + addr: *mut u8, + size: usize, +} + +// Send and Sync aren't automatically inherited for the raw address pointer. +// Accessing that pointer is only done through the stateless interface which +// allows the object to be shared by multiple threads without a decrease in +// safety. +unsafe impl Send for MmapRegion {} +unsafe impl Sync for MmapRegion {} + +impl MmapRegion { + /// Creates an anonymous shared mapping of `size` bytes. + /// + /// # Arguments + /// * `size` - Size of memory region in bytes. + pub fn new(size: usize) -> io::Result { + // This is safe because we are creating an anonymous mapping in a place not already used by + // any other area in this process. + let addr = unsafe { + libc::mmap( + null_mut(), + size, + libc::PROT_READ | libc::PROT_WRITE, + libc::MAP_ANONYMOUS | libc::MAP_SHARED | libc::MAP_NORESERVE, + -1, + 0, + ) + }; + if addr == libc::MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Maps the `size` bytes starting at `offset` bytes of the given `fd`. + /// + /// # Arguments + /// * `fd` - File descriptor to mmap from. + /// * `size` - Size of memory region in bytes. + /// * `offset` - Offset in bytes from the beginning of `fd` to start the mmap. + pub fn from_fd(fd: &AsRawFd, size: usize, offset: libc::off_t) -> io::Result { + // This is safe because we are creating a mapping in a place not already used by any other + // area in this process. + let addr = unsafe { + libc::mmap( + null_mut(), + size, + libc::PROT_READ | libc::PROT_WRITE, + libc::MAP_SHARED, + fd.as_raw_fd(), + offset, + ) + }; + if addr == libc::MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Returns a pointer to the beginning of the memory region. Should only be + /// used for passing this region to ioctls for setting guest memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } +} + +impl AsSlice for MmapRegion { + // Returns the region as a slice + // used to do crap + unsafe fn as_slice(&self) -> &[u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts_mut(self.addr, self.size) + } +} + +impl VolatileMemory for MmapRegion { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> volatile_memory::Result { + let end = compute_offset(offset, count)?; + if end > self.size { + return Err(volatile_memory::Error::OutOfBounds { addr: end }); + } + + // Safe because we checked that offset + count was within our range and we only ever hand + // out volatile accessors. + Ok(unsafe { VolatileSlice::new((self.addr as usize + offset) as *mut _, count) }) + } +} + +impl Drop for MmapRegion { + fn drop(&mut self) { + // This is safe because we mmap the area at addr ourselves, and nobody + // else is holding a reference to it. + unsafe { + libc::munmap(self.addr as *mut libc::c_void, self.size); + } + } +} + +#[cfg(test)] +mod tests { + use mmap_unix::MmapRegion; + use std::os::unix::io::FromRawFd; + + #[test] + fn map_invalid_fd() { + let fd = unsafe { std::fs::File::from_raw_fd(-1) }; + let e = MmapRegion::from_fd(&fd, 1024, 0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EBADF)); + } +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/mmap_windows.rs b/vendor/git-89548d8276566400/vm-memory/src/mmap_windows.rs new file mode 100644 index 000000000..70233582f --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/mmap_windows.rs @@ -0,0 +1,225 @@ +// Copyright (C) 2019 CrowdStrike, Inc. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 +// + +//! A default Windows implementation of the GuestMemory trait using VirtualAlloc() and MapViewOfFile(). +//! +//! The main structs to access guest's memory are: +//! - [MmapRegion](struct.MmapRegion.html): mmap a continuous region of guest's memory into the +//! current process +//! - [GuestRegionMmap](struct.GuestRegionMmap.html): tracks a mapping of memory in the current +//! process and the corresponding base address. It relays guest memory access requests to the +//! underline [MmapRegion](struct.MmapRegion.html) object. +//! - [GuestMemoryMmap](struct.GuestMemoryMmap.html): provides methods to access a collection of +//! GuestRegionMmap objects. + +use libc; +use std::io; +use std::ptr::null_mut; + +use mmap::AsSlice; +use volatile_memory::{self, compute_offset, VolatileMemory, VolatileSlice}; + +use libc::{c_void, size_t}; +use std; +use std::os::windows::io::{AsRawHandle, RawHandle}; +use std::ptr::null; + +#[allow(non_snake_case)] +#[link(name = "kernel32")] +extern "stdcall" { + pub fn VirtualAlloc( + lpAddress: *mut c_void, + dwSize: size_t, + flAllocationType: u32, + flProtect: u32, + ) -> *mut c_void; + + pub fn VirtualFree(lpAddress: *mut c_void, dwSize: size_t, dwFreeType: u32) -> u32; + + pub fn CreateFileMappingA( + hFile: RawHandle, // HANDLE + lpFileMappingAttributes: *const c_void, // LPSECURITY_ATTRIBUTES + flProtect: u32, // DWORD + dwMaximumSizeHigh: u32, // DWORD + dwMaximumSizeLow: u32, // DWORD + lpName: *const u8, // LPCSTR + ) -> RawHandle; // HANDLE + + pub fn MapViewOfFile( + hFileMappingObject: RawHandle, + dwDesiredAccess: u32, + dwFileOffsetHigh: u32, + dwFileOffsetLow: u32, + dwNumberOfBytesToMap: size_t, + ) -> *mut c_void; + + pub fn CloseHandle(hObject: RawHandle) -> u32; // BOOL +} + +const MM_HIGHEST_VAD_ADDRESS: u64 = 0x000007FFFFFDFFFF; + +const MEM_COMMIT: u32 = 0x00001000; +const MEM_RELEASE: u32 = 0x00008000; +const FILE_MAP_ALL_ACCESS: u32 = 0xf001f; +const PAGE_READWRITE: u32 = 0x04; + +pub const MAP_FAILED: *mut c_void = 0 as *mut c_void; +pub const INVALID_HANDLE_VALUE: RawHandle = (-1isize) as RawHandle; +#[allow(dead_code)] +pub const ERROR_INVALID_PARAMETER: i32 = 87; + +/// A backend driver to access guest's physical memory by mmapping guest's memory into the current +/// process. +/// For a combination of 32-bit hypervisor and 64-bit virtual machine, only partial of guest's +/// physical memory may be mapped into current process due to limited process virtual address +/// space size. +#[derive(Debug)] +pub struct MmapRegion { + addr: *mut u8, + size: usize, +} + +// Send and Sync aren't automatically inherited for the raw address pointer. +// Accessing that pointer is only done through the stateless interface which +// allows the object to be shared by multiple threads without a decrease in +// safety. +unsafe impl Send for MmapRegion {} +unsafe impl Sync for MmapRegion {} + +impl MmapRegion { + /// Creates an anonymous shared mapping of `size` bytes. + /// + /// # Arguments + /// * `size` - Size of memory region in bytes. + pub fn new(size: usize) -> io::Result { + if (size == 0) || (size > MM_HIGHEST_VAD_ADDRESS as usize) { + return Err(io::Error::from_raw_os_error(libc::EINVAL)); + } + // This is safe because we are creating an anonymous mapping in a place not already used by + // any other area in this process. + let addr = unsafe { VirtualAlloc(0 as *mut c_void, size, MEM_COMMIT, PAGE_READWRITE) }; + if addr == MAP_FAILED { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Maps the `size` bytes starting at `offset` bytes of the given `fd`. + /// + /// # Arguments + /// * `file` - Raw handle to a file to map into the address space. + /// * `size` - Size of memory region in bytes. + /// * `offset` - Offset in bytes from the beginning of `file` to start the mapping. + pub fn from_fd(file: &AsRawHandle, size: usize, offset: libc::off_t) -> io::Result { + let handle = file.as_raw_handle(); + if handle == INVALID_HANDLE_VALUE { + return Err(io::Error::from_raw_os_error(libc::EBADF)); + } + + let mapping = unsafe { + CreateFileMappingA( + handle, + null(), + PAGE_READWRITE, + (size >> 32) as u32, + size as u32, + null(), + ) + }; + if mapping == 0 as RawHandle { + return Err(io::Error::last_os_error()); + } + + // This is safe because we are creating a mapping in a place not already used by any other + // area in this process. + let addr = unsafe { + MapViewOfFile( + mapping, + FILE_MAP_ALL_ACCESS, + (offset as u64 >> 32) as u32, + offset as u32, + size, + ) + }; + + unsafe { + CloseHandle(mapping); + } + + if addr == null_mut() { + return Err(io::Error::last_os_error()); + } + Ok(Self { + addr: addr as *mut u8, + size, + }) + } + + /// Returns a pointer to the beginning of the memory region. Should only be + /// used for passing this region to ioctls for setting guest memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } +} + +impl AsSlice for MmapRegion { + // Returns the region as a slice + // used to do crap + unsafe fn as_slice(&self) -> &[u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + // This is safe because we mapped the area at addr ourselves, so this slice will not + // overflow. However, it is possible to alias. + std::slice::from_raw_parts_mut(self.addr, self.size) + } +} + +impl VolatileMemory for MmapRegion { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> volatile_memory::Result { + let end = compute_offset(offset, count)?; + if end > self.size { + return Err(volatile_memory::Error::OutOfBounds { addr: end }); + } + + // Safe because we checked that offset + count was within our range and we only ever hand + // out volatile accessors. + Ok(unsafe { VolatileSlice::new((self.addr as usize + offset) as *mut _, count) }) + } +} + +impl Drop for MmapRegion { + fn drop(&mut self) { + // This is safe because we mmap the area at addr ourselves, and nobody + // else is holding a reference to it. + unsafe { + VirtualFree(self.addr as *mut libc::c_void, self.size, MEM_RELEASE); + } + } +} + +#[cfg(test)] +mod tests { + use mmap_windows::{MmapRegion, INVALID_HANDLE_VALUE}; + use std::os::windows::io::FromRawHandle; + + #[test] + fn map_invalid_handle() { + let fd = unsafe { std::fs::File::from_raw_handle(INVALID_HANDLE_VALUE) }; + let e = MmapRegion::from_fd(&fd, 1024, 0).unwrap_err(); + assert_eq!(e.raw_os_error(), Some(libc::EBADF)); + } +} diff --git a/vendor/git-89548d8276566400/vm-memory/src/volatile_memory.rs b/vendor/git-89548d8276566400/vm-memory/src/volatile_memory.rs new file mode 100644 index 000000000..fdc91f775 --- /dev/null +++ b/vendor/git-89548d8276566400/vm-memory/src/volatile_memory.rs @@ -0,0 +1,967 @@ +// Portions Copyright 2019 Red Hat, Inc. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the THIRT-PARTY file. + +//! Types for volatile access to memory. +//! +//! Two of the core rules for safe rust is no data races and no aliased mutable references. +//! `VolatileRef` and `VolatileSlice`, along with types that produce those which implement +//! `VolatileMemory`, allow us to sidestep that rule by wrapping pointers that absolutely have to be +//! accessed volatile. Some systems really do need to operate on shared memory and can't have the +//! compiler reordering or eliding access because it has no visibility into what other systems are +//! doing with that hunk of memory. +//! +//! For the purposes of maintaining safety, volatile memory has some rules of its own: +//! 1. No references or slices to volatile memory (`&` or `&mut`). +//! 2. Access should always been done with a volatile read or write. +//! The First rule is because having references of any kind to memory considered volatile would +//! violate pointer aliasing. The second is because unvolatile accesses are inherently undefined if +//! done concurrently without synchronization. With volatile access we know that the compiler has +//! not reordered or elided the access. + +use std::cmp::min; +use std::fmt; +use std::io::{self, Read, Write}; +use std::marker::PhantomData; +use std::mem::size_of; +use std::ptr::copy; +use std::ptr::{read_volatile, write_volatile}; +use std::result; +use std::slice::{from_raw_parts, from_raw_parts_mut}; +use std::usize; + +use bytes::{ByteValued, Bytes}; + +/// VolatileMemory related error codes +#[allow(missing_docs)] +#[derive(Debug)] +pub enum Error { + /// `addr` is out of bounds of the volatile memory slice. + OutOfBounds { addr: usize }, + /// Taking a slice at `base` with `offset` would overflow `usize`. + Overflow { base: usize, offset: usize }, + /// Writing to memory failed + IOError(io::Error), + /// Incomplete read or write + PartialBuffer { expected: usize, completed: usize }, +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Error::OutOfBounds { addr } => write!(f, "address 0x{:x} is out of bounds", addr), + Error::Overflow { base, offset } => write!( + f, + "address 0x{:x} offset by 0x{:x} would overflow", + base, offset + ), + Error::IOError(error) => write!(f, "{}", error), + Error::PartialBuffer { + expected, + completed, + } => write!( + f, + "only used {} bytes in {} long buffer", + completed, expected + ), + } + } +} + +/// Result of volatile memory operations +pub type Result = result::Result; + +/// Convenience function for computing `base + offset` which returns +/// `Err(Error::Overflow)` instead of panicking in the case `base + offset` exceeds +/// `usize::MAX`. +/// +/// # Examples +/// +/// ``` +/// # use vm_memory::volatile_memory::*; +/// # fn get_slice(offset: usize, count: usize) -> Result<()> { +/// let mem_end = compute_offset(offset, count)?; +/// if mem_end > 100 { +/// return Err(Error::OutOfBounds{addr: mem_end}); +/// } +/// # Ok(()) +/// # } +/// ``` +pub fn compute_offset(base: usize, offset: usize) -> Result { + match base.checked_add(offset) { + None => Err(Error::Overflow { base, offset }), + Some(m) => Ok(m), + } +} + +/// Trait for types that support raw volatile access to their data. +pub trait VolatileMemory { + /// Gets the size of this slice. + fn len(&self) -> usize; + + /// Check whether the region is empty. + fn is_empty(&self) -> bool { + self.len() == 0 + } + + /// Gets a slice of memory at `offset` that is `count` bytes in length and supports volatile + /// access. + fn get_slice(&self, offset: usize, count: usize) -> Result; + + /// Gets a slice of memory for the entire region that supports volatile access. + fn as_volatile_slice(&self) -> VolatileSlice { + self.get_slice(0, self.len()).unwrap() + } + + /// Gets a `VolatileRef` at `offset`. + fn get_ref(&self, offset: usize) -> Result> { + let slice = self.get_slice(offset, size_of::())?; + unsafe { + // This is safe because the pointer is range-checked by get_slice, and + // the lifetime is the same as self. + Ok(VolatileRef::::new(slice.addr)) + } + } + + /// Check that addr + count is valid and return the sum. + fn compute_end_offset(&self, base: usize, offset: usize) -> Result { + let mem_end = compute_offset(base, offset)?; + if mem_end > self.len() { + return Err(Error::OutOfBounds { addr: mem_end }); + } + Ok(mem_end) + } +} + +impl<'a> VolatileMemory for &'a mut [u8] { + fn len(&self) -> usize { + <[u8]>::len(self) + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + unsafe { + // This is safe because the pointer is range-checked by compute_end_offset, and + // the lifetime is the same as the original slice. + Ok(VolatileSlice::new( + (self.as_ptr() as usize + offset) as *mut _, + count, + )) + } + } +} + +#[repr(C, packed)] +struct Packed(T); + +/// A slice of raw memory that supports volatile access. +#[derive(Copy, Clone, Debug)] +pub struct VolatileSlice<'a> { + addr: *mut u8, + size: usize, + phantom: PhantomData<&'a u8>, +} + +impl<'a> VolatileSlice<'a> { + /// Creates a slice of raw memory that must support volatile access. + /// + /// To use this safely, the caller must guarantee that the memory at `addr` is `size` bytes long + /// and is available for the duration of the lifetime of the new `VolatileSlice`. The caller + /// must also guarantee that all other users of the given chunk of memory are using volatile + /// accesses. + pub unsafe fn new(addr: *mut u8, size: usize) -> VolatileSlice<'a> { + VolatileSlice { + addr, + size, + phantom: PhantomData, + } + } + + /// Gets the address of this slice's memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr + } + + /// Gets the size of this slice. + pub fn len(&self) -> usize { + self.size + } + + /// Check whether the slice is empty. + pub fn is_empty(&self) -> bool { + self.size == 0 + } + + /// Creates a copy of this slice with the address increased by `count` bytes, and the size + /// reduced by `count` bytes. + pub fn offset(self, count: usize) -> Result> { + let new_addr = (self.addr as usize) + .checked_add(count) + .ok_or(Error::Overflow { + base: self.addr as usize, + offset: count, + })?; + let new_size = self + .size + .checked_sub(count) + .ok_or(Error::OutOfBounds { addr: new_addr })?; + unsafe { + // Safe because the memory has the same lifetime and points to a subset of the + // memory of the original slice. + Ok(VolatileSlice::new(new_addr as *mut u8, new_size)) + } + } + + /// Copies `self.len()` or `buf.len()` times the size of `T` bytes, whichever is smaller, to + /// `buf`. + /// + /// The copy happens from smallest to largest address in `T` sized chunks using volatile reads. + /// + /// # Examples + /// + /// ``` + /// # use std::fs::File; + /// # use std::path::Path; + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// let mut buf = [5u8; 16]; + /// vslice.copy_to(&mut buf[..]); + /// for v in &buf[..] { + /// assert_eq!(buf[0], 0); + /// } + /// # Ok(()) + /// # } + /// ``` + pub fn copy_to(&self, buf: &mut [T]) -> usize + where + T: ByteValued, + { + let mut addr = self.addr; + let mut i = 0; + for v in buf.iter_mut().take(self.size / size_of::()) { + unsafe { + *v = read_volatile(addr as *const Packed).0; + addr = addr.add(size_of::()); + }; + i += 1; + } + i + } + + /// Copies `self.len()` or `slice.len()` bytes, whichever is smaller, to `slice`. + /// + /// The copies happen in an undefined order. + /// # Examples + /// + /// ``` + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// vslice.copy_to_volatile_slice(vslice.get_slice(16, 16).map_err(|_| ())?); + /// # Ok(()) + /// # } + /// ``` + pub fn copy_to_volatile_slice(&self, slice: VolatileSlice) { + unsafe { + // Safe because the pointers are range-checked when the slices + // are created, and they never escape the VolatileSlices. + // FIXME: ... however, is it really okay to mix non-volatile + // operations such as copy with read_volatile and write_volatile? + copy(self.addr, slice.addr, min(self.size, slice.size)); + } + } + + /// Copies `self.len()` or `buf.len()` times the size of `T` bytes, whichever is smaller, to + /// this slice's memory. + /// + /// The copy happens from smallest to largest address in `T` sized chunks using volatile writes. + /// + /// # Examples + /// + /// ``` + /// # use std::fs::File; + /// # use std::path::Path; + /// # use vm_memory::VolatileMemory; + /// # fn test_write_null() -> Result<(), ()> { + /// let mut mem = [0u8; 32]; + /// let mem_ref = &mut mem[..]; + /// let vslice = mem_ref.get_slice(0, 32).map_err(|_| ())?; + /// let buf = [5u8; 64]; + /// vslice.copy_from(&buf[..]); + /// for i in 0..4 { + /// assert_eq!(vslice.get_ref::(i * 4).map_err(|_| ())?.load(), 0x05050505); + /// } + /// # Ok(()) + /// # } + /// ``` + pub fn copy_from(&self, buf: &[T]) + where + T: ByteValued, + { + let mut addr = self.addr; + for &v in buf.iter().take(self.size / size_of::()) { + unsafe { + // Safe because the pointers are range-checked when the slices + // are created, and they never escape the VolatileSlices. + write_volatile(addr as *mut Packed, Packed::(v)); + addr = addr.add(size_of::()); + } + } + } + + // These function are private and only used for the read/write functions. It is not valid in + // general to take slices of volatile memory. + unsafe fn as_slice(&self) -> &[u8] { + from_raw_parts(self.addr, self.size) + } + + // safe because it's expected interior mutability + #[allow(clippy::mut_from_ref)] + unsafe fn as_mut_slice(&self) -> &mut [u8] { + from_raw_parts_mut(self.addr, self.size) + } +} + +impl<'a> Bytes for VolatileSlice<'a> { + type E = Error; + + /// Writes a slice to the region at the specified address. + /// Returns the number of bytes written. The number of bytes written can + /// be less than the length of the slice if there isn't enough room in the + /// region. + /// + /// # Examples + /// * Write a slice at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let res = vslice.write(&[1,2,3,4,5], 1020); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), 4); + /// ``` + fn write(&self, buf: &[u8], addr: usize) -> Result { + if addr >= self.size { + return Err(Error::OutOfBounds { addr }); + } + unsafe { + // Guest memory can't strictly be modeled as a slice because it is + // volatile. Writing to it with what compiles down to a memcpy + // won't hurt anything as long as we get the bounds checks right. + let mut slice: &mut [u8] = &mut self.as_mut_slice()[addr..]; + Ok(slice.write(buf).map_err(Error::IOError)?) + } + } + + /// Reads to a slice from the region at the specified address. + /// Returns the number of bytes read. The number of bytes read can be less than the length + /// of the slice if there isn't enough room in the region. + /// + /// # Examples + /// * Read a slice of size 16 at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let buf = &mut [0u8; 16]; + /// let res = vslice.read(buf, 1010); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), 14); + /// ``` + fn read(&self, mut buf: &mut [u8], addr: usize) -> Result { + if addr >= self.size { + return Err(Error::OutOfBounds { addr }); + } + unsafe { + // Guest memory can't strictly be modeled as a slice because it is + // volatile. Writing to it with what compiles down to a memcpy + // won't hurt anything as long as we get the bounds checks right. + let slice: &[u8] = &self.as_slice()[addr..]; + Ok(buf.write(slice).map_err(Error::IOError)?) + } + } + + /// Writes a slice to the region at the specified address. + /// + /// # Examples + /// * Write a slice at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let res = vslice.write_slice(&[1,2,3,4,5], 256); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), ()); + /// ``` + fn write_slice(&self, buf: &[u8], addr: usize) -> Result<()> { + let len = self.write(buf, addr)?; + if len != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: len, + }); + } + Ok(()) + } + + /// Reads to a slice from the region at the specified address. + /// + /// # Examples + /// * Read a slice of size 16 at offset 256. + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let buf = &mut [0u8; 16]; + /// let res = vslice.read_slice(buf, 256); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap(), ()); + /// ``` + fn read_slice(&self, buf: &mut [u8], addr: usize) -> Result<()> { + let len = self.read(buf, addr)?; + if len != buf.len() { + return Err(Error::PartialBuffer { + expected: buf.len(), + completed: len, + }); + } + Ok(()) + } + + /// Writes data from a readable object like a File and writes it to the region. + /// + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_read_random() -> Result { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/urandom")).map_err(|_| ())?; + /// vslice.read_from(32, &mut file, 128).map_err(|_| ())?; + /// let rand_val: u32 = vslice.read_obj(40).map_err(|_| ())?; + /// # Ok(rand_val) + /// # } + /// ``` + fn read_from(&self, addr: usize, src: &mut F, count: usize) -> Result + where + F: Read, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to overwrite the volatile memory. Accessing the guest + // memory as a mutable slice is OK because nothing assumes another + // thread won't change what is loaded. + let dst = &mut self.as_mut_slice()[addr..end]; + src.read(dst).map_err(Error::IOError) + } + } + + /// Writes data from a readable object like a File and writes it to the region. + /// + /// # Examples + /// + /// * Read bytes from /dev/urandom + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_read_random() -> Result { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/urandom")).map_err(|_| ())?; + /// vslice.read_exact_from(32, &mut file, 128).map_err(|_| ())?; + /// let rand_val: u32 = vslice.read_obj(40).map_err(|_| ())?; + /// # Ok(rand_val) + /// # } + /// ``` + fn read_exact_from(&self, addr: usize, src: &mut F, count: usize) -> Result<()> + where + F: Read, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to overwrite the volatile memory. Accessing the guest + // memory as a mutable slice is OK because nothing assumes another + // thread won't change what is loaded. + let dst = &mut self.as_mut_slice()[addr..end]; + src.read_exact(dst).map_err(Error::IOError)?; + } + Ok(()) + } + + /// Reads data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to /dev/null + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_write_null() -> Result<(), ()> { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/null")).map_err(|_| ())?; + /// vslice.write_to(32, &mut file, 128).map_err(|_| ())?; + /// # Ok(()) + /// # } + /// ``` + fn write_to(&self, addr: usize, dst: &mut F, count: usize) -> Result + where + F: Write, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let src = &self.as_mut_slice()[addr..end]; + dst.write(src).map_err(Error::IOError) + } + } + + /// Reads data from the region to a writable object. + /// + /// # Examples + /// + /// * Write 128 bytes to /dev/null + /// + /// ``` + /// # use vm_memory::{Bytes, VolatileMemory}; + /// # use std::fs::File; + /// # use std::path::Path; + /// # fn test_write_null() -> Result<(), ()> { + /// # let mut mem = [0u8; 1024]; + /// # let mut mem_ref = &mut mem[..]; + /// # let vslice = mem_ref.as_volatile_slice(); + /// let mut file = File::open(Path::new("/dev/null")).map_err(|_| ())?; + /// vslice.write_all_to(32, &mut file, 128).map_err(|_| ())?; + /// # Ok(()) + /// # } + /// ``` + fn write_all_to(&self, addr: usize, dst: &mut F, count: usize) -> Result<()> + where + F: Write, + { + let end = self.compute_end_offset(addr, count)?; + unsafe { + // It is safe to read from volatile memory. Accessing the guest + // memory as a slice is OK because nothing assumes another thread + // won't change what is loaded. + let src = &self.as_mut_slice()[addr..end]; + dst.write_all(src).map_err(Error::IOError)?; + } + Ok(()) + } +} + +impl<'a> VolatileMemory for VolatileSlice<'a> { + fn len(&self) -> usize { + self.size + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + Ok(unsafe { + // This is safe because the pointer is range-checked by compute_end_offset, and + // the lifetime is the same as self. + VolatileSlice::new((self.addr as usize + offset) as *mut u8, count) + }) + } +} + +/// A memory location that supports volatile access of a `T`. +/// +/// # Examples +/// +/// ``` +/// # use vm_memory::VolatileRef; +/// let mut v = 5u32; +/// assert_eq!(v, 5); +/// let v_ref = unsafe { VolatileRef::::new(&mut v as *mut u32 as *mut u8) }; +/// assert_eq!(v_ref.load(), 5); +/// v_ref.store(500); +/// assert_eq!(v, 500); +#[derive(Debug)] +pub struct VolatileRef<'a, T: ByteValued> +where + T: 'a, +{ + addr: *mut Packed, + phantom: PhantomData<&'a T>, +} + +#[allow(clippy::len_without_is_empty)] +impl<'a, T: ByteValued> VolatileRef<'a, T> { + /// Creates a reference to raw memory that must support volatile access of `T` sized chunks. + /// + /// To use this safely, the caller must guarantee that the memory at `addr` is big enough for a + /// `T` and is available for the duration of the lifetime of the new `VolatileRef`. The caller + /// must also guarantee that all other users of the given chunk of memory are using volatile + /// accesses. + pub unsafe fn new(addr: *mut u8) -> VolatileRef<'a, T> { + VolatileRef { + addr: addr as *mut Packed, + phantom: PhantomData, + } + } + + /// Gets the address of this slice's memory. + pub fn as_ptr(&self) -> *mut u8 { + self.addr as *mut u8 + } + + /// Gets the size of this slice. + /// + /// # Examples + /// + /// ``` + /// # use std::mem::size_of; + /// # use vm_memory::VolatileRef; + /// let v_ref = unsafe { VolatileRef::::new(0 as *mut _) }; + /// assert_eq!(v_ref.len(), size_of::() as usize); + /// ``` + pub fn len(&self) -> usize { + size_of::() + } + + /// Does a volatile write of the value `v` to the address of this ref. + #[inline(always)] + pub fn store(&self, v: T) { + unsafe { write_volatile(self.addr, Packed::(v)) }; + } + + /// Does a volatile read of the value at the address of this ref. + #[inline(always)] + pub fn load(&self) -> T { + // For the purposes of demonstrating why read_volatile is necessary, try replacing the code + // in this function with the commented code below and running `cargo test --release`. + // unsafe { *(self.addr as *const T) } + unsafe { read_volatile(self.addr).0 } + } + + /// Converts this `T` reference to a raw slice with the same size and address. + pub fn to_slice(&self) -> VolatileSlice<'a> { + unsafe { VolatileSlice::new(self.addr as *mut u8, size_of::()) } + } +} + +#[cfg(test)] +mod tests { + extern crate tempfile; + + use super::*; + + use self::tempfile::tempfile; + use std::sync::Arc; + use std::thread::{sleep, spawn}; + use std::time::Duration; + + use std::fs::File; + use std::path::Path; + + #[derive(Clone)] + struct VecMem { + mem: Arc>, + } + + impl VecMem { + fn new(size: usize) -> VecMem { + let mut mem = Vec::new(); + mem.resize(size, 0); + VecMem { mem: Arc::new(mem) } + } + } + + impl VolatileMemory for VecMem { + fn len(&self) -> usize { + self.mem.len() + } + + fn get_slice(&self, offset: usize, count: usize) -> Result { + let _ = self.compute_end_offset(offset, count)?; + Ok(unsafe { + VolatileSlice::new((self.mem.as_ptr() as usize + offset) as *mut _, count) + }) + } + } + + #[test] + fn ref_store() { + let mut a = [0u8; 1]; + { + let a_ref = &mut a[..]; + let v_ref = a_ref.get_ref(0).unwrap(); + v_ref.store(2u8); + } + assert_eq!(a[0], 2); + } + + #[test] + fn ref_load() { + let mut a = [5u8; 1]; + { + let a_ref = &mut a[..]; + let c = { + let v_ref = a_ref.get_ref::(0).unwrap(); + assert_eq!(v_ref.load(), 5u8); + v_ref + }; + // To make sure we can take a v_ref out of the scope we made it in: + c.load(); + // but not too far: + // c + } //.load() + ; + } + + #[test] + fn ref_to_slice() { + let mut a = [1u8; 5]; + let a_ref = &mut a[..]; + let v_ref = a_ref.get_ref(1).unwrap(); + v_ref.store(0x1234_5678u32); + let ref_slice = v_ref.to_slice(); + assert_eq!(v_ref.as_ptr() as usize, ref_slice.as_ptr() as usize); + assert_eq!(v_ref.len(), ref_slice.len()); + assert!(!ref_slice.is_empty()); + } + + #[test] + fn observe_mutate() { + let a = VecMem::new(1); + let a_clone = a.clone(); + let v_ref = a.get_ref::(0).unwrap(); + v_ref.store(99); + spawn(move || { + sleep(Duration::from_millis(10)); + let clone_v_ref = a_clone.get_ref::(0).unwrap(); + clone_v_ref.store(0); + }); + + // Technically this is a race condition but we have to observe the v_ref's value changing + // somehow and this helps to ensure the sleep actually happens before the store rather then + // being reordered by the compiler. + assert_eq!(v_ref.load(), 99); + + // Granted we could have a machine that manages to perform this many volatile loads in the + // amount of time the spawned thread sleeps, but the most likely reason the retry limit will + // get reached is because v_ref.load() is not actually performing the required volatile read + // or v_ref.store() is not doing a volatile write. A timer based solution was avoided + // because that might use a syscall which could hint the optimizer to reload v_ref's pointer + // regardless of volatile status. Note that we use a longer retry duration for optimized + // builds. + #[cfg(debug_assertions)] + const RETRY_MAX: usize = 500_000_000; + #[cfg(not(debug_assertions))] + const RETRY_MAX: usize = 10_000_000_000; + + let mut retry = 0; + while v_ref.load() == 99 && retry < RETRY_MAX { + retry += 1; + } + + assert_ne!(retry, RETRY_MAX, "maximum retry exceeded"); + assert_eq!(v_ref.load(), 0); + } + + #[test] + fn slice_len() { + let a = VecMem::new(100); + let s = a.get_slice(0, 27).unwrap(); + assert_eq!(s.len(), 27); + + let s = a.get_slice(34, 27).unwrap(); + assert_eq!(s.len(), 27); + + let s = s.get_slice(20, 5).unwrap(); + assert_eq!(s.len(), 5); + } + + #[test] + fn slice_is_empty() { + let a = VecMem::new(100); + let s = a.get_slice(0, 27).unwrap(); + assert!(!s.is_empty()); + + let s = a.get_slice(34, 0).unwrap(); + assert!(s.is_empty()); + } + + #[test] + fn slice_overflow_error() { + use std::usize::MAX; + let a = VecMem::new(1); + let res = a.get_slice(MAX, 1).unwrap_err(); + assert_matches!( + res, + Error::Overflow { + base: MAX, + offset: 1, + } + ); + } + + #[test] + fn slice_oob_error() { + let a = VecMem::new(100); + a.get_slice(50, 50).unwrap(); + let res = a.get_slice(55, 50).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 105 }); + } + + #[test] + fn ref_overflow_error() { + use std::usize::MAX; + let a = VecMem::new(1); + let res = a.get_ref::(MAX).unwrap_err(); + assert_matches!( + res, + Error::Overflow { + base: MAX, + offset: 1, + } + ); + } + + #[test] + fn ref_oob_error() { + let a = VecMem::new(100); + a.get_ref::(99).unwrap(); + let res = a.get_ref::(99).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 101 }); + } + + #[test] + fn ref_oob_too_large() { + let a = VecMem::new(3); + let res = a.get_ref::(0).unwrap_err(); + assert_matches!(res, Error::OutOfBounds { addr: 4 }); + } + + #[test] + fn slice_store() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let r = a.get_ref(2).unwrap(); + r.store(9u16); + assert_eq!(s.read_obj::(2).unwrap(), 9); + } + + #[test] + fn test_write_past_end() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let res = s.write(&[1, 2, 3, 4, 5, 6], 0); + assert!(res.is_ok()); + assert_eq!(res.unwrap(), 5); + } + + #[test] + fn slice_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + let sample_buf = [1, 2, 3]; + assert!(s.write(&sample_buf, 5).is_err()); + assert!(s.write(&sample_buf, 2).is_ok()); + let mut buf = [0u8; 3]; + assert!(s.read(&mut buf, 5).is_err()); + assert!(s.read_slice(&mut buf, 2).is_ok()); + assert_eq!(buf, sample_buf); + } + + #[test] + fn obj_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + assert!(s.write_obj(55u16, 4).is_err()); + assert!(s.write_obj(55u16, core::usize::MAX).is_err()); + assert!(s.write_obj(55u16, 2).is_ok()); + assert_eq!(s.read_obj::(2).unwrap(), 55u16); + assert!(s.read_obj::(4).is_err()); + assert!(s.read_obj::(core::usize::MAX).is_err()); + } + + #[test] + fn mem_read_and_write() { + let a = VecMem::new(5); + let s = a.as_volatile_slice(); + assert!(s.write_obj(!0u32, 1).is_ok()); + let mut file = if cfg!(unix) { + File::open(Path::new("/dev/zero")).unwrap() + } else { + File::open(Path::new("c:\\Windows\\system32\\ntoskrnl.exe")).unwrap() + }; + assert!(s.read_exact_from(2, &mut file, size_of::()).is_err()); + assert!(s + .read_exact_from(core::usize::MAX, &mut file, size_of::()) + .is_err()); + + assert!(s.read_exact_from(1, &mut file, size_of::()).is_ok()); + + let mut f = tempfile().unwrap(); + assert!(s.read_exact_from(1, &mut f, size_of::()).is_err()); + format!("{:?}", s.read_exact_from(1, &mut f, size_of::())); + + let value = s.read_obj::(1).unwrap(); + if cfg!(unix) { + assert_eq!(value, 0); + } else { + assert_eq!(value, 0x0090_5a4d); + } + + let mut sink = Vec::new(); + assert!(s.write_all_to(1, &mut sink, size_of::()).is_ok()); + assert!(s.write_all_to(2, &mut sink, size_of::()).is_err()); + assert!(s + .write_all_to(core::usize::MAX, &mut sink, size_of::()) + .is_err()); + format!("{:?}", s.write_all_to(2, &mut sink, size_of::())); + if cfg!(unix) { + assert_eq!(sink, vec![0; size_of::()]); + } else { + assert_eq!(sink, vec![0x4d, 0x5a, 0x90, 0x00]); + }; + } + + #[test] + fn unaligned_read_and_write() { + let a = VecMem::new(7); + let s = a.as_volatile_slice(); + let sample_buf: [u8; 7] = [1, 2, 0xAA, 0xAA, 0xAA, 0xAA, 4]; + assert!(s.write_slice(&sample_buf, 0).is_ok()); + let r = a.get_ref::(2).unwrap(); + assert_eq!(r.load(), 0xAAAA_AAAA); + + r.store(0x5555_5555); + let sample_buf: [u8; 7] = [1, 2, 0x55, 0x55, 0x55, 0x55, 4]; + let mut buf: [u8; 7] = Default::default(); + assert!(s.read_slice(&mut buf, 0).is_ok()); + assert_eq!(buf, sample_buf); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/.buildkite/pipeline.yml b/vendor/git-bad78e1967b13e00/vmm-sys-util/.buildkite/pipeline.yml new file mode 100644 index 000000000..f62c2a4fc --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/.buildkite/pipeline.yml @@ -0,0 +1,75 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-arm" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: arm.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + tmpfs: [ "/tmp:exec" ] + + - label: "unittests-gnu-arm" + commands: + - cargo test + retry: + automatic: false + agents: + platform: arm.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + tmpfs: [ "/tmp:exec" ] + + - label: "clippy-x86" + commands: + - cargo clippy --all -- -D warnings + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/.cargo-checksum.json b/vendor/git-bad78e1967b13e00/vmm-sys-util/.cargo-checksum.json new file mode 100644 index 000000000..2bd61c742 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/pipeline.yml":"0194df2d3534e3c6938ba2945e05696a12b8ed63d4941b3a4173c5bcf6e587c4","Cargo.toml":"d19b52349ada25dbbae4e2bea4850cf1b09ea546d5efee03ddfbbf9f184c0c72","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-BSD-3-Clause":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","README.md":"94512ed84e8e89faba431d9107e85d229363c187705ab9244f0ab5269b5961b5","src/errno.rs":"b93845c200fc596b0ef2414671d965cf5c4fdbf6bba6e5e5f0d032a32c73f8ac","src/eventfd.rs":"7bd871242f49c14d8783714e6814456f51a9c280dcadf1625e1bd2313d2b5f7f","src/file_traits.rs":"398c529e7ebce143ecb9f9bd2f5f47ea3e953ac34cc211ad71cdcf1898cc7d38","src/ioctl.rs":"5c4abf75e7b6786e7da3191ac1e4460e1ec7d073a53331a6d9597bb9ccc3f88a","src/lib.rs":"ee0818e0ca6fdc340c52d514eeb2e3aeb4f7ba8e4e522bb946cdbce4779926f1","src/poll.rs":"1498c14ba022ede57c4faf17bee49cf5ac9d1c8d3883db441697ee224dac7818","src/seek_hole.rs":"de43f21bc2c5d9eb7f06e21e3c20f93476bf6016e4d041df71a02b9e54b3c3ca","src/signal.rs":"724f679cb62d268a5ec8f0704a8d6b01882f302f508c189e82054657ed8b31bf","src/syslog.rs":"fbf4bde16b1059b5b39c5318e8bb918dc431e8e0ccbc82c0d765b9ce4a8d5f96","src/tempdir.rs":"4993460e81f7df6398e0f2b07cc3d81e728aa7e0559c7f3d83b6df1876bc3776","src/terminal.rs":"85efb1df641730fa1981bac6fd65bd75f7d532bb8680a56e94d6d006eeb363e9","src/timerfd.rs":"fd3c52e3918d881c16cb1498f8f66253ee758275a6a66ed8eb11c78e69f69e55","src/write_zeroes.rs":"c2951bbdb3ab07727eda29e9a91a51e427fdf6fed0b611ea6a3732edbd9a1246"},"package":null} \ No newline at end of file diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/Cargo.toml b/vendor/git-bad78e1967b13e00/vmm-sys-util/Cargo.toml new file mode 100644 index 000000000..bb697b6c3 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "vmm-sys-util" +version = "0.1.0" +authors = ["Jing Liu "] +license = "Apache-2.0" + +[dependencies] +libc = ">=0.2.39" + diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/LICENSE-APACHE b/vendor/git-bad78e1967b13e00/vmm-sys-util/LICENSE-APACHE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/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/vendor/git-bad78e1967b13e00/vmm-sys-util/LICENSE-BSD-3-Clause b/vendor/git-bad78e1967b13e00/vmm-sys-util/LICENSE-BSD-3-Clause new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/LICENSE-BSD-3-Clause @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/README.md b/vendor/git-bad78e1967b13e00/vmm-sys-util/README.md new file mode 100644 index 000000000..383aa42db --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/README.md @@ -0,0 +1,2 @@ +# vmm-sys-util +This crate is a collection of modules that provides helpers and utilities. diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/errno.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/errno.rs new file mode 100644 index 000000000..89bbbb6b1 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/errno.rs @@ -0,0 +1,80 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::fmt::{Display, Formatter}; +use std::io; +use std::result; + +use libc::__errno_location; + +/// An error number, retrieved from [`errno`](http://man7.org/linux/man-pages/man3/errno.3.html), +/// set by a libc function that returned an error. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Error(i32); +pub type Result = result::Result; + +impl Error { + /// Constructs a new error with the given `errno`. + pub fn new(e: i32) -> Error { + Error(e) + } + + /// Constructs an error from the current `errno`. + /// + /// The result of this only has any meaning just after a libc call that returned a value + /// indicating `errno` was set. + pub fn last() -> Error { + Error(unsafe { *__errno_location() }) + } + + /// Gets the `errno` for this error. + pub fn errno(self) -> i32 { + self.0 + } +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + io::Error::from_raw_os_error(self.0).fmt(f) + } +} + +impl From for Error { + fn from(e: io::Error) -> Self { + Error::new(e.raw_os_error().unwrap_or_default()) + } +} + +/// Returns the last `errno` as a [`Result`] that is always an error. +/// +/// [`Result`]: type.Result.html +pub fn errno_result() -> Result { + Err(Error::last()) +} + +#[cfg(test)] +mod tests { + use super::*; + use libc; + use std::fs::File; + use std::io::{self, Write}; + use std::os::unix::io::FromRawFd; + + #[test] + pub fn test_invalid_fd() { + let mut file = unsafe { File::from_raw_fd(-1) }; + assert!(file.write(b"test").is_err()); + let last_err = errno_result::().unwrap_err(); + assert_eq!(last_err, Error::new(libc::EBADF)); + assert_eq!(last_err.errno(), libc::EBADF); + assert_eq!(last_err, Error::from(io::Error::last_os_error())); + assert_eq!(last_err, Error::last()); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/eventfd.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/eventfd.rs new file mode 100644 index 000000000..ff0542735 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/eventfd.rs @@ -0,0 +1,150 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::fs::File; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; +use std::{io, mem, result}; + +use libc::{c_void, dup, eventfd, read, write}; + +/// A safe wrapper around a Linux eventfd (man 2 eventfd). +pub struct EventFd { + eventfd: File, +} + +impl EventFd { + /// Creates a new blocking EventFd with an initial value. + /// + /// `flag`: The initial value. Refer to Linux eventfd(2). + pub fn new(flag: i32) -> result::Result { + // This is safe because eventfd merely allocated an eventfd for + // our process and we handle the error case. + let ret = unsafe { eventfd(0, flag) }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + // This is safe because we checked ret for success and know + // the kernel gave us an fd that we own. + Ok(EventFd { + eventfd: unsafe { File::from_raw_fd(ret) }, + }) + } + } + + /// Adds `v` to the eventfd's count, does not block if the result will overflow the count + pub fn write(&self, v: u64) -> result::Result<(), io::Error> { + // This is safe because we made this fd and the pointer we pass + // can not overflow because we give the syscall's size parameter properly. + let ret = unsafe { + write( + self.as_raw_fd(), + &v as *const u64 as *const c_void, + mem::size_of::(), + ) + }; + if ret <= 0 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } + } + + /// Tries to read from the eventfd, does not block if the counter is zero + pub fn read(&self) -> result::Result { + let mut buf: u64 = 0; + let ret = unsafe { + // This is safe because we made this fd and the pointer we + // pass can not overflow because we give the syscall's size parameter properly. + read( + self.as_raw_fd(), + &mut buf as *mut u64 as *mut c_void, + mem::size_of::(), + ) + }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + Ok(buf) + } + } + + /// Clones this EventFd, internally creating a new file descriptor. The new EventFd will share + /// the same underlying count within the kernel. + pub fn try_clone(&self) -> result::Result { + // This is safe because we made this fd and properly check that it returns without error. + let ret = unsafe { dup(self.as_raw_fd()) }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + // This is safe because we checked ret for success and know the kernel gave us an fd that we + // own. + Ok(EventFd { + eventfd: unsafe { File::from_raw_fd(ret) }, + }) + } + } +} + +impl AsRawFd for EventFd { + fn as_raw_fd(&self) -> RawFd { + self.eventfd.as_raw_fd() + } +} + +impl FromRawFd for EventFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + EventFd { + eventfd: File::from_raw_fd(fd), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::EFD_NONBLOCK; + + #[test] + fn test_new() { + EventFd::new(EFD_NONBLOCK).unwrap(); + EventFd::new(0).unwrap(); + } + + #[test] + fn test_read_write() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + evt.write(55).unwrap(); + assert_eq!(evt.read().unwrap(), 55); + } + + #[test] + fn test_write_overflow() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + evt.write(std::u64::MAX - 1).unwrap(); + let r = evt.write(1); + match r { + Err(ref inner) if inner.kind() == io::ErrorKind::WouldBlock => (), + _ => panic!("Unexpected"), + } + } + #[test] + fn test_read_nothing() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + let r = evt.read(); + match r { + Err(ref inner) if inner.kind() == io::ErrorKind::WouldBlock => (), + _ => panic!("Unexpected"), + } + } + #[test] + fn test_clone() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + let evt_clone = evt.try_clone().unwrap(); + evt.write(923).unwrap(); + assert_eq!(evt_clone.read().unwrap(), 923); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/file_traits.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/file_traits.rs new file mode 100644 index 000000000..a2fa77b87 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/file_traits.rs @@ -0,0 +1,39 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::fs::File; +use std::io::Result; + +/// A trait for flushing the contents of a file to disk. +/// This is equivalent to File's `sync_all` method, but +/// wrapped in a trait so that it can be implemented for +/// other types. +pub trait FileSync { + // Flush buffers related to this file to disk. + fn fsync(&mut self) -> Result<()>; +} + +impl FileSync for File { + fn fsync(&mut self) -> Result<()> { + self.sync_all() + } +} + +/// A trait for setting the size of a file. +/// This is equivalent to File's `set_len` method, but +/// wrapped in a trait so that it can be implemented for +/// other types. +pub trait FileSetLen { + // Set the size of this file. + // This is the moral equivalent of `ftruncate()`. + fn set_len(&self, _len: u64) -> Result<()>; +} + +impl FileSetLen for File { + fn set_len(&self, len: u64) -> Result<()> { + File::set_len(self, len) + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/ioctl.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/ioctl.rs new file mode 100644 index 000000000..0adc3b1d4 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/ioctl.rs @@ -0,0 +1,225 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +//! Macros and wrapper functions for dealing with ioctls. +use libc; +use std::os::raw::{c_int, c_uint, c_ulong, c_void}; +use std::os::unix::io::AsRawFd; + +/// Raw macro to declare the expression that calculates an ioctl number +#[macro_export] +macro_rules! ioctl_expr { + ($dir:expr, $ty:expr, $nr:expr, $size:expr) => { + (($dir << $crate::ioctl::_IOC_DIRSHIFT) + | ($ty << $crate::ioctl::_IOC_TYPESHIFT) + | ($nr << $crate::ioctl::_IOC_NRSHIFT) + | ($size << $crate::ioctl::_IOC_SIZESHIFT)) as ::std::os::raw::c_ulong + }; +} + +/// Raw macro to declare a function that returns an ioctl number. +#[macro_export] +macro_rules! ioctl_ioc_nr { + ($name:ident, $dir:expr, $ty:expr, $nr:expr, $size:expr) => { + #[allow(non_snake_case)] + #[allow(clippy::cast_lossless)] + pub fn $name() -> ::std::os::raw::c_ulong { + ioctl_expr!($dir, $ty, $nr, $size) + } + }; + ($name:ident, $dir:expr, $ty:expr, $nr:expr, $size:expr, $($v:ident),+) => { + #[allow(non_snake_case)] + #[allow(clippy::cast_lossless)] + pub fn $name($($v: ::std::os::raw::c_uint),+) -> ::std::os::raw::c_ulong { + ioctl_expr!($dir, $ty, $nr, $size) + } + }; +} + +/// Declare an ioctl that transfers no data. +#[macro_export] +macro_rules! ioctl_io_nr { + ($name:ident, $ty:expr, $nr:expr) => { + ioctl_ioc_nr!($name, $crate::ioctl::_IOC_NONE, $ty, $nr, 0); + }; + ($name:ident, $ty:expr, $nr:expr, $($v:ident),+) => { + ioctl_ioc_nr!($name, $crate::ioctl::_IOC_NONE, $ty, $nr, 0, $($v),+); + }; +} + +/// Declare an ioctl that reads data. +#[macro_export] +macro_rules! ioctl_ior_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +/// Declare an ioctl that writes data. +#[macro_export] +macro_rules! ioctl_iow_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +/// Declare an ioctl that reads and writes data. +#[macro_export] +macro_rules! ioctl_iowr_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ | $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ | $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +pub const _IOC_NRBITS: c_uint = 8; +pub const _IOC_TYPEBITS: c_uint = 8; +pub const _IOC_SIZEBITS: c_uint = 14; +pub const _IOC_DIRBITS: c_uint = 2; +pub const _IOC_NRMASK: c_uint = 255; +pub const _IOC_TYPEMASK: c_uint = 255; +pub const _IOC_SIZEMASK: c_uint = 16383; +pub const _IOC_DIRMASK: c_uint = 3; +pub const _IOC_NRSHIFT: c_uint = 0; +pub const _IOC_TYPESHIFT: c_uint = 8; +pub const _IOC_SIZESHIFT: c_uint = 16; +pub const _IOC_DIRSHIFT: c_uint = 30; +pub const _IOC_NONE: c_uint = 0; +pub const _IOC_WRITE: c_uint = 1; +pub const _IOC_READ: c_uint = 2; +pub const IOC_IN: c_uint = 1_073_741_824; +pub const IOC_OUT: c_uint = 2_147_483_648; +pub const IOC_INOUT: c_uint = 3_221_225_472; +pub const IOCSIZE_MASK: c_uint = 1_073_676_288; +pub const IOCSIZE_SHIFT: c_uint = 16; + +// The type of the `req` parameter is different for the `musl` library. This will enable +// successful build for other non-musl libraries. +#[cfg(target_env = "musl")] +type IoctlRequest = c_int; +#[cfg(not(target_env = "musl"))] +type IoctlRequest = c_ulong; + +/// Run an ioctl with no arguments. +pub unsafe fn ioctl(fd: &F, req: c_ulong) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, 0) +} + +/// Run an ioctl with a single value argument. +pub unsafe fn ioctl_with_val(fd: &F, req: c_ulong, arg: c_ulong) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg) +} + +/// Run an ioctl with an immutable reference. +pub unsafe fn ioctl_with_ref(fd: &F, req: c_ulong, arg: &T) -> c_int { + libc::ioctl( + fd.as_raw_fd(), + req as IoctlRequest, + arg as *const T as *const c_void, + ) +} + +/// Run an ioctl with a mutable reference. +pub unsafe fn ioctl_with_mut_ref(fd: &F, req: c_ulong, arg: &mut T) -> c_int { + libc::ioctl( + fd.as_raw_fd(), + req as IoctlRequest, + arg as *mut T as *mut c_void, + ) +} + +/// Run an ioctl with a raw pointer. +pub unsafe fn ioctl_with_ptr(fd: &F, req: c_ulong, arg: *const T) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg as *const c_void) +} + +/// Run an ioctl with a mutable raw pointer. +pub unsafe fn ioctl_with_mut_ptr(fd: &F, req: c_ulong, arg: *mut T) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg as *mut c_void) +} + +#[cfg(test)] +mod tests { + const TUNTAP: ::std::os::raw::c_uint = 0x54; + const VHOST: ::std::os::raw::c_uint = 0xAF; + const EVDEV: ::std::os::raw::c_uint = 0x45; + + const KVMIO: ::std::os::raw::c_uint = 0xAE; + + ioctl_io_nr!(KVM_CREATE_VM, KVMIO, 0x01); + ioctl_ior_nr!(TUNGETFEATURES, TUNTAP, 0xcf, ::std::os::raw::c_uint); + ioctl_iow_nr!(TUNSETQUEUE, TUNTAP, 0xd9, ::std::os::raw::c_int); + ioctl_io_nr!(VHOST_SET_OWNER, VHOST, 0x01); + ioctl_iowr_nr!(VHOST_GET_VRING_BASE, VHOST, 0x12, ::std::os::raw::c_int); + ioctl_iowr_nr!(KVM_GET_MSR_INDEX_LIST, KVMIO, 0x2, ::std::os::raw::c_int); + + ioctl_ior_nr!(EVIOCGBIT, EVDEV, 0x20 + evt, [u8; 128], evt); + ioctl_io_nr!(FAKE_IOCTL_2_ARG, EVDEV, 0x01 + x + y, x, y); + + #[test] + fn test_ioctl_macros() { + assert_eq!(0x0000_AE01, KVM_CREATE_VM()); + assert_eq!(0x0000_AF01, VHOST_SET_OWNER()); + assert_eq!(0x8004_54CF, TUNGETFEATURES()); + assert_eq!(0x4004_54D9, TUNSETQUEUE()); + assert_eq!(0xC004_AE02, KVM_GET_MSR_INDEX_LIST()); + assert_eq!(0xC004_AF12, VHOST_GET_VRING_BASE()); + + assert_eq!(0x8080_4522, EVIOCGBIT(2)); + assert_eq!(0x0000_4509, FAKE_IOCTL_2_ARG(3, 5)); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/lib.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/lib.rs new file mode 100644 index 000000000..883e4a53d --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/lib.rs @@ -0,0 +1,78 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +extern crate libc; + +mod tempdir; + +#[macro_use] +pub mod ioctl; + +pub mod errno; +pub mod eventfd; +pub mod file_traits; +pub mod seek_hole; +pub mod signal; +pub mod terminal; +pub mod timerfd; +pub mod write_zeroes; + +#[macro_use] +pub mod syslog; + +pub mod poll; + +pub use crate::tempdir::*; +pub use errno::*; +pub use eventfd::*; +pub use poll::*; + +use std::os::unix::io::AsRawFd; + +pub use crate::file_traits::{FileSetLen, FileSync}; +pub use crate::seek_hole::SeekHole; +pub use crate::write_zeroes::{PunchHole, WriteZeroes}; + +pub enum FallocateMode { + PunchHole, + ZeroRange, +} + +/// Safe wrapper for `fallocate()`. +pub fn fallocate( + file: &dyn AsRawFd, + mode: FallocateMode, + keep_size: bool, + offset: u64, + len: u64, +) -> Result<()> { + let offset = if offset > libc::off64_t::max_value() as u64 { + return Err(Error::new(libc::EINVAL)); + } else { + offset as libc::off64_t + }; + + let len = if len > libc::off64_t::max_value() as u64 { + return Err(Error::new(libc::EINVAL)); + } else { + len as libc::off64_t + }; + + let mut mode = match mode { + FallocateMode::PunchHole => libc::FALLOC_FL_PUNCH_HOLE, + FallocateMode::ZeroRange => libc::FALLOC_FL_ZERO_RANGE, + }; + + if keep_size { + mode |= libc::FALLOC_FL_KEEP_SIZE; + } + + // Safe since we pass in a valid fd and fallocate mode, validate offset and len, + // and check the return value. + let ret = unsafe { libc::fallocate64(file.as_raw_fd(), mode, offset, len) }; + if ret < 0 { + errno_result() + } else { + Ok(()) + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/poll.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/poll.rs new file mode 100644 index 000000000..4eb49a429 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/poll.rs @@ -0,0 +1,711 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::cell::{Cell, Ref, RefCell}; +use std::cmp::min; +use std::fs::File; +use std::i32; +use std::i64; +use std::marker::PhantomData; +use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; +use std::ptr::null_mut; +use std::slice; +use std::thread; +use std::time::Duration; + +use libc::{ + c_int, epoll_create1, epoll_ctl, epoll_event, epoll_wait, EINTR, EPOLLHUP, EPOLLIN, EPOLLOUT, + EPOLL_CLOEXEC, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD, +}; + +use crate::{errno_result, Error, Result}; + +macro_rules! handle_eintr_errno { + ($x:expr) => {{ + let mut res; + loop { + res = $x; + if res != -1 || Error::last() != Error::new(EINTR) { + break; + } + } + res + }}; +} + +const POLL_CONTEXT_MAX_EVENTS: usize = 16; + +/// EpollEvents wraps raw epoll_events, it should only be used with EpollContext. +pub struct EpollEvents(RefCell<[epoll_event; POLL_CONTEXT_MAX_EVENTS]>); + +impl EpollEvents { + pub fn new() -> EpollEvents { + EpollEvents(RefCell::new( + [epoll_event { events: 0, u64: 0 }; POLL_CONTEXT_MAX_EVENTS], + )) + } +} + +impl Default for EpollEvents { + fn default() -> Self { + Self::new() + } +} + +/// Trait for a token that can be associated with an `fd` in a `PollContext`. +/// +/// Simple enums that have no or primitive variant data can use the `#[derive(PollToken)]` +/// custom derive to implement this trait. +pub trait PollToken { + /// Converts this token into a u64 that can be turned back into a token via `from_raw_token`. + fn as_raw_token(&self) -> u64; + + /// Converts a raw token as returned from `as_raw_token` back into a token. + /// + /// It is invalid to give a raw token that was not returned via `as_raw_token` from the same + /// `Self`. The implementation can expect that this will never happen as a result of its usage + /// in `PollContext`. + fn from_raw_token(data: u64) -> Self; +} + +impl PollToken for usize { + fn as_raw_token(&self) -> u64 { + *self as u64 + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u64 { + fn as_raw_token(&self) -> u64 { + *self as u64 + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u32 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u16 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u8 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for () { + fn as_raw_token(&self) -> u64 { + 0 + } + + fn from_raw_token(_data: u64) -> Self {} +} + +/// An event returned by `PollContext::wait`. +pub struct PollEvent<'a, T> { + event: &'a epoll_event, + token: PhantomData, // Needed to satisfy usage of T +} + +impl<'a, T: PollToken> PollEvent<'a, T> { + /// Gets the token associated in `PollContext::add` with this event. + pub fn token(&self) -> T { + T::from_raw_token(self.event.u64) + } + + /// True if the `fd` associated with this token in `PollContext::add` is readable. + pub fn readable(&self) -> bool { + self.event.events & (EPOLLIN as u32) != 0 + } + + /// True if the `fd` associated with this token in `PollContext::add` has been hungup on. + pub fn hungup(&self) -> bool { + self.event.events & (EPOLLHUP as u32) != 0 + } +} + +/// An iterator over some (sub)set of events returned by `PollContext::wait`. +pub struct PollEventIter<'a, I, T> +where + I: Iterator, +{ + mask: u32, + iter: I, + tokens: PhantomData<[T]>, // Needed to satisfy usage of T +} + +impl<'a, I, T> Iterator for PollEventIter<'a, I, T> +where + I: Iterator, + T: PollToken, +{ + type Item = PollEvent<'a, T>; + fn next(&mut self) -> Option { + let mask = self.mask; + self.iter + .find(|event| (event.events & mask) != 0) + .map(|event| PollEvent { + event, + token: PhantomData, + }) + } +} + +/// The list of event returned by `PollContext::wait`. +pub struct PollEvents<'a, T> { + count: usize, + events: Ref<'a, [epoll_event; POLL_CONTEXT_MAX_EVENTS]>, + tokens: PhantomData<[T]>, // Needed to satisfy usage of T +} + +impl<'a, T: PollToken> PollEvents<'a, T> { + /// Copies the events to an owned structure so the reference to this (and by extension + /// `PollContext`) can be dropped. + pub fn to_owned(&self) -> PollEventsOwned { + PollEventsOwned { + count: self.count, + events: RefCell::new(*self.events), + tokens: PhantomData, + } + } + + /// Iterates over each event. + pub fn iter(&self) -> PollEventIter, T> { + PollEventIter { + mask: 0xffff_ffff, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } + + /// Iterates over each readable event. + pub fn iter_readable(&self) -> PollEventIter, T> { + PollEventIter { + mask: EPOLLIN as u32, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } + + /// Iterates over each hungup event. + pub fn iter_hungup(&self) -> PollEventIter, T> { + PollEventIter { + mask: EPOLLHUP as u32, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } +} + +/// A deep copy of the event records from `PollEvents`. +pub struct PollEventsOwned { + count: usize, + events: RefCell<[epoll_event; POLL_CONTEXT_MAX_EVENTS]>, + tokens: PhantomData, // Needed to satisfy usage of T +} + +impl PollEventsOwned { + /// Takes a reference to the events so that they can be iterated via methods in `PollEvents`. + pub fn as_ref(&self) -> PollEvents { + PollEvents { + count: self.count, + events: self.events.borrow(), + tokens: PhantomData, + } + } +} + +/// Watching events taken by PollContext. +pub struct WatchingEvents(u32); + +impl WatchingEvents { + /// Returns empty Events. + #[inline(always)] + pub fn empty() -> WatchingEvents { + WatchingEvents(0) + } + + /// Build Events from raw epoll events (defined in epoll_ctl(2)). + #[inline(always)] + pub fn new(raw: u32) -> WatchingEvents { + WatchingEvents(raw) + } + + /// Set read events. + #[inline(always)] + pub fn set_read(self) -> WatchingEvents { + WatchingEvents(self.0 | EPOLLIN as u32) + } + + /// Set write events. + #[inline(always)] + pub fn set_write(self) -> WatchingEvents { + WatchingEvents(self.0 | EPOLLOUT as u32) + } + + /// Get the underlying epoll events. + pub fn get_raw(&self) -> u32 { + self.0 + } +} + +/// EpollContext wraps linux epoll. It provides similar interface to PollContext. +/// It is thread safe while PollContext is not. It requires user to pass in a reference of +/// EpollEvents while PollContext does not. Always use PollContext if you don't need to access the +/// same epoll from different threads. +pub struct EpollContext { + epoll_ctx: File, + // Needed to satisfy usage of T + tokens: PhantomData<[T]>, +} + +impl EpollContext { + /// Creates a new `EpollContext`. + pub fn new() -> Result> { + // Safe because we check the return value. + let epoll_fd = unsafe { epoll_create1(EPOLL_CLOEXEC) }; + if epoll_fd < 0 { + return errno_result(); + } + Ok(EpollContext { + epoll_ctx: unsafe { File::from_raw_fd(epoll_fd) }, + tokens: PhantomData, + }) + } + + /// Adds the given `fd` to this context and associates the given `token` with the `fd`'s + /// readable events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add(&self, fd: &AsRawFd, token: T) -> Result<()> { + self.add_fd_with_events(fd, WatchingEvents::empty().set_read(), token) + } + + /// Adds the given `fd` to this context, watching for the specified events and associates the + /// given 'token' with those events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add_fd_with_events(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + let mut evt = epoll_event { + events: events.get_raw(), + u64: token.as_raw_token(), + }; + // Safe because we give a valid epoll FD and FD to watch, as well as a valid epoll_event + // structure. Then we check the return value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_ADD, + fd.as_raw_fd(), + &mut evt, + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// If `fd` was previously added to this context, the watched events will be replaced with + /// `events` and the token associated with it will be replaced with the given `token`. + pub fn modify(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + let mut evt = epoll_event { + events: events.0, + u64: token.as_raw_token(), + }; + // Safe because we give a valid epoll FD and FD to modify, as well as a valid epoll_event + // structure. Then we check the return value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_MOD, + fd.as_raw_fd(), + &mut evt, + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// Deletes the given `fd` from this context. + /// + /// If an `fd`'s token shows up in the list of hangup events, it should be removed using this + /// method or by closing/dropping (if and only if the fd was never dup()'d/fork()'d) the `fd`. + /// Failure to do so will cause the `wait` method to always return immediately, causing ~100% + /// CPU load. + pub fn delete(&self, fd: &AsRawFd) -> Result<()> { + // Safe because we give a valid epoll FD and FD to stop watching. Then we check the return + // value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_DEL, + fd.as_raw_fd(), + null_mut(), + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// Waits for any events to occur in FDs that were previously added to this context. + /// + /// The events are level-triggered, meaning that if any events are unhandled (i.e. not reading + /// for readable events and not closing for hungup events), subsequent calls to `wait` will + /// return immediately. The consequence of not handling an event perpetually while calling + /// `wait` is that the callers loop will degenerated to busy loop polling, pinning a CPU to + /// ~100% usage. + pub fn wait<'a>(&self, events: &'a EpollEvents) -> Result> { + self.wait_timeout(events, Duration::new(i64::MAX as u64, 0)) + } + + /// Like `wait` except will only block for a maximum of the given `timeout`. + /// + /// This may return earlier than `timeout` with zero events if the duration indicated exceeds + /// system limits. + pub fn wait_timeout<'a>( + &self, + events: &'a EpollEvents, + timeout: Duration, + ) -> Result> { + let timeout_millis = if timeout.as_secs() as i64 == i64::max_value() { + // We make the convenient assumption that 2^63 seconds is an effectively unbounded time + // frame. This is meant to mesh with `wait` calling us with no timeout. + -1 + } else { + // In cases where we the number of milliseconds would overflow an i32, we substitute the + // maximum timeout which is ~24.8 days. + let millis = timeout + .as_secs() + .checked_mul(1_000) + .and_then(|ms| ms.checked_add(u64::from(timeout.subsec_nanos()) / 1_000_000)) + .unwrap_or(i32::max_value() as u64); + min(i32::max_value() as u64, millis) as i32 + }; + let ret = { + let mut epoll_events = events.0.borrow_mut(); + let max_events = epoll_events.len() as c_int; + // Safe because we give an epoll context and a properly sized epoll_events array + // pointer, which we trust the kernel to fill in properly. + unsafe { + handle_eintr_errno!(epoll_wait( + self.epoll_ctx.as_raw_fd(), + &mut epoll_events[0], + max_events, + timeout_millis + )) + } + }; + if ret < 0 { + return errno_result(); + } + let epoll_events = events.0.borrow(); + let events = PollEvents { + count: ret as usize, + events: epoll_events, + tokens: PhantomData, + }; + Ok(events) + } +} + +impl AsRawFd for EpollContext { + fn as_raw_fd(&self) -> RawFd { + self.epoll_ctx.as_raw_fd() + } +} + +impl IntoRawFd for EpollContext { + fn into_raw_fd(self) -> RawFd { + self.epoll_ctx.into_raw_fd() + } +} + +/// Used to poll multiple objects that have file descriptors. +/// +/// # Example +/// +/// ``` +/// # use vmm_sys_util::{Result, EventFd, PollContext, PollEvents}; +/// # fn test() -> Result<()> { +/// let evt1 = EventFd::new(0)?; +/// let evt2 = EventFd::new(0)?; +/// evt2.write(1)?; +/// +/// let ctx: PollContext = PollContext::new()?; +/// ctx.add(&evt1, 1)?; +/// ctx.add(&evt2, 2)?; +/// +/// let pollevents: PollEvents = ctx.wait()?; +/// let tokens: Vec = pollevents.iter_readable().map(|e| e.token()).collect(); +/// assert_eq!(&tokens[..], &[2]); +/// # Ok(()) +/// # } +/// ``` +pub struct PollContext { + epoll_ctx: EpollContext, + + // We use a RefCell here so that the `wait` method only requires an immutable self reference + // while returning the events (encapsulated by PollEvents). Without the RefCell, `wait` would + // hold a mutable reference that lives as long as its returned reference (i.e. the PollEvents), + // even though that reference is immutable. This is terribly inconvenient for the caller because + // the borrow checking would prevent them from using `delete` and `add` while the events are in + // scope. + events: EpollEvents, + + // Hangup busy loop detection variables. See `check_for_hungup_busy_loop`. + hangups: Cell, + max_hangups: Cell, +} + +impl PollContext { + /// Creates a new `PollContext`. + pub fn new() -> Result> { + Ok(PollContext { + epoll_ctx: EpollContext::new()?, + events: EpollEvents::new(), + hangups: Cell::new(0), + max_hangups: Cell::new(0), + }) + } + + /// Adds the given `fd` to this context and associates the given `token` with the `fd`'s + /// readable events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add(&self, fd: &AsRawFd, token: T) -> Result<()> { + self.add_fd_with_events(fd, WatchingEvents::empty().set_read(), token) + } + + /// Adds the given `fd` to this context, watching for the specified events and associates the + /// given 'token' with those events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add_fd_with_events(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + self.epoll_ctx.add_fd_with_events(fd, events, token)?; + self.hangups.set(0); + self.max_hangups.set(self.max_hangups.get() + 1); + Ok(()) + } + + /// If `fd` was previously added to this context, the watched events will be replaced with + /// `events` and the token associated with it will be replaced with the given `token`. + pub fn modify(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + self.epoll_ctx.modify(fd, events, token) + } + + /// Deletes the given `fd` from this context. + /// + /// If an `fd`'s token shows up in the list of hangup events, it should be removed using this + /// method or by closing/dropping (if and only if the fd was never dup()'d/fork()'d) the `fd`. + /// Failure to do so will cause the `wait` method to always return immediately, causing ~100% + /// CPU load. + pub fn delete(&self, fd: &AsRawFd) -> Result<()> { + self.epoll_ctx.delete(fd)?; + self.hangups.set(0); + self.max_hangups.set(self.max_hangups.get() - 1); + Ok(()) + } + + // This method determines if the the user of wait is misusing the `PollContext` by leaving FDs + // in this `PollContext` that have been shutdown or hungup on. Such an FD will cause `wait` to + // return instantly with a hungup event. If that FD is perpetually left in this context, a busy + // loop burning ~100% of one CPU will silently occur with no human visible malfunction. + // + // How do we know if the client of this context is ignoring hangups? A naive implementation + // would trigger if consecutive wait calls yield hangup events, but there are legitimate cases + // for this, such as two distinct sockets becoming hungup across two consecutive wait calls. A + // smarter implementation would only trigger if `delete` wasn't called between waits that + // yielded hangups. Sadly `delete` isn't the only way to remove an FD from this context. The + // other way is for the client to close the hungup FD, which automatically removes it from this + // context. Assuming that the client always uses close, this implementation would too eagerly + // trigger. + // + // The implementation used here keeps an upper bound of FDs in this context using a counter + // hooked into add/delete (which is imprecise because close can also remove FDs without us + // knowing). The number of consecutive (no add or delete in between) hangups yielded by wait + // calls is counted and compared to the upper bound. If the upper bound is exceeded by the + // consecutive hangups, the implementation triggers the check and logs. + // + // This implementation has false negatives because the upper bound can be completely too high, + // in the worst case caused by only using close instead of delete. However, this method has the + // advantage of always triggering eventually genuine busy loop cases, requires no dynamic + // allocations, is fast and constant time to compute, and has no false positives. + fn check_for_hungup_busy_loop(&self, new_hangups: usize) { + let old_hangups = self.hangups.get(); + let max_hangups = self.max_hangups.get(); + if old_hangups <= max_hangups && old_hangups + new_hangups > max_hangups { + warn!( + "busy poll wait loop with hungup FDs detected on thread {}", + thread::current().name().unwrap_or("") + ); + // This panic is helpful for tests of this functionality. + #[cfg(test)] + panic!("hungup busy loop detected"); + } + self.hangups.set(old_hangups + new_hangups); + } + + /// Waits for any events to occur in FDs that were previously added to this context. + /// + /// The events are level-triggered, meaning that if any events are unhandled (i.e. not reading + /// for readable events and not closing for hungup events), subsequent calls to `wait` will + /// return immediately. The consequence of not handling an event perpetually while calling + /// `wait` is that the callers loop will degenerated to busy loop polling, pinning a CPU to + /// ~100% usage. + /// + /// # Panics + /// Panics if the returned `PollEvents` structure is not dropped before subsequent `wait` calls. + pub fn wait(&self) -> Result> { + self.wait_timeout(Duration::new(i64::MAX as u64, 0)) + } + + /// Like `wait` except will only block for a maximum of the given `timeout`. + /// + /// This may return earlier than `timeout` with zero events if the duration indicated exceeds + /// system limits. + pub fn wait_timeout(&self, timeout: Duration) -> Result> { + let events = self.epoll_ctx.wait_timeout(&self.events, timeout)?; + let hangups = events.iter_hungup().count(); + self.check_for_hungup_busy_loop(hangups); + Ok(events) + } +} + +impl AsRawFd for PollContext { + fn as_raw_fd(&self) -> RawFd { + self.epoll_ctx.as_raw_fd() + } +} + +impl IntoRawFd for PollContext { + fn into_raw_fd(self) -> RawFd { + self.epoll_ctx.into_raw_fd() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::eventfd::EventFd; + use std::os::unix::net::UnixStream; + use std::time::Instant; + + #[test] + fn test_poll_context() { + let evt1 = EventFd::new(0).unwrap(); + let evt2 = EventFd::new(0).unwrap(); + evt1.write(1).unwrap(); + evt2.write(1).unwrap(); + let ctx: PollContext = PollContext::new().unwrap(); + ctx.add(&evt1, 1).unwrap(); + ctx.add(&evt2, 2).unwrap(); + + let mut evt_count = 0; + while evt_count < 2 { + for event in ctx.wait().unwrap().iter_readable() { + evt_count += 1; + match event.token() { + 1 => { + evt1.read().unwrap(); + ctx.delete(&evt1).unwrap(); + } + 2 => { + evt2.read().unwrap(); + ctx.delete(&evt2).unwrap(); + } + _ => panic!("unexpected token"), + }; + } + } + assert_eq!(evt_count, 2); + } + + #[test] + fn test_poll_context_overflow() { + const EVT_COUNT: usize = POLL_CONTEXT_MAX_EVENTS * 2 + 1; + let ctx: PollContext = PollContext::new().unwrap(); + let mut evts = Vec::with_capacity(EVT_COUNT); + for i in 0..EVT_COUNT { + let evt = EventFd::new(0).unwrap(); + evt.write(1).unwrap(); + ctx.add(&evt, i).unwrap(); + evts.push(evt); + } + let mut evt_count = 0; + while evt_count < EVT_COUNT { + for event in ctx.wait().unwrap().iter_readable() { + evts[event.token()].read().unwrap(); + evt_count += 1; + } + } + } + + #[test] + #[should_panic] + fn test_poll_context_hungup() { + let (s1, s2) = UnixStream::pair().unwrap(); + let ctx: PollContext = PollContext::new().unwrap(); + ctx.add(&s1, 1).unwrap(); + + // Causes s1 to receive hangup events, which we purposefully ignore to trip the detection + // logic in `PollContext`. + drop(s2); + + // Should easily panic within this many iterations. + for _ in 0..1000 { + ctx.wait().unwrap(); + } + } + + #[test] + fn test_poll_context_timeout() { + let ctx: PollContext = PollContext::new().unwrap(); + let dur = Duration::from_millis(10); + let start_inst = Instant::now(); + ctx.wait_timeout(dur).unwrap(); + assert!(start_inst.elapsed() >= dur); + } + +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/seek_hole.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/seek_hole.rs new file mode 100644 index 000000000..12ac2e9bb --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/seek_hole.rs @@ -0,0 +1,215 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::fs::File; +use std::io::{Error, Result}; +use std::os::unix::io::AsRawFd; + +#[cfg(target_env = "musl")] +use libc::{c_int, lseek64, ENXIO}; + +#[cfg(target_env = "gnu")] +use libc::{lseek64, ENXIO, SEEK_DATA, SEEK_HOLE}; + +/// A trait for seeking to the next hole or non-hole position in a file. +pub trait SeekHole { + /// Seek to the first hole in a file at a position greater than or equal to `offset`. + /// If no holes exist after `offset`, the seek position will be set to the end of the file. + /// If `offset` is at or after the end of the file, the seek position is unchanged, and None is returned. + /// Returns the current seek position after the seek or an error. + fn seek_hole(&mut self, offset: u64) -> Result>; + + /// Seek to the first data in a file at a position greater than or equal to `offset`. + /// If no data exists after `offset`, the seek position is unchanged, and None is returned. + /// Returns the current offset after the seek or an error. + fn seek_data(&mut self, offset: u64) -> Result>; +} + +#[cfg(target_env = "musl")] +pub const SEEK_DATA: c_int = 3; +#[cfg(target_env = "musl")] +pub const SEEK_HOLE: c_int = 4; + +/// Safe wrapper for `libc::lseek64()` +fn lseek(file: &mut File, offset: i64, whence: i32) -> Result> { + // This is safe because we pass a known-good file descriptor. + let res = unsafe { lseek64(file.as_raw_fd(), offset, whence) }; + + if res < 0 { + // Convert ENXIO into None; pass any other error as-is. + let err = Error::last_os_error(); + if let Some(errno) = Error::raw_os_error(&err) { + if errno == ENXIO { + return Ok(None); + } + } + Err(err) + } else { + Ok(Some(res as u64)) + } +} + +impl SeekHole for File { + fn seek_hole(&mut self, offset: u64) -> Result> { + lseek(self, offset as i64, SEEK_HOLE) + } + + fn seek_data(&mut self, offset: u64) -> Result> { + lseek(self, offset as i64, SEEK_DATA) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::TempDir; + use std::fs::File; + use std::io::{Seek, SeekFrom, Write}; + use std::path::PathBuf; + + fn seek_cur(file: &mut File) -> u64 { + file.seek(SeekFrom::Current(0)).unwrap() + } + + #[test] + fn seek_data() { + let tempdir = TempDir::new("/tmp/seek_data_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("test_file"); + let mut file = File::create(&path).unwrap(); + + // Empty file + assert_eq!(file.seek_data(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // File with non-zero length consisting entirely of a hole + file.set_len(0x10000).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // seek_data at or after the end of the file should return None + assert_eq!(file.seek_data(0x10000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_data(0x10001).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x10000, 0x20000) + let b = [0x55u8; 0x10000]; + file.seek(SeekFrom::Start(0x10000)).unwrap(); + file.write_all(&b).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + + // seek_data within data should return the same offset + assert_eq!(file.seek_data(0x10000).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + assert_eq!(file.seek_data(0x10001).unwrap(), Some(0x10001)); + assert_eq!(seek_cur(&mut file), 0x10001); + assert_eq!(file.seek_data(0x1FFFF).unwrap(), Some(0x1FFFF)); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + + // Extend the file to add another hole after the data + file.set_len(0x30000).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + assert_eq!(file.seek_data(0x1FFFF).unwrap(), Some(0x1FFFF)); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + assert_eq!(file.seek_data(0x20000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + } + + #[test] + #[allow(clippy::cyclomatic_complexity)] + fn seek_hole() { + let tempdir = TempDir::new("/tmp/seek_hole_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("test_file"); + let mut file = File::create(&path).unwrap(); + + // Empty file + assert_eq!(file.seek_hole(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // File with non-zero length consisting entirely of a hole + file.set_len(0x10000).unwrap(); + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + + // seek_hole at or after the end of the file should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0x10001).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x10000, 0x20000) + let b = [0x55u8; 0x10000]; + file.seek(SeekFrom::Start(0x10000)).unwrap(); + file.write_all(&b).unwrap(); + + // seek_hole within a hole should return the same offset + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + + // seek_hole within data should return the next hole (EOF) + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10001).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + + // seek_hole at EOF after data should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Extend the file to add another hole after the data + file.set_len(0x30000).unwrap(); + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x20001)); + assert_eq!(seek_cur(&mut file), 0x20001); + + // seek_hole at EOF after a hole should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x30000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x20000, 0x30000) + file.seek(SeekFrom::Start(0x20000)).unwrap(); + file.write_all(&b).unwrap(); + + // seek_hole within [0x20000, 0x30000) should now find the hole at EOF + assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x30000)); + assert_eq!(seek_cur(&mut file), 0x30000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x30000)); + assert_eq!(seek_cur(&mut file), 0x30000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x30000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/signal.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/signal.rs new file mode 100644 index 000000000..71d88b723 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/signal.rs @@ -0,0 +1,420 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use libc::{ + c_int, c_void, pthread_kill, pthread_sigmask, pthread_t, sigaction, sigaddset, sigemptyset, + siginfo_t, sigismember, sigpending, sigset_t, sigtimedwait, timespec, EAGAIN, EINTR, EINVAL, + SIGHUP, SIGSYS, SIG_BLOCK, SIG_UNBLOCK, +}; + +use errno; +use std::fmt::{self, Display}; +use std::io; +use std::mem; +use std::os::unix::thread::JoinHandleExt; +use std::ptr::{null, null_mut}; +use std::result; +use std::thread::JoinHandle; + +#[derive(Debug)] +pub enum Error { + /// Couldn't create a sigset. + CreateSigset(errno::Error), + /// The wrapped signal has already been blocked. + SignalAlreadyBlocked(c_int), + /// Failed to check if the requested signal is in the blocked set already. + CompareBlockedSignals(errno::Error), + /// The signal could not be blocked. + BlockSignal(errno::Error), + /// The signal mask could not be retrieved. + RetrieveSignalMask(i32), + /// The signal could not be unblocked. + UnblockSignal(errno::Error), + /// Failed to wait for given signal. + ClearWaitPending(errno::Error), + /// Failed to get pending signals. + ClearGetPending(errno::Error), + /// Failed to check if given signal is in the set of pending signals. + ClearCheckPending(errno::Error), +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + match self { + CreateSigset(e) => write!(f, "couldn't create a sigset: {}", e), + SignalAlreadyBlocked(num) => write!(f, "signal {} already blocked", num), + CompareBlockedSignals(e) => write!( + f, + "failed to check whether requested signal is in the blocked set: {}", + e, + ), + BlockSignal(e) => write!(f, "signal could not be blocked: {}", e), + RetrieveSignalMask(errno) => write!( + f, + "failed to retrieve signal mask: {}", + io::Error::from_raw_os_error(*errno), + ), + UnblockSignal(e) => write!(f, "signal could not be unblocked: {}", e), + ClearWaitPending(e) => write!(f, "failed to wait for given signal: {}", e), + ClearGetPending(e) => write!(f, "failed to get pending signals: {}", e), + ClearCheckPending(e) => write!( + f, + "failed to check whether given signal is in the pending set: {}", + e, + ), + } + } +} + +pub type SignalResult = result::Result; +type SiginfoHandler = extern "C" fn(num: c_int, info: *mut siginfo_t, _unused: *mut c_void) -> (); + +pub enum SignalHandler { + Siginfo(SiginfoHandler), + // TODO add a`SimpleHandler` when `libc` adds `sa_handler` support to `sigaction`. +} + +impl SignalHandler { + fn set_flags(act: &mut sigaction, flag: c_int) { + act.sa_flags = flag; + } +} +/// Fills a `sigaction` structure from of the signal handler. +/// Refer to http://man7.org/linux/man-pages/man7/signal.7.html +impl Into for SignalHandler { + fn into(self) -> sigaction { + let mut act: sigaction = unsafe { mem::zeroed() }; + match self { + SignalHandler::Siginfo(function) => { + act.sa_sigaction = function as *const () as usize; + } + } + act + } +} + +extern "C" { + fn __libc_current_sigrtmin() -> c_int; + fn __libc_current_sigrtmax() -> c_int; +} + +/// Returns the minimum (inclusive) real-time signal number. +#[allow(non_snake_case)] +fn SIGRTMIN() -> c_int { + unsafe { __libc_current_sigrtmin() } +} + +/// Returns the maximum (inclusive) real-time signal number. +#[allow(non_snake_case)] +fn SIGRTMAX() -> c_int { + unsafe { __libc_current_sigrtmax() } +} + +/// Verifies that a signal number is valid: for VCPU signals, it needs to be enclosed within the OS +/// limits for realtime signals, and the remaining ones need to be between the minimum (SIGHUP) and +/// maximum (SIGSYS) values. +pub fn validate_signal_num(num: c_int, for_vcpu: bool) -> errno::Result { + if for_vcpu { + let actual_num = num + SIGRTMIN(); + if actual_num <= SIGRTMAX() { + return Ok(actual_num); + } + } else if SIGHUP <= num && num <= SIGSYS { + return Ok(num); + } + Err(errno::Error::new(EINVAL)) +} + +/// Registers `handler` as the signal handler of signum `num`. +/// +/// Uses `sigaction` to register the handler. +/// +/// This is considered unsafe because the given handler will be called asynchronously, interrupting +/// whatever the thread was doing and therefore must only do async-signal-safe operations. +/// flags: SA_SIGINFO or SA_RESTART if wants to restart after signal received. +pub unsafe fn register_signal_handler( + num: i32, + handler: SignalHandler, + for_vcpu: bool, + flag: c_int, +) -> errno::Result<()> { + let num = validate_signal_num(num, for_vcpu)?; + let mut act: sigaction = handler.into(); + SignalHandler::set_flags(&mut act, flag); + match sigaction(num, &act, null_mut()) { + 0 => Ok(()), + _ => errno::errno_result(), + } +} + +/// Creates `sigset` from an array of signal numbers. +/// +/// This is a helper function used when we want to manipulate signals. +pub fn create_sigset(signals: &[c_int]) -> errno::Result { + // sigset will actually be initialized by sigemptyset below. + let mut sigset: sigset_t = unsafe { mem::zeroed() }; + + // Safe - return value is checked. + let ret = unsafe { sigemptyset(&mut sigset) }; + if ret < 0 { + return errno::errno_result(); + } + + for signal in signals { + // Safe - return value is checked. + let ret = unsafe { sigaddset(&mut sigset, *signal) }; + if ret < 0 { + return errno::errno_result(); + } + } + + Ok(sigset) +} + +/// Retrieves the signal mask of the current thread as a vector of c_ints. +pub fn get_blocked_signals() -> SignalResult> { + let mut mask = Vec::new(); + + // Safe - return values are checked. + unsafe { + let mut old_sigset: sigset_t = mem::zeroed(); + let ret = pthread_sigmask(SIG_BLOCK, null(), &mut old_sigset as *mut sigset_t); + if ret < 0 { + return Err(Error::RetrieveSignalMask(ret)); + } + + for num in 0..=SIGRTMAX() { + if sigismember(&old_sigset, num) > 0 { + mask.push(num); + } + } + } + + Ok(mask) +} + +/// Masks given signal. +/// +/// If signal is already blocked the call will fail with Error::SignalAlreadyBlocked +/// result. +pub fn block_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + // Safe - return values are checked. + unsafe { + let mut old_sigset: sigset_t = mem::zeroed(); + let ret = pthread_sigmask(SIG_BLOCK, &sigset, &mut old_sigset as *mut sigset_t); + if ret < 0 { + return Err(Error::BlockSignal(errno::Error::last())); + } + let ret = sigismember(&old_sigset, num); + if ret < 0 { + return Err(Error::CompareBlockedSignals(errno::Error::last())); + } else if ret > 0 { + return Err(Error::SignalAlreadyBlocked(num)); + } + } + Ok(()) +} + +/// Unmasks given signal. +pub fn unblock_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + // Safe - return value is checked. + let ret = unsafe { pthread_sigmask(SIG_UNBLOCK, &sigset, null_mut()) }; + if ret < 0 { + return Err(Error::UnblockSignal(errno::Error::last())); + } + Ok(()) +} + +/// Clears pending signal. +pub fn clear_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + while { + // This is safe as we are rigorously checking return values + // of libc calls. + unsafe { + let mut siginfo: siginfo_t = mem::zeroed(); + let ts = timespec { + tv_sec: 0, + tv_nsec: 0, + }; + // Attempt to consume one instance of pending signal. If signal + // is not pending, the call will fail with EAGAIN or EINTR. + let ret = sigtimedwait(&sigset, &mut siginfo, &ts); + if ret < 0 { + let e = errno::Error::last(); + match e.errno() { + EAGAIN | EINTR => {} + _ => { + return Err(Error::ClearWaitPending(errno::Error::last())); + } + } + } + + // This sigset will be actually filled with `sigpending` call. + let mut chkset: sigset_t = mem::zeroed(); + // See if more instances of the signal are pending. + let ret = sigpending(&mut chkset); + if ret < 0 { + return Err(Error::ClearGetPending(errno::Error::last())); + } + + let ret = sigismember(&chkset, num); + if ret < 0 { + return Err(Error::ClearCheckPending(errno::Error::last())); + } + + // This is do-while loop condition. + ret != 0 + } + } {} + + Ok(()) +} + +/// Trait for threads that can be signalled via `pthread_kill`. +/// +/// Note that this is only useful for signals between SIGRTMIN and SIGRTMAX because these are +/// guaranteed to not be used by the C runtime. +/// +/// This is marked unsafe because the implementation of this trait must guarantee that the returned +/// pthread_t is valid and has a lifetime at least that of the trait object. +pub unsafe trait Killable { + fn pthread_handle(&self) -> pthread_t; + + /// Sends the signal `num + SIGRTMIN` to this killable thread. + /// + /// The value of `num + SIGRTMIN` must not exceed `SIGRTMAX`. + fn kill(&self, num: i32) -> errno::Result<()> { + let num = validate_signal_num(num, true)?; + + // Safe because we ensure we are using a valid pthread handle, a valid signal number, and + // check the return result. + let ret = unsafe { pthread_kill(self.pthread_handle(), num) }; + if ret < 0 { + return errno::errno_result(); + } + Ok(()) + } +} + +// Safe because we fulfill our contract of returning a genuine pthread handle. +unsafe impl Killable for JoinHandle { + fn pthread_handle(&self) -> pthread_t { + self.as_pthread_t() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::SA_SIGINFO; + use std::thread; + use std::time::Duration; + + static mut SIGNAL_HANDLER_CALLED: bool = false; + + extern "C" fn handle_signal(_: c_int, _: *mut siginfo_t, _: *mut c_void) { + unsafe { + SIGNAL_HANDLER_CALLED = true; + } + } + + #[test] + fn test_register_signal_handler() { + unsafe { + // testing bad value + assert!(register_signal_handler( + SIGRTMAX(), + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + .is_err()); + format!( + "{:?}", + register_signal_handler( + SIGRTMAX(), + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + ); + assert!(register_signal_handler( + 0, + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + .is_ok()); + assert!(register_signal_handler( + libc::SIGSYS, + SignalHandler::Siginfo(handle_signal), + false, + SA_SIGINFO + ) + .is_ok()); + } + } + + #[test] + #[allow(clippy::empty_loop)] + fn test_killing_thread() { + let killable = thread::spawn(|| thread::current().id()); + let killable_id = killable.join().unwrap(); + assert_ne!(killable_id, thread::current().id()); + + // We install a signal handler for the specified signal; otherwise the whole process will + // be brought down when the signal is received, as part of the default behaviour. Signal + // handlers are global, so we install this before starting the thread. + unsafe { + register_signal_handler(0, SignalHandler::Siginfo(handle_signal), true, SA_SIGINFO) + .expect("failed to register vcpu signal handler"); + } + + let killable = thread::spawn(|| loop {}); + + let res = killable.kill(SIGRTMAX()); + assert!(res.is_err()); + format!("{:?}", res); + + unsafe { + assert!(!SIGNAL_HANDLER_CALLED); + } + + assert!(killable.kill(0).is_ok()); + + // We're waiting to detect that the signal handler has been called. + const MAX_WAIT_ITERS: u32 = 20; + let mut iter_count = 0; + loop { + thread::sleep(Duration::from_millis(100)); + + if unsafe { SIGNAL_HANDLER_CALLED } { + break; + } + + iter_count += 1; + // timeout if we wait too long + assert!(iter_count <= MAX_WAIT_ITERS); + } + + // Our signal handler doesn't do anything which influences the killable thread, so the + // previous signal is effectively ignored. If we were to join killable here, we would block + // forever as the loop keeps running. Since we don't join, the thread will become detached + // as the handle is dropped, and will be killed when the process/main thread exits. + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/syslog.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/syslog.rs new file mode 100644 index 000000000..d09b56a88 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/syslog.rs @@ -0,0 +1,643 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +//! Facilities for sending log message to syslog. +//! +//! Every function exported by this module is thread-safe. Each function will silently fail until +//! `syslog::init()` is called and returns `Ok`. +//! +//! # Examples +//! +//! ``` +//! #[macro_use] +//! extern crate vmm_sys_util; +//! +//! use vmm_sys_util::syslog::init; +//! fn main() { +//! if let Err(e) = init() { +//! println!("failed to initiailize syslog: {}", e); +//! return; +//! } +//! warn!("this is your {} warning", "final"); +//! error!("something went horribly wrong: {}", "out of RAMs"); +//! } +//! ``` + +use std::env; +use std::ffi::CString; +use std::ffi::{OsStr, OsString}; +use std::fmt::{self, Display}; +use std::fs::File; +use std::io; +use std::io::{stderr, Cursor, ErrorKind, Write}; +use std::mem; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; +use std::os::unix::net::UnixDatagram; +use std::path::PathBuf; +use std::ptr::null; +use std::str::from_utf8; +use std::sync::{Mutex as StdMutex, MutexGuard, Once, ONCE_INIT}; + +use libc::{ + c_char, c_long, closelog, fcntl, gethostname, localtime_r, openlog, pid_t, syscall, time, + time_t, tm, F_GETFD, LOG_NDELAY, LOG_PERROR, LOG_PID, LOG_USER, +}; + +/// Temporary define linux-x86_64 syscall value here. +#[allow(non_upper_case_globals)] +pub const SYS_getpid: c_long = 39; + +const SYSLOG_PATH: &str = "/dev/log"; + +/// The priority (i.e. severity) of a syslog message. +/// +/// See syslog man pages for information on their semantics. +#[derive(Copy, Clone, Debug)] +pub enum Priority { + Emergency = 0, + Alert = 1, + Critical = 2, + Error = 3, + Warning = 4, + Notice = 5, + Info = 6, + Debug = 7, +} + +impl fmt::Display for Priority { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Priority::Emergency => write!(f, "EMERGENCY"), + Priority::Alert => write!(f, "ALERT"), + Priority::Critical => write!(f, "CRITICAL"), + Priority::Error => write!(f, "ERROR"), + Priority::Warning => write!(f, "WARNING"), + Priority::Notice => write!(f, "NOTICE"), + Priority::Info => write!(f, "INFO"), + Priority::Debug => write!(f, "DEBUG"), + } + } +} + +/// The facility of a syslog message. +/// +/// See syslog man pages for information on their semantics. +pub enum Facility { + Kernel = 0, + User = 1 << 3, + Mail = 2 << 3, + Daemon = 3 << 3, + Auth = 4 << 3, + Syslog = 5 << 3, + Lpr = 6 << 3, + News = 7 << 3, + Uucp = 8 << 3, + Local0 = 16 << 3, + Local1 = 17 << 3, + Local2 = 18 << 3, + Local3 = 19 << 3, + Local4 = 20 << 3, + Local5 = 21 << 3, + Local6 = 22 << 3, + Local7 = 23 << 3, +} + +/// Errors returned by `syslog::init()`. +#[derive(Debug)] +pub enum Error { + /// Initialization was never attempted. + NeverInitialized, + /// Initialization has previously failed and can not be retried. + Poisoned, + /// Error while creating socket. + Socket(io::Error), + /// Error while attempting to connect socket. + Connect(io::Error), + // There was an error using `open` to get the lowest file descriptor. + GetLowestFd(io::Error), + // The guess of libc's file descriptor for the syslog connection was invalid. + InvalidFd, +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + match self { + NeverInitialized => write!(f, "initialization was never attempted"), + Poisoned => write!(f, "initialization previously failed and cannot be retried"), + Socket(e) => write!(f, "failed to create socket: {}", e), + Connect(e) => write!(f, "failed to connect socket: {}", e), + GetLowestFd(e) => write!(f, "failed to get lowest file descriptor: {}", e), + InvalidFd => write!(f, "guess of fd for syslog connection was invalid"), + } + } +} + +fn get_hostname() -> Result { + let mut hostname: [u8; 256] = [b'\0'; 256]; + // Safe because we give a valid pointer to a buffer of the indicated length and check for the + // result. + let ret = unsafe { gethostname(hostname.as_mut_ptr() as *mut c_char, hostname.len()) }; + if ret == -1 { + return Err(()); + } + + let len = hostname.iter().position(|&v| v == b'\0').ok_or(())?; + + Ok(from_utf8(&hostname[..len]).map_err(|_| ())?.to_string()) +} + +fn get_proc_name() -> Option { + env::args_os() + .next() + .map(PathBuf::from) + .and_then(|s| s.file_name().map(OsStr::to_os_string)) + .map(OsString::into_string) + .and_then(Result::ok) +} + +// Uses libc's openlog function to get a socket to the syslogger. By getting the socket this way, as +// opposed to connecting to the syslogger directly, libc's internal state gets initialized for other +// libraries (e.g. minijail) that make use of libc's syslog function. Note that this function +// depends on no other threads or signal handlers being active in this process because they might +// create FDs. +// +// TODO(zachr): Once https://android-review.googlesource.com/470998 lands, there won't be any +// libraries in use that hard depend on libc's syslogger. Remove this and go back to making the +// connection directly once minjail is ready. +fn openlog_and_get_socket() -> Result { + // closelog first in case there was already a file descriptor open. Safe because it takes no + // arguments and just closes an open file descriptor. Does nothing if the file descriptor + // was not already open. + unsafe { + closelog(); + } + + let file_path = CString::new("/dev/null").unwrap(); + unsafe { + // Ordinarily libc's FD for the syslog connection can't be accessed, but we can guess that the + // FD that openlog will be getting is the lowest unused FD. To guarantee that an FD is opened in + // this function we use the LOG_NDELAY to tell openlog to connect to the syslog now. To get the + // lowest unused FD, we open a dummy file (which the manual says will always return the lowest + // fd), and then close that fd. Voilà, we now know the lowest numbered FD. The call to openlog + // will make use of that FD, and then we just wrap a `UnixDatagram` around it for ease of use. + let fd = libc::open(file_path.as_ptr(), libc::O_RDONLY); + if fd < 0 { + let err = io::Error::last_os_error(); + return Err(Error::GetLowestFd(err)); + } + + // Safe because openlog accesses no pointers because `ident` is null, only valid flags are + // used, and it returns no error. + openlog(null(), LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_USER); + // For safety, ensure the fd we guessed is valid. The `fcntl` call itself only reads the + // file descriptor table of the current process, which is trivially safe. + if fcntl(fd, F_GETFD) >= 0 { + Ok(UnixDatagram::from_raw_fd(fd)) + } else { + Err(Error::InvalidFd) + } + } +} + +struct State { + stderr: bool, + socket: Option, + file: Option, + hostname: Option, + proc_name: Option, +} + +impl State { + fn new() -> Result { + let s = openlog_and_get_socket()?; + Ok(State { + stderr: true, + socket: Some(s), + file: None, + hostname: get_hostname().ok(), + proc_name: get_proc_name(), + }) + } +} + +static STATE_ONCE: Once = ONCE_INIT; +static mut STATE: *const StdMutex = 0 as *const _; + +fn new_mutex_ptr(inner: T) -> *const StdMutex { + Box::into_raw(Box::new(StdMutex::new(inner))) +} + +/// Initialize the syslog connection and internal variables. +/// +/// This should only be called once per process before any other threads have been spawned or any +/// signal handlers have been registered. Every call made after the first will have no effect +/// besides return `Ok` or `Err` appropriately. +pub fn init() -> Result<(), Error> { + let mut err = Error::Poisoned; + STATE_ONCE.call_once(|| match State::new() { + // Safe because STATE mutation is guarded by `Once`. + Ok(state) => unsafe { STATE = new_mutex_ptr(state) }, + Err(e) => err = e, + }); + + if unsafe { STATE.is_null() } { + Err(err) + } else { + Ok(()) + } +} + +fn lock() -> Result, Error> { + // Safe because we assume that STATE is always in either a valid or NULL state. + let state_ptr = unsafe { STATE }; + if state_ptr.is_null() { + return Err(Error::NeverInitialized); + } + // Safe because STATE only mutates once and we checked for NULL. + let state = unsafe { &*state_ptr }; + let guard = match state.lock() { + Ok(guard) => guard, + _ => panic!("mutex is poisoned"), + }; + Ok(guard) +} + +// Attempts to lock and retrieve the state. Returns from the function silently on failure. +macro_rules! lock { + () => { + match lock() { + Ok(s) => s, + _ => return, + }; + }; +} + +/// Replaces the hostname reported in each syslog message. +/// +/// The default hostname is whatever `gethostname()` returned when `vmm_sys_util::syslog::init()` was first +/// called. +/// +/// Does nothing if syslog was never initialized. +pub fn set_hostname>(hostname: T) { + let mut state = lock!(); + state.hostname = Some(hostname.into()); +} + +/// Replaces the process name reported in each syslog message. +/// +/// The default process name is the _file name_ of `argv[0]`. For example, if this program was +/// invoked as +/// +/// ```bash +/// $ path/to/app --delete everything +/// ``` +/// +/// the default process name would be _app_. +/// +/// Does nothing if syslog was never initialized. +pub fn set_proc_name>(proc_name: T) { + let mut state = lock!(); + state.proc_name = Some(proc_name.into()); +} + +/// Enables or disables echoing log messages to the syslog. +/// +/// The default behavior is **enabled**. +/// +/// If `enable` goes from `true` to `false`, the syslog connection is closed. The connection is +/// reopened if `enable` is set to `true` after it became `false`. +/// +/// Returns an error if syslog was never initialized or the syslog connection failed to be +/// established. +/// +/// # Arguments +/// * `enable` - `true` to enable echoing to syslog, `false` to disable echoing to syslog. +pub fn echo_syslog(enable: bool) -> Result<(), Error> { + let state_ptr = unsafe { STATE }; + if state_ptr.is_null() { + return Err(Error::NeverInitialized); + } + let mut state = lock().map_err(|_| Error::Poisoned)?; + + match state.socket.take() { + Some(_) if enable => {} + Some(s) => { + // Because `openlog_and_get_socket` actually just "borrows" the syslog FD, this module + // does not own the syslog connection and therefore should not destroy it. + mem::forget(s); + } + None if enable => { + let s = openlog_and_get_socket()?; + state.socket = Some(s); + } + _ => {} + } + Ok(()) +} + +/// Replaces the optional `File` to echo log messages to. +/// +/// The default behavior is to not echo to a file. Passing `None` to this function restores that +/// behavior. +/// +/// Does nothing if syslog was never initialized. +/// +/// # Arguments +/// * `file` - `Some(file)` to echo to `file`, `None` to disable echoing to the file previously passed to `echo_file`. +pub fn echo_file(file: Option) { + let mut state = lock!(); + state.file = file; +} + +/// Enables or disables echoing log messages to the `std::io::stderr()`. +/// +/// The default behavior is **enabled**. +/// +/// Does nothing if syslog was never initialized. +/// +/// # Arguments +/// * `enable` - `true` to enable echoing to stderr, `false` to disable echoing to stderr. +pub fn echo_stderr(enable: bool) { + let mut state = lock!(); + state.stderr = enable; +} + +/// Retrieves the file descriptors owned by the global syslogger. +/// +/// Does nothing if syslog was never initialized. If their are any file descriptors, they will be +/// pushed into `fds`. +/// +/// Note that the `stderr` file descriptor is never added, as it is not owned by syslog. +#[allow(clippy::redundant_closure)] +pub fn push_fds(fds: &mut Vec) { + let state = lock!(); + fds.extend(state.socket.iter().map(|s| s.as_raw_fd())); + fds.extend(state.file.iter().map(|f| f.as_raw_fd())); +} + +/// Should only be called after `init()` was called. +fn send_buf(socket: &UnixDatagram, buf: &[u8]) { + const SEND_RETRY: usize = 2; + + for _ in 0..SEND_RETRY { + match socket.send(&buf[..]) { + Ok(_) => break, + Err(e) => match e.kind() { + ErrorKind::ConnectionRefused + | ErrorKind::ConnectionReset + | ErrorKind::ConnectionAborted + | ErrorKind::NotConnected => { + let res = socket.connect(SYSLOG_PATH); + if res.is_err() { + break; + } + } + _ => {} + }, + } + } +} + +fn get_localtime() -> tm { + unsafe { + // Safe because tm is just a struct of plain data. + let mut tm: tm = mem::zeroed(); + let mut now: time_t = 0; + // Safe because we give time a valid pointer and can never fail. + time(&mut now as *mut _); + // Safe because we give localtime_r valid pointers and can never fail. + localtime_r(&now, &mut tm as *mut _); + tm + } +} + +/// Records a log message with the given details. +/// +/// Note that this will fail silently if syslog was not initialized. +/// +/// # Arguments +/// * `pri` - The `Priority` (i.e. severity) of the log message. +/// * `fac` - The `Facility` of the log message. Usually `Facility::User` should be used. +/// * `file_name` - Name of the file that generated the log. +/// * `line` - Line number within `file_name` that generated the log. +/// * `args` - The log's message to record, in the form of `format_args!()` return value +/// +/// # Examples +/// +/// ``` +/// # use vmm_sys_util::syslog::{init, log, Priority, Facility}; +/// # fn main() { +/// # if let Err(e) = init() { +/// # println!("failed to initiailize syslog: {}", e); +/// # return; +/// # } +/// log(Priority::Error, +/// Facility::User, +/// file!(), +/// line!(), +/// format_args!("hello syslog")); +/// # } +/// ``` +#[allow(clippy::redundant_closure)] +pub fn log(pri: Priority, fac: Facility, file_name: &str, line: u32, args: fmt::Arguments) { + const MONTHS: [&str; 12] = [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + ]; + + let mut state = lock!(); + let mut buf = [0u8; 1024]; + if let Some(ref socket) = state.socket { + let tm = get_localtime(); + let prifac = (pri as u8) | (fac as u8); + let (res, len) = { + let mut buf_cursor = Cursor::new(&mut buf[..]); + ( + write!( + &mut buf_cursor, + "<{}>{} {:02} {:02}:{:02}:{:02} {} {}[{}]: [{}:{}] {}", + prifac, + MONTHS[tm.tm_mon as usize], + tm.tm_mday, + tm.tm_hour, + tm.tm_min, + tm.tm_sec, + state.hostname.as_ref().map(|s| s.as_ref()).unwrap_or("-"), + state.proc_name.as_ref().map(|s| s.as_ref()).unwrap_or("-"), + unsafe { syscall(SYS_getpid as c_long) as pid_t }, + //getpid(), + file_name, + line, + args + ), + buf_cursor.position() as usize, + ) + }; + + if res.is_ok() { + send_buf(&socket, &buf[..len]); + } + } + + let (res, len) = { + let mut buf_cursor = Cursor::new(&mut buf[..]); + ( + writeln!(&mut buf_cursor, "[{}:{}:{}] {}", pri, file_name, line, args), + buf_cursor.position() as usize, + ) + }; + if res.is_ok() { + if let Some(ref mut file) = state.file { + let _ = file.write_all(&buf[..len]); + } + if state.stderr { + let _ = stderr().write_all(&buf[..len]); + } + } +} + +/// A macro for logging at an arbitrary priority level. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! log { + ($pri:expr, $($args:tt)+) => ({ + $crate::syslog::log($pri, $crate::syslog::Facility::User, file!(), line!(), format_args!($($args)+)) + }) +} + +/// A macro for logging an error. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! error { + ($($args:tt)+) => (log!($crate::syslog::Priority::Error, $($args)*)) +} + +/// A macro for logging a warning. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! warn { + ($($args:tt)+) => (log!($crate::syslog::Priority::Warning, $($args)*)) +} + +/// A macro for logging info. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! info { + ($($args:tt)+) => (log!($crate::syslog::Priority::Info, $($args)*)) +} + +/// A macro for logging debug information. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! debug { + ($($args:tt)+) => (log!($crate::syslog::Priority::Debug, $($args)*)) +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::{shm_open, shm_unlink, O_CREAT, O_EXCL, O_RDWR}; + + use std::ffi::CStr; + use std::io::{Read, Seek, SeekFrom}; + use std::os::unix::io::FromRawFd; + + #[test] + fn test_init_syslog() { + init().unwrap(); + } + + #[test] + fn test_fds() { + init().unwrap(); + let mut fds = Vec::new(); + push_fds(&mut fds); + assert!(!fds.is_empty()); + for fd in fds { + assert!(fd >= 0); + } + } + + #[test] + fn test_syslog_log() { + init().unwrap(); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("hello syslog"), + ); + } + + #[test] + fn test_proc_name() { + init().unwrap(); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("before proc name"), + ); + set_proc_name("sys_util-test"); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("after proc name"), + ); + } + + #[test] + #[allow(clippy::zero_prefixed_literal)] + fn test_syslog_file() { + init().unwrap(); + let shm_name = CStr::from_bytes_with_nul(b"/crosvm_shm\0").unwrap(); + let mut file = unsafe { + shm_unlink(shm_name.as_ptr()); + let fd = shm_open(shm_name.as_ptr(), O_RDWR | O_CREAT | O_EXCL, 0666); + assert!(fd >= 0, "error creating shared memory;"); + File::from_raw_fd(fd) + }; + + let syslog_file = file.try_clone().expect("error cloning shared memory file"); + echo_file(Some(syslog_file)); + + const TEST_STR: &str = "hello shared memory file"; + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("{}", TEST_STR), + ); + + file.seek(SeekFrom::Start(0)) + .expect("error seeking shared memory file"); + let mut buf = String::new(); + file.read_to_string(&mut buf) + .expect("error reading shared memory file"); + assert!(buf.contains(TEST_STR)); + } + + #[test] + fn test_macros() { + init().unwrap(); + error!("this is an error {}", 3); + warn!("this is a warning {}", "uh oh"); + info!("this is info {}", true); + debug!("this is debug info {:?}", Some("helpful stuff")); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/tempdir.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/tempdir.rs new file mode 100644 index 000000000..7256998e8 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/tempdir.rs @@ -0,0 +1,104 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::ffi::CString; +use std::ffi::OsStr; +use std::ffi::OsString; +use std::fs; +use std::os::unix::ffi::OsStringExt; +use std::path::Path; +use std::path::PathBuf; + +use libc; + +use crate::{errno_result, Result}; + +/// Create and remove a temporary directory. The directory will be maintained for the lifetime of +/// the `TempDir` object. +pub struct TempDir { + path: Option, +} + +impl TempDir { + /// Creates a new tempory directory. + /// The directory will be removed when the object goes out of scope. + /// + /// # Examples + /// + /// ``` + /// # use std::path::Path; + /// # use std::path::PathBuf; + /// # use vmm_sys_util::TempDir; + /// # fn test_create_temp_dir() -> Result<(), ()> { + /// let t = TempDir::new("/tmp/testdir").map_err(|_| ())?; + /// assert!(t.as_path().unwrap().exists()); + /// # Ok(()) + /// # } + /// ``` + pub fn new>(prefix: P) -> Result { + let mut dir_string = prefix.as_ref().to_os_string(); + dir_string.push("XXXXXX"); + // unwrap this result as the internal bytes can't have a null with a valid path. + let dir_name = CString::new(dir_string.into_vec()).unwrap(); + let mut dir_bytes = dir_name.into_bytes_with_nul(); + let ret = unsafe { + // Creating the directory isn't unsafe. The fact that it modifies the guts of the path + // is also OK because it only overwrites the last 6 Xs added above. + libc::mkdtemp(dir_bytes.as_mut_ptr() as *mut libc::c_char) + }; + if ret.is_null() { + return errno_result(); + } + dir_bytes.pop(); // Remove the null becasue from_vec can't handle it. + Ok(TempDir { + path: Some(PathBuf::from(OsString::from_vec(dir_bytes))), + }) + } + + /// Removes the temporary directory. Calling this is optional as dropping a `TempDir` object + /// will also remove the directory. Calling remove explicitly allows for better error handling. + pub fn remove(mut self) -> Result<()> { + let path = self.path.take(); + path.map_or(Ok(()), fs::remove_dir_all)?; + Ok(()) + } + + /// Returns the path to the tempdir if it is currently valid + pub fn as_path(&self) -> Option<&Path> { + self.path.as_ref().map(|ref p| p.as_path()) + } +} + +impl Drop for TempDir { + fn drop(&mut self) { + if let Some(ref p) = self.path { + // Nothing can be done here if this returns an error. + let _ = fs::remove_dir_all(p); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn create_dir() { + let t = TempDir::new("/tmp/asdf").unwrap(); + let path = t.as_path().unwrap(); + assert!(path.exists()); + assert!(path.is_dir()); + assert!(path.starts_with("/tmp/")); + } + + #[test] + fn remove_dir() { + let t = TempDir::new("/tmp/asdf").unwrap(); + let path = t.as_path().unwrap().to_owned(); + assert!(t.remove().is_ok()); + assert!(!path.exists()); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/terminal.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/terminal.rs new file mode 100644 index 000000000..2d6177d1d --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/terminal.rs @@ -0,0 +1,155 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::io::StdinLock; +use std::mem::zeroed; +use std::os::unix::io::RawFd; + +use libc::{ + c_int, fcntl, isatty, read, tcgetattr, tcsetattr, termios, ECHO, F_GETFL, F_SETFL, ICANON, + ISIG, O_NONBLOCK, STDIN_FILENO, TCSANOW, +}; + +use crate::errno::{errno_result, Result}; + +fn modify_mode(fd: RawFd, f: F) -> Result<()> { + // Safe because we check the return value of isatty. + if unsafe { isatty(fd) } != 1 { + return Ok(()); + } + + // The following pair are safe because termios gets totally overwritten by tcgetattr and we + // check the return result. + let mut termios: termios = unsafe { zeroed() }; + let ret = unsafe { tcgetattr(fd, &mut termios as *mut _) }; + if ret < 0 { + return errno_result(); + } + let mut new_termios = termios; + f(&mut new_termios); + // Safe because the syscall will only read the extent of termios and we check the return result. + let ret = unsafe { tcsetattr(fd, TCSANOW, &new_termios as *const _) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) +} + +fn get_flags(fd: RawFd) -> Result { + // Safe because no third parameter is expected and we check the return result. + let ret = unsafe { fcntl(fd, F_GETFL) }; + if ret < 0 { + return errno_result(); + } + Ok(ret) +} + +fn set_flags(fd: RawFd, flags: c_int) -> Result<()> { + // Safe because we supply the third parameter and we check the return result. + let ret = unsafe { fcntl(fd, F_SETFL, flags) }; + if ret < 0 { + return errno_result(); + } + Ok(()) +} + +/// Trait for file descriptors that are TTYs, according to `isatty(3)`. +/// +/// This is marked unsafe because the implementation must promise that the returned RawFd is a valid +/// fd and that the lifetime of the returned fd is at least that of the trait object. +pub unsafe trait Terminal { + /// Gets the file descriptor of the TTY. + fn tty_fd(&self) -> RawFd; + + /// Set this terminal's mode to canonical mode (`ICANON | ECHO | ISIG`). + fn set_canon_mode(&self) -> Result<()> { + modify_mode(self.tty_fd(), |t| t.c_lflag |= ICANON | ECHO | ISIG) + } + + /// Set this terminal's mode to raw mode (`!(ICANON | ECHO | ISIG)`). + fn set_raw_mode(&self) -> Result<()> { + modify_mode(self.tty_fd(), |t| t.c_lflag &= !(ICANON | ECHO | ISIG)) + } + + /// Sets the non-blocking mode of this terminal's file descriptor. + /// + /// If `non_block` is `true`, then `read_raw` will not block. If `non_block` is `false`, then + /// `read_raw` may block if there is nothing to read. + fn set_non_block(&self, non_block: bool) -> Result<()> { + let old_flags = get_flags(self.tty_fd())?; + let new_flags = if non_block { + old_flags | O_NONBLOCK + } else { + old_flags & !O_NONBLOCK + }; + if new_flags != old_flags { + set_flags(self.tty_fd(), new_flags)? + } + Ok(()) + } + + /// Reads up to `out.len()` bytes from this terminal without any buffering. + /// + /// This may block, depending on if non-blocking was enabled with `set_non_block` or if there + /// are any bytes to read. If there is at least one byte that is readable, this will not block. + fn read_raw(&self, out: &mut [u8]) -> Result { + // Safe because read will only modify the pointer up to the length we give it and we check + // the return result. + let ret = unsafe { read(self.tty_fd(), out.as_mut_ptr() as *mut _, out.len()) }; + if ret < 0 { + return errno_result(); + } + + Ok(ret as usize) + } +} + +// Safe because we return a genuine terminal fd that never changes and shares our lifetime. +unsafe impl<'a> Terminal for StdinLock<'a> { + fn tty_fd(&self) -> RawFd { + STDIN_FILENO + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs::File; + use std::io; + use std::os::unix::io::AsRawFd; + use std::path::Path; + + unsafe impl Terminal for File { + fn tty_fd(&self) -> RawFd { + self.as_raw_fd() + } + } + + #[test] + fn test_a_tty() { + let stdin_handle = io::stdin(); + let stdin = stdin_handle.lock(); + + assert!(stdin.set_canon_mode().is_ok()); + assert!(stdin.set_raw_mode().is_ok()); + assert!(stdin.set_raw_mode().is_ok()); + assert!(stdin.set_canon_mode().is_ok()); + assert!(stdin.set_non_block(true).is_ok()); + let mut out = [0u8; 0]; + assert!(stdin.read_raw(&mut out[..]).is_ok()); + } + + #[test] + fn test_a_non_tty() { + let file = File::open(Path::new("/dev/zero")).unwrap(); + assert!(file.set_canon_mode().is_ok()); + } +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/timerfd.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/timerfd.rs new file mode 100644 index 000000000..4e2903e52 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/timerfd.rs @@ -0,0 +1,173 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-clause file. + +use std::fs::File; +use std::mem; +use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; +use std::ptr; +use std::time::Duration; + +use libc::{self, timerfd_create, timerfd_gettime, timerfd_settime, CLOCK_MONOTONIC, TFD_CLOEXEC}; + +use crate::errno::{errno_result, Result}; + +/// A safe wrapper around a Linux timerfd (man 2 timerfd_create). +pub struct TimerFd(File); + +impl TimerFd { + /// Creates a new [`TimerFd`](struct.TimerFd.html). + /// + /// The timer is initally disarmed and must be armed by calling [`reset`](fn.reset.html). + pub fn new() -> Result { + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC) }; + if ret < 0 { + return errno_result(); + } + + // Safe because we uniquely own the file descriptor. + Ok(TimerFd(unsafe { File::from_raw_fd(ret) })) + } + + /// Sets the timer to expire after `dur`. + /// + /// If `interval` is not `None` it represents the period for repeated expirations after the + /// initial expiration. Otherwise the timer will expire just once. Cancels any existing duration and repeating interval. + pub fn reset(&mut self, dur: Duration, interval: Option) -> Result<()> { + // Safe because we are zero-initializing a struct with only primitive member fields. + let mut spec: libc::itimerspec = unsafe { mem::zeroed() }; + spec.it_value.tv_sec = dur.as_secs() as libc::time_t; + // nsec always fits in i32 because subsec_nanos is defined to be less than one billion. + let nsec = dur.subsec_nanos() as i32; + spec.it_value.tv_nsec = libc::c_long::from(nsec); + + if let Some(int) = interval { + spec.it_interval.tv_sec = int.as_secs() as libc::time_t; + // nsec always fits in i32 because subsec_nanos is defined to be less than one billion. + let nsec = int.subsec_nanos() as i32; + spec.it_interval.tv_nsec = libc::c_long::from(nsec); + } + + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_settime(self.as_raw_fd(), 0, &spec, ptr::null_mut()) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) + } + + /// Waits until the timer expires. + /// + /// The return value represents the number of times the timer + /// has expired since the last time `wait` was called. If the timer has not yet expired once + /// this call will block until it does. + pub fn wait(&mut self) -> Result { + let mut count = 0u64; + + // Safe because this will only modify |buf| and we check the return value. + let ret = unsafe { + libc::read( + self.as_raw_fd(), + &mut count as *mut _ as *mut libc::c_void, + mem::size_of_val(&count), + ) + }; + if ret < 0 { + return errno_result(); + } + + // The bytes in the buffer are guaranteed to be in native byte-order so we don't need to + // use from_le or from_be. + Ok(count) + } + + /// Returns `true` if the timer is currently armed. + pub fn is_armed(&self) -> Result { + // Safe because we are zero-initializing a struct with only primitive member fields. + let mut spec: libc::itimerspec = unsafe { mem::zeroed() }; + + // Safe because timerfd_gettime is trusted to only modify `spec`. + let ret = unsafe { timerfd_gettime(self.as_raw_fd(), &mut spec) }; + if ret < 0 { + return errno_result(); + } + + Ok(spec.it_value.tv_sec != 0 || spec.it_value.tv_nsec != 0) + } + + /// Disarms the timer. + pub fn clear(&mut self) -> Result<()> { + // Safe because we are zero-initializing a struct with only primitive member fields. + let spec: libc::itimerspec = unsafe { mem::zeroed() }; + + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_settime(self.as_raw_fd(), 0, &spec, ptr::null_mut()) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) + } +} + +impl AsRawFd for TimerFd { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + +impl FromRawFd for TimerFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + TimerFd(File::from_raw_fd(fd)) + } +} + +impl IntoRawFd for TimerFd { + fn into_raw_fd(self) -> RawFd { + self.0.into_raw_fd() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::thread::sleep; + use std::time::{Duration, Instant}; + + #[test] + fn test_one_shot() { + let mut tfd = TimerFd::new().expect("failed to create timerfd"); + assert_eq!(tfd.is_armed().unwrap(), false); + + let dur = Duration::from_millis(200); + let now = Instant::now(); + tfd.reset(dur, None).expect("failed to arm timer"); + + assert_eq!(tfd.is_armed().unwrap(), true); + + let count = tfd.wait().expect("unable to wait for timer"); + + assert_eq!(count, 1); + assert!(now.elapsed() >= dur); + } + + #[test] + fn test_repeating() { + let mut tfd = TimerFd::new().expect("failed to create timerfd"); + + let dur = Duration::from_millis(200); + let interval = Duration::from_millis(100); + tfd.reset(dur, Some(interval)).expect("failed to arm timer"); + + sleep(dur * 3); + + let count = tfd.wait().expect("unable to wait for timer"); + assert!(count >= 5, "count = {}", count); + } + +} diff --git a/vendor/git-bad78e1967b13e00/vmm-sys-util/src/write_zeroes.rs b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/write_zeroes.rs new file mode 100644 index 000000000..98195d8f3 --- /dev/null +++ b/vendor/git-bad78e1967b13e00/vmm-sys-util/src/write_zeroes.rs @@ -0,0 +1,172 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::cmp::min; +use std::fs::File; +use std::io::{self, Seek, SeekFrom, Write}; + +use crate::fallocate; +use crate::FallocateMode; + +/// A trait for deallocating space in a file. +pub trait PunchHole { + /// Replace a range of bytes with a hole. + fn punch_hole(&mut self, offset: u64, length: u64) -> io::Result<()>; +} + +impl PunchHole for File { + fn punch_hole(&mut self, offset: u64, length: u64) -> io::Result<()> { + fallocate(self, FallocateMode::PunchHole, true, offset, length as u64) + .map_err(|e| io::Error::from_raw_os_error(e.errno())) + } +} + +/// A trait for writing zeroes to a stream. +pub trait WriteZeroes { + /// Write `length` bytes of zeroes to the stream, returning how many bytes were written. + fn write_zeroes(&mut self, length: usize) -> io::Result; +} + +impl WriteZeroes for T { + fn write_zeroes(&mut self, length: usize) -> io::Result { + // Try to punch a hole first. + let offset = self.seek(SeekFrom::Current(0))?; + if let Ok(()) = self.punch_hole(offset, length as u64) { + // Advance the seek cursor as if we had done a real write(). + self.seek(SeekFrom::Current(length as i64))?; + return Ok(length); + } + + // fall back to write() + + // punch_hole() failed; fall back to writing a buffer of zeroes + // until we have written up to length. + let buf_size = min(length, 0x10000); + let buf = vec![0u8; buf_size]; + let mut nwritten: usize = 0; + while nwritten < length { + let remaining = length - nwritten; + let write_size = min(remaining, buf_size); + nwritten += self.write(&buf[0..write_size])?; + } + Ok(length) + } +} + +#[cfg(test)] +#[allow(clippy::unused_io_amount)] +mod tests { + use super::*; + use std::fs::OpenOptions; + use std::io::{Read, Seek, SeekFrom}; + use std::path::PathBuf; + + use crate::TempDir; + + #[test] + fn simple_test() { + let tempdir = TempDir::new("/tmp/write_zeroes_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("file"); + let mut f = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path) + .unwrap(); + f.set_len(16384).unwrap(); + + // Write buffer of non-zero bytes to offset 1234 + let orig_data = [0x55u8; 5678]; + f.seek(SeekFrom::Start(1234)).unwrap(); + f.write(&orig_data).unwrap(); + + // Read back the data plus some overlap on each side + let mut readback = [0u8; 16384]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // Bytes before the write should still be 0 + for read in readback[0..1234].iter() { + assert_eq!(*read, 0); + } + // Bytes that were just written should be 0x55 + for read in readback[1234..(1234 + 5678)].iter() { + assert_eq!(*read, 0x55); + } + // Bytes after the written area should still be 0 + for read in readback[(1234 + 5678)..].iter() { + assert_eq!(*read, 0); + } + + // Overwrite some of the data with zeroes + f.seek(SeekFrom::Start(2345)).unwrap(); + f.write_zeroes(4321).expect("write_zeroes failed"); + // Verify seek position after write_zeroes() + assert_eq!(f.seek(SeekFrom::Current(0)).unwrap(), 2345 + 4321); + + // Read back the data and verify that it is now zero + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // Bytes before the write should still be 0 + for read in readback[0..1234].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist before the write_zeroes region + for read in readback[1234..2345].iter() { + assert_eq!(*read, 0x55); + } + // The write_zeroes region should now be zero + for read in readback[2345..(2345 + 4321)].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist after the write_zeroes region + for read in readback[(2345 + 4321)..(1234 + 5678)].iter() { + assert_eq!(*read, 0x55); + } + // The rest of the file should still be 0 + for read in readback[(1234 + 5678)..].iter() { + assert_eq!(*read, 0); + } + } + + #[test] + fn large_write_zeroes() { + let tempdir = TempDir::new("/tmp/write_zeroes_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("file"); + let mut f = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path) + .unwrap(); + f.set_len(16384).unwrap(); + + // Write buffer of non-zero bytes + let orig_data = [0x55u8; 0x20000]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.write(&orig_data).unwrap(); + + // Overwrite some of the data with zeroes + f.seek(SeekFrom::Start(0)).unwrap(); + f.write_zeroes(0x10001).expect("write_zeroes failed"); + // Verify seek position after write_zeroes() + assert_eq!(f.seek(SeekFrom::Current(0)).unwrap(), 0x10001); + + // Read back the data and verify that it is now zero + let mut readback = [0u8; 0x20000]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // The write_zeroes region should now be zero + for read in readback[0..0x10001].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist after the write_zeroes region + for read in readback[0x10001..0x20000].iter() { + assert_eq!(*read, 0x55); + } + } +} diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/hooks/post-checkout b/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/hooks/post-checkout new file mode 100644 index 000000000..8b1bf2e2c --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/hooks/post-checkout @@ -0,0 +1,5 @@ +#!/bin/bash + +wget http://mirror.centos.org/centos/7/os/x86_64/Packages/kernel-3.10.0-957.el7.x86_64.rpm +rpm2cpio kernel-3.10.0-957.el7.x86_64.rpm | cpio -idmv ./boot/vmlinuz-3.10.0-957.el7.x86_64 + diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/pipeline.yml b/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/pipeline.yml new file mode 100644 index 000000000..656690f3f --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/.buildkite/pipeline.yml @@ -0,0 +1,109 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-x86-elf" + commands: + - cargo build --release --features elf + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86-elf" + commands: + - cargo test --features elf + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + + - label: "build-gnu-x86-bzImage" + commands: + - cargo build --release --features bzImage + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86-bzImage" + commands: + - cargo test --features bzImage + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + + - label: "clippy-x86" + commands: + - cargo clippy --all -- -D warnings + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "coverage-x86" + commands: + - pytest tests/test_coverage.py + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/.cargo-checksum.json b/vendor/git-bda1448fb2afcb00/linux-loader/.cargo-checksum.json new file mode 100644 index 000000000..d7eb78fa7 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/hooks/post-checkout":"4433e2001686837e6bd1a6baef67daacd07434817a04fcb7df8332ee16c51740",".buildkite/pipeline.yml":"8d0550f4a793c4b056189e0612afc50d6d8a686535ee81262318ae33d72611e3",".gitignore/.gitignore":"6b937008e0a58a438c32574627db6961a4d2aff4bf5c703d4e45cb56ef3b168a","Cargo.toml":"f2754a32f2dacc0f8695ee9780193badc85995954ed452d0df4ca1ef8517d089","DESIGN.md":"d877f3093cf94402528a54a97e833fc79d4cbc07934031035f60a2d8d0a542d4","LICENSE-APACHE":"000b4962e6b27176a0ff89cce4be555b16472cafb5671eb2804a8fdac6854793","LICENSE-BSD-3-Clause":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","README.md":"3e585f0ceb915bf4734075d2f0a91b626ff2363079baebcf7592a8d51d2c7931","src/cmdline/mod.rs":"30f57b492618155be6129311d0182688e5d1ecd9a3b5fdc9b742cd0c0e1f85da","src/lib.rs":"67d3e4a9ed48495c00fe6698fc606693b15a006fb0599cb18b946ea3929cd0f6","src/loader/bootparam.rs":"054b5a196873965cb48b9e9fa99c2505f523f9c71ca8ca0fad3af02491811fe6","src/loader/elf.rs":"f4e4eb6ffcb114bbf3242a9c72ea7e99631487d63bbbfbcf641bea42b3aba2e1","src/loader/mod.rs":"6bc6b4f5e90cbf15f554c3c0e4752226794053fc4c0781a7a7828124de1b1ec7","src/loader/struct_util.rs":"a98c2854ebd3a0c0ed11e01e474f2da15fb9200754129223710d62cc88ab253a","src/loader/test_elf.bin":"dda390f7546c7ba36bab412a93add96533806154824b77aafc8c153231f3f161","tests/conftest.py":"ee2baacd9da7ac04ffbfd580a7d4fe8a8b166a16e1eeed2d488f7b820abab433","tests/coverage":"69eaa47e0089d5a3e2844fe7ca823b67ff712e382f6c34b0300797a415b7f3e9","tests/test_coverage.py":"2f4bbb571bf52ad796f9f47a3aaace61ee92ab9788980496bb1652826f224150"},"package":null} \ No newline at end of file diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/.gitignore/.gitignore b/vendor/git-bda1448fb2afcb00/linux-loader/.gitignore/.gitignore new file mode 100644 index 000000000..693699042 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/.gitignore/.gitignore @@ -0,0 +1,3 @@ +/target +**/*.rs.bk +Cargo.lock diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/Cargo.toml b/vendor/git-bda1448fb2afcb00/linux-loader/Cargo.toml new file mode 100644 index 000000000..d180f24e4 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "linux-loader" +version = "0.1.0" +authors = ["cathy "] +edition = "2018" +license = "Apache-2.0 AND BSD-3-Clause" + +[features] +default = ["elf"] +elf = [] +bzImage = [] + + +[dependencies.vm-memory] +git = "https://github.com/rust-vmm/vm-memory" +features = ["backend-mmap"] diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/DESIGN.md b/vendor/git-bda1448fb2afcb00/linux-loader/DESIGN.md new file mode 100644 index 000000000..f84fb9368 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/DESIGN.md @@ -0,0 +1,64 @@ +# ELF Image parsing and loading + +The boot process is explained from the following two sides. + +## Loader side + +It follows ELF standard which is specified in elf.rs. The entry header and program headers will be inerpreted, and PT_LOAD segments will be loaded into guest memory. + +### Where kernel is loaded + +There are two ways on deciding where the program segments will be loaded. + +- One way is to provide an option and allow vmm to specify where to load the image, considering its memory layout. +- The other way is to load image into phdr.p_paddr by default. + +## Vmm side + +### Construct zero page + +According to the 64-bit boot protocol, the boot parameters (traditionally known as "zero page") should be setup, including setup_header, e820 table and other stuff. However, ELF has no setup_header, nothing returned from ELF loader could be used to fill boot parameters, vmm is totally responsible for the construction. + +### Configure vcpu + +- RIP, the start offset of guest memory where kernel is loaded, which is returned from loader +- 64 bit mode with paging enabled +- GDT must be configured and loaded + +# bzImage + +The boot process is also explained from the following two sides. + +## Loader side + +### What will be returned from loader + +bzImage includes two parts, the setup and the compressed kernel. The compressed kernel part will be loaded into guest memory, and the following three parts will returned to vmm by loader. +- The start address of loaded kernel +- The offset of memory where kernel is end of loading +- The setup header begin at the offset 0x01f1 of bzImage, this one is an extra compared to the return of ELF loader. + +### Where kernel is loaded + +The same as ELF image loader, there are two ways for deciding where the compressed kernel will be loaded. + +- Vmm specify where to load kernel image. +- Load into code32_start (Boot load address) by default. + +### Additional checking + +As what the boot protocol said, the kernel is a bzImage kernel if the protocol >= 2.00 and the 0x01 bit(LOAD_HIGH) is the loadflags field is set. Add this checking to validate the bzImage. + +## Vmm side + +### Construct zero page + +While vmm build "zero page" with e820 table and other stuff, bzImage loader will return the setup header to fill the boot parameters. Meanwhile, setup_header.init_size is a must to be filled into zero page, which will be used during head_64.S boot process. + +### Configure vcpu + +- RIP, the start address of loaded 64-bit kernel returned from loader + 0x200. Regarding to the 64-bit boot protocol, kernel is started by jumping to the 64-bit kernel entry point, which is the start address of loaded 64-bit kernel plus 0x200. +- 64 bit mode with paging enabled +- GDT must be configured and loaded + + diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/LICENSE-APACHE b/vendor/git-bda1448fb2afcb00/linux-loader/LICENSE-APACHE new file mode 100644 index 000000000..6f756351a --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/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/vendor/git-bda1448fb2afcb00/linux-loader/LICENSE-BSD-3-Clause b/vendor/git-bda1448fb2afcb00/linux-loader/LICENSE-BSD-3-Clause new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/LICENSE-BSD-3-Clause @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/README.md b/vendor/git-bda1448fb2afcb00/linux-loader/README.md new file mode 100644 index 000000000..0c8920db4 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/README.md @@ -0,0 +1,105 @@ +# Linux-loader + +## Short-description + +* Parsing and loading vmlinux (raw ELF image) and bzImage images +* Linux command line parsing and generation +* Definitions and helpers for the Linux boot protocol + +## How to build + +``` +cd linux-loader +cargo build +``` + +## Tests + +Our Continuous Integration (CI) pipeline is implemented on top of +[Buildkite](https://buildkite.com/). +For the complete list of tests, check our +[CI pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci). + +Each individual test runs in a container. To reproduce a test locally, you can +use the dev-container on both x86 and arm64. + +```bash +docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +cd linux-loader/ +cargo test +``` + +### Test Profiles + +The integration tests support two test profiles: +- **devel**: this is the recommended profile for running the integration tests + on a local development machine. +- **ci** (default option): this is the profile used when running the + integration tests as part of the the Continuous Integration (CI). + +The test profiles are applicable to tests that run using pytest. Currently only +the [coverage test](tests/test_coverage.py) follows this model as all the other +integration tests are run using the +[Buildkite pipeline](https://buildkite.com/rust-vmm/vm-virtio-ci). + +The difference between is declaring tests as passed or failed: +- with the **devel** profile the coverage test passes if the current coverage + is equal or higher than the upstream coverage value. In case the current + coverage is higher, the coverage file is updated to the new coverage value. +- with the **ci** profile the coverage test passes only if the current coverage + is equal to the upstream coverage value. + +Further details about the coverage test can be found in the +[Adaptive Coverage](#adaptive-coverage) section. + +### Adaptive Coverage + +The line coverage is saved in [tests/coverage](tests/coverage). To update the +coverage before submitting a PR, run the coverage test: + +```bash +docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +cd linux-loader/ +pytest --profile=devel tests/test_coverage.py +``` + +If the PR coverage is higher than the upstream coverage, the coverage file +needs to be manually added to the commit before submitting the PR: + +```bash +git add tests/coverage +``` + +Failing to do so will generate a fail on the CI pipeline when publishing the +PR. + +**NOTE:** The coverage file is only updated in the `devel` test profile. In +the `ci` profile the coverage test will fail if the current coverage is higher +than the coverage reported in [tests/coverage](tests/coverage). + +### bzImage test + +As we don't want to distribute an entire kernel bzImage, the `load_bzImage` test is ignored by +default. In order to test the bzImage support, one needs to locally build a bzImage, copy it +to the `src/loader` directory and run the ignored test: + +```shell +# Assuming your linux-loader and linux-stable are both under $LINUX_LOADER +$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git $LINUX_LOADER/linux-stable +$ cd linux-stable +$ make bzImage +$ cp linux-stable/arch/x86/boot/bzImage $LINUX_LOADER/linux-loader/src/loader/ +$ cd $LINUX_LOADER/linux-loader +$ docker run -it \ + --security-opt seccomp=unconfined \ + --volume $(pwd):/linux-loader \ + fandree/rust-vmm-dev +$ cd linux-loader/ +$ cargo test -- --ignored +``` diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/cmdline/mod.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/cmdline/mod.rs new file mode 100644 index 000000000..d9991f69f --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/cmdline/mod.rs @@ -0,0 +1,235 @@ +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause +// +//! Helper for creating valid kernel command line strings. + +use std::fmt; +use std::result; + +/// The error type for command line building operations. +#[derive(PartialEq, Debug)] +pub enum Error { + /// Operation would have resulted in a non-printable ASCII character. + InvalidAscii, + /// Key/Value Operation would have had a space in it. + HasSpace, + /// Key/Value Operation would have had an equals sign in it. + HasEquals, + /// Operation would have made the command line too large. + TooLarge, +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!( + f, + "{}", + match *self { + Error::InvalidAscii => "string contains non-printable ASCII character", + Error::HasSpace => "string contains a space", + Error::HasEquals => "string contains an equals sign", + Error::TooLarge => "inserting string would make command line too long", + } + ) + } +} + +/// Specialized Result type for command line operations. +pub type Result = result::Result; + +fn valid_char(c: char) -> bool { + match c { + ' '...'~' => true, + _ => false, + } +} + +fn valid_str(s: &str) -> Result<()> { + if s.chars().all(valid_char) { + Ok(()) + } else { + Err(Error::InvalidAscii) + } +} + +fn valid_element(s: &str) -> Result<()> { + if !s.chars().all(valid_char) { + Err(Error::InvalidAscii) + } else if s.contains(' ') { + Err(Error::HasSpace) + } else if s.contains('=') { + Err(Error::HasEquals) + } else { + Ok(()) + } +} + +/// A builder for a kernel command line string that validates the string as its being built. A +/// `CString` can be constructed from this directly using `CString::new`. +#[derive(Clone)] +pub struct Cmdline { + line: String, + capacity: usize, +} + +impl Cmdline { + /// Constructs an empty Cmdline with the given capacity, which includes the nul terminator. + /// Capacity must be greater than 0. + pub fn new(capacity: usize) -> Cmdline { + assert_ne!(capacity, 0); + Cmdline { + line: String::with_capacity(capacity), + capacity, + } + } + + fn has_capacity(&self, more: usize) -> Result<()> { + let needs_space = if self.line.is_empty() { 0 } else { 1 }; + if self.line.len() + more + needs_space < self.capacity { + Ok(()) + } else { + Err(Error::TooLarge) + } + } + + fn start_push(&mut self) { + if !self.line.is_empty() { + self.line.push(' '); + } + } + + fn end_push(&mut self) { + // This assert is always true because of the `has_capacity` check that each insert method + // uses. + assert!(self.line.len() < self.capacity); + } + + /// Validates and inserts a key value pair into this command line + pub fn insert>(&mut self, key: T, val: T) -> Result<()> { + let k = key.as_ref(); + let v = val.as_ref(); + + valid_element(k)?; + valid_element(v)?; + self.has_capacity(k.len() + v.len() + 1)?; + + self.start_push(); + self.line.push_str(k); + self.line.push('='); + self.line.push_str(v); + self.end_push(); + + Ok(()) + } + + /// Validates and inserts a string to the end of the current command line + pub fn insert_str>(&mut self, slug: T) -> Result<()> { + let s = slug.as_ref(); + valid_str(s)?; + + self.has_capacity(s.len())?; + + self.start_push(); + self.line.push_str(s); + self.end_push(); + + Ok(()) + } + + /// Returns the cmdline in progress without nul termination + pub fn as_str(&self) -> &str { + self.line.as_str() + } +} + +impl Into> for Cmdline { + fn into(self) -> Vec { + self.line.into_bytes() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::ffi::CString; + + #[test] + fn insert_hello_world() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.as_str(), ""); + assert!(cl.insert("hello", "world").is_ok()); + assert_eq!(cl.as_str(), "hello=world"); + + let s = CString::new(cl).expect("failed to create CString from Cmdline"); + assert_eq!(s, CString::new("hello=world").unwrap()); + } + + #[test] + fn insert_multi() { + let mut cl = Cmdline::new(100); + assert!(cl.insert("hello", "world").is_ok()); + assert!(cl.insert("foo", "bar").is_ok()); + assert_eq!(cl.as_str(), "hello=world foo=bar"); + } + + #[test] + fn insert_space() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("a ", "b"), Err(Error::HasSpace)); + assert_eq!(cl.insert("a", "b "), Err(Error::HasSpace)); + assert_eq!(cl.insert("a ", "b "), Err(Error::HasSpace)); + assert_eq!(cl.insert(" a", "b"), Err(Error::HasSpace)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_equals() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("a=", "b"), Err(Error::HasEquals)); + assert_eq!(cl.insert("a", "b="), Err(Error::HasEquals)); + assert_eq!(cl.insert("a=", "b "), Err(Error::HasEquals)); + assert_eq!(cl.insert("=a", "b"), Err(Error::HasEquals)); + assert_eq!(cl.insert("a", "=b"), Err(Error::HasEquals)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_emoji() { + let mut cl = Cmdline::new(100); + assert_eq!(cl.insert("heart", "💖"), Err(Error::InvalidAscii)); + assert_eq!(cl.insert("💖", "love"), Err(Error::InvalidAscii)); + assert_eq!(cl.as_str(), ""); + } + + #[test] + fn insert_string() { + let mut cl = Cmdline::new(13); + assert_eq!(cl.as_str(), ""); + assert!(cl.insert_str("noapic").is_ok()); + assert_eq!(cl.as_str(), "noapic"); + assert!(cl.insert_str("nopci").is_ok()); + assert_eq!(cl.as_str(), "noapic nopci"); + } + + #[test] + fn insert_too_large() { + let mut cl = Cmdline::new(4); + assert_eq!(cl.insert("hello", "world"), Err(Error::TooLarge)); + assert_eq!(cl.insert("a", "world"), Err(Error::TooLarge)); + assert_eq!(cl.insert("hello", "b"), Err(Error::TooLarge)); + assert!(cl.insert("a", "b").is_ok()); + assert_eq!(cl.insert("a", "b"), Err(Error::TooLarge)); + assert_eq!(cl.insert_str("a"), Err(Error::TooLarge)); + assert_eq!(cl.as_str(), "a=b"); + + let mut cl = Cmdline::new(10); + assert!(cl.insert("ab", "ba").is_ok()); // adds 5 length + assert_eq!(cl.insert("c", "da"), Err(Error::TooLarge)); // adds 5 (including space) length + assert!(cl.insert("c", "d").is_ok()); // adds 4 (including space) length + } +} diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/lib.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/lib.rs new file mode 100644 index 000000000..4cb50e9eb --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/lib.rs @@ -0,0 +1,13 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +pub mod cmdline; +pub mod loader; + +extern crate vm_memory; diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/bootparam.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/bootparam.rs new file mode 100644 index 000000000..f19663ff6 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/bootparam.rs @@ -0,0 +1,3870 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +/* + * automatically generated by rust-bindgen + * From upstream linux bootparam.h at commit: + * 806276b7f07a39a1cc3f38bb1ef5c573d4594a38 + */ + +#[repr(C)] +#[derive(Default)] +pub struct __IncompleteArrayField(::std::marker::PhantomData); +impl __IncompleteArrayField { + #[inline] + pub fn new() -> Self { + __IncompleteArrayField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ptr(&self) -> *const T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut_ptr(&mut self) -> *mut T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_slice(&self, len: usize) -> &[T] { + ::std::slice::from_raw_parts(self.as_ptr(), len) + } + #[inline] + pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] { + ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len) + } +} +impl ::std::fmt::Debug for __IncompleteArrayField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + fmt.write_str("__IncompleteArrayField") + } +} +impl ::std::clone::Clone for __IncompleteArrayField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::std::marker::Copy for __IncompleteArrayField {} +#[repr(C)] +pub struct __BindgenUnionField(::std::marker::PhantomData); +impl __BindgenUnionField { + #[inline] + pub fn new() -> Self { + __BindgenUnionField(::std::marker::PhantomData) + } + #[inline] + pub unsafe fn as_ref(&self) -> &T { + ::std::mem::transmute(self) + } + #[inline] + pub unsafe fn as_mut(&mut self) -> &mut T { + ::std::mem::transmute(self) + } +} +impl ::std::default::Default for __BindgenUnionField { + #[inline] + fn default() -> Self { + Self::new() + } +} +impl ::std::clone::Clone for __BindgenUnionField { + #[inline] + fn clone(&self) -> Self { + Self::new() + } +} +impl ::std::marker::Copy for __BindgenUnionField {} +impl ::std::fmt::Debug for __BindgenUnionField { + fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + fmt.write_str("__BindgenUnionField") + } +} +pub const SETUP_NONE: ::std::os::raw::c_uint = 0; +pub const SETUP_E820_EXT: ::std::os::raw::c_uint = 1; +pub const SETUP_DTB: ::std::os::raw::c_uint = 2; +pub const SETUP_PCI: ::std::os::raw::c_uint = 3; +pub const SETUP_EFI: ::std::os::raw::c_uint = 4; +pub const RAMDISK_IMAGE_START_MASK: ::std::os::raw::c_uint = 2047; +pub const RAMDISK_PROMPT_FLAG: ::std::os::raw::c_uint = 32768; +pub const RAMDISK_LOAD_FLAG: ::std::os::raw::c_uint = 16384; +pub const LOADED_HIGH: ::std::os::raw::c_uint = 1; +pub const QUIET_FLAG: ::std::os::raw::c_uint = 32; +pub const KEEP_SEGMENTS: ::std::os::raw::c_uint = 64; +pub const CAN_USE_HEAP: ::std::os::raw::c_uint = 128; +pub const XLF_KERNEL_64: ::std::os::raw::c_uint = 1; +pub const XLF_CAN_BE_LOADED_ABOVE_4G: ::std::os::raw::c_uint = 2; +pub const XLF_EFI_HANDOVER_32: ::std::os::raw::c_uint = 4; +pub const XLF_EFI_HANDOVER_64: ::std::os::raw::c_uint = 8; +pub const XLF_EFI_KEXEC: ::std::os::raw::c_uint = 16; +pub const __BITS_PER_LONG: ::std::os::raw::c_uint = 64; +pub const __FD_SETSIZE: ::std::os::raw::c_uint = 1024; +pub const VIDEO_TYPE_MDA: ::std::os::raw::c_uint = 16; +pub const VIDEO_TYPE_CGA: ::std::os::raw::c_uint = 17; +pub const VIDEO_TYPE_EGAM: ::std::os::raw::c_uint = 32; +pub const VIDEO_TYPE_EGAC: ::std::os::raw::c_uint = 33; +pub const VIDEO_TYPE_VGAC: ::std::os::raw::c_uint = 34; +pub const VIDEO_TYPE_VLFB: ::std::os::raw::c_uint = 35; +pub const VIDEO_TYPE_PICA_S3: ::std::os::raw::c_uint = 48; +pub const VIDEO_TYPE_MIPS_G364: ::std::os::raw::c_uint = 49; +pub const VIDEO_TYPE_SGI: ::std::os::raw::c_uint = 51; +pub const VIDEO_TYPE_TGAC: ::std::os::raw::c_uint = 64; +pub const VIDEO_TYPE_SUN: ::std::os::raw::c_uint = 80; +pub const VIDEO_TYPE_SUNPCI: ::std::os::raw::c_uint = 81; +pub const VIDEO_TYPE_PMAC: ::std::os::raw::c_uint = 96; +pub const VIDEO_TYPE_EFI: ::std::os::raw::c_uint = 112; +pub const VIDEO_FLAGS_NOCURSOR: ::std::os::raw::c_uint = 1; +pub const VIDEO_CAPABILITY_SKIP_QUIRKS: ::std::os::raw::c_uint = 1; +pub const APM_STATE_READY: ::std::os::raw::c_uint = 0; +pub const APM_STATE_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_STATE_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_STATE_OFF: ::std::os::raw::c_uint = 3; +pub const APM_STATE_BUSY: ::std::os::raw::c_uint = 4; +pub const APM_STATE_REJECT: ::std::os::raw::c_uint = 5; +pub const APM_STATE_OEM_SYS: ::std::os::raw::c_uint = 32; +pub const APM_STATE_OEM_DEV: ::std::os::raw::c_uint = 64; +pub const APM_STATE_DISABLE: ::std::os::raw::c_uint = 0; +pub const APM_STATE_ENABLE: ::std::os::raw::c_uint = 1; +pub const APM_STATE_DISENGAGE: ::std::os::raw::c_uint = 0; +pub const APM_STATE_ENGAGE: ::std::os::raw::c_uint = 1; +pub const APM_SYS_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_SYS_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_NORMAL_RESUME: ::std::os::raw::c_uint = 3; +pub const APM_CRITICAL_RESUME: ::std::os::raw::c_uint = 4; +pub const APM_LOW_BATTERY: ::std::os::raw::c_uint = 5; +pub const APM_POWER_STATUS_CHANGE: ::std::os::raw::c_uint = 6; +pub const APM_UPDATE_TIME: ::std::os::raw::c_uint = 7; +pub const APM_CRITICAL_SUSPEND: ::std::os::raw::c_uint = 8; +pub const APM_USER_STANDBY: ::std::os::raw::c_uint = 9; +pub const APM_USER_SUSPEND: ::std::os::raw::c_uint = 10; +pub const APM_STANDBY_RESUME: ::std::os::raw::c_uint = 11; +pub const APM_CAPABILITY_CHANGE: ::std::os::raw::c_uint = 12; +pub const APM_USER_HIBERNATION: ::std::os::raw::c_uint = 13; +pub const APM_HIBERNATION_RESUME: ::std::os::raw::c_uint = 14; +pub const APM_SUCCESS: ::std::os::raw::c_uint = 0; +pub const APM_DISABLED: ::std::os::raw::c_uint = 1; +pub const APM_CONNECTED: ::std::os::raw::c_uint = 2; +pub const APM_NOT_CONNECTED: ::std::os::raw::c_uint = 3; +pub const APM_16_CONNECTED: ::std::os::raw::c_uint = 5; +pub const APM_16_UNSUPPORTED: ::std::os::raw::c_uint = 6; +pub const APM_32_CONNECTED: ::std::os::raw::c_uint = 7; +pub const APM_32_UNSUPPORTED: ::std::os::raw::c_uint = 8; +pub const APM_BAD_DEVICE: ::std::os::raw::c_uint = 9; +pub const APM_BAD_PARAM: ::std::os::raw::c_uint = 10; +pub const APM_NOT_ENGAGED: ::std::os::raw::c_uint = 11; +pub const APM_BAD_FUNCTION: ::std::os::raw::c_uint = 12; +pub const APM_RESUME_DISABLED: ::std::os::raw::c_uint = 13; +pub const APM_NO_ERROR: ::std::os::raw::c_uint = 83; +pub const APM_BAD_STATE: ::std::os::raw::c_uint = 96; +pub const APM_NO_EVENTS: ::std::os::raw::c_uint = 128; +pub const APM_NOT_PRESENT: ::std::os::raw::c_uint = 134; +pub const APM_DEVICE_BIOS: ::std::os::raw::c_uint = 0; +pub const APM_DEVICE_ALL: ::std::os::raw::c_uint = 1; +pub const APM_DEVICE_DISPLAY: ::std::os::raw::c_uint = 256; +pub const APM_DEVICE_STORAGE: ::std::os::raw::c_uint = 512; +pub const APM_DEVICE_PARALLEL: ::std::os::raw::c_uint = 768; +pub const APM_DEVICE_SERIAL: ::std::os::raw::c_uint = 1024; +pub const APM_DEVICE_NETWORK: ::std::os::raw::c_uint = 1280; +pub const APM_DEVICE_PCMCIA: ::std::os::raw::c_uint = 1536; +pub const APM_DEVICE_BATTERY: ::std::os::raw::c_uint = 32768; +pub const APM_DEVICE_OEM: ::std::os::raw::c_uint = 57344; +pub const APM_DEVICE_OLD_ALL: ::std::os::raw::c_uint = 65535; +pub const APM_DEVICE_CLASS: ::std::os::raw::c_uint = 255; +pub const APM_DEVICE_MASK: ::std::os::raw::c_uint = 65280; +pub const APM_MAX_BATTERIES: ::std::os::raw::c_uint = 2; +pub const APM_CAP_GLOBAL_STANDBY: ::std::os::raw::c_uint = 1; +pub const APM_CAP_GLOBAL_SUSPEND: ::std::os::raw::c_uint = 2; +pub const APM_CAP_RESUME_STANDBY_TIMER: ::std::os::raw::c_uint = 4; +pub const APM_CAP_RESUME_SUSPEND_TIMER: ::std::os::raw::c_uint = 8; +pub const APM_CAP_RESUME_STANDBY_RING: ::std::os::raw::c_uint = 16; +pub const APM_CAP_RESUME_SUSPEND_RING: ::std::os::raw::c_uint = 32; +pub const APM_CAP_RESUME_STANDBY_PCMCIA: ::std::os::raw::c_uint = 64; +pub const APM_CAP_RESUME_SUSPEND_PCMCIA: ::std::os::raw::c_uint = 128; +pub const _IOC_NRBITS: ::std::os::raw::c_uint = 8; +pub const _IOC_TYPEBITS: ::std::os::raw::c_uint = 8; +pub const _IOC_SIZEBITS: ::std::os::raw::c_uint = 14; +pub const _IOC_DIRBITS: ::std::os::raw::c_uint = 2; +pub const _IOC_NRMASK: ::std::os::raw::c_uint = 255; +pub const _IOC_TYPEMASK: ::std::os::raw::c_uint = 255; +pub const _IOC_SIZEMASK: ::std::os::raw::c_uint = 16383; +pub const _IOC_DIRMASK: ::std::os::raw::c_uint = 3; +pub const _IOC_NRSHIFT: ::std::os::raw::c_uint = 0; +pub const _IOC_TYPESHIFT: ::std::os::raw::c_uint = 8; +pub const _IOC_SIZESHIFT: ::std::os::raw::c_uint = 16; +pub const _IOC_DIRSHIFT: ::std::os::raw::c_uint = 30; +pub const _IOC_NONE: ::std::os::raw::c_uint = 0; +pub const _IOC_WRITE: ::std::os::raw::c_uint = 1; +pub const _IOC_READ: ::std::os::raw::c_uint = 2; +pub const IOC_IN: ::std::os::raw::c_uint = 1073741824; +pub const IOC_OUT: ::std::os::raw::c_uint = 2147483648; +pub const IOC_INOUT: ::std::os::raw::c_uint = 3221225472; +pub const IOCSIZE_MASK: ::std::os::raw::c_uint = 1073676288; +pub const IOCSIZE_SHIFT: ::std::os::raw::c_uint = 16; +pub const EDDNR: ::std::os::raw::c_uint = 489; +pub const EDDBUF: ::std::os::raw::c_uint = 3328; +pub const EDDMAXNR: ::std::os::raw::c_uint = 6; +pub const EDDEXTSIZE: ::std::os::raw::c_uint = 8; +pub const EDDPARMSIZE: ::std::os::raw::c_uint = 74; +pub const CHECKEXTENSIONSPRESENT: ::std::os::raw::c_uint = 65; +pub const GETDEVICEPARAMETERS: ::std::os::raw::c_uint = 72; +pub const LEGACYGETDEVICEPARAMETERS: ::std::os::raw::c_uint = 8; +pub const EDDMAGIC1: ::std::os::raw::c_uint = 21930; +pub const EDDMAGIC2: ::std::os::raw::c_uint = 43605; +pub const READ_SECTORS: ::std::os::raw::c_uint = 2; +pub const EDD_MBR_SIG_OFFSET: ::std::os::raw::c_uint = 440; +pub const EDD_MBR_SIG_BUF: ::std::os::raw::c_uint = 656; +pub const EDD_MBR_SIG_MAX: ::std::os::raw::c_uint = 16; +pub const EDD_MBR_SIG_NR_BUF: ::std::os::raw::c_uint = 490; +pub const EDD_EXT_FIXED_DISK_ACCESS: ::std::os::raw::c_uint = 1; +pub const EDD_EXT_DEVICE_LOCKING_AND_EJECTING: ::std::os::raw::c_uint = 2; +pub const EDD_EXT_ENHANCED_DISK_DRIVE_SUPPORT: ::std::os::raw::c_uint = 4; +pub const EDD_EXT_64BIT_EXTENSIONS: ::std::os::raw::c_uint = 8; +pub const EDD_INFO_DMA_BOUNDARY_ERROR_TRANSPARENT: ::std::os::raw::c_uint = 1; +pub const EDD_INFO_GEOMETRY_VALID: ::std::os::raw::c_uint = 2; +pub const EDD_INFO_REMOVABLE: ::std::os::raw::c_uint = 4; +pub const EDD_INFO_WRITE_VERIFY: ::std::os::raw::c_uint = 8; +pub const EDD_INFO_MEDIA_CHANGE_NOTIFICATION: ::std::os::raw::c_uint = 16; +pub const EDD_INFO_LOCKABLE: ::std::os::raw::c_uint = 32; +pub const EDD_INFO_NO_MEDIA_PRESENT: ::std::os::raw::c_uint = 64; +pub const EDD_INFO_USE_INT13_FN50: ::std::os::raw::c_uint = 128; +pub const E820MAP: ::std::os::raw::c_uint = 720; +pub const E820MAX: ::std::os::raw::c_uint = 128; +pub const E820_X_MAX: ::std::os::raw::c_uint = 128; +pub const E820NR: ::std::os::raw::c_uint = 488; +pub const E820_RAM: ::std::os::raw::c_uint = 1; +pub const E820_RESERVED: ::std::os::raw::c_uint = 2; +pub const E820_ACPI: ::std::os::raw::c_uint = 3; +pub const E820_NVS: ::std::os::raw::c_uint = 4; +pub const E820_UNUSABLE: ::std::os::raw::c_uint = 5; +pub const E820_RESERVED_KERN: ::std::os::raw::c_uint = 128; +pub const ISA_START_ADDRESS: ::std::os::raw::c_uint = 655360; +pub const ISA_END_ADDRESS: ::std::os::raw::c_uint = 1048576; +pub const BIOS_BEGIN: ::std::os::raw::c_uint = 655360; +pub const BIOS_END: ::std::os::raw::c_uint = 1048576; +pub const BIOS_ROM_BASE: ::std::os::raw::c_uint = 4292870144; +pub const BIOS_ROM_END: ::std::os::raw::c_uint = 4294967295; +pub type __s8 = ::std::os::raw::c_schar; +pub type __u8 = ::std::os::raw::c_uchar; +pub type __s16 = ::std::os::raw::c_short; +pub type __u16 = ::std::os::raw::c_ushort; +pub type __s32 = ::std::os::raw::c_int; +pub type __u32 = ::std::os::raw::c_uint; +pub type __s64 = ::std::os::raw::c_longlong; +pub type __u64 = ::std::os::raw::c_ulonglong; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct __kernel_fd_set { + pub fds_bits: [::std::os::raw::c_ulong; 16usize], +} +#[test] +fn bindgen_test_layout___kernel_fd_set() { + assert_eq!( + ::std::mem::size_of::<__kernel_fd_set>(), + 128usize, + concat!("Size of: ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + ::std::mem::align_of::<__kernel_fd_set>(), + 8usize, + concat!("Alignment of ", stringify!(__kernel_fd_set)) + ); + assert_eq!( + unsafe { &(*(0 as *const __kernel_fd_set)).fds_bits as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(__kernel_fd_set), + "::", + stringify!(fds_bits) + ) + ); +} +impl Clone for __kernel_fd_set { + fn clone(&self) -> Self { + *self + } +} +pub type __kernel_sighandler_t = + ::std::option::Option; +pub type __kernel_key_t = ::std::os::raw::c_int; +pub type __kernel_mqd_t = ::std::os::raw::c_int; +pub type __kernel_old_uid_t = ::std::os::raw::c_ushort; +pub type __kernel_old_gid_t = ::std::os::raw::c_ushort; +pub type __kernel_old_dev_t = ::std::os::raw::c_ulong; +pub type __kernel_long_t = ::std::os::raw::c_long; +pub type __kernel_ulong_t = ::std::os::raw::c_ulong; +pub type __kernel_ino_t = __kernel_ulong_t; +pub type __kernel_mode_t = ::std::os::raw::c_uint; +pub type __kernel_pid_t = ::std::os::raw::c_int; +pub type __kernel_ipc_pid_t = ::std::os::raw::c_int; +pub type __kernel_uid_t = ::std::os::raw::c_uint; +pub type __kernel_gid_t = ::std::os::raw::c_uint; +pub type __kernel_suseconds_t = __kernel_long_t; +pub type __kernel_daddr_t = ::std::os::raw::c_int; +pub type __kernel_uid32_t = ::std::os::raw::c_uint; +pub type __kernel_gid32_t = ::std::os::raw::c_uint; +pub type __kernel_size_t = __kernel_ulong_t; +pub type __kernel_ssize_t = __kernel_long_t; +pub type __kernel_ptrdiff_t = __kernel_long_t; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct __kernel_fsid_t { + pub val: [::std::os::raw::c_int; 2usize], +} +#[test] +fn bindgen_test_layout___kernel_fsid_t() { + assert_eq!( + ::std::mem::size_of::<__kernel_fsid_t>(), + 8usize, + concat!("Size of: ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + ::std::mem::align_of::<__kernel_fsid_t>(), + 4usize, + concat!("Alignment of ", stringify!(__kernel_fsid_t)) + ); + assert_eq!( + unsafe { &(*(0 as *const __kernel_fsid_t)).val as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(__kernel_fsid_t), + "::", + stringify!(val) + ) + ); +} +impl Clone for __kernel_fsid_t { + fn clone(&self) -> Self { + *self + } +} +pub type __kernel_off_t = __kernel_long_t; +pub type __kernel_loff_t = ::std::os::raw::c_longlong; +pub type __kernel_time_t = __kernel_long_t; +pub type __kernel_clock_t = __kernel_long_t; +pub type __kernel_timer_t = ::std::os::raw::c_int; +pub type __kernel_clockid_t = ::std::os::raw::c_int; +pub type __kernel_caddr_t = *mut ::std::os::raw::c_char; +pub type __kernel_uid16_t = ::std::os::raw::c_ushort; +pub type __kernel_gid16_t = ::std::os::raw::c_ushort; +pub type __le16 = __u16; +pub type __be16 = __u16; +pub type __le32 = __u32; +pub type __be32 = __u32; +pub type __le64 = __u64; +pub type __be64 = __u64; +pub type __sum16 = __u16; +pub type __wsum = __u32; +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct screen_info { + pub orig_x: __u8, + pub orig_y: __u8, + pub ext_mem_k: __u16, + pub orig_video_page: __u16, + pub orig_video_mode: __u8, + pub orig_video_cols: __u8, + pub flags: __u8, + pub unused2: __u8, + pub orig_video_ega_bx: __u16, + pub unused3: __u16, + pub orig_video_lines: __u8, + pub orig_video_isVGA: __u8, + pub orig_video_points: __u16, + pub lfb_width: __u16, + pub lfb_height: __u16, + pub lfb_depth: __u16, + pub lfb_base: __u32, + pub lfb_size: __u32, + pub cl_magic: __u16, + pub cl_offset: __u16, + pub lfb_linelength: __u16, + pub red_size: __u8, + pub red_pos: __u8, + pub green_size: __u8, + pub green_pos: __u8, + pub blue_size: __u8, + pub blue_pos: __u8, + pub rsvd_size: __u8, + pub rsvd_pos: __u8, + pub vesapm_seg: __u16, + pub vesapm_off: __u16, + pub pages: __u16, + pub vesa_attributes: __u16, + pub capabilities: __u32, + pub _reserved: [__u8; 6usize], +} +#[test] +fn bindgen_test_layout_screen_info() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(screen_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(screen_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_x as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_x) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_y as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_y) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).ext_mem_k as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(ext_mem_k) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_page as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_page) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_mode as *const _ as usize }, + 6usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_mode) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_cols as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_cols) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).flags as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).unused2 as *const _ as usize }, + 9usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(unused2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_ega_bx as *const _ as usize }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_ega_bx) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).unused3 as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(unused3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_lines as *const _ as usize }, + 14usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_lines) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_isVGA as *const _ as usize }, + 15usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_isVGA) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).orig_video_points as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(orig_video_points) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_width as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_width) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_height as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_height) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_depth as *const _ as usize }, + 22usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_depth) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_base as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_base) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_size as *const _ as usize }, + 28usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).cl_magic as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(cl_magic) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).cl_offset as *const _ as usize }, + 34usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(cl_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).lfb_linelength as *const _ as usize }, + 36usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(lfb_linelength) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).red_size as *const _ as usize }, + 38usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(red_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).red_pos as *const _ as usize }, + 39usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(red_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).green_size as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(green_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).green_pos as *const _ as usize }, + 41usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(green_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).blue_size as *const _ as usize }, + 42usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(blue_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).blue_pos as *const _ as usize }, + 43usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(blue_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).rsvd_size as *const _ as usize }, + 44usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(rsvd_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).rsvd_pos as *const _ as usize }, + 45usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(rsvd_pos) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesapm_seg as *const _ as usize }, + 46usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesapm_seg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesapm_off as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesapm_off) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).pages as *const _ as usize }, + 50usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(pages) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).vesa_attributes as *const _ as usize }, + 52usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(vesa_attributes) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info)).capabilities as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(capabilities) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const screen_info))._reserved as *const _ as usize }, + 58usize, + concat!( + "Alignment of field: ", + stringify!(screen_info), + "::", + stringify!(_reserved) + ) + ); +} +impl Clone for screen_info { + fn clone(&self) -> Self { + *self + } +} +pub type apm_event_t = ::std::os::raw::c_ushort; +pub type apm_eventinfo_t = ::std::os::raw::c_ushort; +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct apm_bios_info { + pub version: __u16, + pub cseg: __u16, + pub offset: __u32, + pub cseg_16: __u16, + pub dseg: __u16, + pub flags: __u16, + pub cseg_len: __u16, + pub cseg_16_len: __u16, + pub dseg_len: __u16, +} +#[test] +fn bindgen_test_layout_apm_bios_info() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(apm_bios_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(apm_bios_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).version as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).offset as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_16 as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_16) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).dseg as *const _ as usize }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(dseg) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).flags as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_len as *const _ as usize }, + 14usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).cseg_16_len as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(cseg_16_len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const apm_bios_info)).dseg_len as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(apm_bios_info), + "::", + stringify!(dseg_len) + ) + ); +} +impl Clone for apm_bios_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params { + pub length: __u16, + pub info_flags: __u16, + pub num_default_cylinders: __u32, + pub num_default_heads: __u32, + pub sectors_per_track: __u32, + pub number_of_sectors: __u64, + pub bytes_per_sector: __u16, + pub dpte_ptr: __u32, + pub key: __u16, + pub device_path_info_length: __u8, + pub reserved2: __u8, + pub reserved3: __u16, + pub host_bus_type: [__u8; 4usize], + pub interface_type: [__u8; 8usize], + pub interface_path: edd_device_params__bindgen_ty_1, + pub device_path: edd_device_params__bindgen_ty_2, + pub reserved4: __u8, + pub checksum: __u8, +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1 { + pub isa: __BindgenUnionField, + pub pci: __BindgenUnionField, + pub ibnd: __BindgenUnionField, + pub xprs: __BindgenUnionField, + pub htpt: __BindgenUnionField, + pub unknown: __BindgenUnionField, + pub bindgen_union_field: [u8; 8usize], +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_1 { + pub base_address: __u16, + pub reserved1: __u16, + pub reserved2: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).base_address as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(base_address) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).reserved1 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_1)).reserved2 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_1), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_2 { + pub bus: __u8, + pub slot: __u8, + pub function: __u8, + pub channel: __u8, + pub reserved: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).bus as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(bus) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).slot as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(slot) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).function as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(function) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).channel as *const _ + as usize + }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(channel) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_2)).reserved as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_2), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_3 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_3)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_3), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_3 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_4 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_4() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_4)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_4), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_4 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_5 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_5() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_5)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_5), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_5 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_1__bindgen_ty_6 { + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1__bindgen_ty_6() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_1__bindgen_ty_6)).reserved as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1__bindgen_ty_6), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1__bindgen_ty_6 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 8usize, + concat!("Size of: ", stringify!(edd_device_params__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params__bindgen_ty_1)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).isa as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(isa) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).pci as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(pci) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).ibnd as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(ibnd) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).xprs as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(xprs) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).htpt as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(htpt) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_1)).unknown as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_1), + "::", + stringify!(unknown) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2 { + pub ata: __BindgenUnionField, + pub atapi: __BindgenUnionField, + pub scsi: __BindgenUnionField, + pub usb: __BindgenUnionField, + pub i1394: __BindgenUnionField, + pub fibre: __BindgenUnionField, + pub i2o: __BindgenUnionField, + pub raid: __BindgenUnionField, + pub sata: __BindgenUnionField, + pub unknown: __BindgenUnionField, + pub bindgen_union_field: [u8; 16usize], +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_1 { + pub device: __u8, + pub reserved1: __u8, + pub reserved2: __u16, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved1 as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved2 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_1)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_1), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_1 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_2 { + pub device: __u8, + pub lun: __u8, + pub reserved1: __u8, + pub reserved2: __u8, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).lun as *const _ as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(lun) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved1 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved2 as *const _ + as usize + }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_2)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_2), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_3 { + pub id: __u16, + pub lun: __u64, + pub reserved1: __u16, + pub reserved2: __u32, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_3() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).id as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(id) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).lun as *const _ as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(lun) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).reserved1 as *const _ + as usize + }, + 10usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_3)).reserved2 as *const _ + as usize + }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_3), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_3 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_4 { + pub serial_number: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_4() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_4)).serial_number + as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4), + "::", + stringify!(serial_number) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_4)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_4), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_4 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_5 { + pub eui: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_5() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_5)).eui as *const _ as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5), + "::", + stringify!(eui) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_5)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_5), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_5 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_6 { + pub wwid: __u64, + pub lun: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_6() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_6)).wwid as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6), + "::", + stringify!(wwid) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_6)).lun as *const _ as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_6), + "::", + stringify!(lun) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_6 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_7 { + pub identity_tag: __u64, + pub reserved: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_7() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_7)).identity_tag as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7), + "::", + stringify!(identity_tag) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_7)).reserved as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_7), + "::", + stringify!(reserved) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_7 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_8 { + pub array_number: __u32, + pub reserved1: __u32, + pub reserved2: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_8() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).array_number as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(array_number) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).reserved1 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_8)).reserved2 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_8), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_8 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_9 { + pub device: __u8, + pub reserved1: __u8, + pub reserved2: __u16, + pub reserved3: __u32, + pub reserved4: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_9() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).device as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved1 as *const _ + as usize + }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved2 as *const _ + as usize + }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved3 as *const _ + as usize + }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_9)).reserved4 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_9), + "::", + stringify!(reserved4) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_9 { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_device_params__bindgen_ty_2__bindgen_ty_10 { + pub reserved1: __u64, + pub reserved2: __u64, +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2__bindgen_ty_10() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!( + "Size of: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10) + ) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!( + "Alignment of ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_10)).reserved1 as *const _ + as usize + }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10), + "::", + stringify!(reserved1) + ) + ); + assert_eq!( + unsafe { + &(*(0 as *const edd_device_params__bindgen_ty_2__bindgen_ty_10)).reserved2 as *const _ + as usize + }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2__bindgen_ty_10), + "::", + stringify!(reserved2) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2__bindgen_ty_10 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params__bindgen_ty_2() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(edd_device_params__bindgen_ty_2)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params__bindgen_ty_2)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).ata as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(ata) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).atapi as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(atapi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).scsi as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(scsi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).usb as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(usb) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).i1394 as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(i1394) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).fibre as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(fibre) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).i2o as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(i2o) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).raid as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(raid) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).sata as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(sata) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params__bindgen_ty_2)).unknown as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params__bindgen_ty_2), + "::", + stringify!(unknown) + ) + ); +} +impl Clone for edd_device_params__bindgen_ty_2 { + fn clone(&self) -> Self { + *self + } +} +#[test] +fn bindgen_test_layout_edd_device_params() { + assert_eq!( + ::std::mem::size_of::(), + 74usize, + concat!("Size of: ", stringify!(edd_device_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_device_params)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).length as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).info_flags as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(info_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).num_default_cylinders as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(num_default_cylinders) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).num_default_heads as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(num_default_heads) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).sectors_per_track as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(sectors_per_track) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).number_of_sectors as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(number_of_sectors) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).bytes_per_sector as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(bytes_per_sector) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).dpte_ptr as *const _ as usize }, + 26usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(dpte_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).key as *const _ as usize }, + 30usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(key) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).device_path_info_length as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(device_path_info_length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved2 as *const _ as usize }, + 33usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved3 as *const _ as usize }, + 34usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).host_bus_type as *const _ as usize }, + 36usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(host_bus_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).interface_type as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(interface_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).interface_path as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(interface_path) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).device_path as *const _ as usize }, + 56usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(device_path) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).reserved4 as *const _ as usize }, + 72usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(reserved4) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_device_params)).checksum as *const _ as usize }, + 73usize, + concat!( + "Alignment of field: ", + stringify!(edd_device_params), + "::", + stringify!(checksum) + ) + ); +} +impl Clone for edd_device_params { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct edd_info { + pub device: __u8, + pub version: __u8, + pub interface_support: __u16, + pub legacy_max_cylinder: __u16, + pub legacy_max_head: __u8, + pub legacy_sectors_per_track: __u8, + pub params: edd_device_params, +} +#[test] +fn bindgen_test_layout_edd_info() { + assert_eq!( + ::std::mem::size_of::(), + 82usize, + concat!("Size of: ", stringify!(edd_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edd_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).device as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(device) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).version as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).interface_support as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(interface_support) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_max_cylinder as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_max_cylinder) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_max_head as *const _ as usize }, + 6usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_max_head) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).legacy_sectors_per_track as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(legacy_sectors_per_track) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd_info)).params as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(edd_info), + "::", + stringify!(params) + ) + ); +} +impl Clone for edd_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct edd { + pub mbr_signature: [::std::os::raw::c_uint; 16usize], + pub edd_info: [edd_info; 6usize], + pub mbr_signature_nr: ::std::os::raw::c_uchar, + pub edd_info_nr: ::std::os::raw::c_uchar, +} +#[test] +fn bindgen_test_layout_edd() { + assert_eq!( + ::std::mem::size_of::(), + 560usize, + concat!("Size of: ", stringify!(edd)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(edd)) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).mbr_signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(mbr_signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).edd_info as *const _ as usize }, + 64usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(edd_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).mbr_signature_nr as *const _ as usize }, + 556usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(mbr_signature_nr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const edd)).edd_info_nr as *const _ as usize }, + 557usize, + concat!( + "Alignment of field: ", + stringify!(edd), + "::", + stringify!(edd_info_nr) + ) + ); +} +impl Clone for edd { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct e820entry { + pub addr: __u64, + pub size: __u64, + pub type_: __u32, +} +#[test] +fn bindgen_test_layout_e820entry() { + assert_eq!( + ::std::mem::size_of::(), + 20usize, + concat!("Size of: ", stringify!(e820entry)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(e820entry)) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).addr as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(addr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).size as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820entry)).type_ as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(e820entry), + "::", + stringify!(type_) + ) + ); +} +impl Clone for e820entry { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +pub struct e820map { + pub nr_map: __u32, + pub map: [e820entry; 128usize], +} +#[test] +fn bindgen_test_layout_e820map() { + assert_eq!( + ::std::mem::size_of::(), + 2564usize, + concat!("Size of: ", stringify!(e820map)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(e820map)) + ); + assert_eq!( + unsafe { &(*(0 as *const e820map)).nr_map as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(e820map), + "::", + stringify!(nr_map) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const e820map)).map as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(e820map), + "::", + stringify!(map) + ) + ); +} +impl Default for e820map { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct ist_info { + pub signature: __u32, + pub command: __u32, + pub event: __u32, + pub perf_level: __u32, +} +#[test] +fn bindgen_test_layout_ist_info() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(ist_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(ist_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).command as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(command) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).event as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(event) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const ist_info)).perf_level as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(ist_info), + "::", + stringify!(perf_level) + ) + ); +} +impl Clone for ist_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Copy, Clone)] +pub struct edid_info { + pub dummy: [::std::os::raw::c_uchar; 128usize], +} +#[test] +fn bindgen_test_layout_edid_info() { + assert_eq!( + ::std::mem::size_of::(), + 128usize, + concat!("Size of: ", stringify!(edid_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(edid_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const edid_info)).dummy as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(edid_info), + "::", + stringify!(dummy) + ) + ); +} +impl Default for edid_info { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct setup_data { + pub next: __u64, + pub type_: __u32, + pub len: __u32, + pub data: __IncompleteArrayField<__u8>, +} +#[test] +fn bindgen_test_layout_setup_data() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(setup_data)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(setup_data)) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).next as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(next) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).type_ as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(type_) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).len as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(len) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_data)).data as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(setup_data), + "::", + stringify!(data) + ) + ); +} +impl Clone for setup_data { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct setup_header { + pub setup_sects: __u8, + pub root_flags: __u16, + pub syssize: __u32, + pub ram_size: __u16, + pub vid_mode: __u16, + pub root_dev: __u16, + pub boot_flag: __u16, + pub jump: __u16, + pub header: __u32, + pub version: __u16, + pub realmode_swtch: __u32, + pub start_sys: __u16, + pub kernel_version: __u16, + pub type_of_loader: __u8, + pub loadflags: __u8, + pub setup_move_size: __u16, + pub code32_start: __u32, + pub ramdisk_image: __u32, + pub ramdisk_size: __u32, + pub bootsect_kludge: __u32, + pub heap_end_ptr: __u16, + pub ext_loader_ver: __u8, + pub ext_loader_type: __u8, + pub cmd_line_ptr: __u32, + pub initrd_addr_max: __u32, + pub kernel_alignment: __u32, + pub relocatable_kernel: __u8, + pub min_alignment: __u8, + pub xloadflags: __u16, + pub cmdline_size: __u32, + pub hardware_subarch: __u32, + pub hardware_subarch_data: __u64, + pub payload_offset: __u32, + pub payload_length: __u32, + pub setup_data: __u64, + pub pref_address: __u64, + pub init_size: __u32, + pub handover_offset: __u32, +} +#[test] +fn bindgen_test_layout_setup_header() { + assert_eq!( + ::std::mem::size_of::(), + 119usize, + concat!("Size of: ", stringify!(setup_header)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(setup_header)) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_sects as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_sects) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).root_flags as *const _ as usize }, + 1usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(root_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).syssize as *const _ as usize }, + 3usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(syssize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ram_size as *const _ as usize }, + 7usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ram_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).vid_mode as *const _ as usize }, + 9usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(vid_mode) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).root_dev as *const _ as usize }, + 11usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(root_dev) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).boot_flag as *const _ as usize }, + 13usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(boot_flag) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).jump as *const _ as usize }, + 15usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(jump) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).header as *const _ as usize }, + 17usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(header) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).version as *const _ as usize }, + 21usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).realmode_swtch as *const _ as usize }, + 23usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(realmode_swtch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).start_sys as *const _ as usize }, + 27usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(start_sys) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).kernel_version as *const _ as usize }, + 29usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(kernel_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).type_of_loader as *const _ as usize }, + 31usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(type_of_loader) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).loadflags as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(loadflags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_move_size as *const _ as usize }, + 33usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_move_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).code32_start as *const _ as usize }, + 35usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(code32_start) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ramdisk_image as *const _ as usize }, + 39usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ramdisk_image) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ramdisk_size as *const _ as usize }, + 43usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ramdisk_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).bootsect_kludge as *const _ as usize }, + 47usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(bootsect_kludge) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).heap_end_ptr as *const _ as usize }, + 51usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(heap_end_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ext_loader_ver as *const _ as usize }, + 53usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ext_loader_ver) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).ext_loader_type as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(ext_loader_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).cmd_line_ptr as *const _ as usize }, + 55usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(cmd_line_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).initrd_addr_max as *const _ as usize }, + 59usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(initrd_addr_max) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).kernel_alignment as *const _ as usize }, + 63usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(kernel_alignment) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).relocatable_kernel as *const _ as usize }, + 67usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(relocatable_kernel) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).min_alignment as *const _ as usize }, + 68usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(min_alignment) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).xloadflags as *const _ as usize }, + 69usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(xloadflags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).cmdline_size as *const _ as usize }, + 71usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(cmdline_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).hardware_subarch as *const _ as usize }, + 75usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(hardware_subarch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).hardware_subarch_data as *const _ as usize }, + 79usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(hardware_subarch_data) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).payload_offset as *const _ as usize }, + 87usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(payload_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).payload_length as *const _ as usize }, + 91usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(payload_length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).setup_data as *const _ as usize }, + 95usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(setup_data) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).pref_address as *const _ as usize }, + 103usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(pref_address) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).init_size as *const _ as usize }, + 111usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(init_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const setup_header)).handover_offset as *const _ as usize }, + 115usize, + concat!( + "Alignment of field: ", + stringify!(setup_header), + "::", + stringify!(handover_offset) + ) + ); +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct sys_desc_table { + pub length: __u16, + pub table: [__u8; 14usize], +} +#[test] +fn bindgen_test_layout_sys_desc_table() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(sys_desc_table)) + ); + assert_eq!( + ::std::mem::align_of::(), + 2usize, + concat!("Alignment of ", stringify!(sys_desc_table)) + ); + assert_eq!( + unsafe { &(*(0 as *const sys_desc_table)).length as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(sys_desc_table), + "::", + stringify!(length) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const sys_desc_table)).table as *const _ as usize }, + 2usize, + concat!( + "Alignment of field: ", + stringify!(sys_desc_table), + "::", + stringify!(table) + ) + ); +} +impl Clone for sys_desc_table { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Debug, Default, Copy)] +pub struct olpc_ofw_header { + pub ofw_magic: __u32, + pub ofw_version: __u32, + pub cif_handler: __u32, + pub irq_desc_table: __u32, +} +#[test] +fn bindgen_test_layout_olpc_ofw_header() { + assert_eq!( + ::std::mem::size_of::(), + 16usize, + concat!("Size of: ", stringify!(olpc_ofw_header)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(olpc_ofw_header)) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).ofw_magic as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(ofw_magic) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).ofw_version as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(ofw_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).cif_handler as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(cif_handler) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const olpc_ofw_header)).irq_desc_table as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(olpc_ofw_header), + "::", + stringify!(irq_desc_table) + ) + ); +} +impl Clone for olpc_ofw_header { + fn clone(&self) -> Self { + *self + } +} +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct efi_info { + pub efi_loader_signature: __u32, + pub efi_systab: __u32, + pub efi_memdesc_size: __u32, + pub efi_memdesc_version: __u32, + pub efi_memmap: __u32, + pub efi_memmap_size: __u32, + pub efi_systab_hi: __u32, + pub efi_memmap_hi: __u32, +} +#[test] +fn bindgen_test_layout_efi_info() { + assert_eq!( + ::std::mem::size_of::(), + 32usize, + concat!("Size of: ", stringify!(efi_info)) + ); + assert_eq!( + ::std::mem::align_of::(), + 4usize, + concat!("Alignment of ", stringify!(efi_info)) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_loader_signature as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_loader_signature) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_systab as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_systab) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memdesc_size as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memdesc_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memdesc_version as *const _ as usize }, + 12usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memdesc_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap_size as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_systab_hi as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_systab_hi) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const efi_info)).efi_memmap_hi as *const _ as usize }, + 28usize, + concat!( + "Alignment of field: ", + stringify!(efi_info), + "::", + stringify!(efi_memmap_hi) + ) + ); +} +impl Clone for efi_info { + fn clone(&self) -> Self { + *self + } +} +#[repr(C, packed)] +#[derive(Copy, Clone)] +pub struct boot_params { + pub screen_info: screen_info, + pub apm_bios_info: apm_bios_info, + pub _pad2: [__u8; 4usize], + pub tboot_addr: __u64, + pub ist_info: ist_info, + pub _pad3: [__u8; 16usize], + pub hd0_info: [__u8; 16usize], + pub hd1_info: [__u8; 16usize], + pub sys_desc_table: sys_desc_table, + pub olpc_ofw_header: olpc_ofw_header, + pub ext_ramdisk_image: __u32, + pub ext_ramdisk_size: __u32, + pub ext_cmd_line_ptr: __u32, + pub _pad4: [__u8; 116usize], + pub edid_info: edid_info, + pub efi_info: efi_info, + pub alt_mem_k: __u32, + pub scratch: __u32, + pub e820_entries: __u8, + pub eddbuf_entries: __u8, + pub edd_mbr_sig_buf_entries: __u8, + pub kbd_status: __u8, + pub _pad5: [__u8; 3usize], + pub sentinel: __u8, + pub _pad6: [__u8; 1usize], + pub hdr: setup_header, + pub _pad7: [__u8; 40usize], + pub edd_mbr_sig_buffer: [__u32; 16usize], + pub e820_map: [e820entry; 128usize], + pub _pad8: [__u8; 48usize], + pub eddbuf: [edd_info; 6usize], + pub _pad9: [__u8; 276usize], +} +#[test] +fn bindgen_test_layout_boot_params() { + assert_eq!( + ::std::mem::size_of::(), + 4096usize, + concat!("Size of: ", stringify!(boot_params)) + ); + assert_eq!( + ::std::mem::align_of::(), + 1usize, + concat!("Alignment of ", stringify!(boot_params)) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).screen_info as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(screen_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).apm_bios_info as *const _ as usize }, + 64usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(apm_bios_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad2 as *const _ as usize }, + 84usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad2) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).tboot_addr as *const _ as usize }, + 88usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(tboot_addr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ist_info as *const _ as usize }, + 96usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ist_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad3 as *const _ as usize }, + 112usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad3) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hd0_info as *const _ as usize }, + 128usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hd0_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hd1_info as *const _ as usize }, + 144usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hd1_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).sys_desc_table as *const _ as usize }, + 160usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(sys_desc_table) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).olpc_ofw_header as *const _ as usize }, + 176usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(olpc_ofw_header) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_ramdisk_image as *const _ as usize }, + 192usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_ramdisk_image) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_ramdisk_size as *const _ as usize }, + 196usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_ramdisk_size) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).ext_cmd_line_ptr as *const _ as usize }, + 200usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(ext_cmd_line_ptr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad4 as *const _ as usize }, + 204usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad4) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edid_info as *const _ as usize }, + 320usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edid_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).efi_info as *const _ as usize }, + 448usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(efi_info) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).alt_mem_k as *const _ as usize }, + 480usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(alt_mem_k) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).scratch as *const _ as usize }, + 484usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(scratch) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).e820_entries as *const _ as usize }, + 488usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(e820_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).eddbuf_entries as *const _ as usize }, + 489usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(eddbuf_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edd_mbr_sig_buf_entries as *const _ as usize }, + 490usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edd_mbr_sig_buf_entries) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).kbd_status as *const _ as usize }, + 491usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(kbd_status) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad5 as *const _ as usize }, + 492usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad5) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).sentinel as *const _ as usize }, + 495usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(sentinel) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad6 as *const _ as usize }, + 496usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad6) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).hdr as *const _ as usize }, + 497usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(hdr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad7 as *const _ as usize }, + 616usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad7) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).edd_mbr_sig_buffer as *const _ as usize }, + 656usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(edd_mbr_sig_buffer) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).e820_map as *const _ as usize }, + 720usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(e820_map) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad8 as *const _ as usize }, + 3280usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad8) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params)).eddbuf as *const _ as usize }, + 3328usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(eddbuf) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const boot_params))._pad9 as *const _ as usize }, + 3820usize, + concat!( + "Alignment of field: ", + stringify!(boot_params), + "::", + stringify!(_pad9) + ) + ); +} +impl Default for boot_params { + fn default() -> Self { + unsafe { ::std::mem::zeroed() } + } +} +pub const X86_SUBARCH_PC: _bindgen_ty_1 = 0; +pub const X86_SUBARCH_LGUEST: _bindgen_ty_1 = 1; +pub const X86_SUBARCH_XEN: _bindgen_ty_1 = 2; +pub const X86_SUBARCH_INTEL_MID: _bindgen_ty_1 = 3; +pub const X86_SUBARCH_CE4100: _bindgen_ty_1 = 4; +pub const X86_NR_SUBARCHS: _bindgen_ty_1 = 5; +pub type _bindgen_ty_1 = ::std::os::raw::c_uint; diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/elf.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/elf.rs new file mode 100644 index 000000000..b7d71d7a2 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/elf.rs @@ -0,0 +1,340 @@ +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +/* + * automatically generated by rust-bindgen + * From upstream linux include/uapi/linux/elf.h at commit: + * 806276b7f07a39a1cc3f38bb1ef5c573d4594a38 + */ +pub const EI_MAG0: ::std::os::raw::c_uint = 0; +pub const EI_MAG1: ::std::os::raw::c_uint = 1; +pub const EI_MAG2: ::std::os::raw::c_uint = 2; +pub const EI_MAG3: ::std::os::raw::c_uint = 3; +pub const EI_DATA: ::std::os::raw::c_uint = 5; + +pub const ELFMAG0: ::std::os::raw::c_uint = 127; + +pub const ELFDATA2LSB: ::std::os::raw::c_uint = 1; +pub const PT_LOAD: ::std::os::raw::c_uint = 1; + +pub const ELFMAG1: u8 = b'E'; +pub const ELFMAG2: u8 = b'L'; +pub const ELFMAG3: u8 = b'F'; + +type Elf64_Addr = __u64; +type Elf64_Half = __u16; +type Elf64_Off = __u64; +type Elf64_Word = __u32; +type Elf64_Xword = __u64; + +type __s8 = ::std::os::raw::c_schar; +type __u8 = ::std::os::raw::c_uchar; +type __s16 = ::std::os::raw::c_short; +type __u16 = ::std::os::raw::c_ushort; +type __s32 = ::std::os::raw::c_int; +type __u32 = ::std::os::raw::c_uint; +type __s64 = ::std::os::raw::c_longlong; +type __u64 = ::std::os::raw::c_ulonglong; + +#[repr(C)] +#[derive(Debug, Default, Copy)] +pub struct elf64_hdr { + pub e_ident: [::std::os::raw::c_uchar; 16usize], + 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, +} +impl Clone for elf64_hdr { + fn clone(&self) -> Self { + *self + } +} +pub type Elf64_Ehdr = elf64_hdr; + +#[repr(C)] +#[derive(Debug, Default, Copy)] +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, +} + +impl Clone for elf64_phdr { + fn clone(&self) -> Self { + *self + } +} +pub type Elf64_Phdr = elf64_phdr; + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn bindgen_test_layout_elf64_phdr() { + assert_eq!( + ::std::mem::size_of::(), + 56usize, + concat!("Size of: ", stringify!(elf64_phdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(elf64_phdr)) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_type as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_flags as *const _ as usize }, + 4usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_offset as *const _ as usize }, + 8usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_offset) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_vaddr as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_vaddr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_paddr as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_paddr) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_filesz as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_filesz) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_memsz as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_memsz) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_phdr)).p_align as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(elf64_phdr), + "::", + stringify!(p_align) + ) + ); + } + + #[test] + fn bindgen_test_layout_elf64_hdr() { + assert_eq!( + ::std::mem::size_of::(), + 64usize, + concat!("Size of: ", stringify!(elf64_hdr)) + ); + assert_eq!( + ::std::mem::align_of::(), + 8usize, + concat!("Alignment of ", stringify!(elf64_hdr)) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_ident as *const _ as usize }, + 0usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_ident) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_type as *const _ as usize }, + 16usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_type) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_machine as *const _ as usize }, + 18usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_machine) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_version as *const _ as usize }, + 20usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_version) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_entry as *const _ as usize }, + 24usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_entry) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phoff as *const _ as usize }, + 32usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phoff) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shoff as *const _ as usize }, + 40usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shoff) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_flags as *const _ as usize }, + 48usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_flags) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_ehsize as *const _ as usize }, + 52usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_ehsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phentsize as *const _ as usize }, + 54usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phentsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_phnum as *const _ as usize }, + 56usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_phnum) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shentsize as *const _ as usize }, + 58usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shentsize) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shnum as *const _ as usize }, + 60usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shnum) + ) + ); + assert_eq!( + unsafe { &(*(0 as *const elf64_hdr)).e_shstrndx as *const _ as usize }, + 62usize, + concat!( + "Alignment of field: ", + stringify!(elf64_hdr), + "::", + stringify!(e_shstrndx) + ) + ); + } +} diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/mod.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/mod.rs new file mode 100644 index 000000000..7c9d5e87e --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/mod.rs @@ -0,0 +1,596 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +//! Traits and Structs +//! - [KernelLoader](trait.KernelLoader.html): load kernel image into guest memory +//! - [KernelLoaderResult](struct.KernelLoaderResult.html): the structure which loader +//! returns to VMM to assist zero page construction and boot environment setup +//! - [Elf](struct.Elf.html): elf image loader +//! - [BzImage](struct.BzImage.html): bzImage loader + +extern crate vm_memory; + +use std::error::{self, Error as KernelLoaderError}; +use std::ffi::CStr; +use std::fmt::{self, Display}; +use std::io::{Read, Seek, SeekFrom}; +use std::mem; + +use vm_memory::{Address, Bytes, GuestAddress, GuestMemory, GuestUsize}; + +#[allow(dead_code)] +#[allow(non_camel_case_types)] +#[allow(non_snake_case)] +#[allow(non_upper_case_globals)] +#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))] +pub mod bootparam; +#[allow(dead_code)] +#[allow(non_camel_case_types)] +#[allow(non_snake_case)] +#[allow(non_upper_case_globals)] +#[cfg_attr(feature = "cargo-clippy", allow(clippy::all))] +mod elf; +mod struct_util; + +#[derive(Debug, PartialEq)] +pub enum Error { + BigEndianElfOnLittle, + CommandLineCopy, + CommandLineOverflow, + InvalidElfMagicNumber, + InvalidProgramHeaderSize, + InvalidProgramHeaderOffset, + InvalidProgramHeaderAddress, + InvalidEntryAddress, + InvalidBzImage, + InvalidKernelStartAddress, + InitrdImageSizeTooLarge, + MemoryOverflow, + ReadElfHeader, + ReadKernelImage, + ReadProgramHeader, + ReadBzImageHeader, + ReadBzImageCompressedKernel, + ReadInitrdImage, + SeekKernelStart, + SeekElfStart, + SeekProgramHeader, + SeekBzImageEnd, + SeekBzImageHeader, + SeekBzImageCompressedKernel, + SeekInitrdImage, +} +pub type Result = std::result::Result; + +impl error::Error for Error { + fn description(&self) -> &str { + match self { + Error::BigEndianElfOnLittle => { + "Trying to load big-endian binary on little-endian machine" + } + Error::CommandLineCopy => "Failed writing command line to guest memory", + Error::CommandLineOverflow => "Command line overflowed guest memory", + Error::InvalidElfMagicNumber => "Invalid Elf magic number", + Error::InvalidProgramHeaderSize => "Invalid program header size", + Error::InvalidProgramHeaderOffset => "Invalid program header offset", + Error::InvalidProgramHeaderAddress => "Invalid Program Header Address", + Error::InvalidEntryAddress => "Invalid entry address", + Error::InvalidBzImage => "Invalid bzImage", + Error::InvalidKernelStartAddress => "Invalid kernel start address", + Error::InitrdImageSizeTooLarge => "Initrd image size too large", + Error::MemoryOverflow => "Memory to load kernel image is not enough", + Error::ReadElfHeader => "Unable to read elf header", + Error::ReadKernelImage => "Unable to read kernel image", + Error::ReadProgramHeader => "Unable to read program header", + Error::ReadBzImageHeader => "Unable to read bzImage header", + Error::ReadBzImageCompressedKernel => "Unable to read bzImage compressed kernel", + Error::ReadInitrdImage => "Unable to read initrd image", + Error::SeekKernelStart => "Unable to seek to kernel start", + Error::SeekElfStart => "Unable to seek to elf start", + Error::SeekProgramHeader => "Unable to seek to program header", + Error::SeekBzImageEnd => "Unable to seek bzImage end", + Error::SeekBzImageHeader => "Unable to seek bzImage header", + Error::SeekBzImageCompressedKernel => "Unable to seek bzImage compressed kernel", + Error::SeekInitrdImage => "Unable to seek initrd image", + } + } +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Kernel Loader Error: {}", Error::description(self)) + } +} + +#[derive(Debug, Default, Copy, Clone, PartialEq)] +pub struct KernelLoaderResult { + // Address in the guest memory where the kernel image starts to be loaded + pub kernel_load: GuestAddress, + // Offset in guest memory corresponding to the end of kernel image, in case that + // device tree blob and initrd will be loaded adjacent to kernel image. + pub kernel_end: GuestUsize, + // This field is only for bzImage following https://www.kernel.org/doc/Documentation/x86/boot.txt + // VMM should make use of it to fill zero page for bzImage direct boot. + pub setup_header: Option, +} + +pub trait KernelLoader { + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + highmem_start_address: Option, + ) -> Result + where + F: Read + Seek; +} + +#[cfg(feature = "elf")] +pub struct Elf; + +#[cfg(feature = "elf")] +impl KernelLoader for Elf { + /// Loads a kernel from a vmlinux elf image to a slice + /// + /// kernel is loaded into guest memory at offset phdr.p_paddr specified by elf image. + /// + /// # Arguments + /// + /// * `guest_mem` - The guest memory region the kernel is written to. + /// * `kernel_start` - The offset into 'guest_mem' at which to load the kernel. + /// * `kernel_image` - Input vmlinux image. + /// * `highmem_start_address` - This is the start of the high memory, kernel should above it. + /// + /// # Returns + /// * KernelLoaderResult + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + highmem_start_address: Option, + ) -> Result + where + F: Read + Seek, + { + let mut ehdr: elf::Elf64_Ehdr = Default::default(); + kernel_image + .seek(SeekFrom::Start(0)) + .map_err(|_| Error::SeekElfStart)?; + unsafe { + // read_struct is safe when reading a POD struct. It can be used and dropped without issue. + struct_util::read_struct(kernel_image, &mut ehdr).map_err(|_| Error::ReadElfHeader)?; + } + + // Sanity checks + if ehdr.e_ident[elf::EI_MAG0 as usize] != elf::ELFMAG0 as u8 + || ehdr.e_ident[elf::EI_MAG1 as usize] != elf::ELFMAG1 + || ehdr.e_ident[elf::EI_MAG2 as usize] != elf::ELFMAG2 + || ehdr.e_ident[elf::EI_MAG3 as usize] != elf::ELFMAG3 + { + return Err(Error::InvalidElfMagicNumber); + } + if ehdr.e_ident[elf::EI_DATA as usize] != elf::ELFDATA2LSB as u8 { + return Err(Error::BigEndianElfOnLittle); + } + if ehdr.e_phentsize as usize != mem::size_of::() { + return Err(Error::InvalidProgramHeaderSize); + } + if (ehdr.e_phoff as usize) < mem::size_of::() { + + return Err(Error::InvalidProgramHeaderOffset); + } + if (highmem_start_address.is_some()) + && ((ehdr.e_entry as u64) < highmem_start_address.unwrap().raw_value()) + { + return Err(Error::InvalidEntryAddress); + } + + let mut loader_result: KernelLoaderResult = Default::default(); + // where the kernel will be start loaded. + loader_result.kernel_load = match kernel_start { + Some(start) => GuestAddress(start.raw_value() + (ehdr.e_entry as u64)), + None => GuestAddress(ehdr.e_entry as u64), + }; + + kernel_image + .seek(SeekFrom::Start(ehdr.e_phoff)) + .map_err(|_| Error::SeekProgramHeader)?; + let phdrs: Vec = unsafe { + // Reading the structs is safe for a slice of POD structs. + struct_util::read_struct_slice(kernel_image, ehdr.e_phnum as usize) + .map_err(|_| Error::ReadProgramHeader)? + }; + + // Read in each section pointed to by the program headers. + for phdr in &phdrs { + if phdr.p_type != elf::PT_LOAD || phdr.p_filesz == 0 { + continue; + } + + kernel_image + .seek(SeekFrom::Start(phdr.p_offset)) + .map_err(|_| Error::SeekKernelStart)?; + + // if the vmm does not specify where the kernel should be loaded, just + // load it to the physical address p_paddr for each segment. + let mem_offset = match kernel_start { + Some(start) => start + .checked_add(phdr.p_paddr as u64) + .ok_or(Error::InvalidProgramHeaderAddress)?, + None => GuestAddress(phdr.p_paddr as u64), + }; + + guest_mem + .read_exact_from(mem_offset, kernel_image, phdr.p_filesz as usize) + .map_err(|_| Error::ReadKernelImage)?; + + loader_result.kernel_end = mem_offset.raw_value() + .checked_add(phdr.p_memsz as GuestUsize) + .ok_or(Error::MemoryOverflow)?; + } + + // elf image has no setup_header which is defined for bzImage + loader_result.setup_header = None; + + Ok(loader_result) + } +} + +#[cfg(feature = "bzImage")] +pub struct BzImage; + +#[cfg(feature = "bzImage")] +impl KernelLoader for BzImage { + /// Loads a bzImage + /// + /// kernel is loaded into guest memory at code32_start the default load address + /// stored in bzImage setup header. + /// + /// # Arguments + /// + /// * `guest_mem` - The guest memory where the kernel image is loaded. + /// * `kernel_start` - The offset into 'guest_mem' at which to load the kernel. + /// * `kernel_image` - Input bzImage image. + /// * `highmem_start_address` - This is the start of the high memory, kernel should above it. + /// + /// # Returns + /// * KernelLoaderResult + fn load( + guest_mem: &M, + kernel_start: Option, + kernel_image: &mut F, + highmem_start_address: Option, + ) -> Result + where + F: Read + Seek, + { + let mut kernel_size = kernel_image + .seek(SeekFrom::End(0)) + .map_err(|_| Error::SeekBzImageEnd)? as usize; + let mut boot_header: bootparam::setup_header = Default::default(); + kernel_image + .seek(SeekFrom::Start(0x1F1)) + .map_err(|_| Error::SeekBzImageHeader)?; + unsafe { + // read_struct is safe when reading a POD struct. It can be used and dropped without issue. + struct_util::read_struct(kernel_image, &mut boot_header) + .map_err(|_| Error::ReadBzImageHeader)?; + } + + // if the HdrS magic number is not found at offset 0x202, the boot protocol version is "old", + // the image type is assumed as zImage, not bzImage. + if boot_header.header != 0x5372_6448 { + return Err(Error::InvalidBzImage); + } + + // follow section of loading the rest of the kernel in linux boot protocol + if (boot_header.version < 0x0200) || ((boot_header.loadflags & 0x1) == 0x0) { + return Err(Error::InvalidBzImage); + } + + let mut setup_size = boot_header.setup_sects as usize; + if setup_size == 0 { + setup_size = 4; + } + setup_size = (setup_size + 1) * 512; + kernel_size -= setup_size; + + // verify bzImage validation by checking if code32_start, the defaults to the address of + // the kernel is not lower than high memory. + if (highmem_start_address.is_some()) + && (u64::from(boot_header.code32_start) < highmem_start_address.unwrap().raw_value()) + { + return Err(Error::InvalidKernelStartAddress); + } + + let mem_offset = match kernel_start { + Some(start) => start, + None => GuestAddress(u64::from(boot_header.code32_start)), + }; + + boot_header.code32_start = mem_offset.raw_value() as u32; + + let mut loader_result: KernelLoaderResult = Default::default(); + loader_result.setup_header = Some(boot_header); + loader_result.kernel_load = mem_offset; + + //seek the compressed vmlinux.bin and read to memory + kernel_image + .seek(SeekFrom::Start(setup_size as u64)) + .map_err(|_| Error::SeekBzImageCompressedKernel)?; + guest_mem + .read_exact_from(mem_offset, kernel_image, kernel_size) + .map_err(|_| Error::ReadBzImageCompressedKernel)?; + + loader_result.kernel_end = mem_offset.raw_value() + .checked_add(kernel_size as GuestUsize) + .ok_or(Error::MemoryOverflow)?; + + Ok(loader_result) + } +} + +/// Writes the command line string to the given memory slice. +/// +/// # Arguments +/// +/// * `guest_mem` - A u8 slice that will be partially overwritten by the command line. +/// * `guest_addr` - The address in `guest_mem` at which to load the command line. +/// * `cmdline` - The kernel command line. +pub fn load_cmdline( + guest_mem: &M, + guest_addr: GuestAddress, + cmdline: &CStr, +) -> Result<()> { + let len = cmdline.to_bytes().len(); + if len == 0 { + return Ok(()); + } + + let end = guest_addr + .checked_add(len as u64 + 1) + .ok_or(Error::CommandLineOverflow)?; // Extra for null termination. + if end > guest_mem.end_addr() { + return Err(Error::CommandLineOverflow)?; + } + + guest_mem + .write_slice(cmdline.to_bytes_with_nul(), guest_addr) + .map_err(|_| Error::CommandLineCopy)?; + + Ok(()) +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::Cursor; + use vm_memory::{Address, GuestAddress, GuestMemoryMmap}; + + const MEM_SIZE: u64 = 0x1000000; + + fn create_guest_mem() -> GuestMemoryMmap { + GuestMemoryMmap::new(&[(GuestAddress(0x0), (MEM_SIZE as usize))]).unwrap() + } + + #[allow(non_snake_case)] + #[cfg(feature = "bzImage")] + fn make_bzImage() -> Vec { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("../../.buildkite/hooks/boot/vmlinuz-3.10.0-957.el7.x86_64")); + v + } + + // Elf64 image that prints hello world on x86_64. + fn make_elf_bin() -> Vec { + let mut v = Vec::new(); + v.extend_from_slice(include_bytes!("test_elf.bin")); + v + } + + #[allow(safe_packed_borrows)] + #[allow(non_snake_case)] + #[test] + #[cfg(feature = "bzImage")] + fn load_bzImage() { + let gm = create_guest_mem(); + let image = make_bzImage(); + let mut kernel_start = GuestAddress(0x200000); + let mut highmem_start_address = GuestAddress(0x0); + + // load bzImage with good kernel_start and himem_start setting + let mut loader_result = BzImage::load( + &gm, + Some(kernel_start), + &mut Cursor::new(&image), + Some(highmem_start_address), + ) + .unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + println!( + "bzImage version is {:2x} \n", + loader_result.setup_header.unwrap().version + ); + println!( + "bzImage loadflags is {:x} \n", + loader_result.setup_header.unwrap().loadflags + ); + println!( + "bzImage kernel size is {:4x} \n", + (loader_result.kernel_end as u32) + ); + + // load bzImage without kernel_start + loader_result = BzImage::load( + &gm, + None, + &mut Cursor::new(&image), + Some(highmem_start_address), + ) + .unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + // load bzImage withouth himem_start + loader_result = BzImage::load(&gm, None, &mut Cursor::new(&image), None).unwrap(); + assert_eq!(0x53726448, loader_result.setup_header.unwrap().header); + println!( + "bzImage is loaded at {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + // load bzImage with a bad himem setting + kernel_start = GuestAddress(0x1000); + highmem_start_address = GuestAddress(0x200000); + let x = BzImage::load( + &gm, + Some(kernel_start), + &mut Cursor::new(&image), + Some(highmem_start_address), + ); + assert_eq!(x.is_ok(), false); + println!("load bzImage with bad himem setting \n"); + } + + #[test] + #[cfg(feature = "elf")] + fn load_elf() { + let gm = create_guest_mem(); + let image = make_elf_bin(); + let kernel_addr = GuestAddress(0x200000); + let mut highmem_start_address = GuestAddress(0x0); + let mut loader_result = Elf::load( + &gm, + Some(kernel_addr), + &mut Cursor::new(&image), + Some(highmem_start_address), + ) + .unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + loader_result = Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&image), None).unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + loader_result = Elf::load( + &gm, + None, + &mut Cursor::new(&image), + Some(highmem_start_address), + ) + .unwrap(); + println!( + "load elf at address {:8x} \n", + loader_result.kernel_load.raw_value() + ); + + highmem_start_address = GuestAddress(0xa00000); + assert_eq!( + Err(Error::InvalidEntryAddress), + Elf::load( + &gm, + None, + &mut Cursor::new(&image), + Some(highmem_start_address) + ) + ); + } + + #[test] + fn cmdline_overflow() { + let gm = create_guest_mem(); + let cmdline_address = GuestAddress(MEM_SIZE - 5); + assert_eq!( + Err(Error::CommandLineOverflow), + load_cmdline( + &gm, + cmdline_address, + CStr::from_bytes_with_nul(b"12345\0").unwrap() + ) + ); + } + + #[test] + fn cmdline_write_end() { + let gm = create_guest_mem(); + let mut cmdline_address = GuestAddress(45); + assert_eq!( + Ok(()), + load_cmdline( + &gm, + cmdline_address, + CStr::from_bytes_with_nul(b"1234\0").unwrap() + ) + ); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '1' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '2' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '3' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '4' as u8); + cmdline_address = cmdline_address.unchecked_add(1); + let val: u8 = gm.read_obj(cmdline_address).unwrap(); + assert_eq!(val, '\0' as u8); + } + + #[test] + fn bad_magic() { + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x1] = 0x33; + assert_eq!( + Err(Error::InvalidElfMagicNumber), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } + + #[test] + fn bad_endian() { + // Only little endian is supported + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x5] = 2; + assert_eq!( + Err(Error::BigEndianElfOnLittle), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } + + #[test] + fn bad_phoff() { + // program header has to be past the end of the elf header + let gm = create_guest_mem(); + let kernel_addr = GuestAddress(0x0); + let mut bad_image = make_elf_bin(); + bad_image[0x20] = 0x10; + assert_eq!( + Err(Error::InvalidProgramHeaderOffset), + Elf::load(&gm, Some(kernel_addr), &mut Cursor::new(&bad_image), None) + ); + } +} diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/struct_util.rs b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/struct_util.rs new file mode 100644 index 000000000..a2ef60bfa --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/struct_util.rs @@ -0,0 +1,152 @@ +// Copyright (c) 2019 Intel Corporation. All rights reserved. +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause + +use std; +use std::io::Read; +use std::mem; + +#[derive(Debug)] +pub enum Error { + ReadStruct, +} +pub type Result = std::result::Result; + +/// Reads a struct from an input buffer. +/// This is unsafe because the struct is initialized to unverified data read from the input. +/// `read_struct` should only be called to fill plain old data structs. It is not endian safe. +/// +/// # Arguments +/// +/// * `f` - The input to read from. Often this is a file. +/// * `out` - The struct to fill with data read from `f`. +pub unsafe fn read_struct(f: &mut F, out: &mut T) -> Result<()> { + let out_slice = std::slice::from_raw_parts_mut(out as *mut T as *mut u8, mem::size_of::()); + f.read_exact(out_slice).map_err(|_| Error::ReadStruct)?; + Ok(()) +} + +/// Reads an array of structs from an input buffer. Returns a Vec of structs initialized with data +/// from the specified input. +/// This is unsafe because the structs are initialized to unverified data read from the input. +/// `read_struct_slice` should only be called for plain old data structs. It is not endian safe. +/// +/// # Arguments +/// +/// * `f` - The input to read from. Often this is a file. +/// * `len` - The number of structs to fill with data read from `f`. +pub unsafe fn read_struct_slice(f: &mut F, len: usize) -> Result> { + let mut out: Vec = Vec::with_capacity(len); + out.set_len(len); + let out_slice = std::slice::from_raw_parts_mut( + out.as_ptr() as *mut T as *mut u8, + mem::size_of::() * len, + ); + f.read_exact(out_slice).map_err(|_| Error::ReadStruct)?; + Ok(out) +} + +#[cfg(test)] +mod tests { + use super::*; + use std::io::Cursor; + use std::mem; + + #[derive(Clone, Copy, Debug, Default, PartialEq)] + struct TestRead { + a: u64, + b: u8, + c: u8, + d: u8, + e: u8, + } + + #[test] + fn struct_basic_read() { + let orig = TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + &orig as *const _ as *const u8, + std::mem::size_of::(), + ) + }; + assert_eq!(mem::size_of::(), mem::size_of_val(&source)); + let mut tr: TestRead = Default::default(); + unsafe { + read_struct(&mut Cursor::new(source), &mut tr).unwrap(); + } + assert_eq!(orig, tr); + } + + #[test] + fn struct_read_past_end() { + let orig = TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + &orig as *const _ as *const u8, + std::mem::size_of::() - 1, + ) + }; + let mut tr: TestRead = Default::default(); + unsafe { + assert!(read_struct(&mut Cursor::new(source), &mut tr).is_err()); + format!("{:?}", read_struct(&mut Cursor::new(source), &mut tr)); + } + } + + #[test] + fn struct_slice_read() { + let orig = vec![ + TestRead { + a: 0x7766554433221100, + b: 0x88, + c: 0x99, + d: 0xaa, + e: 0xbb, + }, + TestRead { + a: 0x7867564534231201, + b: 0x02, + c: 0x13, + d: 0x24, + e: 0x35, + }, + TestRead { + a: 0x7a69584736251403, + b: 0x04, + c: 0x15, + d: 0x26, + e: 0x37, + }, + ]; + let source = unsafe { + // Don't worry it's a test + std::slice::from_raw_parts( + orig.as_ptr() as *const u8, + std::mem::size_of::() * 3, + ) + }; + + let tr: Vec = unsafe { read_struct_slice(&mut Cursor::new(source), 3).unwrap() }; + assert_eq!(orig, tr); + } +} diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/test_elf.bin b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/test_elf.bin new file mode 100644 index 000000000..2e75f639f Binary files /dev/null and b/vendor/git-bda1448fb2afcb00/linux-loader/src/loader/test_elf.bin differ diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/tests/conftest.py b/vendor/git-bda1448fb2afcb00/linux-loader/tests/conftest.py new file mode 100644 index 000000000..58aef2d74 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/tests/conftest.py @@ -0,0 +1,28 @@ +import pytest + + +PROFILE_CI="ci" +PROFILE_DEVEL="devel" + + +def pytest_addoption(parser): + parser.addoption( + "--profile", + default=PROFILE_CI, + choices=[PROFILE_CI, PROFILE_DEVEL], + help="Profile for running the test: {} or {}".format( + PROFILE_CI, + PROFILE_DEVEL + ) + ) + + +@pytest.fixture +def profile(request): + return request.config.getoption("--profile") + + +# This is used for defining global variables in pytest. +def pytest_configure(): + pytest.profile_ci = PROFILE_CI + pytest.profile_devel = PROFILE_DEVEL diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/tests/coverage b/vendor/git-bda1448fb2afcb00/linux-loader/tests/coverage new file mode 100644 index 000000000..4e569a97e --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/tests/coverage @@ -0,0 +1 @@ +67.0 diff --git a/vendor/git-bda1448fb2afcb00/linux-loader/tests/test_coverage.py b/vendor/git-bda1448fb2afcb00/linux-loader/tests/test_coverage.py new file mode 100644 index 000000000..c009f8e04 --- /dev/null +++ b/vendor/git-bda1448fb2afcb00/linux-loader/tests/test_coverage.py @@ -0,0 +1,108 @@ +# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +"""Test the coverage and update the threshold when coverage is increased.""" + +import os, re, shutil, subprocess +import pytest + +def _get_current_coverage(): + """Helper function that returns the coverage computed with kcov.""" + kcov_ouput_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "kcov_output" + ) + + # By default the build output for kcov and unit tests are both in the debug + # directory. This causes some linker errors that I haven't investigated. + # Error: error: linking with `cc` failed: exit code: 1 + # An easy fix is to have separate build directories for kcov & unit tests. + kcov_build_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + "kcov_build" + ) + + # Remove kcov output and build directory to be sure we are always working + # on a clean environment. + shutil.rmtree(kcov_ouput_dir, ignore_errors=True) + shutil.rmtree(kcov_build_dir, ignore_errors=True) + + exclude_pattern = ( + '${CARGO_HOME:-$HOME/.cargo/},' + 'usr/lib/,' + 'lib/' + ) + exclude_region = "'mod tests {'" + + kcov_cmd = "CARGO_TARGET_DIR={} cargo kcov --all " \ + "--output {} -- " \ + "--exclude-region={} " \ + "--exclude-pattern={} " \ + "--verify".format( + kcov_build_dir, + kcov_ouput_dir, + exclude_region, + exclude_pattern + ) + + subprocess.run(kcov_cmd, shell=True, check=True) + + # Read the coverage reported by kcov. + coverage_file = os.path.join(kcov_ouput_dir, 'index.js') + with open(coverage_file) as cov_output: + coverage = float(re.findall( + r'"covered":"(\d+\.\d)"', + cov_output.read() + )[0]) + + # Remove coverage related directories. + shutil.rmtree(kcov_ouput_dir, ignore_errors=True) + shutil.rmtree(kcov_build_dir, ignore_errors=True) + + return coverage + + +def _get_previous_coverage(): + """Helper function that returns the last reported coverage.""" + coverage_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'coverage' + ) + + # The first and only line of the file contains the coverage. + with open(coverage_path) as f: + coverage = f.readline() + return float(coverage.strip()) + +def _update_coverage(cov_value): + """Updates the coverage in the coverage file.""" + coverage_path = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'coverage' + ) + + with open(coverage_path, "w") as f: + f.write(str(cov_value)) + +def test_coverage(profile): + current_coverage = _get_current_coverage() + previous_coverage = _get_previous_coverage() + if previous_coverage < current_coverage: + if profile == pytest.profile_ci: + # In the CI Profile we expect the coverage to be manually updated. + assert False, "Coverage is increased from {} to {}. " \ + "Please update the coverage in " \ + "tests/coverage.".format( + previous_coverage, + current_coverage + ) + elif profile == pytest.profile_devel: + _update_coverage(current_coverage) + else: + # This should never happen because pytest should only accept + # the valid test profiles specified with `choices` in + # `pytest_addoption`. + assert False, "Invalid test profile." + elif previous_coverage > current_coverage: + diff = float(previous_coverage - current_coverage) + assert False, "Coverage drops by {:.2f}%. Please add unit tests for" \ + "the uncovered lines.".format(diff) diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.buildkite/pipeline.yml b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.buildkite/pipeline.yml new file mode 100644 index 000000000..f62c2a4fc --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.buildkite/pipeline.yml @@ -0,0 +1,75 @@ +steps: + - label: "build-gnu-x86" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "build-gnu-arm" + commands: + - cargo build --release + retry: + automatic: false + agents: + platform: arm.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "style" + command: cargo fmt --all -- --check + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true + + - label: "unittests-gnu-x86" + commands: + - cargo test + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + tmpfs: [ "/tmp:exec" ] + + - label: "unittests-gnu-arm" + commands: + - cargo test + retry: + automatic: false + agents: + platform: arm.metal + plugins: + - docker#v3.0.1: + privileged: true + image: "fandree/rust-vmm-dev" + always-pull: true + tmpfs: [ "/tmp:exec" ] + + - label: "clippy-x86" + commands: + - cargo clippy --all -- -D warnings + retry: + automatic: false + agents: + platform: x86_64.metal + plugins: + - docker#v3.0.1: + image: "fandree/rust-vmm-dev" + always-pull: true diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.cargo-checksum.json b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.cargo-checksum.json new file mode 100644 index 000000000..2bd61c742 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{".buildkite/pipeline.yml":"0194df2d3534e3c6938ba2945e05696a12b8ed63d4941b3a4173c5bcf6e587c4","Cargo.toml":"d19b52349ada25dbbae4e2bea4850cf1b09ea546d5efee03ddfbbf9f184c0c72","LICENSE-APACHE":"c71d239df91726fc519c6eb72d318ec65820627232b2f796219e87dcf35d0ab4","LICENSE-BSD-3-Clause":"a6d3ebd1c2f37d4fd83d0676621f695fc0cc2d8c6e646cdbb831b46e0650c208","README.md":"94512ed84e8e89faba431d9107e85d229363c187705ab9244f0ab5269b5961b5","src/errno.rs":"b93845c200fc596b0ef2414671d965cf5c4fdbf6bba6e5e5f0d032a32c73f8ac","src/eventfd.rs":"7bd871242f49c14d8783714e6814456f51a9c280dcadf1625e1bd2313d2b5f7f","src/file_traits.rs":"398c529e7ebce143ecb9f9bd2f5f47ea3e953ac34cc211ad71cdcf1898cc7d38","src/ioctl.rs":"5c4abf75e7b6786e7da3191ac1e4460e1ec7d073a53331a6d9597bb9ccc3f88a","src/lib.rs":"ee0818e0ca6fdc340c52d514eeb2e3aeb4f7ba8e4e522bb946cdbce4779926f1","src/poll.rs":"1498c14ba022ede57c4faf17bee49cf5ac9d1c8d3883db441697ee224dac7818","src/seek_hole.rs":"de43f21bc2c5d9eb7f06e21e3c20f93476bf6016e4d041df71a02b9e54b3c3ca","src/signal.rs":"724f679cb62d268a5ec8f0704a8d6b01882f302f508c189e82054657ed8b31bf","src/syslog.rs":"fbf4bde16b1059b5b39c5318e8bb918dc431e8e0ccbc82c0d765b9ce4a8d5f96","src/tempdir.rs":"4993460e81f7df6398e0f2b07cc3d81e728aa7e0559c7f3d83b6df1876bc3776","src/terminal.rs":"85efb1df641730fa1981bac6fd65bd75f7d532bb8680a56e94d6d006eeb363e9","src/timerfd.rs":"fd3c52e3918d881c16cb1498f8f66253ee758275a6a66ed8eb11c78e69f69e55","src/write_zeroes.rs":"c2951bbdb3ab07727eda29e9a91a51e427fdf6fed0b611ea6a3732edbd9a1246"},"package":null} \ No newline at end of file diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/Cargo.toml b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/Cargo.toml new file mode 100644 index 000000000..bb697b6c3 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "vmm-sys-util" +version = "0.1.0" +authors = ["Jing Liu "] +license = "Apache-2.0" + +[dependencies] +libc = ">=0.2.39" + diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/LICENSE-APACHE b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/LICENSE-APACHE new file mode 100644 index 000000000..261eeb9e9 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/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/vendor/git-ccfa5f04f3f14300/vmm-sys-util/LICENSE-BSD-3-Clause b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/LICENSE-BSD-3-Clause new file mode 100644 index 000000000..8bafca303 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/LICENSE-BSD-3-Clause @@ -0,0 +1,27 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/README.md b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/README.md new file mode 100644 index 000000000..383aa42db --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/README.md @@ -0,0 +1,2 @@ +# vmm-sys-util +This crate is a collection of modules that provides helpers and utilities. diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/errno.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/errno.rs new file mode 100644 index 000000000..89bbbb6b1 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/errno.rs @@ -0,0 +1,80 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::fmt::{Display, Formatter}; +use std::io; +use std::result; + +use libc::__errno_location; + +/// An error number, retrieved from [`errno`](http://man7.org/linux/man-pages/man3/errno.3.html), +/// set by a libc function that returned an error. +#[derive(Clone, Copy, Debug, PartialEq)] +pub struct Error(i32); +pub type Result = result::Result; + +impl Error { + /// Constructs a new error with the given `errno`. + pub fn new(e: i32) -> Error { + Error(e) + } + + /// Constructs an error from the current `errno`. + /// + /// The result of this only has any meaning just after a libc call that returned a value + /// indicating `errno` was set. + pub fn last() -> Error { + Error(unsafe { *__errno_location() }) + } + + /// Gets the `errno` for this error. + pub fn errno(self) -> i32 { + self.0 + } +} + +impl Display for Error { + fn fmt(&self, f: &mut Formatter) -> std::fmt::Result { + io::Error::from_raw_os_error(self.0).fmt(f) + } +} + +impl From for Error { + fn from(e: io::Error) -> Self { + Error::new(e.raw_os_error().unwrap_or_default()) + } +} + +/// Returns the last `errno` as a [`Result`] that is always an error. +/// +/// [`Result`]: type.Result.html +pub fn errno_result() -> Result { + Err(Error::last()) +} + +#[cfg(test)] +mod tests { + use super::*; + use libc; + use std::fs::File; + use std::io::{self, Write}; + use std::os::unix::io::FromRawFd; + + #[test] + pub fn test_invalid_fd() { + let mut file = unsafe { File::from_raw_fd(-1) }; + assert!(file.write(b"test").is_err()); + let last_err = errno_result::().unwrap_err(); + assert_eq!(last_err, Error::new(libc::EBADF)); + assert_eq!(last_err.errno(), libc::EBADF); + assert_eq!(last_err, Error::from(io::Error::last_os_error())); + assert_eq!(last_err, Error::last()); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/eventfd.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/eventfd.rs new file mode 100644 index 000000000..ff0542735 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/eventfd.rs @@ -0,0 +1,150 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::fs::File; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; +use std::{io, mem, result}; + +use libc::{c_void, dup, eventfd, read, write}; + +/// A safe wrapper around a Linux eventfd (man 2 eventfd). +pub struct EventFd { + eventfd: File, +} + +impl EventFd { + /// Creates a new blocking EventFd with an initial value. + /// + /// `flag`: The initial value. Refer to Linux eventfd(2). + pub fn new(flag: i32) -> result::Result { + // This is safe because eventfd merely allocated an eventfd for + // our process and we handle the error case. + let ret = unsafe { eventfd(0, flag) }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + // This is safe because we checked ret for success and know + // the kernel gave us an fd that we own. + Ok(EventFd { + eventfd: unsafe { File::from_raw_fd(ret) }, + }) + } + } + + /// Adds `v` to the eventfd's count, does not block if the result will overflow the count + pub fn write(&self, v: u64) -> result::Result<(), io::Error> { + // This is safe because we made this fd and the pointer we pass + // can not overflow because we give the syscall's size parameter properly. + let ret = unsafe { + write( + self.as_raw_fd(), + &v as *const u64 as *const c_void, + mem::size_of::(), + ) + }; + if ret <= 0 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } + } + + /// Tries to read from the eventfd, does not block if the counter is zero + pub fn read(&self) -> result::Result { + let mut buf: u64 = 0; + let ret = unsafe { + // This is safe because we made this fd and the pointer we + // pass can not overflow because we give the syscall's size parameter properly. + read( + self.as_raw_fd(), + &mut buf as *mut u64 as *mut c_void, + mem::size_of::(), + ) + }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + Ok(buf) + } + } + + /// Clones this EventFd, internally creating a new file descriptor. The new EventFd will share + /// the same underlying count within the kernel. + pub fn try_clone(&self) -> result::Result { + // This is safe because we made this fd and properly check that it returns without error. + let ret = unsafe { dup(self.as_raw_fd()) }; + if ret < 0 { + Err(io::Error::last_os_error()) + } else { + // This is safe because we checked ret for success and know the kernel gave us an fd that we + // own. + Ok(EventFd { + eventfd: unsafe { File::from_raw_fd(ret) }, + }) + } + } +} + +impl AsRawFd for EventFd { + fn as_raw_fd(&self) -> RawFd { + self.eventfd.as_raw_fd() + } +} + +impl FromRawFd for EventFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + EventFd { + eventfd: File::from_raw_fd(fd), + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::EFD_NONBLOCK; + + #[test] + fn test_new() { + EventFd::new(EFD_NONBLOCK).unwrap(); + EventFd::new(0).unwrap(); + } + + #[test] + fn test_read_write() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + evt.write(55).unwrap(); + assert_eq!(evt.read().unwrap(), 55); + } + + #[test] + fn test_write_overflow() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + evt.write(std::u64::MAX - 1).unwrap(); + let r = evt.write(1); + match r { + Err(ref inner) if inner.kind() == io::ErrorKind::WouldBlock => (), + _ => panic!("Unexpected"), + } + } + #[test] + fn test_read_nothing() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + let r = evt.read(); + match r { + Err(ref inner) if inner.kind() == io::ErrorKind::WouldBlock => (), + _ => panic!("Unexpected"), + } + } + #[test] + fn test_clone() { + let evt = EventFd::new(EFD_NONBLOCK).unwrap(); + let evt_clone = evt.try_clone().unwrap(); + evt.write(923).unwrap(); + assert_eq!(evt_clone.read().unwrap(), 923); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/file_traits.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/file_traits.rs new file mode 100644 index 000000000..a2fa77b87 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/file_traits.rs @@ -0,0 +1,39 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::fs::File; +use std::io::Result; + +/// A trait for flushing the contents of a file to disk. +/// This is equivalent to File's `sync_all` method, but +/// wrapped in a trait so that it can be implemented for +/// other types. +pub trait FileSync { + // Flush buffers related to this file to disk. + fn fsync(&mut self) -> Result<()>; +} + +impl FileSync for File { + fn fsync(&mut self) -> Result<()> { + self.sync_all() + } +} + +/// A trait for setting the size of a file. +/// This is equivalent to File's `set_len` method, but +/// wrapped in a trait so that it can be implemented for +/// other types. +pub trait FileSetLen { + // Set the size of this file. + // This is the moral equivalent of `ftruncate()`. + fn set_len(&self, _len: u64) -> Result<()>; +} + +impl FileSetLen for File { + fn set_len(&self, len: u64) -> Result<()> { + File::set_len(self, len) + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/ioctl.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/ioctl.rs new file mode 100644 index 000000000..0adc3b1d4 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/ioctl.rs @@ -0,0 +1,225 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +//! Macros and wrapper functions for dealing with ioctls. +use libc; +use std::os::raw::{c_int, c_uint, c_ulong, c_void}; +use std::os::unix::io::AsRawFd; + +/// Raw macro to declare the expression that calculates an ioctl number +#[macro_export] +macro_rules! ioctl_expr { + ($dir:expr, $ty:expr, $nr:expr, $size:expr) => { + (($dir << $crate::ioctl::_IOC_DIRSHIFT) + | ($ty << $crate::ioctl::_IOC_TYPESHIFT) + | ($nr << $crate::ioctl::_IOC_NRSHIFT) + | ($size << $crate::ioctl::_IOC_SIZESHIFT)) as ::std::os::raw::c_ulong + }; +} + +/// Raw macro to declare a function that returns an ioctl number. +#[macro_export] +macro_rules! ioctl_ioc_nr { + ($name:ident, $dir:expr, $ty:expr, $nr:expr, $size:expr) => { + #[allow(non_snake_case)] + #[allow(clippy::cast_lossless)] + pub fn $name() -> ::std::os::raw::c_ulong { + ioctl_expr!($dir, $ty, $nr, $size) + } + }; + ($name:ident, $dir:expr, $ty:expr, $nr:expr, $size:expr, $($v:ident),+) => { + #[allow(non_snake_case)] + #[allow(clippy::cast_lossless)] + pub fn $name($($v: ::std::os::raw::c_uint),+) -> ::std::os::raw::c_ulong { + ioctl_expr!($dir, $ty, $nr, $size) + } + }; +} + +/// Declare an ioctl that transfers no data. +#[macro_export] +macro_rules! ioctl_io_nr { + ($name:ident, $ty:expr, $nr:expr) => { + ioctl_ioc_nr!($name, $crate::ioctl::_IOC_NONE, $ty, $nr, 0); + }; + ($name:ident, $ty:expr, $nr:expr, $($v:ident),+) => { + ioctl_ioc_nr!($name, $crate::ioctl::_IOC_NONE, $ty, $nr, 0, $($v),+); + }; +} + +/// Declare an ioctl that reads data. +#[macro_export] +macro_rules! ioctl_ior_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +/// Declare an ioctl that writes data. +#[macro_export] +macro_rules! ioctl_iow_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +/// Declare an ioctl that reads and writes data. +#[macro_export] +macro_rules! ioctl_iowr_nr { + ($name:ident, $ty:expr, $nr:expr, $size:ty) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ | $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32 + ); + }; + ($name:ident, $ty:expr, $nr:expr, $size:ty, $($v:ident),+) => { + ioctl_ioc_nr!( + $name, + $crate::ioctl::_IOC_READ | $crate::ioctl::_IOC_WRITE, + $ty, + $nr, + ::std::mem::size_of::<$size>() as u32, + $($v),+ + ); + }; +} + +pub const _IOC_NRBITS: c_uint = 8; +pub const _IOC_TYPEBITS: c_uint = 8; +pub const _IOC_SIZEBITS: c_uint = 14; +pub const _IOC_DIRBITS: c_uint = 2; +pub const _IOC_NRMASK: c_uint = 255; +pub const _IOC_TYPEMASK: c_uint = 255; +pub const _IOC_SIZEMASK: c_uint = 16383; +pub const _IOC_DIRMASK: c_uint = 3; +pub const _IOC_NRSHIFT: c_uint = 0; +pub const _IOC_TYPESHIFT: c_uint = 8; +pub const _IOC_SIZESHIFT: c_uint = 16; +pub const _IOC_DIRSHIFT: c_uint = 30; +pub const _IOC_NONE: c_uint = 0; +pub const _IOC_WRITE: c_uint = 1; +pub const _IOC_READ: c_uint = 2; +pub const IOC_IN: c_uint = 1_073_741_824; +pub const IOC_OUT: c_uint = 2_147_483_648; +pub const IOC_INOUT: c_uint = 3_221_225_472; +pub const IOCSIZE_MASK: c_uint = 1_073_676_288; +pub const IOCSIZE_SHIFT: c_uint = 16; + +// The type of the `req` parameter is different for the `musl` library. This will enable +// successful build for other non-musl libraries. +#[cfg(target_env = "musl")] +type IoctlRequest = c_int; +#[cfg(not(target_env = "musl"))] +type IoctlRequest = c_ulong; + +/// Run an ioctl with no arguments. +pub unsafe fn ioctl(fd: &F, req: c_ulong) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, 0) +} + +/// Run an ioctl with a single value argument. +pub unsafe fn ioctl_with_val(fd: &F, req: c_ulong, arg: c_ulong) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg) +} + +/// Run an ioctl with an immutable reference. +pub unsafe fn ioctl_with_ref(fd: &F, req: c_ulong, arg: &T) -> c_int { + libc::ioctl( + fd.as_raw_fd(), + req as IoctlRequest, + arg as *const T as *const c_void, + ) +} + +/// Run an ioctl with a mutable reference. +pub unsafe fn ioctl_with_mut_ref(fd: &F, req: c_ulong, arg: &mut T) -> c_int { + libc::ioctl( + fd.as_raw_fd(), + req as IoctlRequest, + arg as *mut T as *mut c_void, + ) +} + +/// Run an ioctl with a raw pointer. +pub unsafe fn ioctl_with_ptr(fd: &F, req: c_ulong, arg: *const T) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg as *const c_void) +} + +/// Run an ioctl with a mutable raw pointer. +pub unsafe fn ioctl_with_mut_ptr(fd: &F, req: c_ulong, arg: *mut T) -> c_int { + libc::ioctl(fd.as_raw_fd(), req as IoctlRequest, arg as *mut c_void) +} + +#[cfg(test)] +mod tests { + const TUNTAP: ::std::os::raw::c_uint = 0x54; + const VHOST: ::std::os::raw::c_uint = 0xAF; + const EVDEV: ::std::os::raw::c_uint = 0x45; + + const KVMIO: ::std::os::raw::c_uint = 0xAE; + + ioctl_io_nr!(KVM_CREATE_VM, KVMIO, 0x01); + ioctl_ior_nr!(TUNGETFEATURES, TUNTAP, 0xcf, ::std::os::raw::c_uint); + ioctl_iow_nr!(TUNSETQUEUE, TUNTAP, 0xd9, ::std::os::raw::c_int); + ioctl_io_nr!(VHOST_SET_OWNER, VHOST, 0x01); + ioctl_iowr_nr!(VHOST_GET_VRING_BASE, VHOST, 0x12, ::std::os::raw::c_int); + ioctl_iowr_nr!(KVM_GET_MSR_INDEX_LIST, KVMIO, 0x2, ::std::os::raw::c_int); + + ioctl_ior_nr!(EVIOCGBIT, EVDEV, 0x20 + evt, [u8; 128], evt); + ioctl_io_nr!(FAKE_IOCTL_2_ARG, EVDEV, 0x01 + x + y, x, y); + + #[test] + fn test_ioctl_macros() { + assert_eq!(0x0000_AE01, KVM_CREATE_VM()); + assert_eq!(0x0000_AF01, VHOST_SET_OWNER()); + assert_eq!(0x8004_54CF, TUNGETFEATURES()); + assert_eq!(0x4004_54D9, TUNSETQUEUE()); + assert_eq!(0xC004_AE02, KVM_GET_MSR_INDEX_LIST()); + assert_eq!(0xC004_AF12, VHOST_GET_VRING_BASE()); + + assert_eq!(0x8080_4522, EVIOCGBIT(2)); + assert_eq!(0x0000_4509, FAKE_IOCTL_2_ARG(3, 5)); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/lib.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/lib.rs new file mode 100644 index 000000000..883e4a53d --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/lib.rs @@ -0,0 +1,78 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +extern crate libc; + +mod tempdir; + +#[macro_use] +pub mod ioctl; + +pub mod errno; +pub mod eventfd; +pub mod file_traits; +pub mod seek_hole; +pub mod signal; +pub mod terminal; +pub mod timerfd; +pub mod write_zeroes; + +#[macro_use] +pub mod syslog; + +pub mod poll; + +pub use crate::tempdir::*; +pub use errno::*; +pub use eventfd::*; +pub use poll::*; + +use std::os::unix::io::AsRawFd; + +pub use crate::file_traits::{FileSetLen, FileSync}; +pub use crate::seek_hole::SeekHole; +pub use crate::write_zeroes::{PunchHole, WriteZeroes}; + +pub enum FallocateMode { + PunchHole, + ZeroRange, +} + +/// Safe wrapper for `fallocate()`. +pub fn fallocate( + file: &dyn AsRawFd, + mode: FallocateMode, + keep_size: bool, + offset: u64, + len: u64, +) -> Result<()> { + let offset = if offset > libc::off64_t::max_value() as u64 { + return Err(Error::new(libc::EINVAL)); + } else { + offset as libc::off64_t + }; + + let len = if len > libc::off64_t::max_value() as u64 { + return Err(Error::new(libc::EINVAL)); + } else { + len as libc::off64_t + }; + + let mut mode = match mode { + FallocateMode::PunchHole => libc::FALLOC_FL_PUNCH_HOLE, + FallocateMode::ZeroRange => libc::FALLOC_FL_ZERO_RANGE, + }; + + if keep_size { + mode |= libc::FALLOC_FL_KEEP_SIZE; + } + + // Safe since we pass in a valid fd and fallocate mode, validate offset and len, + // and check the return value. + let ret = unsafe { libc::fallocate64(file.as_raw_fd(), mode, offset, len) }; + if ret < 0 { + errno_result() + } else { + Ok(()) + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/poll.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/poll.rs new file mode 100644 index 000000000..4eb49a429 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/poll.rs @@ -0,0 +1,711 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::cell::{Cell, Ref, RefCell}; +use std::cmp::min; +use std::fs::File; +use std::i32; +use std::i64; +use std::marker::PhantomData; +use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; +use std::ptr::null_mut; +use std::slice; +use std::thread; +use std::time::Duration; + +use libc::{ + c_int, epoll_create1, epoll_ctl, epoll_event, epoll_wait, EINTR, EPOLLHUP, EPOLLIN, EPOLLOUT, + EPOLL_CLOEXEC, EPOLL_CTL_ADD, EPOLL_CTL_DEL, EPOLL_CTL_MOD, +}; + +use crate::{errno_result, Error, Result}; + +macro_rules! handle_eintr_errno { + ($x:expr) => {{ + let mut res; + loop { + res = $x; + if res != -1 || Error::last() != Error::new(EINTR) { + break; + } + } + res + }}; +} + +const POLL_CONTEXT_MAX_EVENTS: usize = 16; + +/// EpollEvents wraps raw epoll_events, it should only be used with EpollContext. +pub struct EpollEvents(RefCell<[epoll_event; POLL_CONTEXT_MAX_EVENTS]>); + +impl EpollEvents { + pub fn new() -> EpollEvents { + EpollEvents(RefCell::new( + [epoll_event { events: 0, u64: 0 }; POLL_CONTEXT_MAX_EVENTS], + )) + } +} + +impl Default for EpollEvents { + fn default() -> Self { + Self::new() + } +} + +/// Trait for a token that can be associated with an `fd` in a `PollContext`. +/// +/// Simple enums that have no or primitive variant data can use the `#[derive(PollToken)]` +/// custom derive to implement this trait. +pub trait PollToken { + /// Converts this token into a u64 that can be turned back into a token via `from_raw_token`. + fn as_raw_token(&self) -> u64; + + /// Converts a raw token as returned from `as_raw_token` back into a token. + /// + /// It is invalid to give a raw token that was not returned via `as_raw_token` from the same + /// `Self`. The implementation can expect that this will never happen as a result of its usage + /// in `PollContext`. + fn from_raw_token(data: u64) -> Self; +} + +impl PollToken for usize { + fn as_raw_token(&self) -> u64 { + *self as u64 + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u64 { + fn as_raw_token(&self) -> u64 { + *self as u64 + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u32 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u16 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for u8 { + fn as_raw_token(&self) -> u64 { + u64::from(*self) + } + + fn from_raw_token(data: u64) -> Self { + data as Self + } +} + +impl PollToken for () { + fn as_raw_token(&self) -> u64 { + 0 + } + + fn from_raw_token(_data: u64) -> Self {} +} + +/// An event returned by `PollContext::wait`. +pub struct PollEvent<'a, T> { + event: &'a epoll_event, + token: PhantomData, // Needed to satisfy usage of T +} + +impl<'a, T: PollToken> PollEvent<'a, T> { + /// Gets the token associated in `PollContext::add` with this event. + pub fn token(&self) -> T { + T::from_raw_token(self.event.u64) + } + + /// True if the `fd` associated with this token in `PollContext::add` is readable. + pub fn readable(&self) -> bool { + self.event.events & (EPOLLIN as u32) != 0 + } + + /// True if the `fd` associated with this token in `PollContext::add` has been hungup on. + pub fn hungup(&self) -> bool { + self.event.events & (EPOLLHUP as u32) != 0 + } +} + +/// An iterator over some (sub)set of events returned by `PollContext::wait`. +pub struct PollEventIter<'a, I, T> +where + I: Iterator, +{ + mask: u32, + iter: I, + tokens: PhantomData<[T]>, // Needed to satisfy usage of T +} + +impl<'a, I, T> Iterator for PollEventIter<'a, I, T> +where + I: Iterator, + T: PollToken, +{ + type Item = PollEvent<'a, T>; + fn next(&mut self) -> Option { + let mask = self.mask; + self.iter + .find(|event| (event.events & mask) != 0) + .map(|event| PollEvent { + event, + token: PhantomData, + }) + } +} + +/// The list of event returned by `PollContext::wait`. +pub struct PollEvents<'a, T> { + count: usize, + events: Ref<'a, [epoll_event; POLL_CONTEXT_MAX_EVENTS]>, + tokens: PhantomData<[T]>, // Needed to satisfy usage of T +} + +impl<'a, T: PollToken> PollEvents<'a, T> { + /// Copies the events to an owned structure so the reference to this (and by extension + /// `PollContext`) can be dropped. + pub fn to_owned(&self) -> PollEventsOwned { + PollEventsOwned { + count: self.count, + events: RefCell::new(*self.events), + tokens: PhantomData, + } + } + + /// Iterates over each event. + pub fn iter(&self) -> PollEventIter, T> { + PollEventIter { + mask: 0xffff_ffff, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } + + /// Iterates over each readable event. + pub fn iter_readable(&self) -> PollEventIter, T> { + PollEventIter { + mask: EPOLLIN as u32, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } + + /// Iterates over each hungup event. + pub fn iter_hungup(&self) -> PollEventIter, T> { + PollEventIter { + mask: EPOLLHUP as u32, + iter: self.events[..self.count].iter(), + tokens: PhantomData, + } + } +} + +/// A deep copy of the event records from `PollEvents`. +pub struct PollEventsOwned { + count: usize, + events: RefCell<[epoll_event; POLL_CONTEXT_MAX_EVENTS]>, + tokens: PhantomData, // Needed to satisfy usage of T +} + +impl PollEventsOwned { + /// Takes a reference to the events so that they can be iterated via methods in `PollEvents`. + pub fn as_ref(&self) -> PollEvents { + PollEvents { + count: self.count, + events: self.events.borrow(), + tokens: PhantomData, + } + } +} + +/// Watching events taken by PollContext. +pub struct WatchingEvents(u32); + +impl WatchingEvents { + /// Returns empty Events. + #[inline(always)] + pub fn empty() -> WatchingEvents { + WatchingEvents(0) + } + + /// Build Events from raw epoll events (defined in epoll_ctl(2)). + #[inline(always)] + pub fn new(raw: u32) -> WatchingEvents { + WatchingEvents(raw) + } + + /// Set read events. + #[inline(always)] + pub fn set_read(self) -> WatchingEvents { + WatchingEvents(self.0 | EPOLLIN as u32) + } + + /// Set write events. + #[inline(always)] + pub fn set_write(self) -> WatchingEvents { + WatchingEvents(self.0 | EPOLLOUT as u32) + } + + /// Get the underlying epoll events. + pub fn get_raw(&self) -> u32 { + self.0 + } +} + +/// EpollContext wraps linux epoll. It provides similar interface to PollContext. +/// It is thread safe while PollContext is not. It requires user to pass in a reference of +/// EpollEvents while PollContext does not. Always use PollContext if you don't need to access the +/// same epoll from different threads. +pub struct EpollContext { + epoll_ctx: File, + // Needed to satisfy usage of T + tokens: PhantomData<[T]>, +} + +impl EpollContext { + /// Creates a new `EpollContext`. + pub fn new() -> Result> { + // Safe because we check the return value. + let epoll_fd = unsafe { epoll_create1(EPOLL_CLOEXEC) }; + if epoll_fd < 0 { + return errno_result(); + } + Ok(EpollContext { + epoll_ctx: unsafe { File::from_raw_fd(epoll_fd) }, + tokens: PhantomData, + }) + } + + /// Adds the given `fd` to this context and associates the given `token` with the `fd`'s + /// readable events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add(&self, fd: &AsRawFd, token: T) -> Result<()> { + self.add_fd_with_events(fd, WatchingEvents::empty().set_read(), token) + } + + /// Adds the given `fd` to this context, watching for the specified events and associates the + /// given 'token' with those events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add_fd_with_events(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + let mut evt = epoll_event { + events: events.get_raw(), + u64: token.as_raw_token(), + }; + // Safe because we give a valid epoll FD and FD to watch, as well as a valid epoll_event + // structure. Then we check the return value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_ADD, + fd.as_raw_fd(), + &mut evt, + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// If `fd` was previously added to this context, the watched events will be replaced with + /// `events` and the token associated with it will be replaced with the given `token`. + pub fn modify(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + let mut evt = epoll_event { + events: events.0, + u64: token.as_raw_token(), + }; + // Safe because we give a valid epoll FD and FD to modify, as well as a valid epoll_event + // structure. Then we check the return value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_MOD, + fd.as_raw_fd(), + &mut evt, + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// Deletes the given `fd` from this context. + /// + /// If an `fd`'s token shows up in the list of hangup events, it should be removed using this + /// method or by closing/dropping (if and only if the fd was never dup()'d/fork()'d) the `fd`. + /// Failure to do so will cause the `wait` method to always return immediately, causing ~100% + /// CPU load. + pub fn delete(&self, fd: &AsRawFd) -> Result<()> { + // Safe because we give a valid epoll FD and FD to stop watching. Then we check the return + // value. + let ret = unsafe { + epoll_ctl( + self.epoll_ctx.as_raw_fd(), + EPOLL_CTL_DEL, + fd.as_raw_fd(), + null_mut(), + ) + }; + if ret < 0 { + return errno_result(); + }; + Ok(()) + } + + /// Waits for any events to occur in FDs that were previously added to this context. + /// + /// The events are level-triggered, meaning that if any events are unhandled (i.e. not reading + /// for readable events and not closing for hungup events), subsequent calls to `wait` will + /// return immediately. The consequence of not handling an event perpetually while calling + /// `wait` is that the callers loop will degenerated to busy loop polling, pinning a CPU to + /// ~100% usage. + pub fn wait<'a>(&self, events: &'a EpollEvents) -> Result> { + self.wait_timeout(events, Duration::new(i64::MAX as u64, 0)) + } + + /// Like `wait` except will only block for a maximum of the given `timeout`. + /// + /// This may return earlier than `timeout` with zero events if the duration indicated exceeds + /// system limits. + pub fn wait_timeout<'a>( + &self, + events: &'a EpollEvents, + timeout: Duration, + ) -> Result> { + let timeout_millis = if timeout.as_secs() as i64 == i64::max_value() { + // We make the convenient assumption that 2^63 seconds is an effectively unbounded time + // frame. This is meant to mesh with `wait` calling us with no timeout. + -1 + } else { + // In cases where we the number of milliseconds would overflow an i32, we substitute the + // maximum timeout which is ~24.8 days. + let millis = timeout + .as_secs() + .checked_mul(1_000) + .and_then(|ms| ms.checked_add(u64::from(timeout.subsec_nanos()) / 1_000_000)) + .unwrap_or(i32::max_value() as u64); + min(i32::max_value() as u64, millis) as i32 + }; + let ret = { + let mut epoll_events = events.0.borrow_mut(); + let max_events = epoll_events.len() as c_int; + // Safe because we give an epoll context and a properly sized epoll_events array + // pointer, which we trust the kernel to fill in properly. + unsafe { + handle_eintr_errno!(epoll_wait( + self.epoll_ctx.as_raw_fd(), + &mut epoll_events[0], + max_events, + timeout_millis + )) + } + }; + if ret < 0 { + return errno_result(); + } + let epoll_events = events.0.borrow(); + let events = PollEvents { + count: ret as usize, + events: epoll_events, + tokens: PhantomData, + }; + Ok(events) + } +} + +impl AsRawFd for EpollContext { + fn as_raw_fd(&self) -> RawFd { + self.epoll_ctx.as_raw_fd() + } +} + +impl IntoRawFd for EpollContext { + fn into_raw_fd(self) -> RawFd { + self.epoll_ctx.into_raw_fd() + } +} + +/// Used to poll multiple objects that have file descriptors. +/// +/// # Example +/// +/// ``` +/// # use vmm_sys_util::{Result, EventFd, PollContext, PollEvents}; +/// # fn test() -> Result<()> { +/// let evt1 = EventFd::new(0)?; +/// let evt2 = EventFd::new(0)?; +/// evt2.write(1)?; +/// +/// let ctx: PollContext = PollContext::new()?; +/// ctx.add(&evt1, 1)?; +/// ctx.add(&evt2, 2)?; +/// +/// let pollevents: PollEvents = ctx.wait()?; +/// let tokens: Vec = pollevents.iter_readable().map(|e| e.token()).collect(); +/// assert_eq!(&tokens[..], &[2]); +/// # Ok(()) +/// # } +/// ``` +pub struct PollContext { + epoll_ctx: EpollContext, + + // We use a RefCell here so that the `wait` method only requires an immutable self reference + // while returning the events (encapsulated by PollEvents). Without the RefCell, `wait` would + // hold a mutable reference that lives as long as its returned reference (i.e. the PollEvents), + // even though that reference is immutable. This is terribly inconvenient for the caller because + // the borrow checking would prevent them from using `delete` and `add` while the events are in + // scope. + events: EpollEvents, + + // Hangup busy loop detection variables. See `check_for_hungup_busy_loop`. + hangups: Cell, + max_hangups: Cell, +} + +impl PollContext { + /// Creates a new `PollContext`. + pub fn new() -> Result> { + Ok(PollContext { + epoll_ctx: EpollContext::new()?, + events: EpollEvents::new(), + hangups: Cell::new(0), + max_hangups: Cell::new(0), + }) + } + + /// Adds the given `fd` to this context and associates the given `token` with the `fd`'s + /// readable events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add(&self, fd: &AsRawFd, token: T) -> Result<()> { + self.add_fd_with_events(fd, WatchingEvents::empty().set_read(), token) + } + + /// Adds the given `fd` to this context, watching for the specified events and associates the + /// given 'token' with those events. + /// + /// A `fd` can only be added once and does not need to be kept open. If the `fd` is dropped and + /// there were no duplicated file descriptors (i.e. adding the same descriptor with a different + /// FD number) added to this context, events will not be reported by `wait` anymore. + pub fn add_fd_with_events(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + self.epoll_ctx.add_fd_with_events(fd, events, token)?; + self.hangups.set(0); + self.max_hangups.set(self.max_hangups.get() + 1); + Ok(()) + } + + /// If `fd` was previously added to this context, the watched events will be replaced with + /// `events` and the token associated with it will be replaced with the given `token`. + pub fn modify(&self, fd: &AsRawFd, events: WatchingEvents, token: T) -> Result<()> { + self.epoll_ctx.modify(fd, events, token) + } + + /// Deletes the given `fd` from this context. + /// + /// If an `fd`'s token shows up in the list of hangup events, it should be removed using this + /// method or by closing/dropping (if and only if the fd was never dup()'d/fork()'d) the `fd`. + /// Failure to do so will cause the `wait` method to always return immediately, causing ~100% + /// CPU load. + pub fn delete(&self, fd: &AsRawFd) -> Result<()> { + self.epoll_ctx.delete(fd)?; + self.hangups.set(0); + self.max_hangups.set(self.max_hangups.get() - 1); + Ok(()) + } + + // This method determines if the the user of wait is misusing the `PollContext` by leaving FDs + // in this `PollContext` that have been shutdown or hungup on. Such an FD will cause `wait` to + // return instantly with a hungup event. If that FD is perpetually left in this context, a busy + // loop burning ~100% of one CPU will silently occur with no human visible malfunction. + // + // How do we know if the client of this context is ignoring hangups? A naive implementation + // would trigger if consecutive wait calls yield hangup events, but there are legitimate cases + // for this, such as two distinct sockets becoming hungup across two consecutive wait calls. A + // smarter implementation would only trigger if `delete` wasn't called between waits that + // yielded hangups. Sadly `delete` isn't the only way to remove an FD from this context. The + // other way is for the client to close the hungup FD, which automatically removes it from this + // context. Assuming that the client always uses close, this implementation would too eagerly + // trigger. + // + // The implementation used here keeps an upper bound of FDs in this context using a counter + // hooked into add/delete (which is imprecise because close can also remove FDs without us + // knowing). The number of consecutive (no add or delete in between) hangups yielded by wait + // calls is counted and compared to the upper bound. If the upper bound is exceeded by the + // consecutive hangups, the implementation triggers the check and logs. + // + // This implementation has false negatives because the upper bound can be completely too high, + // in the worst case caused by only using close instead of delete. However, this method has the + // advantage of always triggering eventually genuine busy loop cases, requires no dynamic + // allocations, is fast and constant time to compute, and has no false positives. + fn check_for_hungup_busy_loop(&self, new_hangups: usize) { + let old_hangups = self.hangups.get(); + let max_hangups = self.max_hangups.get(); + if old_hangups <= max_hangups && old_hangups + new_hangups > max_hangups { + warn!( + "busy poll wait loop with hungup FDs detected on thread {}", + thread::current().name().unwrap_or("") + ); + // This panic is helpful for tests of this functionality. + #[cfg(test)] + panic!("hungup busy loop detected"); + } + self.hangups.set(old_hangups + new_hangups); + } + + /// Waits for any events to occur in FDs that were previously added to this context. + /// + /// The events are level-triggered, meaning that if any events are unhandled (i.e. not reading + /// for readable events and not closing for hungup events), subsequent calls to `wait` will + /// return immediately. The consequence of not handling an event perpetually while calling + /// `wait` is that the callers loop will degenerated to busy loop polling, pinning a CPU to + /// ~100% usage. + /// + /// # Panics + /// Panics if the returned `PollEvents` structure is not dropped before subsequent `wait` calls. + pub fn wait(&self) -> Result> { + self.wait_timeout(Duration::new(i64::MAX as u64, 0)) + } + + /// Like `wait` except will only block for a maximum of the given `timeout`. + /// + /// This may return earlier than `timeout` with zero events if the duration indicated exceeds + /// system limits. + pub fn wait_timeout(&self, timeout: Duration) -> Result> { + let events = self.epoll_ctx.wait_timeout(&self.events, timeout)?; + let hangups = events.iter_hungup().count(); + self.check_for_hungup_busy_loop(hangups); + Ok(events) + } +} + +impl AsRawFd for PollContext { + fn as_raw_fd(&self) -> RawFd { + self.epoll_ctx.as_raw_fd() + } +} + +impl IntoRawFd for PollContext { + fn into_raw_fd(self) -> RawFd { + self.epoll_ctx.into_raw_fd() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::eventfd::EventFd; + use std::os::unix::net::UnixStream; + use std::time::Instant; + + #[test] + fn test_poll_context() { + let evt1 = EventFd::new(0).unwrap(); + let evt2 = EventFd::new(0).unwrap(); + evt1.write(1).unwrap(); + evt2.write(1).unwrap(); + let ctx: PollContext = PollContext::new().unwrap(); + ctx.add(&evt1, 1).unwrap(); + ctx.add(&evt2, 2).unwrap(); + + let mut evt_count = 0; + while evt_count < 2 { + for event in ctx.wait().unwrap().iter_readable() { + evt_count += 1; + match event.token() { + 1 => { + evt1.read().unwrap(); + ctx.delete(&evt1).unwrap(); + } + 2 => { + evt2.read().unwrap(); + ctx.delete(&evt2).unwrap(); + } + _ => panic!("unexpected token"), + }; + } + } + assert_eq!(evt_count, 2); + } + + #[test] + fn test_poll_context_overflow() { + const EVT_COUNT: usize = POLL_CONTEXT_MAX_EVENTS * 2 + 1; + let ctx: PollContext = PollContext::new().unwrap(); + let mut evts = Vec::with_capacity(EVT_COUNT); + for i in 0..EVT_COUNT { + let evt = EventFd::new(0).unwrap(); + evt.write(1).unwrap(); + ctx.add(&evt, i).unwrap(); + evts.push(evt); + } + let mut evt_count = 0; + while evt_count < EVT_COUNT { + for event in ctx.wait().unwrap().iter_readable() { + evts[event.token()].read().unwrap(); + evt_count += 1; + } + } + } + + #[test] + #[should_panic] + fn test_poll_context_hungup() { + let (s1, s2) = UnixStream::pair().unwrap(); + let ctx: PollContext = PollContext::new().unwrap(); + ctx.add(&s1, 1).unwrap(); + + // Causes s1 to receive hangup events, which we purposefully ignore to trip the detection + // logic in `PollContext`. + drop(s2); + + // Should easily panic within this many iterations. + for _ in 0..1000 { + ctx.wait().unwrap(); + } + } + + #[test] + fn test_poll_context_timeout() { + let ctx: PollContext = PollContext::new().unwrap(); + let dur = Duration::from_millis(10); + let start_inst = Instant::now(); + ctx.wait_timeout(dur).unwrap(); + assert!(start_inst.elapsed() >= dur); + } + +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/seek_hole.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/seek_hole.rs new file mode 100644 index 000000000..12ac2e9bb --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/seek_hole.rs @@ -0,0 +1,215 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::fs::File; +use std::io::{Error, Result}; +use std::os::unix::io::AsRawFd; + +#[cfg(target_env = "musl")] +use libc::{c_int, lseek64, ENXIO}; + +#[cfg(target_env = "gnu")] +use libc::{lseek64, ENXIO, SEEK_DATA, SEEK_HOLE}; + +/// A trait for seeking to the next hole or non-hole position in a file. +pub trait SeekHole { + /// Seek to the first hole in a file at a position greater than or equal to `offset`. + /// If no holes exist after `offset`, the seek position will be set to the end of the file. + /// If `offset` is at or after the end of the file, the seek position is unchanged, and None is returned. + /// Returns the current seek position after the seek or an error. + fn seek_hole(&mut self, offset: u64) -> Result>; + + /// Seek to the first data in a file at a position greater than or equal to `offset`. + /// If no data exists after `offset`, the seek position is unchanged, and None is returned. + /// Returns the current offset after the seek or an error. + fn seek_data(&mut self, offset: u64) -> Result>; +} + +#[cfg(target_env = "musl")] +pub const SEEK_DATA: c_int = 3; +#[cfg(target_env = "musl")] +pub const SEEK_HOLE: c_int = 4; + +/// Safe wrapper for `libc::lseek64()` +fn lseek(file: &mut File, offset: i64, whence: i32) -> Result> { + // This is safe because we pass a known-good file descriptor. + let res = unsafe { lseek64(file.as_raw_fd(), offset, whence) }; + + if res < 0 { + // Convert ENXIO into None; pass any other error as-is. + let err = Error::last_os_error(); + if let Some(errno) = Error::raw_os_error(&err) { + if errno == ENXIO { + return Ok(None); + } + } + Err(err) + } else { + Ok(Some(res as u64)) + } +} + +impl SeekHole for File { + fn seek_hole(&mut self, offset: u64) -> Result> { + lseek(self, offset as i64, SEEK_HOLE) + } + + fn seek_data(&mut self, offset: u64) -> Result> { + lseek(self, offset as i64, SEEK_DATA) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::TempDir; + use std::fs::File; + use std::io::{Seek, SeekFrom, Write}; + use std::path::PathBuf; + + fn seek_cur(file: &mut File) -> u64 { + file.seek(SeekFrom::Current(0)).unwrap() + } + + #[test] + fn seek_data() { + let tempdir = TempDir::new("/tmp/seek_data_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("test_file"); + let mut file = File::create(&path).unwrap(); + + // Empty file + assert_eq!(file.seek_data(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // File with non-zero length consisting entirely of a hole + file.set_len(0x10000).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // seek_data at or after the end of the file should return None + assert_eq!(file.seek_data(0x10000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_data(0x10001).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x10000, 0x20000) + let b = [0x55u8; 0x10000]; + file.seek(SeekFrom::Start(0x10000)).unwrap(); + file.write_all(&b).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + + // seek_data within data should return the same offset + assert_eq!(file.seek_data(0x10000).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + assert_eq!(file.seek_data(0x10001).unwrap(), Some(0x10001)); + assert_eq!(seek_cur(&mut file), 0x10001); + assert_eq!(file.seek_data(0x1FFFF).unwrap(), Some(0x1FFFF)); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + + // Extend the file to add another hole after the data + file.set_len(0x30000).unwrap(); + assert_eq!(file.seek_data(0).unwrap(), Some(0x10000)); + assert_eq!(seek_cur(&mut file), 0x10000); + assert_eq!(file.seek_data(0x1FFFF).unwrap(), Some(0x1FFFF)); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + assert_eq!(file.seek_data(0x20000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0x1FFFF); + } + + #[test] + #[allow(clippy::cyclomatic_complexity)] + fn seek_hole() { + let tempdir = TempDir::new("/tmp/seek_hole_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("test_file"); + let mut file = File::create(&path).unwrap(); + + // Empty file + assert_eq!(file.seek_hole(0).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // File with non-zero length consisting entirely of a hole + file.set_len(0x10000).unwrap(); + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + + // seek_hole at or after the end of the file should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0x10001).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x10000, 0x20000) + let b = [0x55u8; 0x10000]; + file.seek(SeekFrom::Start(0x10000)).unwrap(); + file.write_all(&b).unwrap(); + + // seek_hole within a hole should return the same offset + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + + // seek_hole within data should return the next hole (EOF) + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10001).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + + // seek_hole at EOF after data should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Extend the file to add another hole after the data + file.set_len(0x30000).unwrap(); + assert_eq!(file.seek_hole(0).unwrap(), Some(0)); + assert_eq!(seek_cur(&mut file), 0); + assert_eq!(file.seek_hole(0xFFFF).unwrap(), Some(0xFFFF)); + assert_eq!(seek_cur(&mut file), 0xFFFF); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x10000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x1FFFF).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x20000)); + assert_eq!(seek_cur(&mut file), 0x20000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x20001)); + assert_eq!(seek_cur(&mut file), 0x20001); + + // seek_hole at EOF after a hole should return None + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x30000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + + // Write some data to [0x20000, 0x30000) + file.seek(SeekFrom::Start(0x20000)).unwrap(); + file.write_all(&b).unwrap(); + + // seek_hole within [0x20000, 0x30000) should now find the hole at EOF + assert_eq!(file.seek_hole(0x20000).unwrap(), Some(0x30000)); + assert_eq!(seek_cur(&mut file), 0x30000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x20001).unwrap(), Some(0x30000)); + assert_eq!(seek_cur(&mut file), 0x30000); + file.seek(SeekFrom::Start(0)).unwrap(); + assert_eq!(file.seek_hole(0x30000).unwrap(), None); + assert_eq!(seek_cur(&mut file), 0); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/signal.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/signal.rs new file mode 100644 index 000000000..71d88b723 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/signal.rs @@ -0,0 +1,420 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Portions Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use libc::{ + c_int, c_void, pthread_kill, pthread_sigmask, pthread_t, sigaction, sigaddset, sigemptyset, + siginfo_t, sigismember, sigpending, sigset_t, sigtimedwait, timespec, EAGAIN, EINTR, EINVAL, + SIGHUP, SIGSYS, SIG_BLOCK, SIG_UNBLOCK, +}; + +use errno; +use std::fmt::{self, Display}; +use std::io; +use std::mem; +use std::os::unix::thread::JoinHandleExt; +use std::ptr::{null, null_mut}; +use std::result; +use std::thread::JoinHandle; + +#[derive(Debug)] +pub enum Error { + /// Couldn't create a sigset. + CreateSigset(errno::Error), + /// The wrapped signal has already been blocked. + SignalAlreadyBlocked(c_int), + /// Failed to check if the requested signal is in the blocked set already. + CompareBlockedSignals(errno::Error), + /// The signal could not be blocked. + BlockSignal(errno::Error), + /// The signal mask could not be retrieved. + RetrieveSignalMask(i32), + /// The signal could not be unblocked. + UnblockSignal(errno::Error), + /// Failed to wait for given signal. + ClearWaitPending(errno::Error), + /// Failed to get pending signals. + ClearGetPending(errno::Error), + /// Failed to check if given signal is in the set of pending signals. + ClearCheckPending(errno::Error), +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + match self { + CreateSigset(e) => write!(f, "couldn't create a sigset: {}", e), + SignalAlreadyBlocked(num) => write!(f, "signal {} already blocked", num), + CompareBlockedSignals(e) => write!( + f, + "failed to check whether requested signal is in the blocked set: {}", + e, + ), + BlockSignal(e) => write!(f, "signal could not be blocked: {}", e), + RetrieveSignalMask(errno) => write!( + f, + "failed to retrieve signal mask: {}", + io::Error::from_raw_os_error(*errno), + ), + UnblockSignal(e) => write!(f, "signal could not be unblocked: {}", e), + ClearWaitPending(e) => write!(f, "failed to wait for given signal: {}", e), + ClearGetPending(e) => write!(f, "failed to get pending signals: {}", e), + ClearCheckPending(e) => write!( + f, + "failed to check whether given signal is in the pending set: {}", + e, + ), + } + } +} + +pub type SignalResult = result::Result; +type SiginfoHandler = extern "C" fn(num: c_int, info: *mut siginfo_t, _unused: *mut c_void) -> (); + +pub enum SignalHandler { + Siginfo(SiginfoHandler), + // TODO add a`SimpleHandler` when `libc` adds `sa_handler` support to `sigaction`. +} + +impl SignalHandler { + fn set_flags(act: &mut sigaction, flag: c_int) { + act.sa_flags = flag; + } +} +/// Fills a `sigaction` structure from of the signal handler. +/// Refer to http://man7.org/linux/man-pages/man7/signal.7.html +impl Into for SignalHandler { + fn into(self) -> sigaction { + let mut act: sigaction = unsafe { mem::zeroed() }; + match self { + SignalHandler::Siginfo(function) => { + act.sa_sigaction = function as *const () as usize; + } + } + act + } +} + +extern "C" { + fn __libc_current_sigrtmin() -> c_int; + fn __libc_current_sigrtmax() -> c_int; +} + +/// Returns the minimum (inclusive) real-time signal number. +#[allow(non_snake_case)] +fn SIGRTMIN() -> c_int { + unsafe { __libc_current_sigrtmin() } +} + +/// Returns the maximum (inclusive) real-time signal number. +#[allow(non_snake_case)] +fn SIGRTMAX() -> c_int { + unsafe { __libc_current_sigrtmax() } +} + +/// Verifies that a signal number is valid: for VCPU signals, it needs to be enclosed within the OS +/// limits for realtime signals, and the remaining ones need to be between the minimum (SIGHUP) and +/// maximum (SIGSYS) values. +pub fn validate_signal_num(num: c_int, for_vcpu: bool) -> errno::Result { + if for_vcpu { + let actual_num = num + SIGRTMIN(); + if actual_num <= SIGRTMAX() { + return Ok(actual_num); + } + } else if SIGHUP <= num && num <= SIGSYS { + return Ok(num); + } + Err(errno::Error::new(EINVAL)) +} + +/// Registers `handler` as the signal handler of signum `num`. +/// +/// Uses `sigaction` to register the handler. +/// +/// This is considered unsafe because the given handler will be called asynchronously, interrupting +/// whatever the thread was doing and therefore must only do async-signal-safe operations. +/// flags: SA_SIGINFO or SA_RESTART if wants to restart after signal received. +pub unsafe fn register_signal_handler( + num: i32, + handler: SignalHandler, + for_vcpu: bool, + flag: c_int, +) -> errno::Result<()> { + let num = validate_signal_num(num, for_vcpu)?; + let mut act: sigaction = handler.into(); + SignalHandler::set_flags(&mut act, flag); + match sigaction(num, &act, null_mut()) { + 0 => Ok(()), + _ => errno::errno_result(), + } +} + +/// Creates `sigset` from an array of signal numbers. +/// +/// This is a helper function used when we want to manipulate signals. +pub fn create_sigset(signals: &[c_int]) -> errno::Result { + // sigset will actually be initialized by sigemptyset below. + let mut sigset: sigset_t = unsafe { mem::zeroed() }; + + // Safe - return value is checked. + let ret = unsafe { sigemptyset(&mut sigset) }; + if ret < 0 { + return errno::errno_result(); + } + + for signal in signals { + // Safe - return value is checked. + let ret = unsafe { sigaddset(&mut sigset, *signal) }; + if ret < 0 { + return errno::errno_result(); + } + } + + Ok(sigset) +} + +/// Retrieves the signal mask of the current thread as a vector of c_ints. +pub fn get_blocked_signals() -> SignalResult> { + let mut mask = Vec::new(); + + // Safe - return values are checked. + unsafe { + let mut old_sigset: sigset_t = mem::zeroed(); + let ret = pthread_sigmask(SIG_BLOCK, null(), &mut old_sigset as *mut sigset_t); + if ret < 0 { + return Err(Error::RetrieveSignalMask(ret)); + } + + for num in 0..=SIGRTMAX() { + if sigismember(&old_sigset, num) > 0 { + mask.push(num); + } + } + } + + Ok(mask) +} + +/// Masks given signal. +/// +/// If signal is already blocked the call will fail with Error::SignalAlreadyBlocked +/// result. +pub fn block_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + // Safe - return values are checked. + unsafe { + let mut old_sigset: sigset_t = mem::zeroed(); + let ret = pthread_sigmask(SIG_BLOCK, &sigset, &mut old_sigset as *mut sigset_t); + if ret < 0 { + return Err(Error::BlockSignal(errno::Error::last())); + } + let ret = sigismember(&old_sigset, num); + if ret < 0 { + return Err(Error::CompareBlockedSignals(errno::Error::last())); + } else if ret > 0 { + return Err(Error::SignalAlreadyBlocked(num)); + } + } + Ok(()) +} + +/// Unmasks given signal. +pub fn unblock_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + // Safe - return value is checked. + let ret = unsafe { pthread_sigmask(SIG_UNBLOCK, &sigset, null_mut()) }; + if ret < 0 { + return Err(Error::UnblockSignal(errno::Error::last())); + } + Ok(()) +} + +/// Clears pending signal. +pub fn clear_signal(num: c_int) -> SignalResult<()> { + let sigset = create_sigset(&[num]).map_err(Error::CreateSigset)?; + + while { + // This is safe as we are rigorously checking return values + // of libc calls. + unsafe { + let mut siginfo: siginfo_t = mem::zeroed(); + let ts = timespec { + tv_sec: 0, + tv_nsec: 0, + }; + // Attempt to consume one instance of pending signal. If signal + // is not pending, the call will fail with EAGAIN or EINTR. + let ret = sigtimedwait(&sigset, &mut siginfo, &ts); + if ret < 0 { + let e = errno::Error::last(); + match e.errno() { + EAGAIN | EINTR => {} + _ => { + return Err(Error::ClearWaitPending(errno::Error::last())); + } + } + } + + // This sigset will be actually filled with `sigpending` call. + let mut chkset: sigset_t = mem::zeroed(); + // See if more instances of the signal are pending. + let ret = sigpending(&mut chkset); + if ret < 0 { + return Err(Error::ClearGetPending(errno::Error::last())); + } + + let ret = sigismember(&chkset, num); + if ret < 0 { + return Err(Error::ClearCheckPending(errno::Error::last())); + } + + // This is do-while loop condition. + ret != 0 + } + } {} + + Ok(()) +} + +/// Trait for threads that can be signalled via `pthread_kill`. +/// +/// Note that this is only useful for signals between SIGRTMIN and SIGRTMAX because these are +/// guaranteed to not be used by the C runtime. +/// +/// This is marked unsafe because the implementation of this trait must guarantee that the returned +/// pthread_t is valid and has a lifetime at least that of the trait object. +pub unsafe trait Killable { + fn pthread_handle(&self) -> pthread_t; + + /// Sends the signal `num + SIGRTMIN` to this killable thread. + /// + /// The value of `num + SIGRTMIN` must not exceed `SIGRTMAX`. + fn kill(&self, num: i32) -> errno::Result<()> { + let num = validate_signal_num(num, true)?; + + // Safe because we ensure we are using a valid pthread handle, a valid signal number, and + // check the return result. + let ret = unsafe { pthread_kill(self.pthread_handle(), num) }; + if ret < 0 { + return errno::errno_result(); + } + Ok(()) + } +} + +// Safe because we fulfill our contract of returning a genuine pthread handle. +unsafe impl Killable for JoinHandle { + fn pthread_handle(&self) -> pthread_t { + self.as_pthread_t() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::SA_SIGINFO; + use std::thread; + use std::time::Duration; + + static mut SIGNAL_HANDLER_CALLED: bool = false; + + extern "C" fn handle_signal(_: c_int, _: *mut siginfo_t, _: *mut c_void) { + unsafe { + SIGNAL_HANDLER_CALLED = true; + } + } + + #[test] + fn test_register_signal_handler() { + unsafe { + // testing bad value + assert!(register_signal_handler( + SIGRTMAX(), + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + .is_err()); + format!( + "{:?}", + register_signal_handler( + SIGRTMAX(), + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + ); + assert!(register_signal_handler( + 0, + SignalHandler::Siginfo(handle_signal), + true, + SA_SIGINFO + ) + .is_ok()); + assert!(register_signal_handler( + libc::SIGSYS, + SignalHandler::Siginfo(handle_signal), + false, + SA_SIGINFO + ) + .is_ok()); + } + } + + #[test] + #[allow(clippy::empty_loop)] + fn test_killing_thread() { + let killable = thread::spawn(|| thread::current().id()); + let killable_id = killable.join().unwrap(); + assert_ne!(killable_id, thread::current().id()); + + // We install a signal handler for the specified signal; otherwise the whole process will + // be brought down when the signal is received, as part of the default behaviour. Signal + // handlers are global, so we install this before starting the thread. + unsafe { + register_signal_handler(0, SignalHandler::Siginfo(handle_signal), true, SA_SIGINFO) + .expect("failed to register vcpu signal handler"); + } + + let killable = thread::spawn(|| loop {}); + + let res = killable.kill(SIGRTMAX()); + assert!(res.is_err()); + format!("{:?}", res); + + unsafe { + assert!(!SIGNAL_HANDLER_CALLED); + } + + assert!(killable.kill(0).is_ok()); + + // We're waiting to detect that the signal handler has been called. + const MAX_WAIT_ITERS: u32 = 20; + let mut iter_count = 0; + loop { + thread::sleep(Duration::from_millis(100)); + + if unsafe { SIGNAL_HANDLER_CALLED } { + break; + } + + iter_count += 1; + // timeout if we wait too long + assert!(iter_count <= MAX_WAIT_ITERS); + } + + // Our signal handler doesn't do anything which influences the killable thread, so the + // previous signal is effectively ignored. If we were to join killable here, we would block + // forever as the loop keeps running. Since we don't join, the thread will become detached + // as the handle is dropped, and will be killed when the process/main thread exits. + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/syslog.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/syslog.rs new file mode 100644 index 000000000..d09b56a88 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/syslog.rs @@ -0,0 +1,643 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +//! Facilities for sending log message to syslog. +//! +//! Every function exported by this module is thread-safe. Each function will silently fail until +//! `syslog::init()` is called and returns `Ok`. +//! +//! # Examples +//! +//! ``` +//! #[macro_use] +//! extern crate vmm_sys_util; +//! +//! use vmm_sys_util::syslog::init; +//! fn main() { +//! if let Err(e) = init() { +//! println!("failed to initiailize syslog: {}", e); +//! return; +//! } +//! warn!("this is your {} warning", "final"); +//! error!("something went horribly wrong: {}", "out of RAMs"); +//! } +//! ``` + +use std::env; +use std::ffi::CString; +use std::ffi::{OsStr, OsString}; +use std::fmt::{self, Display}; +use std::fs::File; +use std::io; +use std::io::{stderr, Cursor, ErrorKind, Write}; +use std::mem; +use std::os::unix::io::{AsRawFd, FromRawFd, RawFd}; +use std::os::unix::net::UnixDatagram; +use std::path::PathBuf; +use std::ptr::null; +use std::str::from_utf8; +use std::sync::{Mutex as StdMutex, MutexGuard, Once, ONCE_INIT}; + +use libc::{ + c_char, c_long, closelog, fcntl, gethostname, localtime_r, openlog, pid_t, syscall, time, + time_t, tm, F_GETFD, LOG_NDELAY, LOG_PERROR, LOG_PID, LOG_USER, +}; + +/// Temporary define linux-x86_64 syscall value here. +#[allow(non_upper_case_globals)] +pub const SYS_getpid: c_long = 39; + +const SYSLOG_PATH: &str = "/dev/log"; + +/// The priority (i.e. severity) of a syslog message. +/// +/// See syslog man pages for information on their semantics. +#[derive(Copy, Clone, Debug)] +pub enum Priority { + Emergency = 0, + Alert = 1, + Critical = 2, + Error = 3, + Warning = 4, + Notice = 5, + Info = 6, + Debug = 7, +} + +impl fmt::Display for Priority { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Priority::Emergency => write!(f, "EMERGENCY"), + Priority::Alert => write!(f, "ALERT"), + Priority::Critical => write!(f, "CRITICAL"), + Priority::Error => write!(f, "ERROR"), + Priority::Warning => write!(f, "WARNING"), + Priority::Notice => write!(f, "NOTICE"), + Priority::Info => write!(f, "INFO"), + Priority::Debug => write!(f, "DEBUG"), + } + } +} + +/// The facility of a syslog message. +/// +/// See syslog man pages for information on their semantics. +pub enum Facility { + Kernel = 0, + User = 1 << 3, + Mail = 2 << 3, + Daemon = 3 << 3, + Auth = 4 << 3, + Syslog = 5 << 3, + Lpr = 6 << 3, + News = 7 << 3, + Uucp = 8 << 3, + Local0 = 16 << 3, + Local1 = 17 << 3, + Local2 = 18 << 3, + Local3 = 19 << 3, + Local4 = 20 << 3, + Local5 = 21 << 3, + Local6 = 22 << 3, + Local7 = 23 << 3, +} + +/// Errors returned by `syslog::init()`. +#[derive(Debug)] +pub enum Error { + /// Initialization was never attempted. + NeverInitialized, + /// Initialization has previously failed and can not be retried. + Poisoned, + /// Error while creating socket. + Socket(io::Error), + /// Error while attempting to connect socket. + Connect(io::Error), + // There was an error using `open` to get the lowest file descriptor. + GetLowestFd(io::Error), + // The guess of libc's file descriptor for the syslog connection was invalid. + InvalidFd, +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + match self { + NeverInitialized => write!(f, "initialization was never attempted"), + Poisoned => write!(f, "initialization previously failed and cannot be retried"), + Socket(e) => write!(f, "failed to create socket: {}", e), + Connect(e) => write!(f, "failed to connect socket: {}", e), + GetLowestFd(e) => write!(f, "failed to get lowest file descriptor: {}", e), + InvalidFd => write!(f, "guess of fd for syslog connection was invalid"), + } + } +} + +fn get_hostname() -> Result { + let mut hostname: [u8; 256] = [b'\0'; 256]; + // Safe because we give a valid pointer to a buffer of the indicated length and check for the + // result. + let ret = unsafe { gethostname(hostname.as_mut_ptr() as *mut c_char, hostname.len()) }; + if ret == -1 { + return Err(()); + } + + let len = hostname.iter().position(|&v| v == b'\0').ok_or(())?; + + Ok(from_utf8(&hostname[..len]).map_err(|_| ())?.to_string()) +} + +fn get_proc_name() -> Option { + env::args_os() + .next() + .map(PathBuf::from) + .and_then(|s| s.file_name().map(OsStr::to_os_string)) + .map(OsString::into_string) + .and_then(Result::ok) +} + +// Uses libc's openlog function to get a socket to the syslogger. By getting the socket this way, as +// opposed to connecting to the syslogger directly, libc's internal state gets initialized for other +// libraries (e.g. minijail) that make use of libc's syslog function. Note that this function +// depends on no other threads or signal handlers being active in this process because they might +// create FDs. +// +// TODO(zachr): Once https://android-review.googlesource.com/470998 lands, there won't be any +// libraries in use that hard depend on libc's syslogger. Remove this and go back to making the +// connection directly once minjail is ready. +fn openlog_and_get_socket() -> Result { + // closelog first in case there was already a file descriptor open. Safe because it takes no + // arguments and just closes an open file descriptor. Does nothing if the file descriptor + // was not already open. + unsafe { + closelog(); + } + + let file_path = CString::new("/dev/null").unwrap(); + unsafe { + // Ordinarily libc's FD for the syslog connection can't be accessed, but we can guess that the + // FD that openlog will be getting is the lowest unused FD. To guarantee that an FD is opened in + // this function we use the LOG_NDELAY to tell openlog to connect to the syslog now. To get the + // lowest unused FD, we open a dummy file (which the manual says will always return the lowest + // fd), and then close that fd. Voilà, we now know the lowest numbered FD. The call to openlog + // will make use of that FD, and then we just wrap a `UnixDatagram` around it for ease of use. + let fd = libc::open(file_path.as_ptr(), libc::O_RDONLY); + if fd < 0 { + let err = io::Error::last_os_error(); + return Err(Error::GetLowestFd(err)); + } + + // Safe because openlog accesses no pointers because `ident` is null, only valid flags are + // used, and it returns no error. + openlog(null(), LOG_NDELAY | LOG_PERROR | LOG_PID, LOG_USER); + // For safety, ensure the fd we guessed is valid. The `fcntl` call itself only reads the + // file descriptor table of the current process, which is trivially safe. + if fcntl(fd, F_GETFD) >= 0 { + Ok(UnixDatagram::from_raw_fd(fd)) + } else { + Err(Error::InvalidFd) + } + } +} + +struct State { + stderr: bool, + socket: Option, + file: Option, + hostname: Option, + proc_name: Option, +} + +impl State { + fn new() -> Result { + let s = openlog_and_get_socket()?; + Ok(State { + stderr: true, + socket: Some(s), + file: None, + hostname: get_hostname().ok(), + proc_name: get_proc_name(), + }) + } +} + +static STATE_ONCE: Once = ONCE_INIT; +static mut STATE: *const StdMutex = 0 as *const _; + +fn new_mutex_ptr(inner: T) -> *const StdMutex { + Box::into_raw(Box::new(StdMutex::new(inner))) +} + +/// Initialize the syslog connection and internal variables. +/// +/// This should only be called once per process before any other threads have been spawned or any +/// signal handlers have been registered. Every call made after the first will have no effect +/// besides return `Ok` or `Err` appropriately. +pub fn init() -> Result<(), Error> { + let mut err = Error::Poisoned; + STATE_ONCE.call_once(|| match State::new() { + // Safe because STATE mutation is guarded by `Once`. + Ok(state) => unsafe { STATE = new_mutex_ptr(state) }, + Err(e) => err = e, + }); + + if unsafe { STATE.is_null() } { + Err(err) + } else { + Ok(()) + } +} + +fn lock() -> Result, Error> { + // Safe because we assume that STATE is always in either a valid or NULL state. + let state_ptr = unsafe { STATE }; + if state_ptr.is_null() { + return Err(Error::NeverInitialized); + } + // Safe because STATE only mutates once and we checked for NULL. + let state = unsafe { &*state_ptr }; + let guard = match state.lock() { + Ok(guard) => guard, + _ => panic!("mutex is poisoned"), + }; + Ok(guard) +} + +// Attempts to lock and retrieve the state. Returns from the function silently on failure. +macro_rules! lock { + () => { + match lock() { + Ok(s) => s, + _ => return, + }; + }; +} + +/// Replaces the hostname reported in each syslog message. +/// +/// The default hostname is whatever `gethostname()` returned when `vmm_sys_util::syslog::init()` was first +/// called. +/// +/// Does nothing if syslog was never initialized. +pub fn set_hostname>(hostname: T) { + let mut state = lock!(); + state.hostname = Some(hostname.into()); +} + +/// Replaces the process name reported in each syslog message. +/// +/// The default process name is the _file name_ of `argv[0]`. For example, if this program was +/// invoked as +/// +/// ```bash +/// $ path/to/app --delete everything +/// ``` +/// +/// the default process name would be _app_. +/// +/// Does nothing if syslog was never initialized. +pub fn set_proc_name>(proc_name: T) { + let mut state = lock!(); + state.proc_name = Some(proc_name.into()); +} + +/// Enables or disables echoing log messages to the syslog. +/// +/// The default behavior is **enabled**. +/// +/// If `enable` goes from `true` to `false`, the syslog connection is closed. The connection is +/// reopened if `enable` is set to `true` after it became `false`. +/// +/// Returns an error if syslog was never initialized or the syslog connection failed to be +/// established. +/// +/// # Arguments +/// * `enable` - `true` to enable echoing to syslog, `false` to disable echoing to syslog. +pub fn echo_syslog(enable: bool) -> Result<(), Error> { + let state_ptr = unsafe { STATE }; + if state_ptr.is_null() { + return Err(Error::NeverInitialized); + } + let mut state = lock().map_err(|_| Error::Poisoned)?; + + match state.socket.take() { + Some(_) if enable => {} + Some(s) => { + // Because `openlog_and_get_socket` actually just "borrows" the syslog FD, this module + // does not own the syslog connection and therefore should not destroy it. + mem::forget(s); + } + None if enable => { + let s = openlog_and_get_socket()?; + state.socket = Some(s); + } + _ => {} + } + Ok(()) +} + +/// Replaces the optional `File` to echo log messages to. +/// +/// The default behavior is to not echo to a file. Passing `None` to this function restores that +/// behavior. +/// +/// Does nothing if syslog was never initialized. +/// +/// # Arguments +/// * `file` - `Some(file)` to echo to `file`, `None` to disable echoing to the file previously passed to `echo_file`. +pub fn echo_file(file: Option) { + let mut state = lock!(); + state.file = file; +} + +/// Enables or disables echoing log messages to the `std::io::stderr()`. +/// +/// The default behavior is **enabled**. +/// +/// Does nothing if syslog was never initialized. +/// +/// # Arguments +/// * `enable` - `true` to enable echoing to stderr, `false` to disable echoing to stderr. +pub fn echo_stderr(enable: bool) { + let mut state = lock!(); + state.stderr = enable; +} + +/// Retrieves the file descriptors owned by the global syslogger. +/// +/// Does nothing if syslog was never initialized. If their are any file descriptors, they will be +/// pushed into `fds`. +/// +/// Note that the `stderr` file descriptor is never added, as it is not owned by syslog. +#[allow(clippy::redundant_closure)] +pub fn push_fds(fds: &mut Vec) { + let state = lock!(); + fds.extend(state.socket.iter().map(|s| s.as_raw_fd())); + fds.extend(state.file.iter().map(|f| f.as_raw_fd())); +} + +/// Should only be called after `init()` was called. +fn send_buf(socket: &UnixDatagram, buf: &[u8]) { + const SEND_RETRY: usize = 2; + + for _ in 0..SEND_RETRY { + match socket.send(&buf[..]) { + Ok(_) => break, + Err(e) => match e.kind() { + ErrorKind::ConnectionRefused + | ErrorKind::ConnectionReset + | ErrorKind::ConnectionAborted + | ErrorKind::NotConnected => { + let res = socket.connect(SYSLOG_PATH); + if res.is_err() { + break; + } + } + _ => {} + }, + } + } +} + +fn get_localtime() -> tm { + unsafe { + // Safe because tm is just a struct of plain data. + let mut tm: tm = mem::zeroed(); + let mut now: time_t = 0; + // Safe because we give time a valid pointer and can never fail. + time(&mut now as *mut _); + // Safe because we give localtime_r valid pointers and can never fail. + localtime_r(&now, &mut tm as *mut _); + tm + } +} + +/// Records a log message with the given details. +/// +/// Note that this will fail silently if syslog was not initialized. +/// +/// # Arguments +/// * `pri` - The `Priority` (i.e. severity) of the log message. +/// * `fac` - The `Facility` of the log message. Usually `Facility::User` should be used. +/// * `file_name` - Name of the file that generated the log. +/// * `line` - Line number within `file_name` that generated the log. +/// * `args` - The log's message to record, in the form of `format_args!()` return value +/// +/// # Examples +/// +/// ``` +/// # use vmm_sys_util::syslog::{init, log, Priority, Facility}; +/// # fn main() { +/// # if let Err(e) = init() { +/// # println!("failed to initiailize syslog: {}", e); +/// # return; +/// # } +/// log(Priority::Error, +/// Facility::User, +/// file!(), +/// line!(), +/// format_args!("hello syslog")); +/// # } +/// ``` +#[allow(clippy::redundant_closure)] +pub fn log(pri: Priority, fac: Facility, file_name: &str, line: u32, args: fmt::Arguments) { + const MONTHS: [&str; 12] = [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", + ]; + + let mut state = lock!(); + let mut buf = [0u8; 1024]; + if let Some(ref socket) = state.socket { + let tm = get_localtime(); + let prifac = (pri as u8) | (fac as u8); + let (res, len) = { + let mut buf_cursor = Cursor::new(&mut buf[..]); + ( + write!( + &mut buf_cursor, + "<{}>{} {:02} {:02}:{:02}:{:02} {} {}[{}]: [{}:{}] {}", + prifac, + MONTHS[tm.tm_mon as usize], + tm.tm_mday, + tm.tm_hour, + tm.tm_min, + tm.tm_sec, + state.hostname.as_ref().map(|s| s.as_ref()).unwrap_or("-"), + state.proc_name.as_ref().map(|s| s.as_ref()).unwrap_or("-"), + unsafe { syscall(SYS_getpid as c_long) as pid_t }, + //getpid(), + file_name, + line, + args + ), + buf_cursor.position() as usize, + ) + }; + + if res.is_ok() { + send_buf(&socket, &buf[..len]); + } + } + + let (res, len) = { + let mut buf_cursor = Cursor::new(&mut buf[..]); + ( + writeln!(&mut buf_cursor, "[{}:{}:{}] {}", pri, file_name, line, args), + buf_cursor.position() as usize, + ) + }; + if res.is_ok() { + if let Some(ref mut file) = state.file { + let _ = file.write_all(&buf[..len]); + } + if state.stderr { + let _ = stderr().write_all(&buf[..len]); + } + } +} + +/// A macro for logging at an arbitrary priority level. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! log { + ($pri:expr, $($args:tt)+) => ({ + $crate::syslog::log($pri, $crate::syslog::Facility::User, file!(), line!(), format_args!($($args)+)) + }) +} + +/// A macro for logging an error. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! error { + ($($args:tt)+) => (log!($crate::syslog::Priority::Error, $($args)*)) +} + +/// A macro for logging a warning. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! warn { + ($($args:tt)+) => (log!($crate::syslog::Priority::Warning, $($args)*)) +} + +/// A macro for logging info. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! info { + ($($args:tt)+) => (log!($crate::syslog::Priority::Info, $($args)*)) +} + +/// A macro for logging debug information. +/// +/// Note that this will fail silently if syslog was not initialized. +#[macro_export] +macro_rules! debug { + ($($args:tt)+) => (log!($crate::syslog::Priority::Debug, $($args)*)) +} + +#[cfg(test)] +mod tests { + use super::*; + use libc::{shm_open, shm_unlink, O_CREAT, O_EXCL, O_RDWR}; + + use std::ffi::CStr; + use std::io::{Read, Seek, SeekFrom}; + use std::os::unix::io::FromRawFd; + + #[test] + fn test_init_syslog() { + init().unwrap(); + } + + #[test] + fn test_fds() { + init().unwrap(); + let mut fds = Vec::new(); + push_fds(&mut fds); + assert!(!fds.is_empty()); + for fd in fds { + assert!(fd >= 0); + } + } + + #[test] + fn test_syslog_log() { + init().unwrap(); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("hello syslog"), + ); + } + + #[test] + fn test_proc_name() { + init().unwrap(); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("before proc name"), + ); + set_proc_name("sys_util-test"); + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("after proc name"), + ); + } + + #[test] + #[allow(clippy::zero_prefixed_literal)] + fn test_syslog_file() { + init().unwrap(); + let shm_name = CStr::from_bytes_with_nul(b"/crosvm_shm\0").unwrap(); + let mut file = unsafe { + shm_unlink(shm_name.as_ptr()); + let fd = shm_open(shm_name.as_ptr(), O_RDWR | O_CREAT | O_EXCL, 0666); + assert!(fd >= 0, "error creating shared memory;"); + File::from_raw_fd(fd) + }; + + let syslog_file = file.try_clone().expect("error cloning shared memory file"); + echo_file(Some(syslog_file)); + + const TEST_STR: &str = "hello shared memory file"; + log( + Priority::Error, + Facility::User, + file!(), + line!(), + format_args!("{}", TEST_STR), + ); + + file.seek(SeekFrom::Start(0)) + .expect("error seeking shared memory file"); + let mut buf = String::new(); + file.read_to_string(&mut buf) + .expect("error reading shared memory file"); + assert!(buf.contains(TEST_STR)); + } + + #[test] + fn test_macros() { + init().unwrap(); + error!("this is an error {}", 3); + warn!("this is a warning {}", "uh oh"); + info!("this is info {}", true); + debug!("this is debug info {:?}", Some("helpful stuff")); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/tempdir.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/tempdir.rs new file mode 100644 index 000000000..7256998e8 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/tempdir.rs @@ -0,0 +1,104 @@ +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::ffi::CString; +use std::ffi::OsStr; +use std::ffi::OsString; +use std::fs; +use std::os::unix::ffi::OsStringExt; +use std::path::Path; +use std::path::PathBuf; + +use libc; + +use crate::{errno_result, Result}; + +/// Create and remove a temporary directory. The directory will be maintained for the lifetime of +/// the `TempDir` object. +pub struct TempDir { + path: Option, +} + +impl TempDir { + /// Creates a new tempory directory. + /// The directory will be removed when the object goes out of scope. + /// + /// # Examples + /// + /// ``` + /// # use std::path::Path; + /// # use std::path::PathBuf; + /// # use vmm_sys_util::TempDir; + /// # fn test_create_temp_dir() -> Result<(), ()> { + /// let t = TempDir::new("/tmp/testdir").map_err(|_| ())?; + /// assert!(t.as_path().unwrap().exists()); + /// # Ok(()) + /// # } + /// ``` + pub fn new>(prefix: P) -> Result { + let mut dir_string = prefix.as_ref().to_os_string(); + dir_string.push("XXXXXX"); + // unwrap this result as the internal bytes can't have a null with a valid path. + let dir_name = CString::new(dir_string.into_vec()).unwrap(); + let mut dir_bytes = dir_name.into_bytes_with_nul(); + let ret = unsafe { + // Creating the directory isn't unsafe. The fact that it modifies the guts of the path + // is also OK because it only overwrites the last 6 Xs added above. + libc::mkdtemp(dir_bytes.as_mut_ptr() as *mut libc::c_char) + }; + if ret.is_null() { + return errno_result(); + } + dir_bytes.pop(); // Remove the null becasue from_vec can't handle it. + Ok(TempDir { + path: Some(PathBuf::from(OsString::from_vec(dir_bytes))), + }) + } + + /// Removes the temporary directory. Calling this is optional as dropping a `TempDir` object + /// will also remove the directory. Calling remove explicitly allows for better error handling. + pub fn remove(mut self) -> Result<()> { + let path = self.path.take(); + path.map_or(Ok(()), fs::remove_dir_all)?; + Ok(()) + } + + /// Returns the path to the tempdir if it is currently valid + pub fn as_path(&self) -> Option<&Path> { + self.path.as_ref().map(|ref p| p.as_path()) + } +} + +impl Drop for TempDir { + fn drop(&mut self) { + if let Some(ref p) = self.path { + // Nothing can be done here if this returns an error. + let _ = fs::remove_dir_all(p); + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn create_dir() { + let t = TempDir::new("/tmp/asdf").unwrap(); + let path = t.as_path().unwrap(); + assert!(path.exists()); + assert!(path.is_dir()); + assert!(path.starts_with("/tmp/")); + } + + #[test] + fn remove_dir() { + let t = TempDir::new("/tmp/asdf").unwrap(); + let path = t.as_path().unwrap().to_owned(); + assert!(t.remove().is_ok()); + assert!(!path.exists()); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/terminal.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/terminal.rs new file mode 100644 index 000000000..2d6177d1d --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/terminal.rs @@ -0,0 +1,155 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2017 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. + +use std::io::StdinLock; +use std::mem::zeroed; +use std::os::unix::io::RawFd; + +use libc::{ + c_int, fcntl, isatty, read, tcgetattr, tcsetattr, termios, ECHO, F_GETFL, F_SETFL, ICANON, + ISIG, O_NONBLOCK, STDIN_FILENO, TCSANOW, +}; + +use crate::errno::{errno_result, Result}; + +fn modify_mode(fd: RawFd, f: F) -> Result<()> { + // Safe because we check the return value of isatty. + if unsafe { isatty(fd) } != 1 { + return Ok(()); + } + + // The following pair are safe because termios gets totally overwritten by tcgetattr and we + // check the return result. + let mut termios: termios = unsafe { zeroed() }; + let ret = unsafe { tcgetattr(fd, &mut termios as *mut _) }; + if ret < 0 { + return errno_result(); + } + let mut new_termios = termios; + f(&mut new_termios); + // Safe because the syscall will only read the extent of termios and we check the return result. + let ret = unsafe { tcsetattr(fd, TCSANOW, &new_termios as *const _) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) +} + +fn get_flags(fd: RawFd) -> Result { + // Safe because no third parameter is expected and we check the return result. + let ret = unsafe { fcntl(fd, F_GETFL) }; + if ret < 0 { + return errno_result(); + } + Ok(ret) +} + +fn set_flags(fd: RawFd, flags: c_int) -> Result<()> { + // Safe because we supply the third parameter and we check the return result. + let ret = unsafe { fcntl(fd, F_SETFL, flags) }; + if ret < 0 { + return errno_result(); + } + Ok(()) +} + +/// Trait for file descriptors that are TTYs, according to `isatty(3)`. +/// +/// This is marked unsafe because the implementation must promise that the returned RawFd is a valid +/// fd and that the lifetime of the returned fd is at least that of the trait object. +pub unsafe trait Terminal { + /// Gets the file descriptor of the TTY. + fn tty_fd(&self) -> RawFd; + + /// Set this terminal's mode to canonical mode (`ICANON | ECHO | ISIG`). + fn set_canon_mode(&self) -> Result<()> { + modify_mode(self.tty_fd(), |t| t.c_lflag |= ICANON | ECHO | ISIG) + } + + /// Set this terminal's mode to raw mode (`!(ICANON | ECHO | ISIG)`). + fn set_raw_mode(&self) -> Result<()> { + modify_mode(self.tty_fd(), |t| t.c_lflag &= !(ICANON | ECHO | ISIG)) + } + + /// Sets the non-blocking mode of this terminal's file descriptor. + /// + /// If `non_block` is `true`, then `read_raw` will not block. If `non_block` is `false`, then + /// `read_raw` may block if there is nothing to read. + fn set_non_block(&self, non_block: bool) -> Result<()> { + let old_flags = get_flags(self.tty_fd())?; + let new_flags = if non_block { + old_flags | O_NONBLOCK + } else { + old_flags & !O_NONBLOCK + }; + if new_flags != old_flags { + set_flags(self.tty_fd(), new_flags)? + } + Ok(()) + } + + /// Reads up to `out.len()` bytes from this terminal without any buffering. + /// + /// This may block, depending on if non-blocking was enabled with `set_non_block` or if there + /// are any bytes to read. If there is at least one byte that is readable, this will not block. + fn read_raw(&self, out: &mut [u8]) -> Result { + // Safe because read will only modify the pointer up to the length we give it and we check + // the return result. + let ret = unsafe { read(self.tty_fd(), out.as_mut_ptr() as *mut _, out.len()) }; + if ret < 0 { + return errno_result(); + } + + Ok(ret as usize) + } +} + +// Safe because we return a genuine terminal fd that never changes and shares our lifetime. +unsafe impl<'a> Terminal for StdinLock<'a> { + fn tty_fd(&self) -> RawFd { + STDIN_FILENO + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::fs::File; + use std::io; + use std::os::unix::io::AsRawFd; + use std::path::Path; + + unsafe impl Terminal for File { + fn tty_fd(&self) -> RawFd { + self.as_raw_fd() + } + } + + #[test] + fn test_a_tty() { + let stdin_handle = io::stdin(); + let stdin = stdin_handle.lock(); + + assert!(stdin.set_canon_mode().is_ok()); + assert!(stdin.set_raw_mode().is_ok()); + assert!(stdin.set_raw_mode().is_ok()); + assert!(stdin.set_canon_mode().is_ok()); + assert!(stdin.set_non_block(true).is_ok()); + let mut out = [0u8; 0]; + assert!(stdin.read_raw(&mut out[..]).is_ok()); + } + + #[test] + fn test_a_non_tty() { + let file = File::open(Path::new("/dev/zero")).unwrap(); + assert!(file.set_canon_mode().is_ok()); + } +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/timerfd.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/timerfd.rs new file mode 100644 index 000000000..4e2903e52 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/timerfd.rs @@ -0,0 +1,173 @@ +// Copyright 2019 Intel Corporation. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-clause file. + +use std::fs::File; +use std::mem; +use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; +use std::ptr; +use std::time::Duration; + +use libc::{self, timerfd_create, timerfd_gettime, timerfd_settime, CLOCK_MONOTONIC, TFD_CLOEXEC}; + +use crate::errno::{errno_result, Result}; + +/// A safe wrapper around a Linux timerfd (man 2 timerfd_create). +pub struct TimerFd(File); + +impl TimerFd { + /// Creates a new [`TimerFd`](struct.TimerFd.html). + /// + /// The timer is initally disarmed and must be armed by calling [`reset`](fn.reset.html). + pub fn new() -> Result { + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC) }; + if ret < 0 { + return errno_result(); + } + + // Safe because we uniquely own the file descriptor. + Ok(TimerFd(unsafe { File::from_raw_fd(ret) })) + } + + /// Sets the timer to expire after `dur`. + /// + /// If `interval` is not `None` it represents the period for repeated expirations after the + /// initial expiration. Otherwise the timer will expire just once. Cancels any existing duration and repeating interval. + pub fn reset(&mut self, dur: Duration, interval: Option) -> Result<()> { + // Safe because we are zero-initializing a struct with only primitive member fields. + let mut spec: libc::itimerspec = unsafe { mem::zeroed() }; + spec.it_value.tv_sec = dur.as_secs() as libc::time_t; + // nsec always fits in i32 because subsec_nanos is defined to be less than one billion. + let nsec = dur.subsec_nanos() as i32; + spec.it_value.tv_nsec = libc::c_long::from(nsec); + + if let Some(int) = interval { + spec.it_interval.tv_sec = int.as_secs() as libc::time_t; + // nsec always fits in i32 because subsec_nanos is defined to be less than one billion. + let nsec = int.subsec_nanos() as i32; + spec.it_interval.tv_nsec = libc::c_long::from(nsec); + } + + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_settime(self.as_raw_fd(), 0, &spec, ptr::null_mut()) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) + } + + /// Waits until the timer expires. + /// + /// The return value represents the number of times the timer + /// has expired since the last time `wait` was called. If the timer has not yet expired once + /// this call will block until it does. + pub fn wait(&mut self) -> Result { + let mut count = 0u64; + + // Safe because this will only modify |buf| and we check the return value. + let ret = unsafe { + libc::read( + self.as_raw_fd(), + &mut count as *mut _ as *mut libc::c_void, + mem::size_of_val(&count), + ) + }; + if ret < 0 { + return errno_result(); + } + + // The bytes in the buffer are guaranteed to be in native byte-order so we don't need to + // use from_le or from_be. + Ok(count) + } + + /// Returns `true` if the timer is currently armed. + pub fn is_armed(&self) -> Result { + // Safe because we are zero-initializing a struct with only primitive member fields. + let mut spec: libc::itimerspec = unsafe { mem::zeroed() }; + + // Safe because timerfd_gettime is trusted to only modify `spec`. + let ret = unsafe { timerfd_gettime(self.as_raw_fd(), &mut spec) }; + if ret < 0 { + return errno_result(); + } + + Ok(spec.it_value.tv_sec != 0 || spec.it_value.tv_nsec != 0) + } + + /// Disarms the timer. + pub fn clear(&mut self) -> Result<()> { + // Safe because we are zero-initializing a struct with only primitive member fields. + let spec: libc::itimerspec = unsafe { mem::zeroed() }; + + // Safe because this doesn't modify any memory and we check the return value. + let ret = unsafe { timerfd_settime(self.as_raw_fd(), 0, &spec, ptr::null_mut()) }; + if ret < 0 { + return errno_result(); + } + + Ok(()) + } +} + +impl AsRawFd for TimerFd { + fn as_raw_fd(&self) -> RawFd { + self.0.as_raw_fd() + } +} + +impl FromRawFd for TimerFd { + unsafe fn from_raw_fd(fd: RawFd) -> Self { + TimerFd(File::from_raw_fd(fd)) + } +} + +impl IntoRawFd for TimerFd { + fn into_raw_fd(self) -> RawFd { + self.0.into_raw_fd() + } +} + +#[cfg(test)] +mod tests { + use super::*; + use std::thread::sleep; + use std::time::{Duration, Instant}; + + #[test] + fn test_one_shot() { + let mut tfd = TimerFd::new().expect("failed to create timerfd"); + assert_eq!(tfd.is_armed().unwrap(), false); + + let dur = Duration::from_millis(200); + let now = Instant::now(); + tfd.reset(dur, None).expect("failed to arm timer"); + + assert_eq!(tfd.is_armed().unwrap(), true); + + let count = tfd.wait().expect("unable to wait for timer"); + + assert_eq!(count, 1); + assert!(now.elapsed() >= dur); + } + + #[test] + fn test_repeating() { + let mut tfd = TimerFd::new().expect("failed to create timerfd"); + + let dur = Duration::from_millis(200); + let interval = Duration::from_millis(100); + tfd.reset(dur, Some(interval)).expect("failed to arm timer"); + + sleep(dur * 3); + + let count = tfd.wait().expect("unable to wait for timer"); + assert!(count >= 5, "count = {}", count); + } + +} diff --git a/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/write_zeroes.rs b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/write_zeroes.rs new file mode 100644 index 000000000..98195d8f3 --- /dev/null +++ b/vendor/git-ccfa5f04f3f14300/vmm-sys-util/src/write_zeroes.rs @@ -0,0 +1,172 @@ +// Copyright 2018 The Chromium OS Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE-BSD-3-Clause file. +// +// SPDX-License-Identifier: BSD-3-Clause + +use std::cmp::min; +use std::fs::File; +use std::io::{self, Seek, SeekFrom, Write}; + +use crate::fallocate; +use crate::FallocateMode; + +/// A trait for deallocating space in a file. +pub trait PunchHole { + /// Replace a range of bytes with a hole. + fn punch_hole(&mut self, offset: u64, length: u64) -> io::Result<()>; +} + +impl PunchHole for File { + fn punch_hole(&mut self, offset: u64, length: u64) -> io::Result<()> { + fallocate(self, FallocateMode::PunchHole, true, offset, length as u64) + .map_err(|e| io::Error::from_raw_os_error(e.errno())) + } +} + +/// A trait for writing zeroes to a stream. +pub trait WriteZeroes { + /// Write `length` bytes of zeroes to the stream, returning how many bytes were written. + fn write_zeroes(&mut self, length: usize) -> io::Result; +} + +impl WriteZeroes for T { + fn write_zeroes(&mut self, length: usize) -> io::Result { + // Try to punch a hole first. + let offset = self.seek(SeekFrom::Current(0))?; + if let Ok(()) = self.punch_hole(offset, length as u64) { + // Advance the seek cursor as if we had done a real write(). + self.seek(SeekFrom::Current(length as i64))?; + return Ok(length); + } + + // fall back to write() + + // punch_hole() failed; fall back to writing a buffer of zeroes + // until we have written up to length. + let buf_size = min(length, 0x10000); + let buf = vec![0u8; buf_size]; + let mut nwritten: usize = 0; + while nwritten < length { + let remaining = length - nwritten; + let write_size = min(remaining, buf_size); + nwritten += self.write(&buf[0..write_size])?; + } + Ok(length) + } +} + +#[cfg(test)] +#[allow(clippy::unused_io_amount)] +mod tests { + use super::*; + use std::fs::OpenOptions; + use std::io::{Read, Seek, SeekFrom}; + use std::path::PathBuf; + + use crate::TempDir; + + #[test] + fn simple_test() { + let tempdir = TempDir::new("/tmp/write_zeroes_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("file"); + let mut f = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path) + .unwrap(); + f.set_len(16384).unwrap(); + + // Write buffer of non-zero bytes to offset 1234 + let orig_data = [0x55u8; 5678]; + f.seek(SeekFrom::Start(1234)).unwrap(); + f.write(&orig_data).unwrap(); + + // Read back the data plus some overlap on each side + let mut readback = [0u8; 16384]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // Bytes before the write should still be 0 + for read in readback[0..1234].iter() { + assert_eq!(*read, 0); + } + // Bytes that were just written should be 0x55 + for read in readback[1234..(1234 + 5678)].iter() { + assert_eq!(*read, 0x55); + } + // Bytes after the written area should still be 0 + for read in readback[(1234 + 5678)..].iter() { + assert_eq!(*read, 0); + } + + // Overwrite some of the data with zeroes + f.seek(SeekFrom::Start(2345)).unwrap(); + f.write_zeroes(4321).expect("write_zeroes failed"); + // Verify seek position after write_zeroes() + assert_eq!(f.seek(SeekFrom::Current(0)).unwrap(), 2345 + 4321); + + // Read back the data and verify that it is now zero + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // Bytes before the write should still be 0 + for read in readback[0..1234].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist before the write_zeroes region + for read in readback[1234..2345].iter() { + assert_eq!(*read, 0x55); + } + // The write_zeroes region should now be zero + for read in readback[2345..(2345 + 4321)].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist after the write_zeroes region + for read in readback[(2345 + 4321)..(1234 + 5678)].iter() { + assert_eq!(*read, 0x55); + } + // The rest of the file should still be 0 + for read in readback[(1234 + 5678)..].iter() { + assert_eq!(*read, 0); + } + } + + #[test] + fn large_write_zeroes() { + let tempdir = TempDir::new("/tmp/write_zeroes_test").unwrap(); + let mut path = PathBuf::from(tempdir.as_path().unwrap()); + path.push("file"); + let mut f = OpenOptions::new() + .read(true) + .write(true) + .create(true) + .open(&path) + .unwrap(); + f.set_len(16384).unwrap(); + + // Write buffer of non-zero bytes + let orig_data = [0x55u8; 0x20000]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.write(&orig_data).unwrap(); + + // Overwrite some of the data with zeroes + f.seek(SeekFrom::Start(0)).unwrap(); + f.write_zeroes(0x10001).expect("write_zeroes failed"); + // Verify seek position after write_zeroes() + assert_eq!(f.seek(SeekFrom::Current(0)).unwrap(), 0x10001); + + // Read back the data and verify that it is now zero + let mut readback = [0u8; 0x20000]; + f.seek(SeekFrom::Start(0)).unwrap(); + f.read(&mut readback).unwrap(); + // The write_zeroes region should now be zero + for read in readback[0..0x10001].iter() { + assert_eq!(*read, 0); + } + // Original data should still exist after the write_zeroes region + for read in readback[0x10001..0x20000].iter() { + assert_eq!(*read, 0x55); + } + } +} diff --git a/vendor/registry-40351f815f426200/ansi_term/.cargo-checksum.json b/vendor/registry-40351f815f426200/ansi_term/.cargo-checksum.json new file mode 100644 index 000000000..66b0d7deb --- /dev/null +++ b/vendor/registry-40351f815f426200/ansi_term/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"ffe01d108855864ea3c975aad9da22d2a2324730022a5d4e119639f5850209db","LICENCE":"2762990c7fbba9d550802a2593c1d857dcd52596bb0f9f192a97e9a7ac5f4f9e","README.md":"ee22a0db93788e9bfe4c3cf4d7df5daf881a3105f941a915140a34018ff394e5","src/lib.rs":"867242d0699126af5a115709030888e958edfb835a0b3c15c4159a045f367e18"},"package":"23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/ansi_term/Cargo.toml b/vendor/registry-40351f815f426200/ansi_term/Cargo.toml new file mode 100644 index 000000000..93f4d272b --- /dev/null +++ b/vendor/registry-40351f815f426200/ansi_term/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "ansi_term" +description = "Library for ANSI terminal colours and styles (bold, underline)" + +authors = [ "ogham@bsago.me", "Ryan Scheel (Havvy) " ] +documentation = "https://docs.rs/ansi_term/0.9.0/ansi_term/" +homepage = "https://github.com/ogham/rust-ansi-term" +license = "MIT" +readme = "README.md" +version = "0.9.0" + +[lib] +name = "ansi_term" diff --git a/vendor/registry-40351f815f426200/ansi_term/LICENCE b/vendor/registry-40351f815f426200/ansi_term/LICENCE new file mode 100644 index 000000000..3228cc99b --- /dev/null +++ b/vendor/registry-40351f815f426200/ansi_term/LICENCE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Benjamin Sago + +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/vendor/registry-40351f815f426200/ansi_term/README.md b/vendor/registry-40351f815f426200/ansi_term/README.md new file mode 100644 index 000000000..c6687142a --- /dev/null +++ b/vendor/registry-40351f815f426200/ansi_term/README.md @@ -0,0 +1,169 @@ +# rust-ansi-term [![ansi-term on crates.io](http://meritbadge.herokuapp.com/ansi-term)](https://crates.io/crates/ansi_term) [![Build status](https://travis-ci.org/ogham/rust-ansi-term.svg?branch=master)](https://travis-ci.org/ogham/rust-ansi-term) [![Coverage status](https://coveralls.io/repos/ogham/rust-ansi-term/badge.svg?branch=master&service=github)](https://coveralls.io/github/ogham/rust-ansi-term?branch=master) + +This is a library for controlling colours and formatting, such as red bold text or blue underlined text, on ANSI terminals. + +### [View the Rustdoc](http://ogham.rustdocs.org/ansi_term) + + +# Installation + +This crate works with [Cargo](http://crates.io). Add the following to your `Cargo.toml` dependencies section: + +```toml +[dependencies] +ansi_term = "0.8" +``` + + +## Basic usage + +There are two main data structures in this crate that you need to be concerned with: `ANSIString` and `Style`. +A `Style` holds stylistic information: colours, whether the text should be bold, or blinking, or whatever. +There are also `Colour` variants that represent simple foreground colour styles. +An `ANSIString` is a string paired with a `Style`. + +(Yes, it’s British English, but you won’t have to write “colour” very often. `Style` is used the majority of the time.) + +To format a string, call the `paint` method on a `Style` or a `Colour`, passing in the string you want to format as the argument. +For example, here’s how to get some red text: + +```rust +use ansi_term::Colour::Red; +println!("This is in red: {}", Red.paint("a red string")); +``` + +It’s important to note that the `paint` method does *not* actually return a string with the ANSI control characters surrounding it. +Instead, it returns an `ANSIString` value that has a `Display` implementation that, when formatted, returns the characters. +This allows strings to be printed with a minimum of `String` allocations being performed behind the scenes. + +If you *do* want to get at the escape codes, then you can convert the `ANSIString` to a string as you would any other `Display` value: + +```rust +use ansi_term::Colour::Red; +use std::string::ToString; +let red_string = Red.paint("a red string").to_string(); +``` + + +## Bold, underline, background, and other styles + +For anything more complex than plain foreground colour changes, you need to construct `Style` objects themselves, rather than beginning with a `Colour`. +You can do this by chaining methods based on a new `Style`, created with `Style::new()`. +Each method creates a new style that has that specific property set. +For example: + +```rust +use ansi_term::Style; +println!("How about some {} and {}?", + Style::new().bold().paint("bold"), + Style::new().underline().paint("underline")); +``` + +For brevity, these methods have also been implemented for `Colour` values, so you can give your styles a foreground colour without having to begin with an empty `Style` value: + +```rust +use ansi_term::Colour::{Blue, Yellow}; +println!("Demonstrating {} and {}!", + Blue.bold().paint("blue bold"), + Yellow.underline().paint("yellow underline")); +println!("Yellow on blue: {}", Yellow.on(Blue).paint("wow!")); +``` + +The complete list of styles you can use are: +`bold`, `dimmed`, `italic`, `underline`, `blink`, `reverse`, `hidden`, and `on` for background colours. + +In some cases, you may find it easier to change the foreground on an existing `Style` rather than starting from the appropriate `Colour`. +You can do this using the `fg` method: + +```rust + use ansi_term::Style; + use ansi_term::Colour::{Blue, Cyan, Yellow}; + println!("Yellow on blue: {}", Style::new().on(Blue).fg(Yellow).paint("yow!")); + println!("Also yellow on blue: {}", Cyan.on(Blue).fg(Yellow).paint("zow!")); +``` + +Finally, you can turn a `Colour` into a `Style` with the `normal` method. +This will produce the exact same `ANSIString` as if you just used the `paint` method on the `Colour` directly, but it’s useful in certain cases: for example, you may have a method that returns `Styles`, and need to represent both the “red bold” and “red, but not bold” styles with values of the same type. The `Style` struct also has a `Default` implementation if you want to have a style with *nothing* set. + +```rust +use ansi_term::Style; +use ansi_term::Colour::Red; +Red.normal().paint("yet another red string"); +Style::default().paint("a completely regular string"); +``` + + +## Extended colours + +You can access the extended range of 256 colours by using the `Fixed` colour variant, which takes an argument of the colour number to use. +This can be included wherever you would use a `Colour`: + +```rust +use ansi_term::Colour::Fixed; +Fixed(134).paint("A sort of light purple"); +Fixed(221).on(Fixed(124)).paint("Mustard in the ketchup"); +``` + +The first sixteen of these values are the same as the normal and bold standard colour variants. +There’s nothing stopping you from using these as `Fixed` colours instead, but there’s nothing to be gained by doing so either. + +You can also access full 24-bit color by using the `RGB` colour variant, which takes separate `u8` arguments for red, green, and blue: + +```rust + use ansi_term::Colour::RGB; + RGB(70, 130, 180).paint("Steel blue"); +``` + +## Combining successive coloured strings + +The benefit of writing ANSI escape codes to the terminal is that they *stack*: you do not need to end every coloured string with a reset code if the text that follows it is of a similar style. +For example, if you want to have some blue text followed by some blue bold text, it’s possible to send the ANSI code for blue, followed by the ANSI code for bold, and finishing with a reset code without having to have an extra one between the two strings. + +This crate can optimise the ANSI codes that get printed in situations like this, making life easier for your terminal renderer. +The `ANSIStrings` struct takes a slice of several `ANSIString` values, and will iterate over each of them, printing only the codes for the styles that need to be updated as part of its formatting routine. + +The following code snippet uses this to enclose a binary number displayed in red bold text inside some red, but not bold, brackets: + +```rust +use ansi_term::Colour::Red; +use ansi_term::{ANSIString, ANSIStrings}; +let some_value = format!("{:b}", 42); +let strings: &[ANSIString<'static>] = &[ + Red.paint("["), + Red.bold().paint(some_value), + Red.paint("]"), +]; +println!("Value: {}", ANSIStrings(strings)); +``` + +There are several things to note here. +Firstly, the `paint` method can take *either* an owned `String` or a borrowed `&str`. +Internally, an `ANSIString` holds a copy-on-write (`Cow`) string value to deal with both owned and borrowed strings at the same time. +This is used here to display a `String`, the result of the `format!` call, using the same mechanism as some statically-available `&str` slices. +Secondly, that the `ANSIStrings` value works in the same way as its singular counterpart, with a `Display` implementation that only performs the formatting when required. + +## Byte strings + +This library also supports formatting `[u8]` byte strings; this supports +applications working with text in an unknown encoding. `Style` and +`Color` support painting `[u8]` values, resulting in an `ANSIByteString`. +This type does not implement `Display`, as it may not contain UTF-8, but +it does provide a method `write_to` to write the result to any +`io::Write`: + +```rust +use ansi_term::Colour::Green; +Green.paint("user data".as_bytes()).write_to(&mut std::io::stdout()).unwrap(); +``` + +Similarly, the type `ANSIByteStrings` supports writing a list of +`ANSIByteString` values with minimal escape sequences: + +```rust +use ansi_term::Colour::Green; +use ansi_term::ANSIByteStrings; +ANSIByteStrings(&[ + Green.paint("user data 1\n".as_bytes()), + Green.bold().paint("user data 2\n".as_bytes()), +]).write_to(&mut std::io::stdout()).unwrap(); +``` diff --git a/vendor/registry-40351f815f426200/ansi_term/src/lib.rs b/vendor/registry-40351f815f426200/ansi_term/src/lib.rs new file mode 100644 index 000000000..84943bee0 --- /dev/null +++ b/vendor/registry-40351f815f426200/ansi_term/src/lib.rs @@ -0,0 +1,1099 @@ +//! This is a library for controlling colours and formatting, such as +//! red bold text or blue underlined text, on ANSI terminals. +//! +//! +//! ## Basic usage +//! +//! There are two main data structures in this crate that you need to be +//! concerned with: `ANSIString` and `Style`. A `Style` holds stylistic +//! information: colours, whether the text should be bold, or blinking, or +//! whatever. There are also `Colour` variants that represent simple foreground +//! colour styles. An `ANSIString` is a string paired with a `Style`. +//! +//! (Yes, it’s British English, but you won’t have to write “colour” very often. +//! `Style` is used the majority of the time.) +//! +//! To format a string, call the `paint` method on a `Style` or a `Colour`, +//! passing in the string you want to format as the argument. For example, +//! here’s how to get some red text: +//! +//! use ansi_term::Colour::Red; +//! println!("This is in red: {}", Red.paint("a red string")); +//! +//! It’s important to note that the `paint` method does *not* actually return a +//! string with the ANSI control characters surrounding it. Instead, it returns +//! an `ANSIString` value that has a `Display` implementation that, when +//! formatted, returns the characters. This allows strings to be printed with a +//! minimum of `String` allocations being performed behind the scenes. +//! +//! If you *do* want to get at the escape codes, then you can convert the +//! `ANSIString` to a string as you would any other `Display` value: +//! +//! use ansi_term::Colour::Red; +//! use std::string::ToString; +//! let red_string = Red.paint("a red string").to_string(); +//! +//! +//! ## Bold, underline, background, and other styles +//! +//! For anything more complex than plain foreground colour changes, you need to +//! construct `Style` objects themselves, rather than beginning with a `Colour`. +//! You can do this by chaining methods based on a new `Style`, created with +//! `Style::new()`. Each method creates a new style that has that specific +//! property set. For example: +//! +//! use ansi_term::Style; +//! println!("How about some {} and {}?", +//! Style::new().bold().paint("bold"), +//! Style::new().underline().paint("underline")); +//! +//! For brevity, these methods have also been implemented for `Colour` values, +//! so you can give your styles a foreground colour without having to begin with +//! an empty `Style` value: +//! +//! use ansi_term::Colour::{Blue, Yellow}; +//! println!("Demonstrating {} and {}!", +//! Blue.bold().paint("blue bold"), +//! Yellow.underline().paint("yellow underline")); +//! println!("Yellow on blue: {}", Yellow.on(Blue).paint("wow!")); +//! +//! The complete list of styles you can use are: `bold`, `dimmed`, `italic`, +//! `underline`, `blink`, `reverse`, `hidden`, `strikethrough`, and `on` for +//! background colours. +//! +//! In some cases, you may find it easier to change the foreground on an +//! existing `Style` rather than starting from the appropriate `Colour`. +//! You can do this using the `fg` method: +//! +//! use ansi_term::Style; +//! use ansi_term::Colour::{Blue, Cyan, Yellow}; +//! println!("Yellow on blue: {}", Style::new().on(Blue).fg(Yellow).paint("yow!")); +//! println!("Also yellow on blue: {}", Cyan.on(Blue).fg(Yellow).paint("zow!")); +//! +//! Finally, you can turn a `Colour` into a `Style` with the `normal` method. +//! This will produce the exact same `ANSIString` as if you just used the +//! `paint` method on the `Colour` directly, but it’s useful in certain cases: +//! for example, you may have a method that returns `Styles`, and need to +//! represent both the “red bold” and “red, but not bold” styles with values of +//! the same type. The `Style` struct also has a `Default` implementation if you +//! want to have a style with *nothing* set. +//! +//! use ansi_term::Style; +//! use ansi_term::Colour::Red; +//! Red.normal().paint("yet another red string"); +//! Style::default().paint("a completely regular string"); +//! +//! +//! ## Extended colours +//! +//! You can access the extended range of 256 colours by using the `Fixed` colour +//! variant, which takes an argument of the colour number to use. This can be +//! included wherever you would use a `Colour`: +//! +//! use ansi_term::Colour::Fixed; +//! Fixed(134).paint("A sort of light purple"); +//! Fixed(221).on(Fixed(124)).paint("Mustard in the ketchup"); +//! +//! The first sixteen of these values are the same as the normal and bold +//! standard colour variants. There’s nothing stopping you from using these as +//! `Fixed` colours instead, but there’s nothing to be gained by doing so +//! either. +//! +//! You can also access full 24-bit color by using the `RGB` colour variant, +//! which takes separate `u8` arguments for red, green, and blue: +//! +//! use ansi_term::Colour::RGB; +//! RGB(70, 130, 180).paint("Steel blue"); +//! +//! ## Combining successive coloured strings +//! +//! The benefit of writing ANSI escape codes to the terminal is that they +//! *stack*: you do not need to end every coloured string with a reset code if +//! the text that follows it is of a similar style. For example, if you want to +//! have some blue text followed by some blue bold text, it’s possible to send +//! the ANSI code for blue, followed by the ANSI code for bold, and finishing +//! with a reset code without having to have an extra one between the two +//! strings. +//! +//! This crate can optimise the ANSI codes that get printed in situations like +//! this, making life easier for your terminal renderer. The `ANSIStrings` +//! struct takes a slice of several `ANSIString` values, and will iterate over +//! each of them, printing only the codes for the styles that need to be updated +//! as part of its formatting routine. +//! +//! The following code snippet uses this to enclose a binary number displayed in +//! red bold text inside some red, but not bold, brackets: +//! +//! use ansi_term::Colour::Red; +//! use ansi_term::{ANSIString, ANSIStrings}; +//! let some_value = format!("{:b}", 42); +//! let strings: &[ANSIString<'static>] = &[ +//! Red.paint("["), +//! Red.bold().paint(some_value), +//! Red.paint("]"), +//! ]; +//! println!("Value: {}", ANSIStrings(strings)); +//! +//! There are several things to note here. Firstly, the `paint` method can take +//! *either* an owned `String` or a borrowed `&str`. Internally, an `ANSIString` +//! holds a copy-on-write (`Cow`) string value to deal with both owned and +//! borrowed strings at the same time. This is used here to display a `String`, +//! the result of the `format!` call, using the same mechanism as some +//! statically-available `&str` slices. Secondly, that the `ANSIStrings` value +//! works in the same way as its singular counterpart, with a `Display` +//! implementation that only performs the formatting when required. +//! +//! ## Byte strings +//! +//! This library also supports formatting `[u8]` byte strings; this supports +//! applications working with text in an unknown encoding. `Style` and +//! `Color` support painting `[u8]` values, resulting in an `ANSIByteString`. +//! This type does not implement `Display`, as it may not contain UTF-8, but +//! it does provide a method `write_to` to write the result to any +//! `io::Write`: +//! +//! use ansi_term::Colour::Green; +//! Green.paint("user data".as_bytes()).write_to(&mut std::io::stdout()).unwrap(); +//! +//! Similarly, the type `ANSIByteStrings` supports writing a list of +//! `ANSIByteString` values with minimal escape sequences: +//! +//! use ansi_term::Colour::Green; +//! use ansi_term::ANSIByteStrings; +//! ANSIByteStrings(&[ +//! Green.paint("user data 1\n".as_bytes()), +//! Green.bold().paint("user data 2\n".as_bytes()), +//! ]).write_to(&mut std::io::stdout()).unwrap(); + + +#![crate_name = "ansi_term"] +#![crate_type = "rlib"] +#![crate_type = "dylib"] + +#![warn(missing_copy_implementations)] +#![warn(missing_docs)] +#![warn(trivial_casts, trivial_numeric_casts)] +#![warn(unused_extern_crates, unused_qualifications)] + + +use std::borrow::Cow; +use std::default::Default; +use std::fmt; +use std::io; +use std::ops::Deref; + +use Colour::*; +use Difference::*; + +trait AnyWrite { + type str : ?Sized; + type Error; + fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), Self::Error>; + fn write_str(&mut self, s: &Self::str) -> Result<(), Self::Error>; +} + +impl<'a> AnyWrite for fmt::Write + 'a { + type str = str; + type Error = fmt::Error; + fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), Self::Error> { + fmt::Write::write_fmt(self, fmt) + } + fn write_str(&mut self, s: &Self::str) -> Result<(), Self::Error> { + fmt::Write::write_str(self, s) + } +} + +impl<'a> AnyWrite for io::Write + 'a { + type str = [u8]; + type Error = io::Error; + fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), Self::Error> { + io::Write::write_fmt(self, fmt) + } + fn write_str(&mut self, s: &Self::str) -> Result<(), Self::Error> { + io::Write::write_all(self, s) + } +} + +/// An ANSIGenericString includes a generic string type and a Style to +/// display that string. ANSIString and ANSIByteString are aliases for +/// this type on str and [u8], respectively. +#[derive(PartialEq, Debug, Clone)] +pub struct ANSIGenericString<'a, S: 'a + ToOwned + ?Sized> +where ::Owned: std::fmt::Debug { + style: Style, + string: Cow<'a, S>, +} + +impl<'a, S: 'a + ToOwned + ?Sized> ANSIGenericString<'a, S> +where ::Owned: std::fmt::Debug { + fn write_to_any + ?Sized>(&self, w: &mut W) -> Result<(), W::Error> { + try!(self.style.write_prefix(w)); + try!(w.write_str(&self.string)); + self.style.write_suffix(w) + } +} + +/// An ANSI String is a string coupled with the Style to display it +/// in a terminal. +/// +/// Although not technically a string itself, it can be turned into +/// one with the `to_string` method. +/// +/// ### Examples +/// +/// ```no_run +/// use ansi_term::ANSIString; +/// use ansi_term::Colour::Red; +/// +/// let red_string = Red.paint("a red string"); +/// println!("{}", red_string); +/// ``` +/// +/// ``` +/// use ansi_term::ANSIString; +/// +/// let plain_string = ANSIString::from("a plain string"); +/// assert_eq!(&*plain_string, "a plain string"); +/// ``` +pub type ANSIString<'a> = ANSIGenericString<'a, str>; + +/// An ANSIByteString represents a formatted series of bytes. Use +/// ANSIByteString when styling text with an unknown encoding. +pub type ANSIByteString<'a> = ANSIGenericString<'a, [u8]>; + +/// Like `ANSIString`, but only displays the style prefix. +#[derive(Clone, Copy, Debug)] +pub struct Prefix(Style); + +/// Like `ANSIString`, but only displays the style suffix. +#[derive(Clone, Copy, Debug)] +pub struct Suffix(Style); + +/// Like `ANSIString`, but only displays the difference between two +/// styles. +#[derive(Clone, Copy, Debug)] +pub struct Infix(Style, Style); + +impl<'a> fmt::Display for ANSIString<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let w: &mut fmt::Write = f; + self.write_to_any(w) + } +} + +impl<'a> ANSIByteString<'a> { + /// Write an ANSIByteString to an io::Write. This writes the escape + /// sequences for the associated Style around the bytes. + pub fn write_to(&self, w: &mut W) -> io::Result<()> { + let w: &mut io::Write = w; + self.write_to_any(w) + } +} + + +impl<'a, I, S: 'a + ToOwned + ?Sized> From for ANSIGenericString<'a, S> +where I: Into>, + ::Owned: std::fmt::Debug { + fn from(input: I) -> ANSIGenericString<'a, S> { + ANSIGenericString { + string: input.into(), + style: Style::default(), + } + } +} + +impl<'a, S: 'a + ToOwned + ?Sized> Deref for ANSIGenericString<'a, S> +where ::Owned: std::fmt::Debug { + type Target = S; + + fn deref(&self) -> &S { + self.string.deref() + } +} + + +impl fmt::Display for Prefix { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let f: &mut fmt::Write = f; + try!(self.0.write_prefix(f)); + Ok(()) + } +} + +impl fmt::Display for Suffix { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let f: &mut fmt::Write = f; + try!(self.0.write_suffix(f)); + Ok(()) + } +} + +impl fmt::Display for Infix { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self.0.difference(&self.1) { + ExtraStyles(style) => { + let f: &mut fmt::Write = f; + try!(style.write_prefix(f)) + }, + Reset => { + let f: &mut fmt::Write = f; + try!(f.write_str("\x1B[0m")); + try!(self.0.write_prefix(f)); + }, + NoDifference => { /* Do nothing! */ }, + } + Ok(()) + } +} + + +/// A colour is one specific type of ANSI escape code, and can refer +/// to either the foreground or background colour. +/// +/// These use the standard numeric sequences. +/// See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html +#[derive(PartialEq, Clone, Copy, Debug)] +pub enum Colour { + + /// Colour #0 (foreground code `30`, background code `40`). + /// + /// This is not necessarily the background colour, and using it as one may + /// render the text hard to read on terminals with dark backgrounds. + Black, + + /// Colour #1 (foreground code `31`, background code `41`). + Red, + + /// Colour #2 (foreground code `32`, background code `42`). + Green, + + /// Colour #3 (foreground code `33`, background code `43`). + Yellow, + + /// Colour #4 (foreground code `34`, background code `44`). + Blue, + + /// Colour #5 (foreground code `35`, background code `45`). + Purple, + + /// Colour #6 (foreground code `36`, background code `46`). + Cyan, + + /// Colour #7 (foreground code `37`, background code `47`). + /// + /// As above, this is not necessarily the foreground colour, and may be + /// hard to read on terminals with light backgrounds. + White, + + /// A colour number from 0 to 255, for use in 256-colour terminal + /// environments. + /// + /// - Colours 0 to 7 are the `Black` to `White` variants respectively. + /// These colours can usually be changed in the terminal emulator. + /// - Colours 8 to 15 are brighter versions of the eight colours above. + /// These can also usually be changed in the terminal emulator, or it + /// could be configured to use the original colours and show the text in + /// bold instead. It varies depending on the program. + /// - Colours 16 to 231 contain several palettes of bright colours, + /// arranged in six squares measuring six by six each. + /// - Colours 232 to 255 are shades of grey from black to white. + /// + /// It might make more sense to look at a [colour chart][cc]. + /// [cc]: https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg + Fixed(u8), + + /// A 24-bit RGB color, as specified by ISO-8613-3. + RGB(u8, u8, u8), +} + +/// Color is a type alias for Colour for those who can't be bothered. +pub use Colour as Color; + +// I'm not beyond calling Colour Colour, rather than Color, but I did +// purposefully name this crate 'ansi-term' so people wouldn't get +// confused when they tried to install it. +// +// Only *after* they'd installed it. + +impl Colour { + fn write_foreground_code(&self, f: &mut W) -> Result<(), W::Error> { + match *self { + Black => write!(f, "30"), + Red => write!(f, "31"), + Green => write!(f, "32"), + Yellow => write!(f, "33"), + Blue => write!(f, "34"), + Purple => write!(f, "35"), + Cyan => write!(f, "36"), + White => write!(f, "37"), + Fixed(num) => write!(f, "38;5;{}", &num), + RGB(r,g,b) => write!(f, "38;2;{};{};{}", &r, &g, &b), + } + } + + fn write_background_code(&self, f: &mut W) -> Result<(), W::Error> { + match *self { + Black => write!(f, "40"), + Red => write!(f, "41"), + Green => write!(f, "42"), + Yellow => write!(f, "43"), + Blue => write!(f, "44"), + Purple => write!(f, "45"), + Cyan => write!(f, "46"), + White => write!(f, "47"), + Fixed(num) => write!(f, "48;5;{}", &num), + RGB(r,g,b) => write!(f, "48;2;{};{};{}", &r, &g, &b), + } + } + + /// Return a Style with the foreground colour set to this colour. + pub fn normal(self) -> Style { + Style { foreground: Some(self), .. Style::default() } + } + + /// Paints the given text with this colour, returning an ANSI string. + /// This is a short-cut so you don't have to use Blue.normal() just + /// to get blue text. + pub fn paint<'a, I, S: 'a + ToOwned + ?Sized>(self, input: I) -> ANSIGenericString<'a, S> + where I: Into>, + ::Owned: std::fmt::Debug { + ANSIGenericString { + string: input.into(), + style: self.normal(), + } + } + + /// The prefix for this colour. + pub fn prefix(self) -> Prefix { + Prefix(self.normal()) + } + + /// The suffix for this colour. + pub fn suffix(self) -> Suffix { + Suffix(self.normal()) + } + + /// The infix between this colour and another. + pub fn infix(self, other: Colour) -> Infix { + Infix(self.normal(), other.normal()) + } + + /// Returns a Style with the bold property set. + pub fn bold(self) -> Style { + Style { foreground: Some(self), is_bold: true, .. Style::default() } + } + + /// Returns a Style with the dimmed property set. + pub fn dimmed(self) -> Style { + Style { foreground: Some(self), is_dimmed: true, .. Style::default() } + } + + /// Returns a Style with the italic property set. + pub fn italic(self) -> Style { + Style { foreground: Some(self), is_italic: true, .. Style::default() } + } + + /// Returns a Style with the underline property set. + pub fn underline(self) -> Style { + Style { foreground: Some(self), is_underline: true, .. Style::default() } + } + + /// Returns a Style with the blink property set. + pub fn blink(self) -> Style { + Style { foreground: Some(self), is_blink: true, .. Style::default() } + } + + /// Returns a Style with the reverse property set. + pub fn reverse(self) -> Style { + Style { foreground: Some(self), is_reverse: true, .. Style::default() } + } + + /// Returns a Style with the hidden property set. + pub fn hidden(self) -> Style { + Style { foreground: Some(self), is_hidden: true, .. Style::default() } + } + + /// Returns a Style with the strikethrough property set. + pub fn strikethrough(self) -> Style { + Style { foreground: Some(self), is_strikethrough: true, .. Style::default() } + } + + /// Returns a Style with the background colour property set. + pub fn on(self, background: Colour) -> Style { + Style { foreground: Some(self), background: Some(background), .. Style::default() } + } +} + +/// A style is a collection of properties that can format a string +/// using ANSI escape codes. +#[derive(PartialEq, Clone, Copy, Debug)] +pub struct Style { + foreground: Option, + background: Option, + is_bold: bool, + is_dimmed: bool, + is_italic: bool, + is_underline: bool, + is_blink: bool, + is_reverse: bool, + is_hidden: bool, + is_strikethrough: bool +} + +impl Style { + /// Creates a new Style with no differences. + pub fn new() -> Style { + Style::default() + } + + /// Paints the given text with this colour, returning an ANSI string. + pub fn paint<'a, I, S: 'a + ToOwned + ?Sized>(self, input: I) -> ANSIGenericString<'a, S> + where I: Into>, + ::Owned: std::fmt::Debug { + ANSIGenericString { + string: input.into(), + style: self, + } + } + + /// The prefix for this style. + pub fn prefix(self) -> Prefix { + Prefix(self) + } + + /// The suffix for this style. + pub fn suffix(self) -> Suffix { + Suffix(self) + } + + /// The infix between this style and another. + pub fn infix(self, other: Style) -> Infix { + Infix(self, other) + } + + /// Returns a Style with the bold property set. + pub fn bold(&self) -> Style { + Style { is_bold: true, .. *self } + } + + /// Returns a Style with the dimmed property set. + pub fn dimmed(&self) -> Style { + Style { is_dimmed: true, .. *self } + } + + /// Returns a Style with the italic property set. + pub fn italic(&self) -> Style { + Style { is_italic: true, .. *self } + } + + /// Returns a Style with the underline property set. + pub fn underline(&self) -> Style { + Style { is_underline: true, .. *self } + } + + /// Returns a Style with the blink property set. + pub fn blink(&self) -> Style { + Style { is_blink: true, .. *self } + } + + /// Returns a Style with the reverse property set. + pub fn reverse(&self) -> Style { + Style { is_reverse: true, .. *self } + } + + /// Returns a Style with the hidden property set. + pub fn hidden(&self) -> Style { + Style { is_hidden: true, .. *self } + } + + /// Returns a Style with the hidden property set. + pub fn strikethrough(&self) -> Style { + Style { is_strikethrough: true, .. *self } + } + + /// Returns a Style with the foreground colour property set. + pub fn fg(&self, foreground: Colour) -> Style { + Style { foreground: Some(foreground), .. *self } + } + + /// Returns a Style with the background colour property set. + pub fn on(&self, background: Colour) -> Style { + Style { background: Some(background), .. *self } + } + + /// Write any ANSI codes that go *before* a piece of text. These should be + /// the codes to set the terminal to a different colour or font style. + fn write_prefix(&self, f: &mut W) -> Result<(), W::Error> { + // If there are actually no styles here, then don’t write *any* codes + // as the prefix. An empty ANSI code may not affect the terminal + // output at all, but a user may just want a code-free string. + if self.is_plain() { + return Ok(()); + } + + // Write the codes’ prefix, then write numbers, separated by + // semicolons, for each text style we want to apply. + try!(write!(f, "\x1B[")); + let mut written_anything = false; + + { + let mut write_char = |c| { + if written_anything { try!(write!(f, ";")); } + written_anything = true; + try!(write!(f, "{}", c)); + Ok(()) + }; + + if self.is_bold { try!(write_char('1')); } + if self.is_dimmed { try!(write_char('2')); } + if self.is_italic { try!(write_char('3')); } + if self.is_underline { try!(write_char('4')); } + if self.is_blink { try!(write_char('5')); } + if self.is_reverse { try!(write_char('7')); } + if self.is_hidden { try!(write_char('8')); } + if self.is_strikethrough { try!(write_char('9')); } + } + + // The foreground and background colours, if specified, need to be + // handled specially because the number codes are more complicated. + // (see `write_background_code` and `write_foreground_code`) + if let Some(bg) = self.background { + if written_anything { try!(write!(f, ";")); } + written_anything = true; + + try!(bg.write_background_code(f)); + } + + if let Some(fg) = self.foreground { + if written_anything { try!(write!(f, ";")); } + + try!(fg.write_foreground_code(f)); + } + + // All the codes end with an `m`, because reasons. + try!(write!(f, "m")); + Ok(()) + } + + /// Write any ANSI codes that go *after* a piece of text. These should be + /// the codes to *reset* the terminal back to its normal colour and style. + fn write_suffix(&self, f: &mut W) -> Result<(), W::Error> { + if self.is_plain() { + Ok(()) + } + else { + write!(f, "\x1B[0m") + } + } + + /// Compute the 'style difference' required to turn an existing style into + /// the given, second style. + /// + /// For example, to turn green text into green bold text, it's redundant + /// to write a reset command then a second green+bold command, instead of + /// just writing one bold command. This method should see that both styles + /// use the foreground colour green, and reduce it to a single command. + /// + /// This method returns an enum value because it's not actually always + /// possible to turn one style into another: for example, text could be + /// made bold and underlined, but you can't remove the bold property + /// without also removing the underline property. So when this has to + /// happen, this function returns None, meaning that the entire set of + /// styles should be reset and begun again. + fn difference(&self, next: &Style) -> Difference { + // XXX(Havvy): This algorithm is kind of hard to replicate without + // having the Plain/Foreground enum variants, so I'm just leaving + // it commented out for now, and defaulting to Reset. + + if self == next { + return NoDifference; + } + + // Cannot un-bold, so must Reset. + if self.is_bold && !next.is_bold { + return Reset; + } + + if self.is_dimmed && !next.is_dimmed { + return Reset; + } + + if self.is_italic && !next.is_italic { + return Reset; + } + + // Cannot un-underline, so must Reset. + if self.is_underline && !next.is_underline { + return Reset; + } + + if self.is_blink && !next.is_blink { + return Reset; + } + + if self.is_reverse && !next.is_reverse { + return Reset; + } + + if self.is_hidden && !next.is_hidden { + return Reset; + } + + if self.is_strikethrough && !next.is_strikethrough { + return Reset; + } + + // Cannot go from foreground to no foreground, so must Reset. + if self.foreground.is_some() && next.foreground.is_none() { + return Reset; + } + + // Cannot go from background to no background, so must Reset. + if self.background.is_some() && next.background.is_none() { + return Reset; + } + + let mut extra_styles = Style::default(); + + if self.is_bold != next.is_bold { + extra_styles.is_bold = true; + } + + if self.is_dimmed != next.is_dimmed { + extra_styles.is_dimmed = true; + } + + if self.is_italic != next.is_italic { + extra_styles.is_italic = true; + } + + if self.is_underline != next.is_underline { + extra_styles.is_underline = true; + } + + if self.is_blink != next.is_blink { + extra_styles.is_blink = true; + } + + if self.is_reverse != next.is_reverse { + extra_styles.is_reverse = true; + } + + if self.is_hidden != next.is_hidden { + extra_styles.is_hidden = true; + } + + if self.is_strikethrough != next.is_strikethrough { + extra_styles.is_strikethrough = true; + } + + if self.foreground != next.foreground { + extra_styles.foreground = next.foreground; + } + + if self.background != next.background { + extra_styles.background = next.background; + } + + ExtraStyles(extra_styles) + } + + /// Return true if this `Style` has no actual styles, and can be written + /// without any control characters. + fn is_plain(self) -> bool { + self == Style::default() + } +} + +impl Default for Style { + fn default() -> Style { + Style { + foreground: None, + background: None, + is_bold: false, + is_dimmed: false, + is_italic: false, + is_underline: false, + is_blink: false, + is_reverse: false, + is_hidden: false, + is_strikethrough: false, + } + } +} + +/// When printing out one coloured string followed by another, use one of +/// these rules to figure out which *extra* control codes need to be sent. +#[derive(PartialEq, Clone, Copy, Debug)] +enum Difference { + + /// Print out the control codes specified by this style to end up looking + /// like the second string's styles. + ExtraStyles(Style), + + /// Converting between these two is impossible, so just send a reset + /// command and then the second string's styles. + Reset, + + /// The before style is exactly the same as the after style, so no further + /// control codes need to be printed. + NoDifference, +} + +/// A set of `ANSIGenericString`s collected together, in order to be +/// written with a minimum of control characters. +pub struct ANSIGenericStrings<'a, S: 'a + ToOwned + ?Sized> + (pub &'a [ANSIGenericString<'a, S>]) + where ::Owned: std::fmt::Debug; + +/// A set of `ANSIString`s collected together, in order to be written with a +/// minimum of control characters. +pub type ANSIStrings<'a> = ANSIGenericStrings<'a, str>; + +/// A function to construct an ANSIStrings instance. +#[allow(non_snake_case)] +pub fn ANSIStrings<'a>(arg: &'a [ANSIString<'a>]) -> ANSIStrings<'a> { + ANSIGenericStrings(arg) +} + +/// A set of `ANSIByteString`s collected together, in order to be +/// written with a minimum of control characters. +pub type ANSIByteStrings<'a> = ANSIGenericStrings<'a, [u8]>; + +/// A function to construct an ANSIByteStrings instance. +#[allow(non_snake_case)] +pub fn ANSIByteStrings<'a>(arg: &'a [ANSIByteString<'a>]) -> ANSIByteStrings<'a> { + ANSIGenericStrings(arg) +} + +impl<'a, S: 'a + ToOwned + ?Sized> ANSIGenericStrings<'a, S> +where ::Owned: std::fmt::Debug { + fn write_to_any + ?Sized>(&self, w: &mut W) -> Result<(), W::Error> { + let first = match self.0.first() { + None => return Ok(()), + Some(f) => f, + }; + + try!(first.style.write_prefix(w)); + try!(w.write_str(&first.string)); + + for window in self.0.windows(2) { + match window[0].style.difference(&window[1].style) { + ExtraStyles(style) => try!(style.write_prefix(w)), + Reset => { + try!(write!(w, "\x1B[0m")); + try!(window[1].style.write_prefix(w)); + }, + NoDifference => { /* Do nothing! */ }, + } + + try!(w.write_str(&window[1].string)); + } + + // Write the final reset string after all of the ANSIStrings have been + // written, *except* if the last one has no styles, because it would + // have already been written by this point. + if let Some(last) = self.0.last() { + if !last.style.is_plain() { + try!(write!(w, "\x1B[0m")); + } + } + + Ok(()) + } +} + +impl<'a> fmt::Display for ANSIStrings<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let f: &mut fmt::Write = f; + self.write_to_any(f) + } +} + +impl<'a> ANSIByteStrings<'a> { + /// Write ANSIByteStrings to an io::Write. This writes the minimal + /// escape sequences for the associated Styles around each set of + /// bytes. + pub fn write_to(&self, w: &mut W) -> io::Result<()> { + let w: &mut io::Write = w; + self.write_to_any(w) + } +} + +#[cfg(test)] +mod tests { + pub use super::{Style, ANSIStrings}; + pub use super::Colour::*; + + macro_rules! test { + ($name: ident: $style: expr; $input: expr => $result: expr) => { + #[test] + fn $name() { + assert_eq!($style.paint($input).to_string(), $result.to_string()); + + let mut v = Vec::new(); + $style.paint($input.as_bytes()).write_to(&mut v).unwrap(); + assert_eq!(v.as_slice(), $result.as_bytes()); + } + }; + } + + test!(plain: Style::default(); "text/plain" => "text/plain"); + test!(red: Red; "hi" => "\x1B[31mhi\x1B[0m"); + test!(black: Black.normal(); "hi" => "\x1B[30mhi\x1B[0m"); + test!(yellow_bold: Yellow.bold(); "hi" => "\x1B[1;33mhi\x1B[0m"); + test!(yellow_bold_2: Yellow.normal().bold(); "hi" => "\x1B[1;33mhi\x1B[0m"); + test!(blue_underline: Blue.underline(); "hi" => "\x1B[4;34mhi\x1B[0m"); + test!(green_bold_ul: Green.bold().underline(); "hi" => "\x1B[1;4;32mhi\x1B[0m"); + test!(green_bold_ul_2: Green.underline().bold(); "hi" => "\x1B[1;4;32mhi\x1B[0m"); + test!(purple_on_white: Purple.on(White); "hi" => "\x1B[47;35mhi\x1B[0m"); + test!(purple_on_white_2: Purple.normal().on(White); "hi" => "\x1B[47;35mhi\x1B[0m"); + test!(yellow_on_blue: Style::new().on(Blue).fg(Yellow); "hi" => "\x1B[44;33mhi\x1B[0m"); + test!(yellow_on_blue_2: Cyan.on(Blue).fg(Yellow); "hi" => "\x1B[44;33mhi\x1B[0m"); + test!(cyan_bold_on_white: Cyan.bold().on(White); "hi" => "\x1B[1;47;36mhi\x1B[0m"); + test!(cyan_ul_on_white: Cyan.underline().on(White); "hi" => "\x1B[4;47;36mhi\x1B[0m"); + test!(cyan_bold_ul_on_white: Cyan.bold().underline().on(White); "hi" => "\x1B[1;4;47;36mhi\x1B[0m"); + test!(cyan_ul_bold_on_white: Cyan.underline().bold().on(White); "hi" => "\x1B[1;4;47;36mhi\x1B[0m"); + test!(fixed: Fixed(100); "hi" => "\x1B[38;5;100mhi\x1B[0m"); + test!(fixed_on_purple: Fixed(100).on(Purple); "hi" => "\x1B[45;38;5;100mhi\x1B[0m"); + test!(fixed_on_fixed: Fixed(100).on(Fixed(200)); "hi" => "\x1B[48;5;200;38;5;100mhi\x1B[0m"); + test!(rgb: RGB(70,130,180); "hi" => "\x1B[38;2;70;130;180mhi\x1B[0m"); + test!(rgb_on_blue: RGB(70,130,180).on(Blue); "hi" => "\x1B[44;38;2;70;130;180mhi\x1B[0m"); + test!(blue_on_rgb: Blue.on(RGB(70,130,180)); "hi" => "\x1B[48;2;70;130;180;34mhi\x1B[0m"); + test!(rgb_on_rgb: RGB(70,130,180).on(RGB(5,10,15)); "hi" => "\x1B[48;2;5;10;15;38;2;70;130;180mhi\x1B[0m"); + test!(bold: Style::new().bold(); "hi" => "\x1B[1mhi\x1B[0m"); + test!(underline: Style::new().underline(); "hi" => "\x1B[4mhi\x1B[0m"); + test!(bunderline: Style::new().bold().underline(); "hi" => "\x1B[1;4mhi\x1B[0m"); + test!(dimmed: Style::new().dimmed(); "hi" => "\x1B[2mhi\x1B[0m"); + test!(italic: Style::new().italic(); "hi" => "\x1B[3mhi\x1B[0m"); + test!(blink: Style::new().blink(); "hi" => "\x1B[5mhi\x1B[0m"); + test!(reverse: Style::new().reverse(); "hi" => "\x1B[7mhi\x1B[0m"); + test!(hidden: Style::new().hidden(); "hi" => "\x1B[8mhi\x1B[0m"); + test!(stricken: Style::new().strikethrough(); "hi" => "\x1B[9mhi\x1B[0m"); + + mod difference { + use super::*; + use super::super::Difference::*; + + #[test] + fn diff() { + let expected = ExtraStyles(Style::new().bold()); + let got = Green.normal().difference(&Green.bold()); + assert_eq!(expected, got) + } + + #[test] + fn dlb() { + let got = Green.bold().difference(&Green.normal()); + assert_eq!(Reset, got) + } + + #[test] + fn nothing() { + assert_eq!(NoDifference, Green.bold().difference(&Green.bold())); + } + + #[test] + fn nothing_2() { + assert_eq!(NoDifference, Green.normal().difference(&Green.normal())); + } + + #[test] + fn colour_change() { + assert_eq!(ExtraStyles(Blue.normal()), Red.normal().difference(&Blue.normal())) + } + + #[test] + fn removal_of_dimmed() { + let dimmed = Style::new().dimmed(); + let normal = Style::default(); + + assert_eq!(Reset, dimmed.difference(&normal)); + } + + #[test] + fn addition_of_dimmed() { + let dimmed = Style::new().dimmed(); + let normal = Style::default(); + let extra_styles = ExtraStyles(dimmed); + + assert_eq!(extra_styles, normal.difference(&dimmed)); + } + + #[test] + fn removal_of_blink() { + let blink = Style::new().blink(); + let normal = Style::default(); + + assert_eq!(Reset, blink.difference(&normal)); + } + + #[test] + fn addition_of_blink() { + let blink = Style::new().blink(); + let normal = Style::default(); + let extra_styles = ExtraStyles(blink); + + assert_eq!(extra_styles, normal.difference(&blink)); + } + + #[test] + fn removal_of_reverse() { + let reverse = Style::new().reverse(); + let normal = Style::default(); + + assert_eq!(Reset, reverse.difference(&normal)); + } + + #[test] + fn addition_of_reverse() { + let reverse = Style::new().reverse(); + let normal = Style::default(); + let extra_styles = ExtraStyles(reverse); + + assert_eq!(extra_styles, normal.difference(&reverse)); + } + + #[test] + fn removal_of_hidden() { + let hidden = Style::new().hidden(); + let normal = Style::default(); + + assert_eq!(Reset, hidden.difference(&normal)); + } + + #[test] + fn addition_of_hidden() { + let hidden = Style::new().hidden(); + let normal = Style::default(); + let extra_styles = ExtraStyles(hidden); + + assert_eq!(extra_styles, normal.difference(&hidden)); + } + + #[test] + fn removal_of_strikethrough() { + let strikethrough = Style::new().strikethrough(); + let normal = Style::default(); + + assert_eq!(Reset, strikethrough.difference(&normal)); + } + + #[test] + fn addition_of_strikethrough() { + let strikethrough = Style::new().strikethrough(); + let normal = Style::default(); + let extra_styles = ExtraStyles(strikethrough); + + assert_eq!(extra_styles, normal.difference(&strikethrough)); + } + + #[test] + fn no_control_codes_for_plain() { + let one = Style::default().paint("one"); + let two = Style::default().paint("two"); + let output = format!("{}", ANSIStrings( &[ one, two ] )); + assert_eq!(&*output, "onetwo"); + } + } +} diff --git a/vendor/registry-40351f815f426200/atty/.cargo-checksum.json b/vendor/registry-40351f815f426200/atty/.cargo-checksum.json new file mode 100644 index 000000000..b440335bb --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"7bd35273865921a87f96ea8d69bd98bde11a96001b74c79cdcdbc83bfbbee53c","Cargo.toml":"77b51a9746012bf939c0fd0a72daa9db816c26798c557c234213a2d38b8aae81","LICENSE":"f3f8d32084848316048c5a1e125a3c5003eb32145a5f5f2a0d5586377324f9ba","README.md":"a62d294c45c9d8b2e54fcf35d9ee1ba8b8e2ab6960fb3d3f4cc9d59e8aed0835","appveyor.yml":"dea9c8da309cbb02bce31c613b697256f4cfada20b2f7b0c8911b73d569daf58","examples/atty.rs":"1551387a71474d9ac1b5153231f884e9e05213badcfaa3494ad2cb7ea958374a","rustfmt.toml":"bd196700242d17913cf8adead6912f55e9347e52ab5a001729d6c18d169f05c4","src/lib.rs":"ec3428266e83b35a8714ab99d9962c9e29f78becb39e313846f042f5b176c723"},"package":"9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/atty/CHANGELOG.md b/vendor/registry-40351f815f426200/atty/CHANGELOG.md new file mode 100644 index 000000000..0b5c0eab5 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/CHANGELOG.md @@ -0,0 +1,61 @@ +# 0.2.11 + +* fix msys detection with `winapi@0.3.5` [#28](https://github.com/softprops/atty/pull/28) + +# 0.2.10 + +* fix wasm regression [#27](https://github.com/softprops/atty/pull/27) + +# 0.2.9 + +* Fix fix pty detection [#25](https://github.com/softprops/atty/pull/25) + +# 0.2.8 + +* Fix an inverted condition on MinGW [#22](https://github.com/softprops/atty/pull/22) + +# 0.2.7 + +* Change `||` to `&&` for whether MSYS is a tty [#24](https://github.com/softprops/atty/pull/24/) + +# 0.2.6 + +* updated winapi dependency to [0.3](https://retep998.github.io/blog/winapi-0.3/) [#18](https://github.com/softprops/atty/pull/18) + +# 0.2.5 + +* added support for Wasm compile targets [#17](https://github.com/softprops/atty/pull/17) + +# 0.2.4 + +* added support for Wasm compile targets [#17](https://github.com/softprops/atty/pull/17) + +# 0.2.3 + +* added support for Redox OS [#14](https://github.com/softprops/atty/pull/14) + +# 0.2.2 + +* use target specific dependencies [#11](https://github.com/softprops/atty/pull/11) +* Add tty detection for MSYS terminals [#12](https://github.com/softprops/atty/pull/12) + +# 0.2.1 + +* fix windows bug + +# 0.2.0 + +* support for various stream types + +# 0.1.2 + +* windows support (with automated testing) +* automated code coverage + +# 0.1.1 + +* bumped libc dep from `0.1` to `0.2` + +# 0.1.0 + +* initial release diff --git a/vendor/registry-40351f815f426200/atty/Cargo.toml b/vendor/registry-40351f815f426200/atty/Cargo.toml new file mode 100644 index 000000000..0d02b6af2 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/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 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 = "atty" +version = "0.2.11" +authors = ["softprops "] +description = "A simple interface for querying atty" +homepage = "https://github.com/softprops/atty" +documentation = "http://softprops.github.io/atty" +readme = "README.md" +keywords = ["terminal", "tty"] +license = "MIT" +repository = "https://github.com/softprops/atty" +[target."cfg(target_os = \"redox\")".dependencies.termion] +version = "1.5" +[target."cfg(unix)".dependencies.libc] +version = "0.2" +default-features = false +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["consoleapi", "processenv", "minwinbase", "minwindef", "winbase"] +[badges.travis-ci] +repository = "softprops/atty" diff --git a/vendor/registry-40351f815f426200/atty/LICENSE b/vendor/registry-40351f815f426200/atty/LICENSE new file mode 100644 index 000000000..d1f01c829 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2015-2017 Doug Tangren + +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/vendor/registry-40351f815f426200/atty/README.md b/vendor/registry-40351f815f426200/atty/README.md new file mode 100644 index 000000000..5ce32d1d7 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/README.md @@ -0,0 +1,76 @@ +# atty + +[![Build Status](https://travis-ci.org/softprops/atty.svg?branch=master)](https://travis-ci.org/softprops/atty) [![Build status](https://ci.appveyor.com/api/projects/status/geggrsnsjsuse8cv?svg=true)](https://ci.appveyor.com/project/softprops/atty) [![Coverage Status](https://coveralls.io/repos/softprops/atty/badge.svg?branch=master&service=github)](https://coveralls.io/github/softprops/atty?branch=master) [![crates.io](https://img.shields.io/crates/v/atty.svg)](https://crates.io/crates/atty) [![Released API docs](https://docs.rs/atty/badge.svg)](http://docs.rs/atty) [![Master API docs](https://img.shields.io/badge/docs-master-green.svg)](https://softprops.github.io/atty) + +> are you or are you not a tty? + + +## install + +Add the following to your `Cargo.toml` + +```toml +[dependencies] +atty = "0.2" +``` + +## usage + +```rust +extern crate atty; + +use atty::Stream; + +fn main() { + if atty::is(Stream::Stdout) { + println!("I'm a terminal"); + } else { + println!("I'm not"); + } +} +``` + +## testing + +This library has been unit tested on both unix and windows platforms (via appveyor). + + +A simple example program is provided in this repo to test various tty's. By default. + +It prints + +```bash +$ cargo run --example atty +stdout? true +stderr? true +stdin? true +``` + +To test std in, pipe some text to the program + +```bash +$ echo "test" | cargo run --example atty +stdout? true +stderr? true +stdin? false +``` + +To test std out, pipe the program to something + +```bash +$ cargo run --example atty | grep std +stdout? false +stderr? true +stdin? true +``` + +To test std err, pipe the program to something redirecting std err + +```bash +$ cargo run --example atty 2>&1 | grep std +stdout? false +stderr? false +stdin? true +``` + +Doug Tangren (softprops) 2015-2017 diff --git a/vendor/registry-40351f815f426200/atty/appveyor.yml b/vendor/registry-40351f815f426200/atty/appveyor.yml new file mode 100644 index 000000000..d7fb12794 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/appveyor.yml @@ -0,0 +1,16 @@ +environment: + matrix: + - TARGET: nightly-x86_64-pc-windows-msvc + - TARGET: nightly-i686-pc-windows-msvc + - TARGET: nightly-x86_64-pc-windows-gnu + - TARGET: nightly-i686-pc-windows-gnu +install: + - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:TARGET}.exe" -FileName "rust-install.exe" + - ps: .\rust-install.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null + - ps: $env:PATH="$env:PATH;C:\rust\bin" + - call "%VCVARS%" || ver>nul + - rustc -vV + - cargo -vV +build: false +test_script: + - cargo build diff --git a/vendor/registry-40351f815f426200/atty/examples/atty.rs b/vendor/registry-40351f815f426200/atty/examples/atty.rs new file mode 100644 index 000000000..3b3635e59 --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/examples/atty.rs @@ -0,0 +1,9 @@ +extern crate atty; + +use atty::{is, Stream}; + +fn main() { + println!("stdout? {}", is(Stream::Stdout)); + println!("stderr? {}", is(Stream::Stderr)); + println!("stdin? {}", is(Stream::Stdin)); +} diff --git a/vendor/registry-40351f815f426200/atty/rustfmt.toml b/vendor/registry-40351f815f426200/atty/rustfmt.toml new file mode 100644 index 000000000..d83987dca --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/rustfmt.toml @@ -0,0 +1,10 @@ +# keep imports tidy +reorder_imported_names = true +reorder_imports = true +reorder_imports_in_group = true +# there is no try! +use_try_shorthand = true +# don't create rustfmt artifacts +write_mode = "Replace" +# reduce wide load +max_width = 80 \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/atty/src/lib.rs b/vendor/registry-40351f815f426200/atty/src/lib.rs new file mode 100644 index 000000000..6bffeadac --- /dev/null +++ b/vendor/registry-40351f815f426200/atty/src/lib.rs @@ -0,0 +1,210 @@ +//! atty is a simple utility that answers one question +//! > is this a tty? +//! +//! usage is just as simple +//! +//! ``` +//! if atty::is(atty::Stream::Stdout) { +//! println!("i'm a tty") +//! } +//! ``` +//! +//! ``` +//! if atty::isnt(atty::Stream::Stdout) { +//! println!("i'm not a tty") +//! } +//! ``` + +#![cfg_attr(unix, no_std)] + +#[cfg(unix)] +extern crate libc; +#[cfg(windows)] +extern crate winapi; +#[cfg(target_os = "redox")] +extern crate termion; + +#[cfg(windows)] +use winapi::shared::minwindef::DWORD; +#[cfg(windows)] +use winapi::shared::ntdef::WCHAR; + +/// possible stream sources +#[derive(Clone, Copy, Debug)] +pub enum Stream { + Stdout, + Stderr, + Stdin, +} + +/// returns true if this is a tty +#[cfg(all(unix, not(target_arch = "wasm32")))] +pub fn is(stream: Stream) -> bool { + extern crate libc; + + let fd = match stream { + Stream::Stdout => libc::STDOUT_FILENO, + Stream::Stderr => libc::STDERR_FILENO, + Stream::Stdin => libc::STDIN_FILENO, + }; + unsafe { libc::isatty(fd) != 0 } +} + +/// returns true if this is a tty +#[cfg(windows)] +pub fn is(stream: Stream) -> bool { + use winapi::um::winbase::{STD_ERROR_HANDLE as STD_ERROR, STD_INPUT_HANDLE as STD_INPUT, + STD_OUTPUT_HANDLE as STD_OUTPUT}; + + let (fd, others) = match stream { + Stream::Stdin => (STD_INPUT, [STD_ERROR, STD_OUTPUT]), + Stream::Stderr => (STD_ERROR, [STD_INPUT, STD_OUTPUT]), + Stream::Stdout => (STD_OUTPUT, [STD_INPUT, STD_ERROR]), + }; + if unsafe { console_on_any(&[fd]) } { + // False positives aren't possible. If we got a console then + // we definitely have a tty on stdin. + return true; + } + + // At this point, we *could* have a false negative. We can determine that + // this is true negative if we can detect the presence of a console on + // any of the other streams. If another stream has a console, then we know + // we're in a Windows console and can therefore trust the negative. + if unsafe { console_on_any(&others) } { + return false; + } + + // Otherwise, we fall back to a very strange msys hack to see if we can + // sneakily detect the presence of a tty. + unsafe { msys_tty_on(fd) } +} + +/// returns true if this is _not_ a tty +pub fn isnt(stream: Stream) -> bool { + !is(stream) +} + +/// Returns true if any of the given fds are on a console. +#[cfg(windows)] +unsafe fn console_on_any(fds: &[DWORD]) -> bool { + use winapi::um::consoleapi::GetConsoleMode; + use winapi::um::processenv::GetStdHandle; + + for &fd in fds { + let mut out = 0; + let handle = GetStdHandle(fd); + if GetConsoleMode(handle, &mut out) != 0 { + return true; + } + } + false +} + +/// Returns true if there is an MSYS tty on the given handle. +#[cfg(windows)] +unsafe fn msys_tty_on(fd: DWORD) -> bool { + use std::mem; + use std::slice; + + use winapi::ctypes::c_void; + use winapi::um::winbase::GetFileInformationByHandleEx; + use winapi::um::fileapi::FILE_NAME_INFO; + use winapi::um::minwinbase::FileNameInfo; + use winapi::um::processenv::GetStdHandle; + use winapi::shared::minwindef::MAX_PATH; + + let size = mem::size_of::(); + let mut name_info_bytes = vec![0u8; size + MAX_PATH * mem::size_of::()]; + let res = GetFileInformationByHandleEx( + GetStdHandle(fd), + FileNameInfo, + &mut *name_info_bytes as *mut _ as *mut c_void, + name_info_bytes.len() as u32, + ); + if res == 0 { + return false; + } + let name_info: &FILE_NAME_INFO = &*(name_info_bytes.as_ptr() as *const FILE_NAME_INFO); + let s = slice::from_raw_parts( + name_info.FileName.as_ptr(), + name_info.FileNameLength as usize / 2, + ); + let name = String::from_utf16_lossy(s); + // This checks whether 'pty' exists in the file name, which indicates that + // a pseudo-terminal is attached. To mitigate against false positives + // (e.g., an actual file name that contains 'pty'), we also require that + // either the strings 'msys-' or 'cygwin-' are in the file name as well.) + let is_msys = name.contains("msys-") || name.contains("cygwin-"); + let is_pty = name.contains("-pty"); + is_msys && is_pty +} + +/// returns true if this is a tty +#[cfg(target_os = "redox")] +pub fn is(stream: Stream) -> bool { + use std::io; + use termion::is_tty; + + match stream { + Stream::Stdin => is_tty(&io::stdin()), + Stream::Stdout => is_tty(&io::stdout()), + Stream::Stderr => is_tty(&io::stderr()), + } +} + +/// returns true if this is a tty +#[cfg(target_arch = "wasm32")] +pub fn is(_stream: Stream) -> bool { + false +} + +#[cfg(test)] +mod tests { + use super::{Stream, is}; + + #[test] + #[cfg(windows)] + fn is_err() { + // appveyor pipes its output + assert!(!is(Stream::Stderr)) + } + + #[test] + #[cfg(windows)] + fn is_out() { + // appveyor pipes its output + assert!(!is(Stream::Stdout)) + } + + #[test] + #[cfg(windows)] + fn is_in() { + assert!(is(Stream::Stdin)) + } + + #[test] + #[cfg(unix)] + fn is_err() { + assert!(is(Stream::Stderr)) + } + + #[test] + #[cfg(unix)] + fn is_out() { + assert!(is(Stream::Stdout)) + } + + #[test] + #[cfg(target_os = "macos")] + fn is_in() { + // macos on travis seems to pipe its input + assert!(is(Stream::Stdin)) + } + + #[test] + #[cfg(all(not(target_os = "macos"), unix))] + fn is_in() { + assert!(is(Stream::Stdin)) + } +} diff --git a/vendor/registry-40351f815f426200/autocfg/.cargo-checksum.json b/vendor/registry-40351f815f426200/autocfg/.cargo-checksum.json new file mode 100644 index 000000000..57ed3de85 --- /dev/null +++ b/vendor/registry-40351f815f426200/autocfg/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"81919f3285c75199baec182101877463487b46d6b78d27aff5e8c6e0a54fa04c","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"27995d58ad5c1145c1a8cd86244ce844886958a35eb2b78c6b772748669999ac","README.md":"838001be7197cf6b471750ae1b0fdd32612a1eec0de01df59a57e6a282a000ac","examples/integers.rs":"589ff4271566dfa322becddf3e2c7b592e6e0bc97b02892ce75619b7e452e930","examples/paths.rs":"1b30e466b824ce8df7ad0a55334424131d9d2573d6cf9f7d5d50c09c8901d526","examples/traits.rs":"cbee6a3e1f7db60b02ae25b714926517144a77cb492021f492774cf0e1865a9e","examples/versions.rs":"38535e6d9f5bfae0de474a3db79a40e8f5da8ba9334c5ff4c363de9bc99d4d12","src/error.rs":"12de7dafea4a35d1dc2f0fa79bfa038386bbbea72bf083979f4ddf227999eeda","src/lib.rs":"f5fe8ca8ae384685fc82ae85db96ed06a249dc46aa6f5dd6e6ce992d144b3afc","src/tests.rs":"105be895be7c0406203b2ac9f2abc9a9c83b31701efc8b8b9585bc15188da5fe","src/version.rs":"175727d5f02f2fe2271ddc9b041db2a5b9c6fe0f95afd17c73a4d982612764a3"},"package":"0e49efa51329a5fd37e7c79db4621af617cd4e3e5bc224939808d076077077bf"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/autocfg/Cargo.toml b/vendor/registry-40351f815f426200/autocfg/Cargo.toml new file mode 100644 index 000000000..615328a93 --- /dev/null +++ b/vendor/registry-40351f815f426200/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 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 = "autocfg" +version = "0.1.4" +authors = ["Josh Stone "] +description = "Automatic cfg for Rust compiler features" +readme = "README.md" +keywords = ["rustc", "build", "autoconf"] +categories = ["development-tools::build-utils"] +license = "Apache-2.0/MIT" +repository = "https://github.com/cuviper/autocfg" + +[dependencies] diff --git a/vendor/registry-40351f815f426200/autocfg/LICENSE-APACHE b/vendor/registry-40351f815f426200/autocfg/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/LICENSE-MIT b/vendor/registry-40351f815f426200/autocfg/LICENSE-MIT new file mode 100644 index 000000000..44fbc4d8b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/README.md b/vendor/registry-40351f815f426200/autocfg/README.md new file mode 100644 index 000000000..90ee63cfe --- /dev/null +++ b/vendor/registry-40351f815f426200/autocfg/README.md @@ -0,0 +1,75 @@ +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) +[![Travis Status](https://travis-ci.org/cuviper/autocfg.svg?branch=master)](https://travis-ci.org/cuviper/autocfg) + +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 = "0.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(file!()); +} +``` + +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 + +- 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 (2018-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/vendor/registry-40351f815f426200/autocfg/examples/integers.rs b/vendor/registry-40351f815f426200/autocfg/examples/integers.rs new file mode 100644 index 000000000..23d4cba6e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/examples/paths.rs b/vendor/registry-40351f815f426200/autocfg/examples/paths.rs new file mode 100644 index 000000000..b7a6ca7a2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/examples/traits.rs b/vendor/registry-40351f815f426200/autocfg/examples/traits.rs new file mode 100644 index 000000000..c1ca00385 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/examples/versions.rs b/vendor/registry-40351f815f426200/autocfg/examples/versions.rs new file mode 100644 index 000000000..992919b7c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/src/error.rs b/vendor/registry-40351f815f426200/autocfg/src/error.rs new file mode 100644 index 000000000..462483545 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/autocfg/src/lib.rs b/vendor/registry-40351f815f426200/autocfg/src/lib.rs new file mode 100644 index 000000000..1461c0c08 --- /dev/null +++ b/vendor/registry-40351f815f426200/autocfg/src/lib.rs @@ -0,0 +1,305 @@ +//! 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 = "0.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(file!()); +//! } +//! ``` +//! +//! 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. + +#![deny(missing_debug_implementations)] +#![deny(missing_docs)] + +use std::env; +use std::ffi::OsString; +use std::fs; +use std::io::{stderr, Write}; +use std::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, +} + +/// 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)); + + // 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 { + out_dir: dir, + rustc: rustc, + rustc_version: rustc_version, + target: env::var_os("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.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 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); + } + } +} + +fn mangle(s: &str) -> String { + s.chars() + .map(|c| match c { + 'A'...'Z' | 'a'...'z' | '0'...'9' => c, + _ => '_', + }) + .collect() +} diff --git a/vendor/registry-40351f815f426200/autocfg/src/tests.rs b/vendor/registry-40351f815f426200/autocfg/src/tests.rs new file mode 100644 index 000000000..f22e0e045 --- /dev/null +++ b/vendor/registry-40351f815f426200/autocfg/src/tests.rs @@ -0,0 +1,65 @@ +use super::AutoCfg; + +#[test] +fn autocfg_version() { + let ac = AutoCfg::with_dir("target").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::with_dir("target").unwrap(); + assert!(ac.probe_path("std::ops::Add")); + assert!(ac.probe_trait("std::ops::Add")); + assert!(ac.probe_trait("std::ops::Add")); + assert!(ac.probe_trait("std::ops::Add")); + assert!(ac.probe_type("std::ops::Add")); +} + +#[test] +fn probe_as_ref() { + let ac = AutoCfg::with_dir("target").unwrap(); + assert!(ac.probe_path("std::convert::AsRef")); + assert!(ac.probe_trait("std::convert::AsRef")); + assert!(ac.probe_type("std::convert::AsRef")); +} + +#[test] +fn probe_i128() { + let ac = AutoCfg::with_dir("target").unwrap(); + let missing = !ac.probe_rustc_version(1, 26); + assert!(missing ^ ac.probe_path("std::i128")); + assert!(missing ^ ac.probe_type("i128")); +} + +#[test] +fn probe_sum() { + let ac = AutoCfg::with_dir("target").unwrap(); + let missing = !ac.probe_rustc_version(1, 12); + assert!(missing ^ ac.probe_path("std::iter::Sum")); + assert!(missing ^ ac.probe_trait("std::iter::Sum")); + assert!(missing ^ ac.probe_trait("std::iter::Sum")); + assert!(missing ^ ac.probe_type("std::iter::Sum")); +} + +#[test] +fn probe_no_std() { + let ac = AutoCfg::with_dir("target").unwrap(); + assert!(ac.probe_type("i32")); + assert!(ac.probe_type("[i32]")); + assert_eq!(ac.probe_type("Vec"), !ac.no_std); +} diff --git a/vendor/registry-40351f815f426200/autocfg/src/version.rs b/vendor/registry-40351f815f426200/autocfg/src/version.rs new file mode 100644 index 000000000..378c21e61 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/bitflags-0.9.1/.cargo-checksum.json b/vendor/registry-40351f815f426200/bitflags-0.9.1/.cargo-checksum.json new file mode 100644 index 000000000..362611679 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"f35826eec96c765ae8aee4f8a66c6b3cb0d918b49935baf05bae79b6df8e1077","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"602c63819e332e93c85dc8426db4855f18fe0fabbd642c5b2303ed83f1ba926f","src/example_generated.rs":"161b69d92cf6e5fa4b5dc30f06031f3a0fb590b44be2bcf0f31cb8be4fab36fa","src/lib.rs":"56e86a16356d9322fa6b4e9b910041e2e7558c08b52ffbdacc647eba36b37abc","tests/conflicting_trait_impls.rs":"79993ea67ef09a5f99fddd69d8b73b1c137e41d0e8f8535f03865d6766dcc498","tests/external.rs":"15f7901698e286197666ccd309ad1debd3c35eaff680ca090368494e8b06ccf2","tests/external_no_std.rs":"c3556fd19dd91d1b093eb6a65d09a9d0985544f0377ba3d30c0e265c956f7237","tests/i128_bitflags.rs":"c955ef2c9fd385848195bb416e660e946ccbe59acc87862ef2646eb082d82e3f"},"package":"4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/Cargo.toml b/vendor/registry-40351f815f426200/bitflags-0.9.1/Cargo.toml new file mode 100644 index 000000000..8ac9adbfc --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/Cargo.toml @@ -0,0 +1,31 @@ +# 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 = "bitflags" +version = "0.9.1" +authors = ["The Rust Project Developers"] +description = "A macro to generate structures which behave like bitflags.\n" +homepage = "https://github.com/rust-lang-nursery/bitflags" +documentation = "https://docs.rs/bitflags" +readme = "README.md" +keywords = ["bit", "bitmask", "bitflags"] +categories = ["no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-lang-nursery/bitflags" + +[features] +example_generated = [] +unstable_testing = [] +default = ["example_generated"] +[badges.travis-ci] +repository = "rust-lang-nursery/bitflags" diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/LICENSE-APACHE b/vendor/registry-40351f815f426200/bitflags-0.9.1/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/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/vendor/registry-40351f815f426200/bitflags-0.9.1/LICENSE-MIT b/vendor/registry-40351f815f426200/bitflags-0.9.1/LICENSE-MIT new file mode 100644 index 000000000..39d4bdb5a --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/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/vendor/registry-40351f815f426200/bitflags-0.9.1/README.md b/vendor/registry-40351f815f426200/bitflags-0.9.1/README.md new file mode 100644 index 000000000..714ca9d9e --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/README.md @@ -0,0 +1,24 @@ +bitflags +======== + +A Rust macro to generate structures which behave like a set of bitflags + +[![Build Status](https://travis-ci.org/rust-lang-nursery/bitflags.svg?branch=master)](https://travis-ci.org/rust-lang-nursery/bitflags) + +[Documentation](https://docs.rs/bitflags) + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +bitflags = "0.9" +``` + +and this to your crate root: + +```rust +#[macro_use] +extern crate bitflags; +``` diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/src/example_generated.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/src/example_generated.rs new file mode 100644 index 000000000..05b99e8f0 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/src/example_generated.rs @@ -0,0 +1,16 @@ +//! 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 FLAG_A = 0b00000001; + const FLAG_B = 0b00000010; + const FLAG_C = 0b00000100; + const FLAG_ABC = FLAG_A.bits + | FLAG_B.bits + | FLAG_C.bits; + } +} diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/src/lib.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/src/lib.rs new file mode 100644 index 000000000..5840643a8 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/src/lib.rs @@ -0,0 +1,990 @@ +// 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 a `struct` that manages a set of flags. The +//! flags should only be defined for integer types, otherwise unexpected type +//! errors may occur at compile time. +//! +//! # Example +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const FLAG_A = 0b00000001; +//! const FLAG_B = 0b00000010; +//! const FLAG_C = 0b00000100; +//! const FLAG_ABC = FLAG_A.bits +//! | FLAG_B.bits +//! | FLAG_C.bits; +//! } +//! } +//! +//! fn main() { +//! let e1 = FLAG_A | FLAG_C; +//! let e2 = FLAG_B | FLAG_C; +//! assert_eq!((e1 | e2), FLAG_ABC); // union +//! assert_eq!((e1 & e2), FLAG_C); // intersection +//! assert_eq!((e1 - e2), FLAG_A); // set difference +//! assert_eq!(!e2, FLAG_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: +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! use std::fmt; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const FLAG_A = 0b00000001; +//! const FLAG_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 = FLAG_A | FLAG_B; +//! flags.clear(); +//! assert!(flags.is_empty()); +//! assert_eq!(format!("{}", flags), "hi!"); +//! assert_eq!(format!("{:?}", FLAG_A | FLAG_B), "FLAG_A | FLAG_B"); +//! assert_eq!(format!("{:?}", FLAG_B), "FLAG_B"); +//! } +//! ``` +//! +//! # Visibility +//! +//! The generated struct and its 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 `flags`: +//! +//! ```ignore +//! #[macro_use] +//! extern crate bitflags; +//! +//! mod example { +//! bitflags! { +//! pub struct Flags1: u32 { +//! const FLAG_A = 0b00000001; +//! } +//! } +//! bitflags! { +//! struct Flags2: u32 { +//! const FLAG_B = 0b00000010; +//! } +//! } +//! } +//! +//! fn main() { +//! let flag1 = example::FLAG_A; +//! let flag2 = example::FLAG_B; // error: const `FLAG_B` is private +//! } +//! ``` +//! +//! # Attributes +//! +//! Attributes can be attached to the generated `struct` by placing them +//! before the `flags` keyword. +//! +//! # Trait implementations +//! +//! The `Copy`, `Clone`, `PartialEq`, `Eq`, `PartialOrd`, `Ord` and `Hash` +//! traits automatically derived for the `struct` using the `derive` attribute. +//! Additional traits can be derived by providing an explicit `derive` +//! attribute on `flags`. +//! +//! The `Extend` and `FromIterator` traits are implemented for the `struct`, +//! too: `Extend` adds the union of the instances of the `struct` iterated over, +//! while `FromIterator` calculates the union. +//! +//! The `Binary`, `Debug`, `LowerExp`, `Octal` and `UpperExp` trait is also +//! implemented by displaying the bits value of the internal struct. +//! +//! ## Operators +//! +//! The following operator traits are implemented for the generated `struct`: +//! +//! - `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`: +//! +//! - `empty`: an empty set of flags +//! - `all`: the set of all 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 flag +//! - `from_bits_truncate`: convert from underlying bit representation, dropping +//! any bits that do not correspond to flags +//! - `is_empty`: `true` if no flags are currently stored +//! - `is_all`: `true` if all flags are currently set +//! - `intersects`: `true` if there are flags common to both `self` and `other` +//! - `contains`: `true` 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. +//! +//! ## Default +//! +//! The `Default` trait is not automatically implemented for the generated struct. +//! +//! 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`: +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! bitflags! { +//! // Results in default value with bits: 0 +//! #[derive(Default)] +//! struct Flags: u32 { +//! const FLAG_A = 0b00000001; +//! const FLAG_B = 0b00000010; +//! const FLAG_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: +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! bitflags! { +//! struct Flags: u32 { +//! const FLAG_A = 0b00000001; +//! const FLAG_B = 0b00000010; +//! const FLAG_C = 0b00000100; +//! } +//! } +//! +//! // explicit `Default` implementation +//! impl Default for Flags { +//! fn default() -> Flags { +//! FLAG_A | FLAG_C +//! } +//! } +//! +//! fn main() { +//! let implemented_default: Flags = Default::default(); +//! assert_eq!(implemented_default, (FLAG_A | FLAG_C)); +//! } +//! ``` + +#![no_std] + +#![doc(html_root_url = "https://docs.rs/bitflags/0.9.1")] +// When compiled for the rustc compiler itself we want to make sure that this is +// an unstable crate. +#![cfg_attr(rustbuild, feature(staged_api))] +#![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))] + +#[cfg(test)] +#[macro_use] +extern crate std; + +// Re-export libstd/libcore using an alias so that the macros can work in no_std +// crates while remaining compatible with normal crates. +#[doc(hidden)] +pub extern crate core as _core; + +/// The macro used to generate the flag structure. +/// +/// See the [crate level docs](../bitflags/index.html) for complete documentation. +/// +/// # Example +/// +/// ``` +/// #[macro_use] +/// extern crate bitflags; +/// +/// bitflags! { +/// struct Flags: u32 { +/// const FLAG_A = 0b00000001; +/// const FLAG_B = 0b00000010; +/// const FLAG_C = 0b00000100; +/// const FLAG_ABC = FLAG_A.bits +/// | FLAG_B.bits +/// | FLAG_C.bits; +/// } +/// } +/// +/// fn main() { +/// let e1 = FLAG_A | FLAG_C; +/// let e2 = FLAG_B | FLAG_C; +/// assert_eq!((e1 | e2), FLAG_ABC); // union +/// assert_eq!((e1 & e2), FLAG_C); // intersection +/// assert_eq!((e1 - e2), FLAG_A); // set difference +/// assert_eq!(!e2, FLAG_A); // set complement +/// } +/// ``` +/// +/// The generated `struct`s can also be extended with type and trait +/// implementations: +/// +/// ``` +/// #[macro_use] +/// extern crate bitflags; +/// +/// use std::fmt; +/// +/// bitflags! { +/// struct Flags: u32 { +/// const FLAG_A = 0b00000001; +/// const FLAG_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 = FLAG_A | FLAG_B; +/// flags.clear(); +/// assert!(flags.is_empty()); +/// assert_eq!(format!("{}", flags), "hi!"); +/// assert_eq!(format!("{:?}", FLAG_A | FLAG_B), "FLAG_A | FLAG_B"); +/// assert_eq!(format!("{:?}", FLAG_B), "FLAG_B"); +/// } +/// ``` +#[macro_export] +macro_rules! bitflags { + ($(#[$attr:meta])* pub struct $BitFlags:ident: $T:ty { + $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr;)+ + }) => { + #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] + $(#[$attr])* + pub struct $BitFlags { + bits: $T, + } + + $($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+ + + __impl_bitflags! { + struct $BitFlags: $T { + $($(#[$Flag_attr])* const $Flag = $value;)+ + } + } + }; + ($(#[$attr:meta])* struct $BitFlags:ident: $T:ty { + $($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr;)+ + }) => { + #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] + $(#[$attr])* + struct $BitFlags { + bits: $T, + } + + $($(#[$Flag_attr])* const $Flag: $BitFlags = $BitFlags { bits: $value };)+ + + __impl_bitflags! { + struct $BitFlags: $T { + $($(#[$Flag_attr])* const $Flag = $value;)+ + } + } + + }; +} + +#[macro_export] +#[doc(hidden)] +macro_rules! __impl_bitflags { + (struct $BitFlags:ident: $T:ty { + $($(#[$Flag_attr:meta])* const $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 { + $( + fn $Flag(&self) -> bool { false } + )+ + } + + // Conditionally override the check for just those flags that + // are not #[cfg]ed away. + impl __BitFlags for $BitFlags { + $( + $(#[$Flag_attr])* + fn $Flag(&self) -> bool { + self.bits & $Flag.bits == $Flag.bits + } + )+ + } + + let mut first = true; + $( + if <$BitFlags as __BitFlags>::$Flag(self) { + if !first { + try!(f.write_str(" | ")); + } + first = false; + try!(f.write_str(stringify!($Flag))); + } + )+ + if first { + try!(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 { + /// Returns an empty set of flags. + #[inline] + pub fn empty() -> $BitFlags { + $BitFlags { bits: 0 } + } + + /// Returns the set containing all flags. + #[inline] + pub fn all() -> $BitFlags { + // See `Debug::fmt` for why this approach is taken. + #[allow(non_snake_case)] + trait __BitFlags { + $( + fn $Flag() -> $T { 0 } + )+ + } + impl __BitFlags for $BitFlags { + $( + $(#[$Flag_attr])* + fn $Flag() -> $T { $Flag.bits } + )+ + } + $BitFlags { bits: $(<$BitFlags as __BitFlags>::$Flag())|+ } + } + + /// Returns the raw value of the flags currently stored. + #[inline] + pub 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 fn from_bits(bits: $T) -> $crate::_core::option::Option<$BitFlags> { + if (bits & !$BitFlags::all().bits()) == 0 { + $crate::_core::option::Option::Some($BitFlags { bits: bits }) + } else { + $crate::_core::option::Option::None + } + } + + /// Convert from underlying bit representation, dropping any bits + /// that do not correspond to flags. + #[inline] + pub fn from_bits_truncate(bits: $T) -> $BitFlags { + $BitFlags { bits: bits } & $BitFlags::all() + } + + /// Returns `true` if no flags are currently stored. + #[inline] + pub fn is_empty(&self) -> bool { + *self == $BitFlags::empty() + } + + /// Returns `true` if all flags are currently set. + #[inline] + pub fn is_all(&self) -> bool { + *self == $BitFlags::all() + } + + /// Returns `true` if there are flags common to both `self` and `other`. + #[inline] + pub fn intersects(&self, other: $BitFlags) -> bool { + !(*self & other).is_empty() + } + + /// Returns `true` all of the flags in `other` are contained within `self`. + #[inline] + pub fn contains(&self, other: $BitFlags) -> bool { + (*self & other) == other + } + + /// Inserts the specified flags in-place. + #[inline] + pub fn insert(&mut self, other: $BitFlags) { + self.bits |= other.bits; + } + + /// Removes the specified flags in-place. + #[inline] + pub fn remove(&mut self, other: $BitFlags) { + self.bits &= !other.bits; + } + + /// Toggles the specified flags in-place. + #[inline] + pub fn toggle(&mut self, other: $BitFlags) { + self.bits ^= other.bits; + } + + /// Inserts or removes the specified flags depending on the passed value. + #[inline] + pub fn set(&mut self, other: $BitFlags, value: bool) { + if value { + self.insert(other); + } else { + self.remove(other); + } + } + } + + impl $crate::_core::ops::BitOr for $BitFlags { + type Output = $BitFlags; + + /// Returns the union of the two sets of flags. + #[inline] + fn bitor(self, other: $BitFlags) -> $BitFlags { + $BitFlags { bits: self.bits | other.bits } + } + } + + impl $crate::_core::ops::BitOrAssign for $BitFlags { + + /// Adds the set of flags. + #[inline] + fn bitor_assign(&mut self, other: $BitFlags) { + self.bits |= other.bits; + } + } + + impl $crate::_core::ops::BitXor for $BitFlags { + type Output = $BitFlags; + + /// Returns the left flags, but with all the right flags toggled. + #[inline] + fn bitxor(self, other: $BitFlags) -> $BitFlags { + $BitFlags { bits: self.bits ^ other.bits } + } + } + + impl $crate::_core::ops::BitXorAssign for $BitFlags { + + /// Toggles the set of flags. + #[inline] + fn bitxor_assign(&mut self, other: $BitFlags) { + self.bits ^= other.bits; + } + } + + impl $crate::_core::ops::BitAnd for $BitFlags { + type Output = $BitFlags; + + /// Returns the intersection between the two sets of flags. + #[inline] + fn bitand(self, other: $BitFlags) -> $BitFlags { + $BitFlags { 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: $BitFlags) { + self.bits &= other.bits; + } + } + + impl $crate::_core::ops::Sub for $BitFlags { + type Output = $BitFlags; + + /// Returns the set difference of the two sets of flags. + #[inline] + fn sub(self, other: $BitFlags) -> $BitFlags { + $BitFlags { 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: $BitFlags) { + self.bits &= !other.bits; + } + } + + impl $crate::_core::ops::Not for $BitFlags { + type Output = $BitFlags; + + /// Returns the complement of this set of flags. + #[inline] + fn not(self) -> $BitFlags { + $BitFlags { bits: !self.bits } & $BitFlags::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) -> $BitFlags { + let mut result = Self::empty(); + result.extend(iterator); + result + } + } + }; +} + +#[cfg(feature = "example_generated")] +pub mod example_generated; + +#[cfg(test)] +#[allow(non_upper_case_globals, dead_code)] +mod tests { + use std::hash::{Hash, Hasher}; + use std::collections::hash_map::DefaultHasher; + + 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"] + struct Flags: u32 { + const FlagA = 0b00000001; + #[doc = " macros are way better at generating code than trans is"] + const FlagB = 0b00000010; + const FlagC = 0b00000100; + #[doc = "* cmr bed"] + #[doc = "* strcat table"] + #[doc = " wait what?"] + const FlagABC = FlagA.bits + | FlagB.bits + | FlagC.bits; + } + } + + bitflags! { + struct _CfgFlags: u32 { + #[cfg(windows)] + const _CfgA = 0b01; + #[cfg(unix)] + const _CfgB = 0b01; + #[cfg(windows)] + const _CfgC = _CfgA.bits | 0b10; + } + } + + bitflags! { + struct AnotherSetOfFlags: i8 { + const AnotherFlag = -1_i8; + } + } + + bitflags! { + struct LongFlags: u32 { + const LongFlagA = 0b1111111111111111; + } + } + + #[test] + fn test_bits(){ + assert_eq!(Flags::empty().bits(), 0b00000000); + assert_eq!(FlagA.bits(), 0b00000001); + assert_eq!(FlagABC.bits(), 0b00000111); + + assert_eq!(AnotherSetOfFlags::empty().bits(), 0b00); + assert_eq!(AnotherFlag.bits(), !0_i8); + } + + #[test] + fn test_from_bits() { + assert_eq!(Flags::from_bits(0), Some(Flags::empty())); + assert_eq!(Flags::from_bits(0b1), Some(FlagA)); + assert_eq!(Flags::from_bits(0b10), Some(FlagB)); + assert_eq!(Flags::from_bits(0b11), Some(FlagA | FlagB)); + assert_eq!(Flags::from_bits(0b1000), None); + + assert_eq!(AnotherSetOfFlags::from_bits(!0_i8), Some(AnotherFlag)); + } + + #[test] + fn test_from_bits_truncate() { + assert_eq!(Flags::from_bits_truncate(0), Flags::empty()); + assert_eq!(Flags::from_bits_truncate(0b1), FlagA); + assert_eq!(Flags::from_bits_truncate(0b10), FlagB); + assert_eq!(Flags::from_bits_truncate(0b11), (FlagA | FlagB)); + assert_eq!(Flags::from_bits_truncate(0b1000), Flags::empty()); + assert_eq!(Flags::from_bits_truncate(0b1001), FlagA); + + assert_eq!(AnotherSetOfFlags::from_bits_truncate(0_i8), AnotherSetOfFlags::empty()); + } + + #[test] + fn test_is_empty(){ + assert!(Flags::empty().is_empty()); + assert!(!FlagA.is_empty()); + assert!(!FlagABC.is_empty()); + + assert!(!AnotherFlag.is_empty()); + } + + #[test] + fn test_is_all() { + assert!(Flags::all().is_all()); + assert!(!FlagA.is_all()); + assert!(FlagABC.is_all()); + + assert!(AnotherFlag.is_all()); + } + + #[test] + fn test_two_empties_do_not_intersect() { + let e1 = Flags::empty(); + let e2 = Flags::empty(); + assert!(!e1.intersects(e2)); + + assert!(AnotherFlag.intersects(AnotherFlag)); + } + + #[test] + fn test_empty_does_not_intersect_with_full() { + let e1 = Flags::empty(); + let e2 = FlagABC; + assert!(!e1.intersects(e2)); + } + + #[test] + fn test_disjoint_intersects() { + let e1 = FlagA; + let e2 = FlagB; + assert!(!e1.intersects(e2)); + } + + #[test] + fn test_overlapping_intersects() { + let e1 = FlagA; + let e2 = FlagA | FlagB; + assert!(e1.intersects(e2)); + } + + #[test] + fn test_contains() { + let e1 = FlagA; + let e2 = FlagA | FlagB; + assert!(!e1.contains(e2)); + assert!(e2.contains(e1)); + assert!(FlagABC.contains(e2)); + + assert!(AnotherFlag.contains(AnotherFlag)); + } + + #[test] + fn test_insert(){ + let mut e1 = FlagA; + let e2 = FlagA | FlagB; + e1.insert(e2); + assert_eq!(e1, e2); + + let mut e3 = AnotherSetOfFlags::empty(); + e3.insert(AnotherFlag); + assert_eq!(e3, AnotherFlag); + } + + #[test] + fn test_remove(){ + let mut e1 = FlagA | FlagB; + let e2 = FlagA | FlagC; + e1.remove(e2); + assert_eq!(e1, FlagB); + + let mut e3 = AnotherFlag; + e3.remove(AnotherFlag); + assert_eq!(e3, AnotherSetOfFlags::empty()); + } + + #[test] + fn test_operators() { + let e1 = FlagA | FlagC; + let e2 = FlagB | FlagC; + assert_eq!((e1 | e2), FlagABC); // union + assert_eq!((e1 & e2), FlagC); // intersection + assert_eq!((e1 - e2), FlagA); // set difference + assert_eq!(!e2, FlagA); // set complement + assert_eq!(e1 ^ e2, FlagA | FlagB); // toggle + let mut e3 = e1; + e3.toggle(e2); + assert_eq!(e3, FlagA | FlagB); + + let mut m4 = AnotherSetOfFlags::empty(); + m4.toggle(AnotherSetOfFlags::empty()); + assert_eq!(m4, AnotherSetOfFlags::empty()); + } + + #[test] + fn test_set() { + let mut e1 = FlagA | FlagC; + e1.set(FlagB, true); + e1.set(FlagC, false); + + assert_eq!(e1, FlagA | FlagB); + } + + #[test] + fn test_assignment_operators() { + let mut m1 = Flags::empty(); + let e1 = FlagA | FlagC; + // union + m1 |= FlagA; + assert_eq!(m1, FlagA); + // intersection + m1 &= e1; + assert_eq!(m1, FlagA); + // set difference + m1 -= m1; + assert_eq!(m1, Flags::empty()); + // toggle + m1 ^= e1; + assert_eq!(m1, e1); + } + + #[test] + fn test_extend() { + let mut flags; + + flags = Flags::empty(); + flags.extend([].iter().cloned()); + assert_eq!(flags, Flags::empty()); + + flags = Flags::empty(); + flags.extend([FlagA, FlagB].iter().cloned()); + assert_eq!(flags, FlagA | FlagB); + + flags = FlagA; + flags.extend([FlagA, FlagB].iter().cloned()); + assert_eq!(flags, FlagA | FlagB); + + flags = FlagB; + flags.extend([FlagA, FlagABC].iter().cloned()); + assert_eq!(flags, FlagABC); + } + + #[test] + fn test_from_iterator() { + assert_eq!([].iter().cloned().collect::(), Flags::empty()); + assert_eq!([FlagA, FlagB].iter().cloned().collect::(), FlagA | FlagB); + assert_eq!([FlagA, FlagABC].iter().cloned().collect::(), FlagABC); + } + + #[test] + fn test_lt() { + let mut a = Flags::empty(); + let mut b = Flags::empty(); + + assert!(!(a < b) && !(b < a)); + b = FlagB; + assert!(a < b); + a = FlagC; + assert!(!(a < b) && b < a); + b = FlagC | FlagB; + assert!(a < b); + } + + #[test] + fn test_ord() { + let mut a = Flags::empty(); + let mut b = Flags::empty(); + + assert!(a <= b && a >= b); + a = FlagA; + assert!(a > b && a >= b); + assert!(b < a && b <= a); + b = FlagB; + 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 = FlagABC; + assert_eq!(hash(&x), hash(&y)); + } + + #[test] + fn test_debug() { + assert_eq!(format!("{:?}", FlagA | FlagB), "FlagA | FlagB"); + assert_eq!(format!("{:?}", Flags::empty()), "(empty)"); + assert_eq!(format!("{:?}", FlagABC), "FlagA | FlagB | FlagC | FlagABC"); + } + + #[test] + fn test_binary() { + assert_eq!(format!("{:b}", FlagABC), "111"); + assert_eq!(format!("{:#b}", FlagABC), "0b111"); + } + + #[test] + fn test_octal() { + assert_eq!(format!("{:o}", LongFlagA), "177777"); + assert_eq!(format!("{:#o}", LongFlagA), "0o177777"); + } + + #[test] + fn test_lowerhex() { + assert_eq!(format!("{:x}", LongFlagA), "ffff"); + assert_eq!(format!("{:#x}", LongFlagA), "0xffff"); + } + + #[test] + fn test_upperhex() { + assert_eq!(format!("{:X}", LongFlagA), "FFFF"); + assert_eq!(format!("{:#X}", LongFlagA), "0xFFFF"); + } + + mod submodule { + bitflags! { + pub struct PublicFlags: i8 { + const FlagX = 0; + } + } + bitflags! { + struct PrivateFlags: i8 { + const FlagY = 0; + } + } + + #[test] + fn test_private() { + let _ = FlagY; + } + } + + #[test] + fn test_public() { + let _ = submodule::FlagX; + } + + 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(), A); + assert_eq!(format!("{:?}", A), "A"); + } +} diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/conflicting_trait_impls.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/conflicting_trait_impls.rs new file mode 100644 index 000000000..4704dfaa3 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/conflicting_trait_impls.rs @@ -0,0 +1,20 @@ +#![allow(dead_code)] +#![no_std] + +#[macro_use] +extern crate bitflags; + +#[allow(unused_imports)] +use core::fmt::Display; + +bitflags! { + /// baz + struct Flags: u32 { + const A = 0b00000001; + } +} + +#[test] +fn main() { + +} diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external.rs new file mode 100644 index 000000000..fc1c34670 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external.rs @@ -0,0 +1,21 @@ +#![allow(dead_code)] + +#[macro_use] +extern crate bitflags; + +bitflags! { + /// baz + struct Flags: u32 { + const A = 0b00000001; + #[doc = "bar"] + const B = 0b00000010; + const C = 0b00000100; + #[doc = "foo"] + const ABC = A.bits | B.bits | C.bits; + } +} + +#[test] +fn smoke() { + assert_eq!(ABC, A | B | C); +} diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external_no_std.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external_no_std.rs new file mode 100644 index 000000000..8b8c7067f --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/external_no_std.rs @@ -0,0 +1,22 @@ +#![allow(dead_code)] +#![no_std] + +#[macro_use] +extern crate bitflags; + +bitflags! { + /// baz + struct Flags: u32 { + const A = 0b00000001; + #[doc = "bar"] + const B = 0b00000010; + const C = 0b00000100; + #[doc = "foo"] + const ABC = A.bits | B.bits | C.bits; + } +} + +#[test] +fn smoke() { + assert_eq!(ABC, A | B | C); +} diff --git a/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/i128_bitflags.rs b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/i128_bitflags.rs new file mode 100644 index 000000000..acbb92782 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags-0.9.1/tests/i128_bitflags.rs @@ -0,0 +1,30 @@ +#![cfg(feature = "unstable_testing")] + +#![allow(dead_code, unused_imports)] +#![feature(i128_type)] + +#[macro_use] +extern crate bitflags; + +bitflags! { + /// baz + 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 = A.bits | B.bits | C.bits; + } +} + +#[test] +fn test_i128_bitflags() { + assert_eq!(ABC, A | B | C); + assert_eq!(A.bits, 0x0000_0000_0000_0000_0000_0000_0000_0001); + assert_eq!(B.bits, 0x0000_0000_0000_1000_0000_0000_0000_0000); + assert_eq!(C.bits, 0x8000_0000_0000_0000_0000_0000_0000_0000); + assert_eq!(ABC.bits, 0x8000_0000_0000_1000_0000_0000_0000_0001); + assert_eq!(format!("{:?}", A), "A"); + assert_eq!(format!("{:?}", B), "B"); + assert_eq!(format!("{:?}", C), "C"); + assert_eq!(format!("{:?}", ABC), "A | B | C | ABC"); +} diff --git a/vendor/registry-40351f815f426200/bitflags/.cargo-checksum.json b/vendor/registry-40351f815f426200/bitflags/.cargo-checksum.json new file mode 100644 index 000000000..0338787d2 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"b9f503da2d3c91b0a244f1dc853d975f971f782b209ea52cd4cd98705e6e2749","CODE_OF_CONDUCT.md":"42634d0f6d922f49857175af991802822f7f920487aefa2ee250a50d12251a66","Cargo.toml":"0234b6f827764ca093d897126b45505be0996e67860d61caeab696d092ffb781","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"6b236f8b62c82f189fabce0756e01a2c0ab1f32cb84cad9ff3c96b2ce5282bda","src/example_generated.rs":"e43eb59e90f317f38d436670a6067d2fd9eb35fb319fe716184e4a04e24ed1b2","src/lib.rs":"5751eb6fbb8cb97d8accd0846493168d9b5acff1f8d64435d4da8ad7dbf36b4d"},"package":"228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/bitflags/CHANGELOG.md b/vendor/registry-40351f815f426200/bitflags/CHANGELOG.md new file mode 100644 index 000000000..1f5b4252c --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags/CHANGELOG.md @@ -0,0 +1,108 @@ +# 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/vendor/registry-40351f815f426200/bitflags/CODE_OF_CONDUCT.md b/vendor/registry-40351f815f426200/bitflags/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..f7add90ae --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/bitflags/Cargo.toml b/vendor/registry-40351f815f426200/bitflags/Cargo.toml new file mode 100644 index 000000000..956e9e976 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags/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 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 = "bitflags" +version = "1.0.4" +authors = ["The Rust Project Developers"] +exclude = [".travis.yml", "appveyor.yml", "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"] + +[features] +default = [] +example_generated = [] +[badges.travis-ci] +repository = "bitflags/bitflags" diff --git a/vendor/registry-40351f815f426200/bitflags/LICENSE-APACHE b/vendor/registry-40351f815f426200/bitflags/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/bitflags/LICENSE-MIT b/vendor/registry-40351f815f426200/bitflags/LICENSE-MIT new file mode 100644 index 000000000..39d4bdb5a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/bitflags/README.md b/vendor/registry-40351f815f426200/bitflags/README.md new file mode 100644 index 000000000..df12934c3 --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags/README.md @@ -0,0 +1,34 @@ +bitflags +======== + +[![Build Status](https://travis-ci.com/bitflags/bitflags.svg?branch=master)](https://travis-ci.com/bitflags/bitflags) +[![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) +![Minimum rustc version](https://img.shields.io/badge/rustc-1.20+-yellow.svg) +![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.0" +``` + +and this to your crate root: + +```rust +#[macro_use] +extern crate bitflags; +``` + +## Rust Version Support + +The minimum supported Rust version is 1.20 due to use of associated constants. diff --git a/vendor/registry-40351f815f426200/bitflags/src/example_generated.rs b/vendor/registry-40351f815f426200/bitflags/src/example_generated.rs new file mode 100644 index 000000000..cf188d99c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/bitflags/src/lib.rs b/vendor/registry-40351f815f426200/bitflags/src/lib.rs new file mode 100644 index 000000000..9e1bcfd6c --- /dev/null +++ b/vendor/registry-40351f815f426200/bitflags/src/lib.rs @@ -0,0 +1,1229 @@ +// 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 a `struct` that manages a set of flags. The +//! flags should only be defined for integer types, otherwise unexpected type +//! errors may occur at compile time. +//! +//! # Example +//! +//! ``` +//! #[macro_use] +//! extern crate 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: +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! use std::fmt; +//! +//! 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 struct and its 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 `flags`: +//! +//! ``` +//! #[macro_use] +//! extern crate bitflags; +//! +//! mod example { +//! bitflags! { +//! pub struct Flags1: u32 { +//! const A = 0b00000001; +//! } +//! } +//! bitflags! { +//! # 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` by placing them +//! before the `flags` keyword. +//! +//! # Trait implementations +//! +//! The `Copy`, `Clone`, `PartialEq`, `Eq`, `PartialOrd`, `Ord` and `Hash` +//! traits automatically derived for the `struct` using the `derive` attribute. +//! Additional traits can be derived by providing an explicit `derive` +//! attribute on `flags`. +//! +//! The `Extend` and `FromIterator` traits are implemented for the `struct`, +//! too: `Extend` adds the union of the instances of the `struct` iterated over, +//! while `FromIterator` calculates the union. +//! +//! The `Binary`, `Debug`, `LowerExp`, `Octal` and `UpperExp` trait is also +//! implemented by displaying the bits value of the internal struct. +//! +//! ## Operators +//! +//! The following operator traits are implemented for the generated `struct`: +//! +//! - `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`: +//! +//! - `empty`: an empty set of flags +//! - `all`: the set of all 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 flag +//! - `from_bits_truncate`: convert from underlying bit representation, dropping +//! any bits that do not correspond to flags +//! - `is_empty`: `true` if no flags are currently stored +//! - `is_all`: `true` if all flags are currently set +//! - `intersects`: `true` if there are flags common to both `self` and `other` +//! - `contains`: `true` 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 +//! +//! ## Default +//! +//! The `Default` trait is not automatically implemented for the generated struct. +//! +//! 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`: +//! +//! ``` +//! #[macro_use] +//! extern crate 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: +//! +//! ``` +//! #[macro_use] +//! extern crate 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. +//! +//! ``` +//! #[macro_use] +//! extern crate 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()); +//! } +//! ``` + +#![no_std] +#![doc(html_root_url = "https://docs.rs/bitflags/1.0.4")] + +#[cfg(test)] +#[macro_use] +extern crate std; + +// Re-export libcore using an alias so that the macros can work without +// requiring `extern crate core` downstream. +#[doc(hidden)] +pub extern crate core as _core; + +/// The macro used to generate the flag structure. +/// +/// See the [crate level docs](../bitflags/index.html) for complete documentation. +/// +/// # Example +/// +/// ``` +/// #[macro_use] +/// extern crate 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: +/// +/// ``` +/// #[macro_use] +/// extern crate bitflags; +/// +/// use std::fmt; +/// +/// 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])* + pub struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + const $Flag:ident = $value:expr; + )+ + } + ) => { + __bitflags! { + $(#[$outer])* + (pub) $BitFlags: $T { + $( + $(#[$inner $($args)*])* + $Flag = $value; + )+ + } + } + }; + ( + $(#[$outer:meta])* + struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + const $Flag:ident = $value:expr; + )+ + } + ) => { + __bitflags! { + $(#[$outer])* + () $BitFlags: $T { + $( + $(#[$inner $($args)*])* + $Flag = $value; + )+ + } + } + }; + ( + $(#[$outer:meta])* + pub ($($vis:tt)+) struct $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + const $Flag:ident = $value:expr; + )+ + } + ) => { + __bitflags! { + $(#[$outer])* + (pub ($($vis)+)) $BitFlags: $T { + $( + $(#[$inner $($args)*])* + $Flag = $value; + )+ + } + } + }; +} + +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! __bitflags { + ( + $(#[$outer:meta])* + ($($vis:tt)*) $BitFlags:ident: $T:ty { + $( + $(#[$inner:ident $($args:tt)*])* + $Flag:ident = $value:expr; + )+ + } + ) => { + #[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] + $(#[$outer])* + $($vis)* struct $BitFlags { + bits: $T, + } + + __impl_bitflags! { + $BitFlags: $T { + $( + $(#[$inner $($args)*])* + $Flag = $value; + )+ + } + } + }; +} + +#[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. + 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 <$BitFlags as __BitFlags>::$Flag(self) { + if !first { + f.write_str(" | ")?; + } + first = false; + f.write_str(__bitflags_stringify!($Flag))?; + } + )+ + 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: $BitFlags = $BitFlags { bits: $value }; + )+ + + /// Returns an empty set of flags. + #[inline] + pub fn empty() -> $BitFlags { + $BitFlags { bits: 0 } + } + + /// Returns the set containing all flags. + #[inline] + pub fn all() -> $BitFlags { + // See `Debug::fmt` for why this approach is taken. + #[allow(non_snake_case)] + trait __BitFlags { + $( + #[inline] + fn $Flag() -> $T { 0 } + )+ + } + impl __BitFlags for $BitFlags { + $( + __impl_bitflags! { + #[allow(deprecated)] + #[inline] + $(? #[$attr $($args)*])* + fn $Flag() -> $T { Self::$Flag.bits } + } + )+ + } + $BitFlags { bits: $(<$BitFlags as __BitFlags>::$Flag())|+ } + } + + /// Returns the raw value of the flags currently stored. + #[inline] + pub 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 fn from_bits(bits: $T) -> $crate::_core::option::Option<$BitFlags> { + if (bits & !$BitFlags::all().bits()) == 0 { + $crate::_core::option::Option::Some($BitFlags { bits }) + } else { + $crate::_core::option::Option::None + } + } + + /// Convert from underlying bit representation, dropping any bits + /// that do not correspond to flags. + #[inline] + pub fn from_bits_truncate(bits: $T) -> $BitFlags { + $BitFlags { bits } & $BitFlags::all() + } + + /// Returns `true` if no flags are currently stored. + #[inline] + pub fn is_empty(&self) -> bool { + *self == $BitFlags::empty() + } + + /// Returns `true` if all flags are currently set. + #[inline] + pub fn is_all(&self) -> bool { + *self == $BitFlags::all() + } + + /// Returns `true` if there are flags common to both `self` and `other`. + #[inline] + pub fn intersects(&self, other: $BitFlags) -> bool { + !(*self & other).is_empty() + } + + /// Returns `true` all of the flags in `other` are contained within `self`. + #[inline] + pub fn contains(&self, other: $BitFlags) -> bool { + (*self & other) == other + } + + /// Inserts the specified flags in-place. + #[inline] + pub fn insert(&mut self, other: $BitFlags) { + self.bits |= other.bits; + } + + /// Removes the specified flags in-place. + #[inline] + pub fn remove(&mut self, other: $BitFlags) { + self.bits &= !other.bits; + } + + /// Toggles the specified flags in-place. + #[inline] + pub fn toggle(&mut self, other: $BitFlags) { + self.bits ^= other.bits; + } + + /// Inserts or removes the specified flags depending on the passed value. + #[inline] + pub fn set(&mut self, other: $BitFlags, value: bool) { + if value { + self.insert(other); + } else { + self.remove(other); + } + } + } + + impl $crate::_core::ops::BitOr for $BitFlags { + type Output = $BitFlags; + + /// Returns the union of the two sets of flags. + #[inline] + fn bitor(self, other: $BitFlags) -> $BitFlags { + $BitFlags { bits: self.bits | other.bits } + } + } + + impl $crate::_core::ops::BitOrAssign for $BitFlags { + + /// Adds the set of flags. + #[inline] + fn bitor_assign(&mut self, other: $BitFlags) { + self.bits |= other.bits; + } + } + + impl $crate::_core::ops::BitXor for $BitFlags { + type Output = $BitFlags; + + /// Returns the left flags, but with all the right flags toggled. + #[inline] + fn bitxor(self, other: $BitFlags) -> $BitFlags { + $BitFlags { bits: self.bits ^ other.bits } + } + } + + impl $crate::_core::ops::BitXorAssign for $BitFlags { + + /// Toggles the set of flags. + #[inline] + fn bitxor_assign(&mut self, other: $BitFlags) { + self.bits ^= other.bits; + } + } + + impl $crate::_core::ops::BitAnd for $BitFlags { + type Output = $BitFlags; + + /// Returns the intersection between the two sets of flags. + #[inline] + fn bitand(self, other: $BitFlags) -> $BitFlags { + $BitFlags { 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: $BitFlags) { + self.bits &= other.bits; + } + } + + impl $crate::_core::ops::Sub for $BitFlags { + type Output = $BitFlags; + + /// Returns the set difference of the two sets of flags. + #[inline] + fn sub(self, other: $BitFlags) -> $BitFlags { + $BitFlags { 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: $BitFlags) { + self.bits &= !other.bits; + } + } + + impl $crate::_core::ops::Not for $BitFlags { + type Output = $BitFlags; + + /// Returns the complement of this set of flags. + #[inline] + fn not(self) -> $BitFlags { + $BitFlags { bits: !self.bits } & $BitFlags::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) -> $BitFlags { + 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 somthing 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)* + }; +} + +// Same as std::stringify but callable from __impl_bitflags, which needs to use +// local_inner_macros so can only directly call macros from this crate. +#[macro_export] +#[doc(hidden)] +macro_rules! __bitflags_stringify { + ($s:ident) => { + stringify!($s) + }; +} + +#[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"] + 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; + } + } + + bitflags! { + struct _CfgFlags: u32 { + #[cfg(windows)] + const _CFG_A = 0b01; + #[cfg(unix)] + const _CFG_B = 0b01; + #[cfg(windows)] + const _CFG_C = _CFG_A.bits | 0b10; + } + } + + bitflags! { + struct AnotherSetOfFlags: i8 { + const ANOTHER_FLAG = -1_i8; + } + } + + bitflags! { + struct LongFlags: u32 { + const LONG_A = 0b1111111111111111; + } + } + + #[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); + } + + #[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) + ); + } + + #[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() + ); + } + + #[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()); + } + + #[test] + fn test_is_all() { + assert!(Flags::all().is_all()); + assert!(!Flags::A.is_all()); + assert!(Flags::ABC.is_all()); + + assert!(AnotherSetOfFlags::ANOTHER_FLAG.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)); + } + + #[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_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_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_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"); + } + + #[test] + fn test_binary() { + assert_eq!(format!("{:b}", Flags::ABC), "111"); + assert_eq!(format!("{:#b}", Flags::ABC), "0b111"); + } + + #[test] + fn test_octal() { + assert_eq!(format!("{:o}", LongFlags::LONG_A), "177777"); + assert_eq!(format!("{:#o}", LongFlags::LONG_A), "0o177777"); + } + + #[test] + fn test_lowerhex() { + assert_eq!(format!("{:x}", LongFlags::LONG_A), "ffff"); + assert_eq!(format!("{:#x}", LongFlags::LONG_A), "0xffff"); + } + + #[test] + fn test_upperhex() { + assert_eq!(format!("{:X}", LongFlags::LONG_A), "FFFF"); + assert_eq!(format!("{:#X}", LongFlags::LONG_A), "0xFFFF"); + } + + mod submodule { + bitflags! { + pub struct PublicFlags: i8 { + const X = 0; + } + } + bitflags! { + 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"); + } +} diff --git a/vendor/registry-40351f815f426200/byteorder/.cargo-checksum.json b/vendor/registry-40351f815f426200/byteorder/.cargo-checksum.json new file mode 100644 index 000000000..3527b8eb9 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"750ff16a714caad77a272a62b4baed5ea113ead2846f8c3968342e592a99ecd5","COPYING":"01c266bced4a434da0051174d6bee16a4c82cf634e2679b6155d40d75012390f","Cargo.toml":"cd633b2d76dd5d57191388e7cc31340eb2d6b89e2f98f587999dc685d977c673","LICENSE-MIT":"0f96a83840e146e43c0ec96a22ec1f392e0680e6c1226e6f3ba87e0740af850f","README.md":"97c01a66dbff4615acd49a8c3a85d137bf29cc113fa514910195bb11aef445bc","UNLICENSE":"7e12e5df4bae12cb21581ba157ced20e1986a0508dd10d0e8a4ab9a4cf94e85c","benches/bench.rs":"250d46461a0529a856d76a6421fd45c499bccba2c532e05dbf438c94582a8eac","src/io.rs":"4221711399f9723ef21c5b07700b8e9319f6f665b1eaaceb49528f6e976a25a9","src/lib.rs":"07e5f53bf3b9e30f1da9f4cf37797b77ce3d16c9f2a3a3e56669dd323debd1b9"},"package":"652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/byteorder/CHANGELOG.md b/vendor/registry-40351f815f426200/byteorder/CHANGELOG.md new file mode 100644 index 000000000..d59eaa7c5 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/CHANGELOG.md @@ -0,0 +1,58 @@ +1.2.1 +===== +This patch release removes more unnecessary uses of `unsafe` that +were overlooked in the prior `1.2.0` release. In particular, the +`ReadBytesExt::read_{f32,f64}_into_checked` methods have been deprecated and +replaced by more appropriately named `read_{f32,f64}_into` methods. + + +1.2.0 +===== +The most prominent change in this release of `byteorder` is the removal of +unnecessary signaling NaN masking, and in turn, the `unsafe` annotations +associated with methods that didn't do masking. See +[#103](https://github.com/BurntSushi/byteorder/issues/103) +for more details. + +* [BUG #102](https://github.com/BurntSushi/byteorder/issues/102): + Fix big endian tests. +* [BUG #103](https://github.com/BurntSushi/byteorder/issues/103): + Remove sNaN masking. + + +1.1.0 +===== +This release of `byteorder` features a number of fixes and improvements, mostly +as a result of the +[Litz Blitz evaluation](https://public.etherpad-mozilla.org/p/rust-crate-eval-byteorder). + +Feature enhancements: + +* [FEATURE #63](https://github.com/BurntSushi/byteorder/issues/63): + Add methods for reading/writing slices of numbers for a specific + endianness. +* [FEATURE #65](https://github.com/BurntSushi/byteorder/issues/65): + Add support for `u128`/`i128` types. (Behind the nightly only `i128` + feature.) +* [FEATURE #72](https://github.com/BurntSushi/byteorder/issues/72): + Add "panics" and "errors" sections for each relevant public API item. +* [FEATURE #74](https://github.com/BurntSushi/byteorder/issues/74): + Add CI badges to Cargo.toml. +* [FEATURE #75](https://github.com/BurntSushi/byteorder/issues/75): + Add more examples to public API items. +* Add 24-bit read/write methods. +* Add `BE` and `LE` type aliases for `BigEndian` and `LittleEndian`, + respectively. + +Bug fixes: + +* [BUG #68](https://github.com/BurntSushi/byteorder/issues/68): + Panic in {BigEndian,LittleEndian}::default. +* [BUG #69](https://github.com/BurntSushi/byteorder/issues/69): + Seal the `ByteOrder` trait to prevent out-of-crate implementations. +* [BUG #71](https://github.com/BurntSushi/byteorder/issues/71): + Guarantee that the results of `read_f32`/`read_f64` are always defined. +* [BUG #73](https://github.com/BurntSushi/byteorder/issues/73): + Add crates.io categories. +* [BUG #77](https://github.com/BurntSushi/byteorder/issues/77): + Add `html_root` doc attribute. diff --git a/vendor/registry-40351f815f426200/byteorder/COPYING b/vendor/registry-40351f815f426200/byteorder/COPYING new file mode 100644 index 000000000..bb9c20a09 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/COPYING @@ -0,0 +1,3 @@ +This project is dual-licensed under the Unlicense and MIT licenses. + +You may use this code under the terms of either license. diff --git a/vendor/registry-40351f815f426200/byteorder/Cargo.toml b/vendor/registry-40351f815f426200/byteorder/Cargo.toml new file mode 100644 index 000000000..06a18e205 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/Cargo.toml @@ -0,0 +1,43 @@ +# 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 = "byteorder" +version = "1.2.1" +authors = ["Andrew Gallant "] +description = "Library for reading/writing numbers in big-endian and little-endian." +homepage = "https://github.com/BurntSushi/byteorder" +documentation = "https://docs.rs/byteorder" +readme = "README.md" +keywords = ["byte", "endian", "big-endian", "little-endian", "binary"] +categories = ["encoding", "parsing"] +license = "Unlicense/MIT" +repository = "https://github.com/BurntSushi/byteorder" +[profile.bench] +opt-level = 3 + +[lib] +name = "byteorder" +bench = false +[dev-dependencies.quickcheck] +version = "0.4" +default-features = false + +[dev-dependencies.rand] +version = "0.3" + +[features] +default = ["std"] +i128 = [] +std = [] +[badges.travis-ci] +repository = "BurntSushi/byteorder" diff --git a/vendor/registry-40351f815f426200/byteorder/LICENSE-MIT b/vendor/registry-40351f815f426200/byteorder/LICENSE-MIT new file mode 100644 index 000000000..3b0a5dc09 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/LICENSE-MIT @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015 Andrew Gallant + +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/vendor/registry-40351f815f426200/byteorder/README.md b/vendor/registry-40351f815f426200/byteorder/README.md new file mode 100644 index 000000000..f282ab72e --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/README.md @@ -0,0 +1,56 @@ +This crate provides convenience methods for encoding and decoding numbers in +either big-endian or little-endian order. + +[![Build status](https://api.travis-ci.org/BurntSushi/byteorder.svg)](https://travis-ci.org/BurntSushi/byteorder) +[![](http://meritbadge.herokuapp.com/byteorder)](https://crates.io/crates/byteorder) + +Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org). + + +### Documentation + +https://docs.rs/byteorder + + +### Installation + +This crate works with Cargo and is on +[crates.io](https://crates.io/crates/byteorder). Add it to your `Cargo.toml` +like so: + +```toml +[dependencies] +byteorder = "1" +``` + +If you want to augment existing `Read` and `Write` traits, then import the +extension methods like so: + +```rust +extern crate byteorder; + +use byteorder::{ReadBytesExt, WriteBytesExt, BigEndian, LittleEndian}; +``` + +For example: + +```rust +use std::io::Cursor; +use byteorder::{BigEndian, ReadBytesExt}; + +let mut rdr = Cursor::new(vec![2, 5, 3, 0]); +// Note that we use type parameters to indicate which kind of byte order +// we want! +assert_eq!(517, rdr.read_u16::().unwrap()); +assert_eq!(768, rdr.read_u16::().unwrap()); +``` + +### `no_std` crates + +This crate has a feature, `std`, that is enabled by default. To use this crate +in a `no_std` context, add the following to your `Cargo.toml`: + +```toml +[dependencies] +byteorder = { version = "1", default-features = false } +``` diff --git a/vendor/registry-40351f815f426200/byteorder/UNLICENSE b/vendor/registry-40351f815f426200/byteorder/UNLICENSE new file mode 100644 index 000000000..68a49daad --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/UNLICENSE @@ -0,0 +1,24 @@ +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +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 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. + +For more information, please refer to diff --git a/vendor/registry-40351f815f426200/byteorder/benches/bench.rs b/vendor/registry-40351f815f426200/byteorder/benches/bench.rs new file mode 100644 index 000000000..845e489f8 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/benches/bench.rs @@ -0,0 +1,320 @@ +#![cfg_attr(feature = "i128", feature(i128))] +#![feature(test)] + +extern crate byteorder; +extern crate rand; +extern crate test; + +macro_rules! bench_num { + ($name:ident, $read:ident, $bytes:expr, $data:expr) => ( + mod $name { + use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian}; + use super::test::Bencher; + use super::test::black_box as bb; + + const NITER: usize = 100_000; + + #[bench] + fn read_big_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(BigEndian::$read(&buf, $bytes)); + } + }); + } + + #[bench] + fn read_little_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(LittleEndian::$read(&buf, $bytes)); + } + }); + } + + #[bench] + fn read_native_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(NativeEndian::$read(&buf, $bytes)); + } + }); + } + } + ); + ($ty:ident, $max:ident, + $read:ident, $write:ident, $size:expr, $data:expr) => ( + mod $ty { + use std::$ty; + use byteorder::{ByteOrder, BigEndian, NativeEndian, LittleEndian}; + use super::test::Bencher; + use super::test::black_box as bb; + + const NITER: usize = 100_000; + + #[bench] + fn read_big_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(BigEndian::$read(&buf)); + } + }); + } + + #[bench] + fn read_little_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(LittleEndian::$read(&buf)); + } + }); + } + + #[bench] + fn read_native_endian(b: &mut Bencher) { + let buf = $data; + b.iter(|| { + for _ in 0..NITER { + bb(NativeEndian::$read(&buf)); + } + }); + } + + #[bench] + fn write_big_endian(b: &mut Bencher) { + let mut buf = $data; + let n = $ty::$max; + b.iter(|| { + for _ in 0..NITER { + bb(BigEndian::$write(&mut buf, n)); + } + }); + } + + #[bench] + fn write_little_endian(b: &mut Bencher) { + let mut buf = $data; + let n = $ty::$max; + b.iter(|| { + for _ in 0..NITER { + bb(LittleEndian::$write(&mut buf, n)); + } + }); + } + + #[bench] + fn write_native_endian(b: &mut Bencher) { + let mut buf = $data; + let n = $ty::$max; + b.iter(|| { + for _ in 0..NITER { + bb(NativeEndian::$write(&mut buf, n)); + } + }); + } + } + ); +} + +bench_num!(u16, MAX, read_u16, write_u16, 2, [1, 2]); +bench_num!(i16, MAX, read_i16, write_i16, 2, [1, 2]); +bench_num!(u32, MAX, read_u32, write_u32, 4, [1, 2, 3, 4]); +bench_num!(i32, MAX, read_i32, write_i32, 4, [1, 2, 3, 4]); +bench_num!(u64, MAX, read_u64, write_u64, 8, [1, 2, 3, 4, 5, 6, 7, 8]); +bench_num!(i64, MAX, read_i64, write_i64, 8, [1, 2, 3, 4, 5, 6, 7, 8]); +bench_num!(f32, MAX, read_f32, write_f32, 4, [1, 2, 3, 4]); +bench_num!(f64, MAX, read_f64, write_f64, 8, + [1, 2, 3, 4, 5, 6, 7, 8]); + +bench_num!(uint_1, read_uint, 1, [1]); +bench_num!(uint_2, read_uint, 2, [1, 2]); +bench_num!(uint_3, read_uint, 3, [1, 2, 3]); +bench_num!(uint_4, read_uint, 4, [1, 2, 3, 4]); +bench_num!(uint_5, read_uint, 5, [1, 2, 3, 4, 5]); +bench_num!(uint_6, read_uint, 6, [1, 2, 3, 4, 5, 6]); +bench_num!(uint_7, read_uint, 7, [1, 2, 3, 4, 5, 6, 7]); +bench_num!(uint_8, read_uint, 8, [1, 2, 3, 4, 5, 6, 7, 8]); + +bench_num!(int_1, read_int, 1, [1]); +bench_num!(int_2, read_int, 2, [1, 2]); +bench_num!(int_3, read_int, 3, [1, 2, 3]); +bench_num!(int_4, read_int, 4, [1, 2, 3, 4]); +bench_num!(int_5, read_int, 5, [1, 2, 3, 4, 5]); +bench_num!(int_6, read_int, 6, [1, 2, 3, 4, 5, 6]); +bench_num!(int_7, read_int, 7, [1, 2, 3, 4, 5, 6, 7]); +bench_num!(int_8, read_int, 8, [1, 2, 3, 4, 5, 6, 7, 8]); + +#[cfg(feature = "i128")] +bench_num!(u128, MAX, read_u128, write_u128, + 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); +#[cfg(feature = "i128")] +bench_num!(i128, MAX, read_i128, write_i128, + 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + +#[cfg(feature = "i128")] +bench_num!(uint128_1, read_uint128, + 1, [1]); +#[cfg(feature = "i128")] +bench_num!(uint128_2, read_uint128, + 2, [1, 2]); +#[cfg(feature = "i128")] +bench_num!(uint128_3, read_uint128, + 3, [1, 2, 3]); +#[cfg(feature = "i128")] +bench_num!(uint128_4, read_uint128, + 4, [1, 2, 3, 4]); +#[cfg(feature = "i128")] +bench_num!(uint128_5, read_uint128, + 5, [1, 2, 3, 4, 5]); +#[cfg(feature = "i128")] +bench_num!(uint128_6, read_uint128, + 6, [1, 2, 3, 4, 5, 6]); +#[cfg(feature = "i128")] +bench_num!(uint128_7, read_uint128, + 7, [1, 2, 3, 4, 5, 6, 7]); +#[cfg(feature = "i128")] +bench_num!(uint128_8, read_uint128, + 8, [1, 2, 3, 4, 5, 6, 7, 8]); +#[cfg(feature = "i128")] +bench_num!(uint128_9, read_uint128, + 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); +#[cfg(feature = "i128")] +bench_num!(uint128_10, read_uint128, + 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +#[cfg(feature = "i128")] +bench_num!(uint128_11, read_uint128, + 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); +#[cfg(feature = "i128")] +bench_num!(uint128_12, read_uint128, + 12, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); +#[cfg(feature = "i128")] +bench_num!(uint128_13, read_uint128, + 13, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); +#[cfg(feature = "i128")] +bench_num!(uint128_14, read_uint128, + 14, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]); +#[cfg(feature = "i128")] +bench_num!(uint128_15, read_uint128, + 15, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); +#[cfg(feature = "i128")] +bench_num!(uint128_16, read_uint128, + 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + +#[cfg(feature = "i128")] +bench_num!(int128_1, read_int128, + 1, [1]); +#[cfg(feature = "i128")] +bench_num!(int128_2, read_int128, + 2, [1, 2]); +#[cfg(feature = "i128")] +bench_num!(int128_3, read_int128, + 3, [1, 2, 3]); +#[cfg(feature = "i128")] +bench_num!(int128_4, read_int128, + 4, [1, 2, 3, 4]); +#[cfg(feature = "i128")] +bench_num!(int128_5, read_int128, + 5, [1, 2, 3, 4, 5]); +#[cfg(feature = "i128")] +bench_num!(int128_6, read_int128, + 6, [1, 2, 3, 4, 5, 6]); +#[cfg(feature = "i128")] +bench_num!(int128_7, read_int128, + 7, [1, 2, 3, 4, 5, 6, 7]); +#[cfg(feature = "i128")] +bench_num!(int128_8, read_int128, + 8, [1, 2, 3, 4, 5, 6, 7, 8]); +#[cfg(feature = "i128")] +bench_num!(int128_9, read_int128, + 9, [1, 2, 3, 4, 5, 6, 7, 8, 9]); +#[cfg(feature = "i128")] +bench_num!(int128_10, read_int128, + 10, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +#[cfg(feature = "i128")] +bench_num!(int128_11, read_int128, + 11, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]); +#[cfg(feature = "i128")] +bench_num!(int128_12, read_int128, + 12, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]); +#[cfg(feature = "i128")] +bench_num!(int128_13, read_int128, + 13, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]); +#[cfg(feature = "i128")] +bench_num!(int128_14, read_int128, + 14, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]); +#[cfg(feature = "i128")] +bench_num!(int128_15, read_int128, + 15, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); +#[cfg(feature = "i128")] +bench_num!(int128_16, read_int128, + 16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]); + + +macro_rules! bench_slice { + ($name:ident, $numty:ty, $read:ident, $write:ident) => { + mod $name { + use std::mem::size_of; + + use byteorder::{ByteOrder, BigEndian, LittleEndian}; + use rand::{self, Rng}; + use test::Bencher; + + #[bench] + fn read_big_endian(b: &mut Bencher) { + let mut numbers: Vec<$numty> = + rand::thread_rng().gen_iter().take(100000).collect(); + let mut bytes = vec![0; numbers.len() * size_of::<$numty>()]; + BigEndian::$write(&numbers, &mut bytes); + + b.bytes = bytes.len() as u64; + b.iter(|| { + BigEndian::$read(&bytes, &mut numbers); + }); + } + + #[bench] + fn read_little_endian(b: &mut Bencher) { + let mut numbers: Vec<$numty> = + rand::thread_rng().gen_iter().take(100000).collect(); + let mut bytes = vec![0; numbers.len() * size_of::<$numty>()]; + LittleEndian::$write(&numbers, &mut bytes); + + b.bytes = bytes.len() as u64; + b.iter(|| { + LittleEndian::$read(&bytes, &mut numbers); + }); + } + + #[bench] + fn write_big_endian(b: &mut Bencher) { + let numbers: Vec<$numty> = + rand::thread_rng().gen_iter().take(100000).collect(); + let mut bytes = vec![0; numbers.len() * size_of::<$numty>()]; + + b.bytes = bytes.len() as u64; + b.iter(|| { + BigEndian::$write(&numbers, &mut bytes); + }); + } + + #[bench] + fn write_little_endian(b: &mut Bencher) { + let numbers: Vec<$numty> = + rand::thread_rng().gen_iter().take(100000).collect(); + let mut bytes = vec![0; numbers.len() * size_of::<$numty>()]; + + b.bytes = bytes.len() as u64; + b.iter(|| { + LittleEndian::$write(&numbers, &mut bytes); + }); + } + } + } +} + +bench_slice!(slice_u64, u64, read_u64_into, write_u64_into); diff --git a/vendor/registry-40351f815f426200/byteorder/src/io.rs b/vendor/registry-40351f815f426200/byteorder/src/io.rs new file mode 100644 index 000000000..c5645fa17 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/src/io.rs @@ -0,0 +1,1264 @@ +use std::io::{self, Result}; +use std::slice; + +use ByteOrder; + +/// Extends `Read` with methods for reading numbers. (For `std::io`.) +/// +/// Most of the methods defined here have an unconstrained type parameter that +/// must be explicitly instantiated. Typically, it is instantiated with either +/// the `BigEndian` or `LittleEndian` types defined in this crate. +/// +/// # Examples +/// +/// Read unsigned 16 bit big-endian integers from a `Read`: +/// +/// ```rust +/// use std::io::Cursor; +/// use byteorder::{BigEndian, ReadBytesExt}; +/// +/// let mut rdr = Cursor::new(vec![2, 5, 3, 0]); +/// assert_eq!(517, rdr.read_u16::().unwrap()); +/// assert_eq!(768, rdr.read_u16::().unwrap()); +/// ``` +pub trait ReadBytesExt: io::Read { + /// Reads an unsigned 8 bit integer from the underlying reader. + /// + /// Note that since this reads a single byte, no byte order conversions + /// are used. It is included for completeness. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read unsigned 8 bit integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![2, 5]); + /// assert_eq!(2, rdr.read_u8().unwrap()); + /// assert_eq!(5, rdr.read_u8().unwrap()); + /// ``` + #[inline] + fn read_u8(&mut self) -> Result { + let mut buf = [0; 1]; + try!(self.read_exact(&mut buf)); + Ok(buf[0]) + } + + /// Reads a signed 8 bit integer from the underlying reader. + /// + /// Note that since this reads a single byte, no byte order conversions + /// are used. It is included for completeness. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read unsigned 8 bit integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x02, 0xfb]); + /// assert_eq!(2, rdr.read_i8().unwrap()); + /// assert_eq!(-5, rdr.read_i8().unwrap()); + /// ``` + #[inline] + fn read_i8(&mut self) -> Result { + let mut buf = [0; 1]; + try!(self.read_exact(&mut buf)); + Ok(buf[0] as i8) + } + + /// Reads an unsigned 16 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read unsigned 16 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]); + /// assert_eq!(517, rdr.read_u16::().unwrap()); + /// assert_eq!(768, rdr.read_u16::().unwrap()); + /// ``` + #[inline] + fn read_u16(&mut self) -> Result { + let mut buf = [0; 2]; + try!(self.read_exact(&mut buf)); + Ok(T::read_u16(&buf)) + } + + /// Reads a signed 16 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read signed 16 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x00, 0xc1, 0xff, 0x7c]); + /// assert_eq!(193, rdr.read_i16::().unwrap()); + /// assert_eq!(-132, rdr.read_i16::().unwrap()); + /// ``` + #[inline] + fn read_i16(&mut self) -> Result { + let mut buf = [0; 2]; + try!(self.read_exact(&mut buf)); + Ok(T::read_i16(&buf)) + } + + /// Reads an unsigned 24 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read unsigned 24 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x00, 0x01, 0x0b]); + /// assert_eq!(267, rdr.read_u24::().unwrap()); + /// ``` + #[inline] + fn read_u24(&mut self) -> Result { + let mut buf = [0; 3]; + try!(self.read_exact(&mut buf)); + Ok(T::read_u24(&buf)) + } + + /// Reads a signed 24 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read signed 24 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0xff, 0x7a, 0x33]); + /// assert_eq!(-34253, rdr.read_i24::().unwrap()); + /// ``` + #[inline] + fn read_i24(&mut self) -> Result { + let mut buf = [0; 3]; + try!(self.read_exact(&mut buf)); + Ok(T::read_i24(&buf)) + } + + /// Reads an unsigned 32 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read unsigned 32 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x00, 0x00, 0x01, 0x0b]); + /// assert_eq!(267, rdr.read_u32::().unwrap()); + /// ``` + #[inline] + fn read_u32(&mut self) -> Result { + let mut buf = [0; 4]; + try!(self.read_exact(&mut buf)); + Ok(T::read_u32(&buf)) + } + + /// Reads a signed 32 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read signed 32 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0xff, 0xff, 0x7a, 0x33]); + /// assert_eq!(-34253, rdr.read_i32::().unwrap()); + /// ``` + #[inline] + fn read_i32(&mut self) -> Result { + let mut buf = [0; 4]; + try!(self.read_exact(&mut buf)); + Ok(T::read_i32(&buf)) + } + + /// Reads an unsigned 64 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read an unsigned 64 bit big-endian integer from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83]); + /// assert_eq!(918733457491587, rdr.read_u64::().unwrap()); + /// ``` + #[inline] + fn read_u64(&mut self) -> Result { + let mut buf = [0; 8]; + try!(self.read_exact(&mut buf)); + Ok(T::read_u64(&buf)) + } + + /// Reads a signed 64 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a signed 64 bit big-endian integer from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0]); + /// assert_eq!(i64::min_value(), rdr.read_i64::().unwrap()); + /// ``` + #[inline] + fn read_i64(&mut self) -> Result { + let mut buf = [0; 8]; + try!(self.read_exact(&mut buf)); + Ok(T::read_i64(&buf)) + } + + /// Reads an unsigned 128 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read an unsigned 128 bit big-endian integer from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83, + /// 0x00, 0x03, 0x43, 0x95, 0x4d, 0x60, 0x86, 0x83 + /// ]); + /// assert_eq!(16947640962301618749969007319746179, rdr.read_u128::().unwrap()); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_u128(&mut self) -> Result { + let mut buf = [0; 16]; + try!(self.read_exact(&mut buf)); + Ok(T::read_u128(&buf)) + } + + /// Reads a signed 128 bit integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a signed 128 bit big-endian integer from a `Read`: + /// + /// ```rust + /// #![feature(i128_type)] + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); + /// assert_eq!(i128::min_value(), rdr.read_i128::().unwrap()); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_i128(&mut self) -> Result { + let mut buf = [0; 16]; + try!(self.read_exact(&mut buf)); + Ok(T::read_i128(&buf)) + } + + /// Reads an unsigned n-bytes integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read an unsigned n-byte big-endian integer from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0x80, 0x74, 0xfa]); + /// assert_eq!(8418554, rdr.read_uint::(3).unwrap()); + #[inline] + fn read_uint(&mut self, nbytes: usize) -> Result { + let mut buf = [0; 8]; + try!(self.read_exact(&mut buf[..nbytes])); + Ok(T::read_uint(&buf[..nbytes], nbytes)) + } + + /// Reads a signed n-bytes integer from the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read an unsigned n-byte big-endian integer from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0xc1, 0xff, 0x7c]); + /// assert_eq!(-4063364, rdr.read_int::(3).unwrap()); + #[inline] + fn read_int(&mut self, nbytes: usize) -> Result { + let mut buf = [0; 8]; + try!(self.read_exact(&mut buf[..nbytes])); + Ok(T::read_int(&buf[..nbytes], nbytes)) + } + + /// Reads an unsigned n-bytes integer from the underlying reader. + #[cfg(feature = "i128")] + #[inline] + fn read_uint128(&mut self, nbytes: usize) -> Result { + let mut buf = [0; 16]; + try!(self.read_exact(&mut buf[..nbytes])); + Ok(T::read_uint128(&buf[..nbytes], nbytes)) + } + + /// Reads a signed n-bytes integer from the underlying reader. + #[cfg(feature = "i128")] + #[inline] + fn read_int128(&mut self, nbytes: usize) -> Result { + let mut buf = [0; 16]; + try!(self.read_exact(&mut buf[..nbytes])); + Ok(T::read_int128(&buf[..nbytes], nbytes)) + } + + /// Reads a IEEE754 single-precision (4 bytes) floating point number from + /// the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a big-endian single-precision floating point number from a `Read`: + /// + /// ```rust + /// use std::f32; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x49, 0x0f, 0xdb, + /// ]); + /// assert_eq!(f32::consts::PI, rdr.read_f32::().unwrap()); + /// ``` + #[inline] + fn read_f32(&mut self) -> Result { + let mut buf = [0; 4]; + try!(self.read_exact(&mut buf)); + Ok(T::read_f32(&buf)) + } + + /// Reads a IEEE754 double-precision (8 bytes) floating point number from + /// the underlying reader. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a big-endian double-precision floating point number from a `Read`: + /// + /// ```rust + /// use std::f64; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18, + /// ]); + /// assert_eq!(f64::consts::PI, rdr.read_f64::().unwrap()); + /// ``` + #[inline] + fn read_f64(&mut self) -> Result { + let mut buf = [0; 8]; + try!(self.read_exact(&mut buf)); + Ok(T::read_f64(&buf)) + } + + /// Reads a sequence of unsigned 16 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of unsigned 16 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]); + /// let mut dst = [0; 2]; + /// rdr.read_u16_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_u16_into(&mut self, dst: &mut [u16]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_u16(dst); + Ok(()) + } + + /// Reads a sequence of unsigned 32 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of unsigned 32 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]); + /// let mut dst = [0; 2]; + /// rdr.read_u32_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_u32_into(&mut self, dst: &mut [u32]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_u32(dst); + Ok(()) + } + + /// Reads a sequence of unsigned 64 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of unsigned 64 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0, 0, 0, 0, 0, 0, 2, 5, + /// 0, 0, 0, 0, 0, 0, 3, 0, + /// ]); + /// let mut dst = [0; 2]; + /// rdr.read_u64_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_u64_into(&mut self, dst: &mut [u64]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_u64(dst); + Ok(()) + } + + /// Reads a sequence of unsigned 128 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of unsigned 128 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, + /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + /// ]); + /// let mut dst = [0; 2]; + /// rdr.read_u128_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_u128_into( + &mut self, + dst: &mut [u128], + ) -> Result<()> { + { + let mut buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_u128(dst); + Ok(()) + } + + /// Reads a sequence of signed 16 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of signed 16 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![2, 5, 3, 0]); + /// let mut dst = [0; 2]; + /// rdr.read_i16_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_i16_into(&mut self, dst: &mut [i16]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_i16(dst); + Ok(()) + } + + /// Reads a sequence of signed 32 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of signed 32 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![0, 0, 2, 5, 0, 0, 3, 0]); + /// let mut dst = [0; 2]; + /// rdr.read_i32_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_i32_into(&mut self, dst: &mut [i32]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_i32(dst); + Ok(()) + } + + /// Reads a sequence of signed 64 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of signed 64 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0, 0, 0, 0, 0, 0, 2, 5, + /// 0, 0, 0, 0, 0, 0, 3, 0, + /// ]); + /// let mut dst = [0; 2]; + /// rdr.read_i64_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[inline] + fn read_i64_into(&mut self, dst: &mut [i64]) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_i64(dst); + Ok(()) + } + + /// Reads a sequence of signed 128 bit integers from the underlying + /// reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of signed 128 bit big-endian integers from a `Read`: + /// + /// ```rust + /// use std::io::Cursor; + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, + /// 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, + /// ]); + /// let mut dst = [0; 2]; + /// rdr.read_i128_into::(&mut dst).unwrap(); + /// assert_eq!([517, 768], dst); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_i128_into( + &mut self, + dst: &mut [i128], + ) -> Result<()> { + { + let mut buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_i128(dst); + Ok(()) + } + + /// Reads a sequence of IEEE754 single-precision (4 bytes) floating + /// point numbers from the underlying reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of big-endian single-precision floating point number + /// from a `Read`: + /// + /// ```rust + /// use std::f32; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x49, 0x0f, 0xdb, + /// 0x3f, 0x80, 0x00, 0x00, + /// ]); + /// let mut dst = [0.0; 2]; + /// rdr.read_f32_into::(&mut dst).unwrap(); + /// assert_eq!([f32::consts::PI, 1.0], dst); + /// ``` + #[inline] + fn read_f32_into( + &mut self, + dst: &mut [f32], + ) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_f32(dst); + Ok(()) + } + + /// **DEPRECATED**. + /// + /// This method is deprecated. Use `read_f32_into` instead. + /// + /// Reads a sequence of IEEE754 single-precision (4 bytes) floating + /// point numbers from the underlying reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of big-endian single-precision floating point number + /// from a `Read`: + /// + /// ```rust + /// use std::f32; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x49, 0x0f, 0xdb, + /// 0x3f, 0x80, 0x00, 0x00, + /// ]); + /// let mut dst = [0.0; 2]; + /// rdr.read_f32_into_unchecked::(&mut dst).unwrap(); + /// assert_eq!([f32::consts::PI, 1.0], dst); + /// ``` + #[inline] + fn read_f32_into_unchecked( + &mut self, + dst: &mut [f32], + ) -> Result<()> { + self.read_f32_into::(dst) + } + + /// Reads a sequence of IEEE754 double-precision (8 bytes) floating + /// point numbers from the underlying reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of big-endian single-precision floating point number + /// from a `Read`: + /// + /// ```rust + /// use std::f64; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18, + /// 0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /// ]); + /// let mut dst = [0.0; 2]; + /// rdr.read_f64_into::(&mut dst).unwrap(); + /// assert_eq!([f64::consts::PI, 1.0], dst); + /// ``` + #[inline] + fn read_f64_into( + &mut self, + dst: &mut [f64], + ) -> Result<()> { + { + let buf = unsafe { slice_to_u8_mut(dst) }; + try!(self.read_exact(buf)); + } + T::from_slice_f64(dst); + Ok(()) + } + + /// **DEPRECATED**. + /// + /// This method is deprecated. Use `read_f64_into` instead. + /// + /// Reads a sequence of IEEE754 double-precision (8 bytes) floating + /// point numbers from the underlying reader. + /// + /// The given buffer is either filled completely or an error is returned. + /// If an error is returned, the contents of `dst` are unspecified. + /// + /// # Safety + /// + /// This method is unsafe because there are no guarantees made about the + /// floating point values. In particular, this method does not check for + /// signaling NaNs, which may result in undefined behavior. + /// + /// # Errors + /// + /// This method returns the same errors as [`Read::read_exact`]. + /// + /// [`Read::read_exact`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_exact + /// + /// # Examples + /// + /// Read a sequence of big-endian single-precision floating point number + /// from a `Read`: + /// + /// ```rust + /// use std::f64; + /// use std::io::Cursor; + /// + /// use byteorder::{BigEndian, ReadBytesExt}; + /// + /// let mut rdr = Cursor::new(vec![ + /// 0x40, 0x09, 0x21, 0xfb, 0x54, 0x44, 0x2d, 0x18, + /// 0x3f, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /// ]); + /// let mut dst = [0.0; 2]; + /// rdr.read_f64_into_unchecked::(&mut dst).unwrap(); + /// assert_eq!([f64::consts::PI, 1.0], dst); + /// ``` + #[inline] + fn read_f64_into_unchecked( + &mut self, + dst: &mut [f64], + ) -> Result<()> { + self.read_f64_into::(dst) + } +} + +/// All types that implement `Read` get methods defined in `ReadBytesExt` +/// for free. +impl ReadBytesExt for R {} + +/// Extends `Write` with methods for writing numbers. (For `std::io`.) +/// +/// Most of the methods defined here have an unconstrained type parameter that +/// must be explicitly instantiated. Typically, it is instantiated with either +/// the `BigEndian` or `LittleEndian` types defined in this crate. +/// +/// # Examples +/// +/// Write unsigned 16 bit big-endian integers to a `Write`: +/// +/// ```rust +/// use byteorder::{BigEndian, WriteBytesExt}; +/// +/// let mut wtr = vec![]; +/// wtr.write_u16::(517).unwrap(); +/// wtr.write_u16::(768).unwrap(); +/// assert_eq!(wtr, vec![2, 5, 3, 0]); +/// ``` +pub trait WriteBytesExt: io::Write { + /// Writes an unsigned 8 bit integer to the underlying writer. + /// + /// Note that since this writes a single byte, no byte order conversions + /// are used. It is included for completeness. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_u8(&mut self, n: u8) -> Result<()> { + self.write_all(&[n]) + } + + /// Writes a signed 8 bit integer to the underlying writer. + /// + /// Note that since this writes a single byte, no byte order conversions + /// are used. It is included for completeness. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_i8(&mut self, n: i8) -> Result<()> { + self.write_all(&[n as u8]) + } + + /// Writes an unsigned 16 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_u16(&mut self, n: u16) -> Result<()> { + let mut buf = [0; 2]; + T::write_u16(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a signed 16 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_i16(&mut self, n: i16) -> Result<()> { + let mut buf = [0; 2]; + T::write_i16(&mut buf, n); + self.write_all(&buf) + } + + /// Writes an unsigned 24 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_u24(&mut self, n: u32) -> Result<()> { + let mut buf = [0; 3]; + T::write_u24(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a signed 24 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_i24(&mut self, n: i32) -> Result<()> { + let mut buf = [0; 3]; + T::write_i24(&mut buf, n); + self.write_all(&buf) + } + + /// Writes an unsigned 32 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_u32(&mut self, n: u32) -> Result<()> { + let mut buf = [0; 4]; + T::write_u32(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a signed 32 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_i32(&mut self, n: i32) -> Result<()> { + let mut buf = [0; 4]; + T::write_i32(&mut buf, n); + self.write_all(&buf) + } + + /// Writes an unsigned 64 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_u64(&mut self, n: u64) -> Result<()> { + let mut buf = [0; 8]; + T::write_u64(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a signed 64 bit integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_i64(&mut self, n: i64) -> Result<()> { + let mut buf = [0; 8]; + T::write_i64(&mut buf, n); + self.write_all(&buf) + } + + /// Writes an unsigned 128 bit integer to the underlying writer. + #[cfg(feature = "i128")] + #[inline] + fn write_u128(&mut self, n: u128) -> Result<()> { + let mut buf = [0; 16]; + T::write_u128(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a signed 128 bit integer to the underlying writer. + #[cfg(feature = "i128")] + #[inline] + fn write_i128(&mut self, n: i128) -> Result<()> { + let mut buf = [0; 16]; + T::write_i128(&mut buf, n); + self.write_all(&buf) + } + + /// Writes an unsigned n-bytes integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + /// + /// # Panics + /// + /// If the given integer is not representable in the given number of bytes, + /// this method panics. If `nbytes > 8`, this method panics. + #[inline] + fn write_uint( + &mut self, + n: u64, + nbytes: usize, + ) -> Result<()> { + let mut buf = [0; 8]; + T::write_uint(&mut buf, n, nbytes); + self.write_all(&buf[0..nbytes]) + } + + /// Writes a signed n-bytes integer to the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + /// + /// # Panics + /// + /// If the given integer is not representable in the given number of bytes, + /// this method panics. If `nbytes > 8`, this method panics. + #[inline] + fn write_int( + &mut self, + n: i64, + nbytes: usize, + ) -> Result<()> { + let mut buf = [0; 8]; + T::write_int(&mut buf, n, nbytes); + self.write_all(&buf[0..nbytes]) + } + + /// Writes an unsigned n-bytes integer to the underlying writer. + /// + /// If the given integer is not representable in the given number of bytes, + /// this method panics. If `nbytes > 16`, this method panics. + #[cfg(feature = "i128")] + #[inline] + fn write_uint128( + &mut self, + n: u128, + nbytes: usize, + ) -> Result<()> { + let mut buf = [0; 16]; + T::write_uint128(&mut buf, n, nbytes); + self.write_all(&buf[0..nbytes]) + } + + /// Writes a signed n-bytes integer to the underlying writer. + /// + /// If the given integer is not representable in the given number of bytes, + /// this method panics. If `nbytes > 16`, this method panics. + #[cfg(feature = "i128")] + #[inline] + fn write_int128( + &mut self, + n: i128, + nbytes: usize, + ) -> Result<()> { + let mut buf = [0; 16]; + T::write_int128(&mut buf, n, nbytes); + self.write_all(&buf[0..nbytes]) + } + + /// Writes a IEEE754 single-precision (4 bytes) floating point number to + /// the underlying writer. + /// + /// # Errors + /// + /// This method returns the same errors as [`Write::write_all`]. + /// + /// [`Write::write_all`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_all + #[inline] + fn write_f32(&mut self, n: f32) -> Result<()> { + let mut buf = [0; 4]; + T::write_f32(&mut buf, n); + self.write_all(&buf) + } + + /// Writes a IEEE754 double-precision (8 bytes) floating point number to + /// the underlying writer. + #[inline] + fn write_f64(&mut self, n: f64) -> Result<()> { + let mut buf = [0; 8]; + T::write_f64(&mut buf, n); + self.write_all(&buf) + } +} + +/// All types that implement `Write` get methods defined in `WriteBytesExt` +/// for free. +impl WriteBytesExt for W {} + +/// Convert a slice of T (where T is plain old data) to its mutable binary +/// representation. +/// +/// This function is wildly unsafe because it permits arbitrary modification of +/// the binary representation of any `Copy` type. Use with care. +unsafe fn slice_to_u8_mut(slice: &mut [T]) -> &mut [u8] { + use std::mem::size_of; + + let len = size_of::() * slice.len(); + slice::from_raw_parts_mut(slice.as_mut_ptr() as *mut u8, len) +} diff --git a/vendor/registry-40351f815f426200/byteorder/src/lib.rs b/vendor/registry-40351f815f426200/byteorder/src/lib.rs new file mode 100644 index 000000000..0654e88d0 --- /dev/null +++ b/vendor/registry-40351f815f426200/byteorder/src/lib.rs @@ -0,0 +1,3098 @@ +/*! +This crate provides convenience methods for encoding and decoding numbers +in either big-endian or little-endian order. + +The organization of the crate is pretty simple. A trait, `ByteOrder`, specifies +byte conversion methods for each type of number in Rust (sans numbers that have +a platform dependent size like `usize` and `isize`). Two types, `BigEndian` +and `LittleEndian` implement these methods. Finally, `ReadBytesExt` and +`WriteBytesExt` provide convenience methods available to all types that +implement `Read` and `Write`. + +# Examples + +Read unsigned 16 bit big-endian integers from a `Read` type: + +```rust +use std::io::Cursor; +use byteorder::{BigEndian, ReadBytesExt}; + +let mut rdr = Cursor::new(vec![2, 5, 3, 0]); +// Note that we use type parameters to indicate which kind of byte order +// we want! +assert_eq!(517, rdr.read_u16::().unwrap()); +assert_eq!(768, rdr.read_u16::().unwrap()); +``` + +Write unsigned 16 bit little-endian integers to a `Write` type: + +```rust +use byteorder::{LittleEndian, WriteBytesExt}; + +let mut wtr = vec![]; +wtr.write_u16::(517).unwrap(); +wtr.write_u16::(768).unwrap(); +assert_eq!(wtr, vec![5, 2, 0, 3]); +``` +*/ + +#![deny(missing_docs)] +#![cfg_attr(not(feature = "std"), no_std)] +#![cfg_attr(feature = "i128", feature(i128_type))] +#![cfg_attr(all(feature = "i128", test), feature(i128))] +#![doc(html_root_url = "https://docs.rs/byteorder/1.2.1")] + +#[cfg(feature = "std")] +extern crate core; + +use core::fmt::Debug; +use core::hash::Hash; +use core::mem::transmute; +use core::ptr::copy_nonoverlapping; + +#[cfg(feature = "std")] +pub use io::{ReadBytesExt, WriteBytesExt}; + +#[cfg(feature = "std")] +mod io; + +#[inline] +fn extend_sign(val: u64, nbytes: usize) -> i64 { + let shift = (8 - nbytes) * 8; + (val << shift) as i64 >> shift +} + +#[cfg(feature = "i128")] +#[inline] +fn extend_sign128(val: u128, nbytes: usize) -> i128 { + let shift = (16 - nbytes) * 8; + (val << shift) as i128 >> shift +} + +#[inline] +fn unextend_sign(val: i64, nbytes: usize) -> u64 { + let shift = (8 - nbytes) * 8; + (val << shift) as u64 >> shift +} + +#[cfg(feature = "i128")] +#[inline] +fn unextend_sign128(val: i128, nbytes: usize) -> u128 { + let shift = (16 - nbytes) * 8; + (val << shift) as u128 >> shift +} + +#[inline] +fn pack_size(n: u64) -> usize { + if n < 1 << 8 { + 1 + } else if n < 1 << 16 { + 2 + } else if n < 1 << 24 { + 3 + } else if n < 1 << 32 { + 4 + } else if n < 1 << 40 { + 5 + } else if n < 1 << 48 { + 6 + } else if n < 1 << 56 { + 7 + } else { + 8 + } +} + +#[cfg(feature = "i128")] +#[inline] +fn pack_size128(n: u128) -> usize { + if n < 1 << 8 { + 1 + } else if n < 1 << 16 { + 2 + } else if n < 1 << 24 { + 3 + } else if n < 1 << 32 { + 4 + } else if n < 1 << 40 { + 5 + } else if n < 1 << 48 { + 6 + } else if n < 1 << 56 { + 7 + } else if n < 1 << 64 { + 8 + } else if n < 1 << 72 { + 9 + } else if n < 1 << 80 { + 10 + } else if n < 1 << 88 { + 11 + } else if n < 1 << 96 { + 12 + } else if n < 1 << 104 { + 13 + } else if n < 1 << 112 { + 14 + } else if n < 1 << 120 { + 15 + } else { + 16 + } +} + +mod private { + /// Sealed stops crates other than byteorder from implementing any traits + /// that use it. + pub trait Sealed{} + impl Sealed for super::LittleEndian {} + impl Sealed for super::BigEndian {} +} + +/// ByteOrder describes types that can serialize integers as bytes. +/// +/// Note that `Self` does not appear anywhere in this trait's definition! +/// Therefore, in order to use it, you'll need to use syntax like +/// `T::read_u16(&[0, 1])` where `T` implements `ByteOrder`. +/// +/// This crate provides two types that implement `ByteOrder`: `BigEndian` +/// and `LittleEndian`. +/// This trait is sealed and cannot be implemented for callers to avoid +/// breaking backwards compatibility when adding new derived traits. +/// +/// # Examples +/// +/// Write and read `u32` numbers in little endian order: +/// +/// ```rust +/// use byteorder::{ByteOrder, LittleEndian}; +/// +/// let mut buf = [0; 4]; +/// LittleEndian::write_u32(&mut buf, 1_000_000); +/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf)); +/// ``` +/// +/// Write and read `i16` numbers in big endian order: +/// +/// ```rust +/// use byteorder::{ByteOrder, BigEndian}; +/// +/// let mut buf = [0; 2]; +/// BigEndian::write_i16(&mut buf, -50_000); +/// assert_eq!(-50_000, BigEndian::read_i16(&buf)); +/// ``` +pub trait ByteOrder + : Clone + Copy + Debug + Default + Eq + Hash + Ord + PartialEq + PartialOrd + + private::Sealed +{ + /// Reads an unsigned 16 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 2`. + fn read_u16(buf: &[u8]) -> u16; + + /// Reads an unsigned 24 bit integer from `buf`, stored in u32. + /// + /// # Panics + /// + /// Panics when `buf.len() < 3`. + /// + /// # Examples + /// + /// Write and read 24 bit `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_u24(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf)); + /// ``` + fn read_u24(buf: &[u8]) -> u32 { + Self::read_uint(buf, 3) as u32 + } + + /// Reads an unsigned 32 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 4]; + /// LittleEndian::write_u32(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf)); + /// ``` + fn read_u32(buf: &[u8]) -> u32; + + /// Reads an unsigned 64 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `u64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 8]; + /// LittleEndian::write_u64(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf)); + /// ``` + fn read_u64(buf: &[u8]) -> u64; + + /// Reads an unsigned 128 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 16`. + /// + /// # Examples + /// + /// Write and read `u128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 16]; + /// LittleEndian::write_u128(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf)); + /// ``` + #[cfg(feature = "i128")] + fn read_u128(buf: &[u8]) -> u128; + + /// Reads an unsigned n-bytes integer from `buf`. + /// + /// # Panics + /// + /// Panics when `nbytes < 1` or `nbytes > 8` or + /// `buf.len() < nbytes` + /// + /// # Examples + /// + /// Write and read an n-byte number in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_uint(&mut buf, 1_000_000, 3); + /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3)); + /// ``` + fn read_uint(buf: &[u8], nbytes: usize) -> u64; + + /// Reads an unsigned n-bytes integer from `buf`. + /// + /// # Panics + /// + /// Panics when `nbytes < 1` or `nbytes > 16` or + /// `buf.len() < nbytes` + /// + /// # Examples + /// + /// Write and read an n-byte number in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3); + /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3)); + /// ``` + #[cfg(feature = "i128")] + fn read_uint128(buf: &[u8], nbytes: usize) -> u128; + + /// Writes an unsigned 16 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 2`. + /// + /// # Examples + /// + /// Write and read `u16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 2]; + /// LittleEndian::write_u16(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u16(&buf)); + /// ``` + fn write_u16(buf: &mut [u8], n: u16); + + /// Writes an unsigned 24 bit integer `n` to `buf`, stored in u32. + /// + /// # Panics + /// + /// Panics when `buf.len() < 3`. + /// + /// # Examples + /// + /// Write and read 24 bit `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_u24(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u24(&buf)); + /// ``` + fn write_u24(buf: &mut [u8], n: u32) { + Self::write_uint(buf, n as u64, 3) + } + + /// Writes an unsigned 32 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 4]; + /// LittleEndian::write_u32(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u32(&buf)); + /// ``` + fn write_u32(buf: &mut [u8], n: u32); + + /// Writes an unsigned 64 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `u64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 8]; + /// LittleEndian::write_u64(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u64(&buf)); + /// ``` + fn write_u64(buf: &mut [u8], n: u64); + + /// Writes an unsigned 128 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 16`. + /// + /// # Examples + /// + /// Write and read `u128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 16]; + /// LittleEndian::write_u128(&mut buf, 1_000_000); + /// assert_eq!(1_000_000, LittleEndian::read_u128(&buf)); + /// ``` + #[cfg(feature = "i128")] + fn write_u128(buf: &mut [u8], n: u128); + + /// Writes an unsigned integer `n` to `buf` using only `nbytes`. + /// + /// # Panics + /// + /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then + /// this method panics. + /// + /// # Examples + /// + /// Write and read an n-byte number in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_uint(&mut buf, 1_000_000, 3); + /// assert_eq!(1_000_000, LittleEndian::read_uint(&buf, 3)); + /// ``` + fn write_uint(buf: &mut [u8], n: u64, nbytes: usize); + + /// Writes an unsigned integer `n` to `buf` using only `nbytes`. + /// + /// # Panics + /// + /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then + /// this method panics. + /// + /// # Examples + /// + /// Write and read an n-byte number in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_uint128(&mut buf, 1_000_000, 3); + /// assert_eq!(1_000_000, LittleEndian::read_uint128(&buf, 3)); + /// ``` + #[cfg(feature = "i128")] + fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize); + + /// Reads a signed 16 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 2`. + /// + /// # Examples + /// + /// Write and read `i16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 2]; + /// LittleEndian::write_i16(&mut buf, -1_000); + /// assert_eq!(-1_000, LittleEndian::read_i16(&buf)); + /// ``` + #[inline] + fn read_i16(buf: &[u8]) -> i16 { + Self::read_u16(buf) as i16 + } + + /// Reads a signed 24 bit integer from `buf`, stored in i32. + /// + /// # Panics + /// + /// Panics when `buf.len() < 3`. + /// + /// # Examples + /// + /// Write and read 24 bit `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_i24(&mut buf, -1_000_000); + /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf)); + /// ``` + #[inline] + fn read_i24(buf: &[u8]) -> i32 { + Self::read_int(buf, 3) as i32 + } + + /// Reads a signed 32 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 4]; + /// LittleEndian::write_i32(&mut buf, -1_000_000); + /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf)); + /// ``` + #[inline] + fn read_i32(buf: &[u8]) -> i32 { + Self::read_u32(buf) as i32 + } + + /// Reads a signed 64 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `i64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 8]; + /// LittleEndian::write_i64(&mut buf, -1_000_000_000); + /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf)); + /// ``` + #[inline] + fn read_i64(buf: &[u8]) -> i64 { + Self::read_u64(buf) as i64 + } + + /// Reads a signed 128 bit integer from `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 16`. + /// + /// # Examples + /// + /// Write and read `i128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 16]; + /// LittleEndian::write_i128(&mut buf, -1_000_000_000); + /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf)); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_i128(buf: &[u8]) -> i128 { + Self::read_u128(buf) as i128 + } + + /// Reads a signed n-bytes integer from `buf`. + /// + /// # Panics + /// + /// Panics when `nbytes < 1` or `nbytes > 8` or + /// `buf.len() < nbytes` + /// + /// # Examples + /// + /// Write and read n-length signed numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_int(&mut buf, -1_000, 3); + /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3)); + /// ``` + #[inline] + fn read_int(buf: &[u8], nbytes: usize) -> i64 { + extend_sign(Self::read_uint(buf, nbytes), nbytes) + } + + /// Reads a signed n-bytes integer from `buf`. + /// + /// # Panics + /// + /// Panics when `nbytes < 1` or `nbytes > 16` or + /// `buf.len() < nbytes` + /// + /// # Examples + /// + /// Write and read n-length signed numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_int128(&mut buf, -1_000, 3); + /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3)); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_int128(buf: &[u8], nbytes: usize) -> i128 { + extend_sign128(Self::read_uint128(buf, nbytes), nbytes) + } + + /// Reads a IEEE754 single-precision (4 bytes) floating point number. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `f32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let e = 2.71828; + /// let mut buf = [0; 4]; + /// LittleEndian::write_f32(&mut buf, e); + /// assert_eq!(e, LittleEndian::read_f32(&buf)); + /// ``` + #[inline] + fn read_f32(buf: &[u8]) -> f32 { + unsafe { transmute(Self::read_u32(buf)) } + } + + /// Reads a IEEE754 double-precision (8 bytes) floating point number. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `f64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let phi = 1.6180339887; + /// let mut buf = [0; 8]; + /// LittleEndian::write_f64(&mut buf, phi); + /// assert_eq!(phi, LittleEndian::read_f64(&buf)); + /// ``` + #[inline] + fn read_f64(buf: &[u8]) -> f64 { + unsafe { transmute(Self::read_u64(buf)) } + } + + /// Writes a signed 16 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 2`. + /// + /// # Examples + /// + /// Write and read `i16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 2]; + /// LittleEndian::write_i16(&mut buf, -1_000); + /// assert_eq!(-1_000, LittleEndian::read_i16(&buf)); + /// ``` + #[inline] + fn write_i16(buf: &mut [u8], n: i16) { + Self::write_u16(buf, n as u16) + } + + /// Writes a signed 24 bit integer `n` to `buf`, stored in i32. + /// + /// # Panics + /// + /// Panics when `buf.len() < 3`. + /// + /// # Examples + /// + /// Write and read 24 bit `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_i24(&mut buf, -1_000_000); + /// assert_eq!(-1_000_000, LittleEndian::read_i24(&buf)); + /// ``` + #[inline] + fn write_i24(buf: &mut [u8], n: i32) { + Self::write_int(buf, n as i64, 3) + } + + /// Writes a signed 32 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 4]; + /// LittleEndian::write_i32(&mut buf, -1_000_000); + /// assert_eq!(-1_000_000, LittleEndian::read_i32(&buf)); + /// ``` + #[inline] + fn write_i32(buf: &mut [u8], n: i32) { + Self::write_u32(buf, n as u32) + } + + /// Writes a signed 64 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `i64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 8]; + /// LittleEndian::write_i64(&mut buf, -1_000_000_000); + /// assert_eq!(-1_000_000_000, LittleEndian::read_i64(&buf)); + /// ``` + #[inline] + fn write_i64(buf: &mut [u8], n: i64) { + Self::write_u64(buf, n as u64) + } + + /// Writes a signed 128 bit integer `n` to `buf`. + /// + /// # Panics + /// + /// Panics when `buf.len() < 16`. + /// + /// # Examples + /// + /// Write and read n-byte `i128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 16]; + /// LittleEndian::write_i128(&mut buf, -1_000_000_000); + /// assert_eq!(-1_000_000_000, LittleEndian::read_i128(&buf)); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn write_i128(buf: &mut [u8], n: i128) { + Self::write_u128(buf, n as u128) + } + + /// Writes a signed integer `n` to `buf` using only `nbytes`. + /// + /// # Panics + /// + /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 8`, then + /// this method panics. + /// + /// # Examples + /// + /// Write and read an n-byte number in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_int(&mut buf, -1_000, 3); + /// assert_eq!(-1_000, LittleEndian::read_int(&buf, 3)); + /// ``` + #[inline] + fn write_int(buf: &mut [u8], n: i64, nbytes: usize) { + Self::write_uint(buf, unextend_sign(n, nbytes), nbytes) + } + + /// Writes a signed integer `n` to `buf` using only `nbytes`. + /// + /// # Panics + /// + /// If `n` is not representable in `nbytes`, or if `nbytes` is `> 16`, then + /// this method panics. + /// + /// # Examples + /// + /// Write and read n-length signed numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut buf = [0; 3]; + /// LittleEndian::write_int128(&mut buf, -1_000, 3); + /// assert_eq!(-1_000, LittleEndian::read_int128(&buf, 3)); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn write_int128(buf: &mut [u8], n: i128, nbytes: usize) { + Self::write_uint128(buf, unextend_sign128(n, nbytes), nbytes) + } + + /// Writes a IEEE754 single-precision (4 bytes) floating point number. + /// + /// # Panics + /// + /// Panics when `buf.len() < 4`. + /// + /// # Examples + /// + /// Write and read `f32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let e = 2.71828; + /// let mut buf = [0; 4]; + /// LittleEndian::write_f32(&mut buf, e); + /// assert_eq!(e, LittleEndian::read_f32(&buf)); + /// ``` + #[inline] + fn write_f32(buf: &mut [u8], n: f32) { + Self::write_u32(buf, unsafe { transmute(n) }) + } + + /// Writes a IEEE754 double-precision (8 bytes) floating point number. + /// + /// # Panics + /// + /// Panics when `buf.len() < 8`. + /// + /// # Examples + /// + /// Write and read `f64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let phi = 1.6180339887; + /// let mut buf = [0; 8]; + /// LittleEndian::write_f64(&mut buf, phi); + /// assert_eq!(phi, LittleEndian::read_f64(&buf)); + /// ``` + #[inline] + fn write_f64(buf: &mut [u8], n: f64) { + Self::write_u64(buf, unsafe { transmute(n) }) + } + + /// Reads unsigned 16 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 2*dst.len()`. + /// + /// # Examples + /// + /// Write and read `u16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 8]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u16_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u16_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn read_u16_into(src: &[u8], dst: &mut [u16]); + + /// Reads unsigned 32 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 4*dst.len()`. + /// + /// # Examples + /// + /// Write and read `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u32_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn read_u32_into(src: &[u8], dst: &mut [u32]); + + /// Reads unsigned 64 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 8*dst.len()`. + /// + /// # Examples + /// + /// Write and read `u64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u64_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn read_u64_into(src: &[u8], dst: &mut [u64]); + + /// Reads unsigned 128 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 16*dst.len()`. + /// + /// # Examples + /// + /// Write and read `u128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 64]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u128_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u128_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[cfg(feature = "i128")] + fn read_u128_into(src: &[u8], dst: &mut [u128]); + + /// Reads signed 16 bit integers from `src` to `dst`. + /// + /// # Panics + /// + /// Panics when `buf.len() != 2*dst.len()`. + /// + /// # Examples + /// + /// Write and read `i16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 8]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i16_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i16_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[inline] + fn read_i16_into(src: &[u8], dst: &mut [i16]) { + Self::read_u16_into(src, unsafe { transmute(dst) }); + } + + /// Reads signed 32 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 4*dst.len()`. + /// + /// # Examples + /// + /// Write and read `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i32_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[inline] + fn read_i32_into(src: &[u8], dst: &mut [i32]) { + Self::read_u32_into(src, unsafe { transmute(dst) }); + } + + /// Reads signed 64 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 8*dst.len()`. + /// + /// # Examples + /// + /// Write and read `i64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i64_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[inline] + fn read_i64_into(src: &[u8], dst: &mut [i64]) { + Self::read_u64_into(src, unsafe { transmute(dst) }); + } + + /// Reads signed 128 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 16*dst.len()`. + /// + /// # Examples + /// + /// Write and read `i128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 64]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i128_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i128_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn read_i128_into(src: &[u8], dst: &mut [i128]) { + Self::read_u128_into(src, unsafe { transmute(dst) }); + } + + /// Reads IEEE754 single-precision (4 bytes) floating point numbers from + /// `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 4*dst.len()`. + /// + /// # Examples + /// + /// Write and read `f32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91]; + /// LittleEndian::write_f32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0.0; 4]; + /// LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[inline] + fn read_f32_into_unchecked(src: &[u8], dst: &mut [f32]) { + Self::read_u32_into(src, unsafe { transmute(dst) }); + } + + /// Reads IEEE754 single-precision (4 bytes) floating point numbers from + /// `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 8*dst.len()`. + /// + /// # Examples + /// + /// Write and read `f64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91]; + /// LittleEndian::write_f64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0.0; 4]; + /// LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[inline] + fn read_f64_into_unchecked(src: &[u8], dst: &mut [f64]) { + Self::read_u64_into(src, unsafe { transmute(dst) }); + } + + /// Writes unsigned 16 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 2*src.len()`. + /// + /// # Examples + /// + /// Write and read `u16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 8]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u16_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u16_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_u16_into(src: &[u16], dst: &mut [u8]); + + /// Writes unsigned 32 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 4*src.len()`. + /// + /// # Examples + /// + /// Write and read `u32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u32_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_u32_into(src: &[u32], dst: &mut [u8]); + + /// Writes unsigned 64 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 8*src.len()`. + /// + /// # Examples + /// + /// Write and read `u64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u64_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_u64_into(src: &[u64], dst: &mut [u8]); + + /// Writes unsigned 128 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 16*src.len()`. + /// + /// # Examples + /// + /// Write and read `u128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 64]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_u128_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_u128_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[cfg(feature = "i128")] + fn write_u128_into(src: &[u128], dst: &mut [u8]); + + /// Writes signed 16 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `buf.len() != 2*src.len()`. + /// + /// # Examples + /// + /// Write and read `i16` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 8]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i16_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i16_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_i16_into(src: &[i16], dst: &mut [u8]) { + Self::write_u16_into(unsafe { transmute(src) }, dst); + } + + /// Writes signed 32 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 4*src.len()`. + /// + /// # Examples + /// + /// Write and read `i32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i32_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_i32_into(src: &[i32], dst: &mut [u8]) { + Self::write_u32_into(unsafe { transmute(src) }, dst); + } + + /// Writes signed 64 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 8*src.len()`. + /// + /// # Examples + /// + /// Write and read `i64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i64_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_i64_into(src: &[i64], dst: &mut [u8]) { + Self::write_u64_into(unsafe { transmute(src) }, dst); + } + + /// Writes signed 128 bit integers from `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `dst.len() != 16*src.len()`. + /// + /// # Examples + /// + /// Write and read `i128` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 64]; + /// let numbers_given = [1, 2, 0xf00f, 0xffee]; + /// LittleEndian::write_i128_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0; 4]; + /// LittleEndian::read_i128_into(&bytes, &mut numbers_got); + /// assert_eq!(numbers_given, numbers_got); + /// ``` + #[cfg(feature = "i128")] + fn write_i128_into(src: &[i128], dst: &mut [u8]) { + Self::write_u128_into(unsafe { transmute(src) }, dst); + } + + /// Writes IEEE754 single-precision (4 bytes) floating point numbers from + /// `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 4*dst.len()`. + /// + /// # Examples + /// + /// Write and read `f32` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 16]; + /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91]; + /// LittleEndian::write_f32_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0.0; 4]; + /// unsafe { + /// LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got); + /// } + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_f32_into(src: &[f32], dst: &mut [u8]) { + Self::write_u32_into(unsafe { transmute(src) }, dst); + } + + /// Writes IEEE754 double-precision (8 bytes) floating point numbers from + /// `src` into `dst`. + /// + /// # Panics + /// + /// Panics when `src.len() != 8*dst.len()`. + /// + /// # Examples + /// + /// Write and read `f64` numbers in little endian order: + /// + /// ```rust + /// use byteorder::{ByteOrder, LittleEndian}; + /// + /// let mut bytes = [0; 32]; + /// let numbers_given = [1.0, 2.0, 31.312e311, -11.32e91]; + /// LittleEndian::write_f64_into(&numbers_given, &mut bytes); + /// + /// let mut numbers_got = [0.0; 4]; + /// unsafe { + /// LittleEndian::read_f64_into_unchecked(&bytes, &mut numbers_got); + /// } + /// assert_eq!(numbers_given, numbers_got); + /// ``` + fn write_f64_into(src: &[f64], dst: &mut [u8]) { + Self::write_u64_into(unsafe { transmute(src) }, dst); + } + + /// Converts the given slice of unsigned 16 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_u16(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5u16.swap_bytes(), 65000u16.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + fn from_slice_u16(numbers: &mut [u16]); + + /// Converts the given slice of unsigned 32 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_u32(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5u32.swap_bytes(), 65000u32.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + fn from_slice_u32(numbers: &mut [u32]); + + /// Converts the given slice of unsigned 64 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_u64(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5u64.swap_bytes(), 65000u64.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + fn from_slice_u64(numbers: &mut [u64]); + + /// Converts the given slice of unsigned 128 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// #![feature(i128_type)] + /// + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_u128(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5u128.swap_bytes(), 65000u128.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + #[cfg(feature = "i128")] + fn from_slice_u128(numbers: &mut [u128]); + + /// Converts the given slice of signed 16 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_i16(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5i16.swap_bytes(), 65000i16.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + #[inline] + fn from_slice_i16(numbers: &mut [i16]) { + Self::from_slice_u16(unsafe { transmute(numbers) }); + } + + /// Converts the given slice of signed 32 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_i32(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5i32.swap_bytes(), 65000i32.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + #[inline] + fn from_slice_i32(numbers: &mut [i32]) { + Self::from_slice_u32(unsafe { transmute(numbers) }); + } + + /// Converts the given slice of signed 64 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_i64(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5i64.swap_bytes(), 65000i64.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + #[inline] + fn from_slice_i64(numbers: &mut [i64]) { + Self::from_slice_u64(unsafe { transmute(numbers) }); + } + + /// Converts the given slice of signed 128 bit integers to a particular + /// endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + /// + /// # Examples + /// + /// Convert the host platform's endianness to big-endian: + /// + /// ```rust + /// #![feature(i128_type)] + /// + /// use byteorder::{ByteOrder, BigEndian}; + /// + /// let mut numbers = [5, 65000]; + /// BigEndian::from_slice_i128(&mut numbers); + /// if cfg!(target_endian = "little") { + /// assert_eq!(numbers, [5i128.swap_bytes(), 65000i128.swap_bytes()]); + /// } else { + /// assert_eq!(numbers, [5, 65000]); + /// } + /// ``` + #[cfg(feature = "i128")] + #[inline] + fn from_slice_i128(numbers: &mut [i128]) { + Self::from_slice_u128(unsafe { transmute(numbers) }); + } + + /// Converts the given slice of IEEE754 single-precision (4 bytes) floating + /// point numbers to a particular endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + fn from_slice_f32(numbers: &mut [f32]); + + /// Converts the given slice of IEEE754 double-precision (8 bytes) floating + /// point numbers to a particular endianness. + /// + /// If the endianness matches the endianness of the host platform, then + /// this is a no-op. + fn from_slice_f64(numbers: &mut [f64]); +} + +/// Defines big-endian serialization. +/// +/// Note that this type has no value constructor. It is used purely at the +/// type level. +/// +/// # Examples +/// +/// Write and read `u32` numbers in big endian order: +/// +/// ```rust +/// use byteorder::{ByteOrder, BigEndian}; +/// +/// let mut buf = [0; 4]; +/// BigEndian::write_u32(&mut buf, 1_000_000); +/// assert_eq!(1_000_000, BigEndian::read_u32(&buf)); +/// ``` +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub enum BigEndian {} + +impl Default for BigEndian { + fn default() -> BigEndian { + panic!("BigEndian default") + } +} + +/// A type alias for `BigEndian`. +pub type BE = BigEndian; + +/// Defines little-endian serialization. +/// +/// Note that this type has no value constructor. It is used purely at the +/// type level. +/// +/// # Examples +/// +/// Write and read `u32` numbers in little endian order: +/// +/// ```rust +/// use byteorder::{ByteOrder, LittleEndian}; +/// +/// let mut buf = [0; 4]; +/// LittleEndian::write_u32(&mut buf, 1_000_000); +/// assert_eq!(1_000_000, LittleEndian::read_u32(&buf)); +/// ``` +#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +pub enum LittleEndian {} + +impl Default for LittleEndian { + fn default() -> LittleEndian { + panic!("LittleEndian default") + } +} + +/// A type alias for `LittleEndian`. +pub type LE = LittleEndian; + +/// Defines network byte order serialization. +/// +/// Network byte order is defined by [RFC 1700][1] to be big-endian, and is +/// referred to in several protocol specifications. This type is an alias of +/// BigEndian. +/// +/// [1]: https://tools.ietf.org/html/rfc1700 +/// +/// Note that this type has no value constructor. It is used purely at the +/// type level. +/// +/// # Examples +/// +/// Write and read `i16` numbers in big endian order: +/// +/// ```rust +/// use byteorder::{ByteOrder, NetworkEndian, BigEndian}; +/// +/// let mut buf = [0; 2]; +/// BigEndian::write_i16(&mut buf, -50_000); +/// assert_eq!(-50_000, NetworkEndian::read_i16(&buf)); +/// ``` +pub type NetworkEndian = BigEndian; + +/// Defines system native-endian serialization. +/// +/// Note that this type has no value constructor. It is used purely at the +/// type level. +#[cfg(target_endian = "little")] +pub type NativeEndian = LittleEndian; + +/// Defines system native-endian serialization. +/// +/// Note that this type has no value constructor. It is used purely at the +/// type level. +#[cfg(target_endian = "big")] +pub type NativeEndian = BigEndian; + +macro_rules! read_num_bytes { + ($ty:ty, $size:expr, $src:expr, $which:ident) => ({ + assert!($size == ::core::mem::size_of::<$ty>()); + assert!($size <= $src.len()); + let mut data: $ty = 0; + unsafe { + copy_nonoverlapping( + $src.as_ptr(), + &mut data as *mut $ty as *mut u8, + $size); + } + data.$which() + }); +} + +macro_rules! write_num_bytes { + ($ty:ty, $size:expr, $n:expr, $dst:expr, $which:ident) => ({ + assert!($size <= $dst.len()); + unsafe { + // N.B. https://github.com/rust-lang/rust/issues/22776 + let bytes = transmute::<_, [u8; $size]>($n.$which()); + copy_nonoverlapping((&bytes).as_ptr(), $dst.as_mut_ptr(), $size); + } + }); +} + +macro_rules! read_slice { + ($src:expr, $dst:expr, $size:expr, $which:ident) => {{ + assert_eq!($src.len(), $size * $dst.len()); + + unsafe { + copy_nonoverlapping( + $src.as_ptr(), + $dst.as_mut_ptr() as *mut u8, + $src.len()); + } + for v in $dst.iter_mut() { + *v = v.$which(); + } + }}; +} + +macro_rules! write_slice_native { + ($src:expr, $dst:expr, $ty:ty, $size:expr) => {{ + assert!($size == ::core::mem::size_of::<$ty>()); + assert_eq!($size * $src.len(), $dst.len()); + + unsafe { + copy_nonoverlapping( + $src.as_ptr() as *const u8, + $dst.as_mut_ptr(), + $dst.len()); + } + }}; +} + +macro_rules! write_slice { + ($src:expr, $dst:expr, $ty:ty, $size:expr, $write:expr) => ({ + assert!($size == ::core::mem::size_of::<$ty>()); + assert_eq!($size * $src.len(), $dst.len()); + + for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) { + $write(chunk, n); + } + }); +} + +impl ByteOrder for BigEndian { + #[inline] + fn read_u16(buf: &[u8]) -> u16 { + read_num_bytes!(u16, 2, buf, to_be) + } + + #[inline] + fn read_u32(buf: &[u8]) -> u32 { + read_num_bytes!(u32, 4, buf, to_be) + } + + #[inline] + fn read_u64(buf: &[u8]) -> u64 { + read_num_bytes!(u64, 8, buf, to_be) + } + + #[cfg(feature = "i128")] + #[inline] + fn read_u128(buf: &[u8]) -> u128 { + read_num_bytes!(u128, 16, buf, to_be) + } + + #[inline] + fn read_uint(buf: &[u8], nbytes: usize) -> u64 { + assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len()); + let mut out = [0u8; 8]; + let ptr_out = out.as_mut_ptr(); + unsafe { + copy_nonoverlapping( + buf.as_ptr(), ptr_out.offset((8 - nbytes) as isize), nbytes); + (*(ptr_out as *const u64)).to_be() + } + } + + #[cfg(feature = "i128")] + #[inline] + fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { + assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); + let mut out = [0u8; 16]; + let ptr_out = out.as_mut_ptr(); + unsafe { + copy_nonoverlapping( + buf.as_ptr(), ptr_out.offset((16 - nbytes) as isize), nbytes); + (*(ptr_out as *const u128)).to_be() + } + } + + #[inline] + fn write_u16(buf: &mut [u8], n: u16) { + write_num_bytes!(u16, 2, n, buf, to_be); + } + + #[inline] + fn write_u32(buf: &mut [u8], n: u32) { + write_num_bytes!(u32, 4, n, buf, to_be); + } + + #[inline] + fn write_u64(buf: &mut [u8], n: u64) { + write_num_bytes!(u64, 8, n, buf, to_be); + } + + #[cfg(feature = "i128")] + #[inline] + fn write_u128(buf: &mut [u8], n: u128) { + write_num_bytes!(u128, 16, n, buf, to_be); + } + + #[inline] + fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) { + assert!(pack_size(n) <= nbytes && nbytes <= 8); + assert!(nbytes <= buf.len()); + unsafe { + let bytes: [u8; 8] = transmute(n.to_be()); + copy_nonoverlapping( + bytes.as_ptr().offset((8 - nbytes) as isize), + buf.as_mut_ptr(), + nbytes); + } + } + + #[cfg(feature = "i128")] + #[inline] + fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) { + assert!(pack_size128(n) <= nbytes && nbytes <= 16); + assert!(nbytes <= buf.len()); + unsafe { + let bytes: [u8; 16] = transmute(n.to_be()); + copy_nonoverlapping( + bytes.as_ptr().offset((16 - nbytes) as isize), + buf.as_mut_ptr(), + nbytes); + } + } + + #[inline] + fn read_u16_into(src: &[u8], dst: &mut [u16]) { + read_slice!(src, dst, 2, to_be); + } + + #[inline] + fn read_u32_into(src: &[u8], dst: &mut [u32]) { + read_slice!(src, dst, 4, to_be); + } + + #[inline] + fn read_u64_into(src: &[u8], dst: &mut [u64]) { + read_slice!(src, dst, 8, to_be); + } + + #[cfg(feature = "i128")] + #[inline] + fn read_u128_into(src: &[u8], dst: &mut [u128]) { + read_slice!(src, dst, 16, to_be); + } + + #[inline] + fn write_u16_into(src: &[u16], dst: &mut [u8]) { + if cfg!(target_endian = "big") { + write_slice_native!(src, dst, u16, 2); + } else { + write_slice!(src, dst, u16, 2, Self::write_u16); + } + } + + #[inline] + fn write_u32_into(src: &[u32], dst: &mut [u8]) { + if cfg!(target_endian = "big") { + write_slice_native!(src, dst, u32, 4); + } else { + write_slice!(src, dst, u32, 4, Self::write_u32); + } + } + + #[inline] + fn write_u64_into(src: &[u64], dst: &mut [u8]) { + if cfg!(target_endian = "big") { + write_slice_native!(src, dst, u64, 8); + } else { + write_slice!(src, dst, u64, 8, Self::write_u64); + } + } + + #[cfg(feature = "i128")] + #[inline] + fn write_u128_into(src: &[u128], dst: &mut [u8]) { + if cfg!(target_endian = "big") { + write_slice_native!(src, dst, u128, 16); + } else { + write_slice!(src, dst, u128, 16, Self::write_u128); + } + } + + #[inline] + fn from_slice_u16(numbers: &mut [u16]) { + if cfg!(target_endian = "little") { + for n in numbers { + *n = n.to_be(); + } + } + } + + #[inline] + fn from_slice_u32(numbers: &mut [u32]) { + if cfg!(target_endian = "little") { + for n in numbers { + *n = n.to_be(); + } + } + } + + #[inline] + fn from_slice_u64(numbers: &mut [u64]) { + if cfg!(target_endian = "little") { + for n in numbers { + *n = n.to_be(); + } + } + } + + #[cfg(feature = "i128")] + #[inline] + fn from_slice_u128(numbers: &mut [u128]) { + if cfg!(target_endian = "little") { + for n in numbers { + *n = n.to_be(); + } + } + } + + #[inline] + fn from_slice_f32(numbers: &mut [f32]) { + if cfg!(target_endian = "little") { + for n in numbers { + let int: u32 = unsafe { transmute(*n) }; + *n = unsafe { transmute(int.to_be()) }; + } + } + } + + #[inline] + fn from_slice_f64(numbers: &mut [f64]) { + if cfg!(target_endian = "little") { + for n in numbers { + let int: u64 = unsafe { transmute(*n) }; + *n = unsafe { transmute(int.to_be()) }; + } + } + } +} + +impl ByteOrder for LittleEndian { + #[inline] + fn read_u16(buf: &[u8]) -> u16 { + read_num_bytes!(u16, 2, buf, to_le) + } + + #[inline] + fn read_u32(buf: &[u8]) -> u32 { + read_num_bytes!(u32, 4, buf, to_le) + } + + #[inline] + fn read_u64(buf: &[u8]) -> u64 { + read_num_bytes!(u64, 8, buf, to_le) + } + + #[cfg(feature = "i128")] + #[inline] + fn read_u128(buf: &[u8]) -> u128 { + read_num_bytes!(u128, 16, buf, to_le) + } + + #[inline] + fn read_uint(buf: &[u8], nbytes: usize) -> u64 { + assert!(1 <= nbytes && nbytes <= 8 && nbytes <= buf.len()); + let mut out = [0u8; 8]; + let ptr_out = out.as_mut_ptr(); + unsafe { + copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes); + (*(ptr_out as *const u64)).to_le() + } + } + + #[cfg(feature = "i128")] + #[inline] + fn read_uint128(buf: &[u8], nbytes: usize) -> u128 { + assert!(1 <= nbytes && nbytes <= 16 && nbytes <= buf.len()); + let mut out = [0u8; 16]; + let ptr_out = out.as_mut_ptr(); + unsafe { + copy_nonoverlapping(buf.as_ptr(), ptr_out, nbytes); + (*(ptr_out as *const u128)).to_le() + } + } + + #[inline] + fn write_u16(buf: &mut [u8], n: u16) { + write_num_bytes!(u16, 2, n, buf, to_le); + } + + #[inline] + fn write_u32(buf: &mut [u8], n: u32) { + write_num_bytes!(u32, 4, n, buf, to_le); + } + + #[inline] + fn write_u64(buf: &mut [u8], n: u64) { + write_num_bytes!(u64, 8, n, buf, to_le); + } + + #[cfg(feature = "i128")] + #[inline] + fn write_u128(buf: &mut [u8], n: u128) { + write_num_bytes!(u128, 16, n, buf, to_le); + } + + #[inline] + fn write_uint(buf: &mut [u8], n: u64, nbytes: usize) { + assert!(pack_size(n as u64) <= nbytes && nbytes <= 8); + assert!(nbytes <= buf.len()); + unsafe { + let bytes: [u8; 8] = transmute(n.to_le()); + copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes); + } + } + + #[cfg(feature = "i128")] + #[inline] + fn write_uint128(buf: &mut [u8], n: u128, nbytes: usize) { + assert!(pack_size128(n as u128) <= nbytes && nbytes <= 16); + assert!(nbytes <= buf.len()); + unsafe { + let bytes: [u8; 16] = transmute(n.to_le()); + copy_nonoverlapping(bytes.as_ptr(), buf.as_mut_ptr(), nbytes); + } + } + + #[inline] + fn read_u16_into(src: &[u8], dst: &mut [u16]) { + read_slice!(src, dst, 2, to_le); + } + + #[inline] + fn read_u32_into(src: &[u8], dst: &mut [u32]) { + read_slice!(src, dst, 4, to_le); + } + + #[inline] + fn read_u64_into(src: &[u8], dst: &mut [u64]) { + read_slice!(src, dst, 8, to_le); + } + + #[cfg(feature = "i128")] + #[inline] + fn read_u128_into(src: &[u8], dst: &mut [u128]) { + read_slice!(src, dst, 16, to_le); + } + + #[inline] + fn write_u16_into(src: &[u16], dst: &mut [u8]) { + if cfg!(target_endian = "little") { + write_slice_native!(src, dst, u16, 2); + } else { + write_slice!(src, dst, u16, 2, Self::write_u16); + } + } + + #[inline] + fn write_u32_into(src: &[u32], dst: &mut [u8]) { + if cfg!(target_endian = "little") { + write_slice_native!(src, dst, u32, 4); + } else { + write_slice!(src, dst, u32, 4, Self::write_u32); + } + } + + #[inline] + fn write_u64_into(src: &[u64], dst: &mut [u8]) { + if cfg!(target_endian = "little") { + write_slice_native!(src, dst, u64, 8); + } else { + write_slice!(src, dst, u64, 8, Self::write_u64); + } + } + + #[cfg(feature = "i128")] + #[inline] + fn write_u128_into(src: &[u128], dst: &mut [u8]) { + if cfg!(target_endian = "little") { + write_slice_native!(src, dst, u128, 16); + } else { + write_slice!(src, dst, u128, 16, Self::write_u128); + } + } + + #[inline] + fn from_slice_u16(numbers: &mut [u16]) { + if cfg!(target_endian = "big") { + for n in numbers { + *n = n.to_le(); + } + } + } + + #[inline] + fn from_slice_u32(numbers: &mut [u32]) { + if cfg!(target_endian = "big") { + for n in numbers { + *n = n.to_le(); + } + } + } + + #[inline] + fn from_slice_u64(numbers: &mut [u64]) { + if cfg!(target_endian = "big") { + for n in numbers { + *n = n.to_le(); + } + } + } + + #[cfg(feature = "i128")] + #[inline] + fn from_slice_u128(numbers: &mut [u128]) { + if cfg!(target_endian = "big") { + for n in numbers { + *n = n.to_le(); + } + } + } + + #[inline] + fn from_slice_f32(numbers: &mut [f32]) { + if cfg!(target_endian = "big") { + for n in numbers { + let int: u32 = unsafe { transmute(*n) }; + *n = unsafe { transmute(int.to_le()) }; + } + } + } + + #[inline] + fn from_slice_f64(numbers: &mut [f64]) { + if cfg!(target_endian = "big") { + for n in numbers { + let int: u64 = unsafe { transmute(*n) }; + *n = unsafe { transmute(int.to_le()) }; + } + } + } +} + +#[cfg(test)] +mod test { + extern crate quickcheck; + extern crate rand; + + use self::quickcheck::{QuickCheck, StdGen, Testable}; + use self::rand::thread_rng; + #[cfg(feature = "i128")] use self::quickcheck::{Arbitrary, Gen}; + + pub const U24_MAX: u32 = 16_777_215; + pub const I24_MAX: i32 = 8_388_607; + + pub const U64_MAX: u64 = ::core::u64::MAX; + pub const I64_MAX: u64 = ::core::i64::MAX as u64; + + macro_rules! calc_max { + ($max:expr, $bytes:expr) => { calc_max!($max, $bytes, 8) }; + ($max:expr, $bytes:expr, $maxbytes:expr) => { + ($max - 1) >> (8 * ($maxbytes - $bytes)) + }; + } + + #[derive(Clone, Debug)] + pub struct Wi128(pub T); + + #[cfg(feature = "i128")] + impl Wi128 { + pub fn clone(&self) -> T { + self.0.clone() + } + } + + impl PartialEq for Wi128 { + fn eq(&self, other: &T) -> bool { + self.0.eq(other) + } + } + + #[cfg(feature = "i128")] + impl Arbitrary for Wi128 { + fn arbitrary(gen: &mut G) -> Wi128 { + let max = calc_max!(::core::u128::MAX, gen.size(), 16); + let output = + (gen.gen::() as u128) | + ((gen.gen::() as u128) << 64); + Wi128(output & (max - 1)) + } + } + + #[cfg(feature = "i128")] + impl Arbitrary for Wi128 { + fn arbitrary(gen: &mut G) -> Wi128 { + let max = calc_max!(::core::i128::MAX, gen.size(), 16); + let output = + (gen.gen::() as i128) | + ((gen.gen::() as i128) << 64); + Wi128(output & (max - 1)) + } + } + + pub fn qc_sized(f: A, size: u64) { + QuickCheck::new() + .gen(StdGen::new(thread_rng(), size as usize)) + .tests(1_00) + .max_tests(10_000) + .quickcheck(f); + } + + macro_rules! qc_byte_order { + ($name:ident, $ty_int:ty, $max:expr, + $bytes:expr, $read:ident, $write:ident) => ( + mod $name { + use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + #[allow(unused_imports)] use super::{ qc_sized, Wi128 }; + + #[test] + fn big_endian() { + fn prop(n: $ty_int) -> bool { + let mut buf = [0; 16]; + BigEndian::$write(&mut buf, n.clone(), $bytes); + n == BigEndian::$read(&mut buf[..$bytes], $bytes) + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + + #[test] + fn little_endian() { + fn prop(n: $ty_int) -> bool { + let mut buf = [0; 16]; + LittleEndian::$write(&mut buf, n.clone(), $bytes); + n == LittleEndian::$read(&mut buf[..$bytes], $bytes) + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + + #[test] + fn native_endian() { + fn prop(n: $ty_int) -> bool { + let mut buf = [0; 16]; + NativeEndian::$write(&mut buf, n.clone(), $bytes); + n == NativeEndian::$read(&mut buf[..$bytes], $bytes) + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + } + ); + ($name:ident, $ty_int:ty, $max:expr, + $read:ident, $write:ident) => ( + mod $name { + use core::mem::size_of; + use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + #[allow(unused_imports)] use super::{ qc_sized, Wi128 }; + + #[test] + fn big_endian() { + fn prop(n: $ty_int) -> bool { + let bytes = size_of::<$ty_int>(); + let mut buf = [0; 16]; + BigEndian::$write(&mut buf[16 - bytes..], n.clone()); + n == BigEndian::$read(&mut buf[16 - bytes..]) + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + + #[test] + fn little_endian() { + fn prop(n: $ty_int) -> bool { + let bytes = size_of::<$ty_int>(); + let mut buf = [0; 16]; + LittleEndian::$write(&mut buf[..bytes], n.clone()); + n == LittleEndian::$read(&mut buf[..bytes]) + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + + #[test] + fn native_endian() { + fn prop(n: $ty_int) -> bool { + let bytes = size_of::<$ty_int>(); + let mut buf = [0; 16]; + NativeEndian::$write(&mut buf[..bytes], n.clone()); + n == NativeEndian::$read(&mut buf[..bytes]) + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + } + ); + } + + qc_byte_order!(prop_u16, u16, ::core::u16::MAX as u64, read_u16, write_u16); + qc_byte_order!(prop_i16, i16, ::core::i16::MAX as u64, read_i16, write_i16); + qc_byte_order!(prop_u24, u32, ::test::U24_MAX as u64, read_u24, write_u24); + qc_byte_order!(prop_i24, i32, ::test::I24_MAX as u64, read_i24, write_i24); + qc_byte_order!(prop_u32, u32, ::core::u32::MAX as u64, read_u32, write_u32); + qc_byte_order!(prop_i32, i32, ::core::i32::MAX as u64, read_i32, write_i32); + qc_byte_order!(prop_u64, u64, ::core::u64::MAX as u64, read_u64, write_u64); + qc_byte_order!(prop_i64, i64, ::core::i64::MAX as u64, read_i64, write_i64); + qc_byte_order!(prop_f32, f32, ::core::u64::MAX as u64, read_f32, write_f32); + qc_byte_order!(prop_f64, f64, ::core::i64::MAX as u64, read_f64, write_f64); + + #[cfg(feature = "i128")] + qc_byte_order!(prop_u128, Wi128, 16 + 1, read_u128, write_u128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_i128, Wi128, 16 + 1, read_i128, write_i128); + + qc_byte_order!(prop_uint_1, + u64, calc_max!(super::U64_MAX, 1), 1, read_uint, write_uint); + qc_byte_order!(prop_uint_2, + u64, calc_max!(super::U64_MAX, 2), 2, read_uint, write_uint); + qc_byte_order!(prop_uint_3, + u64, calc_max!(super::U64_MAX, 3), 3, read_uint, write_uint); + qc_byte_order!(prop_uint_4, + u64, calc_max!(super::U64_MAX, 4), 4, read_uint, write_uint); + qc_byte_order!(prop_uint_5, + u64, calc_max!(super::U64_MAX, 5), 5, read_uint, write_uint); + qc_byte_order!(prop_uint_6, + u64, calc_max!(super::U64_MAX, 6), 6, read_uint, write_uint); + qc_byte_order!(prop_uint_7, + u64, calc_max!(super::U64_MAX, 7), 7, read_uint, write_uint); + qc_byte_order!(prop_uint_8, + u64, calc_max!(super::U64_MAX, 8), 8, read_uint, write_uint); + + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_1, + Wi128, 1, 1, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_2, + Wi128, 2, 2, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_3, + Wi128, 3, 3, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_4, + Wi128, 4, 4, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_5, + Wi128, 5, 5, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_6, + Wi128, 6, 6, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_7, + Wi128, 7, 7, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_8, + Wi128, 8, 8, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_9, + Wi128, 9, 9, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_10, + Wi128, 10, 10, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_11, + Wi128, 11, 11, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_12, + Wi128, 12, 12, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_13, + Wi128, 13, 13, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_14, + Wi128, 14, 14, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_15, + Wi128, 15, 15, read_uint128, write_uint128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_uint128_16, + Wi128, 16, 16, read_uint128, write_uint128); + + qc_byte_order!(prop_int_1, + i64, calc_max!(super::I64_MAX, 1), 1, read_int, write_int); + qc_byte_order!(prop_int_2, + i64, calc_max!(super::I64_MAX, 2), 2, read_int, write_int); + qc_byte_order!(prop_int_3, + i64, calc_max!(super::I64_MAX, 3), 3, read_int, write_int); + qc_byte_order!(prop_int_4, + i64, calc_max!(super::I64_MAX, 4), 4, read_int, write_int); + qc_byte_order!(prop_int_5, + i64, calc_max!(super::I64_MAX, 5), 5, read_int, write_int); + qc_byte_order!(prop_int_6, + i64, calc_max!(super::I64_MAX, 6), 6, read_int, write_int); + qc_byte_order!(prop_int_7, + i64, calc_max!(super::I64_MAX, 7), 7, read_int, write_int); + qc_byte_order!(prop_int_8, + i64, calc_max!(super::I64_MAX, 8), 8, read_int, write_int); + + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_1, + Wi128, 1, 1, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_2, + Wi128, 2, 2, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_3, + Wi128, 3, 3, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_4, + Wi128, 4, 4, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_5, + Wi128, 5, 5, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_6, + Wi128, 6, 6, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_7, + Wi128, 7, 7, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_8, + Wi128, 8, 8, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_9, + Wi128, 9, 9, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_10, + Wi128, 10, 10, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_11, + Wi128, 11, 11, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_12, + Wi128, 12, 12, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_13, + Wi128, 13, 13, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_14, + Wi128, 14, 14, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_15, + Wi128, 15, 15, read_int128, write_int128); + #[cfg(feature = "i128")] + qc_byte_order!(prop_int128_16, + Wi128, 16, 16, read_int128, write_int128); + + + // Test that all of the byte conversion functions panic when given a + // buffer that is too small. + // + // These tests are critical to ensure safety, otherwise we might end up + // with a buffer overflow. + macro_rules! too_small { + ($name:ident, $maximally_small:expr, $zero:expr, + $read:ident, $write:ident) => ( + mod $name { + use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + + #[test] + #[should_panic] + fn read_big_endian() { + let buf = [0; $maximally_small]; + BigEndian::$read(&buf); + } + + #[test] + #[should_panic] + fn read_little_endian() { + let buf = [0; $maximally_small]; + LittleEndian::$read(&buf); + } + + #[test] + #[should_panic] + fn read_native_endian() { + let buf = [0; $maximally_small]; + NativeEndian::$read(&buf); + } + + #[test] + #[should_panic] + fn write_big_endian() { + let mut buf = [0; $maximally_small]; + BigEndian::$write(&mut buf, $zero); + } + + #[test] + #[should_panic] + fn write_little_endian() { + let mut buf = [0; $maximally_small]; + LittleEndian::$write(&mut buf, $zero); + } + + #[test] + #[should_panic] + fn write_native_endian() { + let mut buf = [0; $maximally_small]; + NativeEndian::$write(&mut buf, $zero); + } + } + ); + ($name:ident, $maximally_small:expr, $read:ident) => ( + mod $name { + use {BigEndian, ByteOrder, NativeEndian, LittleEndian}; + + #[test] + #[should_panic] + fn read_big_endian() { + let buf = [0; $maximally_small]; + BigEndian::$read(&buf, $maximally_small + 1); + } + + #[test] + #[should_panic] + fn read_little_endian() { + let buf = [0; $maximally_small]; + LittleEndian::$read(&buf, $maximally_small + 1); + } + + #[test] + #[should_panic] + fn read_native_endian() { + let buf = [0; $maximally_small]; + NativeEndian::$read(&buf, $maximally_small + 1); + } + } + ); + } + + too_small!(small_u16, 1, 0, read_u16, write_u16); + too_small!(small_i16, 1, 0, read_i16, write_i16); + too_small!(small_u32, 3, 0, read_u32, write_u32); + too_small!(small_i32, 3, 0, read_i32, write_i32); + too_small!(small_u64, 7, 0, read_u64, write_u64); + too_small!(small_i64, 7, 0, read_i64, write_i64); + too_small!(small_f32, 3, 0.0, read_f32, write_f32); + too_small!(small_f64, 7, 0.0, read_f64, write_f64); + #[cfg(feature = "i128")] + too_small!(small_u128, 15, 0, read_u128, write_u128); + #[cfg(feature = "i128")] + too_small!(small_i128, 15, 0, read_i128, write_i128); + + too_small!(small_uint_1, 1, read_uint); + too_small!(small_uint_2, 2, read_uint); + too_small!(small_uint_3, 3, read_uint); + too_small!(small_uint_4, 4, read_uint); + too_small!(small_uint_5, 5, read_uint); + too_small!(small_uint_6, 6, read_uint); + too_small!(small_uint_7, 7, read_uint); + + #[cfg(feature = "i128")] + too_small!(small_uint128_1, 1, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_2, 2, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_3, 3, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_4, 4, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_5, 5, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_6, 6, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_7, 7, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_8, 8, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_9, 9, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_10, 10, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_11, 11, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_12, 12, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_13, 13, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_14, 14, read_uint128); + #[cfg(feature = "i128")] + too_small!(small_uint128_15, 15, read_uint128); + + too_small!(small_int_1, 1, read_int); + too_small!(small_int_2, 2, read_int); + too_small!(small_int_3, 3, read_int); + too_small!(small_int_4, 4, read_int); + too_small!(small_int_5, 5, read_int); + too_small!(small_int_6, 6, read_int); + too_small!(small_int_7, 7, read_int); + + #[cfg(feature = "i128")] + too_small!(small_int128_1, 1, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_2, 2, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_3, 3, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_4, 4, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_5, 5, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_6, 6, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_7, 7, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_8, 8, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_9, 9, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_10, 10, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_11, 11, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_12, 12, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_13, 13, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_14, 14, read_int128); + #[cfg(feature = "i128")] + too_small!(small_int128_15, 15, read_int128); + + // Test that reading/writing slices enforces the correct lengths. + macro_rules! slice_lengths { + ($name:ident, $read:ident, $write:ident, + $num_bytes:expr, $numbers:expr) => { + mod $name { + use {ByteOrder, BigEndian, NativeEndian, LittleEndian}; + + #[test] + #[should_panic] + fn read_big_endian() { + let bytes = [0; $num_bytes]; + let mut numbers = $numbers; + BigEndian::$read(&bytes, &mut numbers); + } + + #[test] + #[should_panic] + fn read_little_endian() { + let bytes = [0; $num_bytes]; + let mut numbers = $numbers; + LittleEndian::$read(&bytes, &mut numbers); + } + + #[test] + #[should_panic] + fn read_native_endian() { + let bytes = [0; $num_bytes]; + let mut numbers = $numbers; + NativeEndian::$read(&bytes, &mut numbers); + } + + #[test] + #[should_panic] + fn write_big_endian() { + let mut bytes = [0; $num_bytes]; + let numbers = $numbers; + BigEndian::$write(&numbers, &mut bytes); + } + + #[test] + #[should_panic] + fn write_little_endian() { + let mut bytes = [0; $num_bytes]; + let numbers = $numbers; + LittleEndian::$write(&numbers, &mut bytes); + } + + #[test] + #[should_panic] + fn write_native_endian() { + let mut bytes = [0; $num_bytes]; + let numbers = $numbers; + NativeEndian::$write(&numbers, &mut bytes); + } + } + } + } + + slice_lengths!( + slice_len_too_small_u16, read_u16_into, write_u16_into, 3, [0, 0]); + slice_lengths!( + slice_len_too_big_u16, read_u16_into, write_u16_into, 5, [0, 0]); + slice_lengths!( + slice_len_too_small_i16, read_i16_into, write_i16_into, 3, [0, 0]); + slice_lengths!( + slice_len_too_big_i16, read_i16_into, write_i16_into, 5, [0, 0]); + + slice_lengths!( + slice_len_too_small_u32, read_u32_into, write_u32_into, 7, [0, 0]); + slice_lengths!( + slice_len_too_big_u32, read_u32_into, write_u32_into, 9, [0, 0]); + slice_lengths!( + slice_len_too_small_i32, read_i32_into, write_i32_into, 7, [0, 0]); + slice_lengths!( + slice_len_too_big_i32, read_i32_into, write_i32_into, 9, [0, 0]); + + slice_lengths!( + slice_len_too_small_u64, read_u64_into, write_u64_into, 15, [0, 0]); + slice_lengths!( + slice_len_too_big_u64, read_u64_into, write_u64_into, 17, [0, 0]); + slice_lengths!( + slice_len_too_small_i64, read_i64_into, write_i64_into, 15, [0, 0]); + slice_lengths!( + slice_len_too_big_i64, read_i64_into, write_i64_into, 17, [0, 0]); + + #[cfg(feature = "i128")] + slice_lengths!( + slice_len_too_small_u128, read_u128_into, write_u128_into, 31, [0, 0]); + #[cfg(feature = "i128")] + slice_lengths!( + slice_len_too_big_u128, read_u128_into, write_u128_into, 33, [0, 0]); + #[cfg(feature = "i128")] + slice_lengths!( + slice_len_too_small_i128, read_i128_into, write_i128_into, 31, [0, 0]); + #[cfg(feature = "i128")] + slice_lengths!( + slice_len_too_big_i128, read_i128_into, write_i128_into, 33, [0, 0]); + + #[test] + fn uint_bigger_buffer() { + use {ByteOrder, LittleEndian}; + let n = LittleEndian::read_uint(&[1, 2, 3, 4, 5, 6, 7, 8], 5); + assert_eq!(n, 0x0504030201); + } +} + +#[cfg(test)] +#[cfg(feature = "std")] +mod stdtests { + extern crate quickcheck; + extern crate rand; + + use self::quickcheck::{QuickCheck, StdGen, Testable}; + use self::rand::thread_rng; + + fn qc_unsized(f: A) { + + QuickCheck::new() + .gen(StdGen::new(thread_rng(), 16)) + .tests(1_00) + .max_tests(10_000) + .quickcheck(f); + } + + macro_rules! calc_max { + ($max:expr, $bytes:expr) => { ($max - 1) >> (8 * (8 - $bytes)) }; + } + + macro_rules! qc_bytes_ext { + ($name:ident, $ty_int:ty, $max:expr, + $bytes:expr, $read:ident, $write:ident) => ( + mod $name { + use std::io::Cursor; + use { + ReadBytesExt, WriteBytesExt, + BigEndian, NativeEndian, LittleEndian, + }; + #[allow(unused_imports)] use test::{qc_sized, Wi128}; + + #[test] + fn big_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let offset = wtr.len() - $bytes; + let mut rdr = Cursor::new(&mut wtr[offset..]); + n == rdr.$read::($bytes).unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + + #[test] + fn little_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let mut rdr = Cursor::new(wtr); + n == rdr.$read::($bytes).unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + + #[test] + fn native_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let offset = if cfg!(target_endian = "big") { + wtr.len() - $bytes + } else { + 0 + }; + let mut rdr = Cursor::new(&mut wtr[offset..]); + n == rdr.$read::($bytes).unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max); + } + } + ); + ($name:ident, $ty_int:ty, $max:expr, $read:ident, $write:ident) => ( + mod $name { + use std::io::Cursor; + use { + ReadBytesExt, WriteBytesExt, + BigEndian, NativeEndian, LittleEndian, + }; + #[allow(unused_imports)] use test::{qc_sized, Wi128}; + + #[test] + fn big_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let mut rdr = Cursor::new(wtr); + n == rdr.$read::().unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + + #[test] + fn little_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let mut rdr = Cursor::new(wtr); + n == rdr.$read::().unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + + #[test] + fn native_endian() { + fn prop(n: $ty_int) -> bool { + let mut wtr = vec![]; + wtr.$write::(n.clone()).unwrap(); + let mut rdr = Cursor::new(wtr); + n == rdr.$read::().unwrap() + } + qc_sized(prop as fn($ty_int) -> bool, $max - 1); + } + } + ); + } + + qc_bytes_ext!(prop_ext_u16, + u16, ::std::u16::MAX as u64, read_u16, write_u16); + qc_bytes_ext!(prop_ext_i16, + i16, ::std::i16::MAX as u64, read_i16, write_i16); + qc_bytes_ext!(prop_ext_u32, + u32, ::std::u32::MAX as u64, read_u32, write_u32); + qc_bytes_ext!(prop_ext_i32, + i32, ::std::i32::MAX as u64, read_i32, write_i32); + qc_bytes_ext!(prop_ext_u64, + u64, ::std::u64::MAX as u64, read_u64, write_u64); + qc_bytes_ext!(prop_ext_i64, + i64, ::std::i64::MAX as u64, read_i64, write_i64); + qc_bytes_ext!(prop_ext_f32, + f32, ::std::u64::MAX as u64, read_f32, write_f32); + qc_bytes_ext!(prop_ext_f64, + f64, ::std::i64::MAX as u64, read_f64, write_f64); + + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_u128, Wi128, 16 + 1, read_u128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_i128, Wi128, 16 + 1, read_i128, write_i128); + + qc_bytes_ext!(prop_ext_uint_1, + u64, calc_max!(::test::U64_MAX, 1), 1, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_2, + u64, calc_max!(::test::U64_MAX, 2), 2, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_3, + u64, calc_max!(::test::U64_MAX, 3), 3, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_4, + u64, calc_max!(::test::U64_MAX, 4), 4, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_5, + u64, calc_max!(::test::U64_MAX, 5), 5, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_6, + u64, calc_max!(::test::U64_MAX, 6), 6, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_7, + u64, calc_max!(::test::U64_MAX, 7), 7, read_uint, write_u64); + qc_bytes_ext!(prop_ext_uint_8, + u64, calc_max!(::test::U64_MAX, 8), 8, read_uint, write_u64); + + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_1, + Wi128, 1, 1, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_2, + Wi128, 2, 2, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_3, + Wi128, 3, 3, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_4, + Wi128, 4, 4, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_5, + Wi128, 5, 5, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_6, + Wi128, 6, 6, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_7, + Wi128, 7, 7, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_8, + Wi128, 8, 8, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_9, + Wi128, 9, 9, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_10, + Wi128, 10, 10, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_11, + Wi128, 11, 11, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_12, + Wi128, 12, 12, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_13, + Wi128, 13, 13, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_14, + Wi128, 14, 14, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_15, + Wi128, 15, 15, read_uint128, write_u128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_uint128_16, + Wi128, 16, 16, read_uint128, write_u128); + + qc_bytes_ext!(prop_ext_int_1, + i64, calc_max!(::test::I64_MAX, 1), 1, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_2, + i64, calc_max!(::test::I64_MAX, 2), 2, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_3, + i64, calc_max!(::test::I64_MAX, 3), 3, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_4, + i64, calc_max!(::test::I64_MAX, 4), 4, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_5, + i64, calc_max!(::test::I64_MAX, 5), 5, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_6, + i64, calc_max!(::test::I64_MAX, 6), 6, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_7, + i64, calc_max!(::test::I64_MAX, 1), 7, read_int, write_i64); + qc_bytes_ext!(prop_ext_int_8, + i64, calc_max!(::test::I64_MAX, 8), 8, read_int, write_i64); + + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_1, + Wi128, 1, 1, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_2, + Wi128, 2, 2, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_3, + Wi128, 3, 3, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_4, + Wi128, 4, 4, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_5, + Wi128, 5, 5, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_6, + Wi128, 6, 6, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_7, + Wi128, 7, 7, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_8, + Wi128, 8, 8, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_9, + Wi128, 9, 9, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_10, + Wi128, 10, 10, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_11, + Wi128, 11, 11, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_12, + Wi128, 12, 12, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_13, + Wi128, 13, 13, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_14, + Wi128, 14, 14, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_15, + Wi128, 15, 15, read_int128, write_i128); + #[cfg(feature = "i128")] + qc_bytes_ext!(prop_ext_int128_16, + Wi128, 16, 16, read_int128, write_i128); + + // Test slice serialization/deserialization. + macro_rules! qc_slice { + ($name:ident, $ty_int:ty, $read:ident, $write:ident, $zero:expr) => { + mod $name { + use core::mem::size_of; + use {ByteOrder, BigEndian, NativeEndian, LittleEndian}; + use super::qc_unsized; + #[allow(unused_imports)] + use test::Wi128; + + #[test] + fn big_endian() { + #[allow(unused_unsafe)] + fn prop(numbers: Vec<$ty_int>) -> bool { + let numbers: Vec<_> = numbers + .into_iter() + .map(|x| x.clone()) + .collect(); + let num_bytes = size_of::<$ty_int>() * numbers.len(); + let mut bytes = vec![0; num_bytes]; + + BigEndian::$write(&numbers, &mut bytes); + + let mut got = vec![$zero; numbers.len()]; + unsafe { BigEndian::$read(&bytes, &mut got); } + + numbers == got + } + qc_unsized(prop as fn(_) -> bool); + } + + #[test] + fn little_endian() { + #[allow(unused_unsafe)] + fn prop(numbers: Vec<$ty_int>) -> bool { + let numbers: Vec<_> = numbers + .into_iter() + .map(|x| x.clone()) + .collect(); + let num_bytes = size_of::<$ty_int>() * numbers.len(); + let mut bytes = vec![0; num_bytes]; + + LittleEndian::$write(&numbers, &mut bytes); + + let mut got = vec![$zero; numbers.len()]; + unsafe { LittleEndian::$read(&bytes, &mut got); } + + numbers == got + } + qc_unsized(prop as fn(_) -> bool); + } + + #[test] + fn native_endian() { + #[allow(unused_unsafe)] + fn prop(numbers: Vec<$ty_int>) -> bool { + let numbers: Vec<_> = numbers + .into_iter() + .map(|x| x.clone()) + .collect(); + let num_bytes = size_of::<$ty_int>() * numbers.len(); + let mut bytes = vec![0; num_bytes]; + + NativeEndian::$write(&numbers, &mut bytes); + + let mut got = vec![$zero; numbers.len()]; + unsafe { NativeEndian::$read(&bytes, &mut got); } + + numbers == got + } + qc_unsized(prop as fn(_) -> bool); + } + } + } + } + + qc_slice!(prop_slice_u16, u16, read_u16_into, write_u16_into, 0); + qc_slice!(prop_slice_i16, i16, read_i16_into, write_i16_into, 0); + qc_slice!(prop_slice_u32, u32, read_u32_into, write_u32_into, 0); + qc_slice!(prop_slice_i32, i32, read_i32_into, write_i32_into, 0); + qc_slice!(prop_slice_u64, u64, read_u64_into, write_u64_into, 0); + qc_slice!(prop_slice_i64, i64, read_i64_into, write_i64_into, 0); + #[cfg(feature = "i128")] + qc_slice!( + prop_slice_u128, Wi128, read_u128_into, write_u128_into, 0); + #[cfg(feature = "i128")] + qc_slice!( + prop_slice_i128, Wi128, read_i128_into, write_i128_into, 0); + + qc_slice!( + prop_slice_f32, f32, read_f32_into_unchecked, write_f32_into, 0.0); + qc_slice!( + prop_slice_f64, f64, read_f64_into_unchecked, write_f64_into, 0.0); +} diff --git a/vendor/registry-40351f815f426200/cfg-if/.cargo-checksum.json b/vendor/registry-40351f815f426200/cfg-if/.cargo-checksum.json new file mode 100644 index 000000000..b7932a3b2 --- /dev/null +++ b/vendor/registry-40351f815f426200/cfg-if/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"60ab45aa0f92dcf54c943acaefe1c62c6cd16bc616dea45b58b978ca0f83cb4e","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"5c345e0dd1ae68db560831c02bc2e5f1825bd10d9b68ddae40dac0bc494d651e","src/lib.rs":"caaa0c2b554377933ce62a32c45e094e9c1faa719c8a2783d6319d8f65467795","tests/xcrate.rs":"30dcb70fbb9c96fda2b7825592558279f534776f72e2a8a0a3e26df4dedb3caa"},"package":"b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/cfg-if/Cargo.toml b/vendor/registry-40351f815f426200/cfg-if/Cargo.toml new file mode 100644 index 000000000..a5f7c3c76 --- /dev/null +++ b/vendor/registry-40351f815f426200/cfg-if/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 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 = "cfg-if" +version = "0.1.9" +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" +[badges.travis-ci] +repository = "alexcrichton/cfg-if" diff --git a/vendor/registry-40351f815f426200/cfg-if/LICENSE-APACHE b/vendor/registry-40351f815f426200/cfg-if/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/cfg-if/LICENSE-MIT b/vendor/registry-40351f815f426200/cfg-if/LICENSE-MIT new file mode 100644 index 000000000..39e0ed660 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/cfg-if/README.md b/vendor/registry-40351f815f426200/cfg-if/README.md new file mode 100644 index 000000000..86837212c --- /dev/null +++ b/vendor/registry-40351f815f426200/cfg-if/README.md @@ -0,0 +1,52 @@ +# cfg-if + +[![Build Status](https://travis-ci.com/alexcrichton/cfg-if.svg?branch=master)](https://travis-ci.com/alexcrichton/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 +#[macro_use] +extern crate 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 Serde 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/vendor/registry-40351f815f426200/cfg-if/src/lib.rs b/vendor/registry-40351f815f426200/cfg-if/src/lib.rs new file mode 100644 index 000000000..e867e65a8 --- /dev/null +++ b/vendor/registry-40351f815f426200/cfg-if/src/lib.rs @@ -0,0 +1,144 @@ +//! 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 +//! +//! ``` +//! #[macro_use] +//! extern crate 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(local_inner_macros)] +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 cfgs 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 approprate #[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)* + }; +} + +#[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()); + } +} diff --git a/vendor/registry-40351f815f426200/cfg-if/tests/xcrate.rs b/vendor/registry-40351f815f426200/cfg-if/tests/xcrate.rs new file mode 100644 index 000000000..f42b87767 --- /dev/null +++ b/vendor/registry-40351f815f426200/cfg-if/tests/xcrate.rs @@ -0,0 +1,17 @@ +#[macro_use] +extern crate 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/vendor/registry-40351f815f426200/clap/.cargo-checksum.json b/vendor/registry-40351f815f426200/clap/.cargo-checksum.json new file mode 100644 index 000000000..f32a851f7 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"9487316c1d190fa572f2779979c99395c687dd0495f4657ffb460e1a2a6c5019","CONTRIBUTORS.md":"6890277f02e66ec77120d3335240ac677abd126db5f7a9d9168f47f5cb4df977","Cargo.toml":"25cb059a452c73a7177ab54d9edf7c0dfcb1489e8013a3efd522e9b2fdfef05e","LICENSE-MIT":"6725d1437fc6c77301f2ff0e7d52914cf4f9509213e1078dc77d9356dbe6eac5","README.md":"57e3b95a81faf3503cc8ba14f8b30f725172551507846b6a6e0f9eb1f1ba2b2a","SPONSORS.md":"097c6b7a80feba1e1b9170fa641a2d7d1868e6115fce73a90ab26448ba36f843","clap-test.rs":"995a9d41ef372a814616113f4a58c1e580043678e54527afc2ebee7e8e1d3ef5","index.html":"36f9ce4465266f3af9a259444b01c4239200473cabfc848f789f75b322a3ea8f","justfile":"811b2dec57aec46e570aeeb9945018cf87fe65f6d5b27cdb9ffca79d906910f6","rustfmt.toml":"8fd2d63119df515fd5f44e530c709b19d66b09fbc2e22a640bf4b64c57e7d6b3","src/app/help.rs":"6bf52a4b213ae6b1e53d206bd63816961608284c1c0cbb6cebe9cc1dcf0dc463","src/app/macros.rs":"77764555c2831180f4e976d5bcd95f3da4fdb609d77ae84c94f4ce602afd0c9b","src/app/meta.rs":"a56d28bb466a8ba68155b3f2883e85228b4b74cf25658f62fc050e07cff2dc85","src/app/mod.rs":"672b7472eb674dd0e875dddb6916f7f63c49873ad6d5afcb46f054b9161fc3a4","src/app/parser.rs":"dd87e6e5b22ec761d0228de66f6d929b68a06a692099cb86feabba1924506e4d","src/app/settings.rs":"e6e73720774d7040efa0c155267e996ad9a1d1d4626bb568f3b902edc8913344","src/app/usage.rs":"703cec975c53e7f01b14b4593de41c518910ab347bc4c54efe79367a704ffc4c","src/app/validator.rs":"0e8d58ce7f22482897a48c8b34d52540274ece40f974226fcca6078cc896ae02","src/args/any_arg.rs":"2960506a31a884a9b3142fea532afa0a01f7de8d14ba2a6347eb5cd5b2fdd98b","src/args/arg.rs":"e10c790b12aea012a52edec6c5e8afe27925ae4b936f83352830a40ef1f4c93d","src/args/arg_builder/base.rs":"8b99a9ab811df3e0bdcfba8c0994042b0bcd06d8ddf794ab559baaf9a490ba59","src/args/arg_builder/flag.rs":"fd6eef19c4de7ded217e86224de472147d4f4c5813607bc0fa67462c5d347b7a","src/args/arg_builder/mod.rs":"7a32c8fd85b48f7b60e5f2c13dc70fa9100aa65cd933ba419300d28d682bf722","src/args/arg_builder/option.rs":"e73031991e561ea7e61574f719207034df0fa3acdd28735502d8511f00d7adbf","src/args/arg_builder/positional.rs":"897df6cda52b67728103c7b2c0750f91326880b751204f4ab15852b18be0d929","src/args/arg_builder/switched.rs":"61f5121b0ec746461215a47e1b7a4d699a37a3f181172820e0615f68d5f6f0ef","src/args/arg_builder/valued.rs":"20998bf790a58206b27cf8b09f6740812d507336042a2026f203f99af4500ed5","src/args/arg_matcher.rs":"ff2b23b43fb5d61727410ab156844b90f898279e08b4aa56f244ad7ced12d03f","src/args/arg_matches.rs":"2342be87d96e3b7437d711a3550e8bf83a524a52b3cd1a34e91de02f16e01fa6","src/args/group.rs":"7fe5e2f0dd24faf1765410a9336d85976875e964d7f246e1fa216c4808d88dde","src/args/macros.rs":"57f248e2694f9413cbbaf9087813ed4f27064f5f8e29eaf4ec41ec2b274ae806","src/args/matched_arg.rs":"1ed8d338869ecc3b5fa426ef4cf42f4c9c3b1dd538cdea1fe0489169345536f7","src/args/mod.rs":"c155cd989fa4ca1f8de6a79115afbf5086f092adcb854ff9698b9100f45fc323","src/args/settings.rs":"2753ff50046def9ccb7f601b3d9f565348da1ef0253af24ccee94616a2e5c470","src/args/subcommand.rs":"e1ad9638c33785f1301675de1795b0a4f4b079452aa11f7526d263c2a1179432","src/completions/bash.rs":"116c6830ee2b6310f299a69924f5b1e39b05ebec2b5f7b0ffe3b6938b7fa5514","src/completions/fish.rs":"65782afc62724e068efcb1c85b193f7963891def2ff5cd6e5200ebdb67003bb5","src/completions/macros.rs":"ebad5037e6e63401b1a54498e09d3bd93d1a3a06f045c2990902d47eb9a73774","src/completions/mod.rs":"5d4a734df6a21e6c1e0831a2f7be50a45d2e7bdaf7475589ea78b978643229cd","src/completions/powershell.rs":"866409e5d0a9b2551d739f86c0e4faf86911e9e7c656fb74b38e6960844233b5","src/completions/shell.rs":"c7995ca229fd0d8671761da0aca0513c4f740165f02d06cd97aa0ae881c22cd4","src/completions/zsh.rs":"e98cc3676c0bfa67f0816947b932c92a14cbcf13b45656cf2f8683f9ab05fbca","src/errors.rs":"3c46a4d79d9304ffb152a190528ec9db0cb6c05799bb5211e6df9f7d7abab814","src/fmt.rs":"f205f784268572544ff7e84a89f416c898255404275d4ab1f8fea7e89695daa9","src/lib.rs":"804d8a9c384122e54cc230327810bde108660e61238c2b889d5bbbbcc2f19c75","src/macros.rs":"a65e1349b12ff164578b5c106c73eb646c86b8be04ec4964fa6da511b3135d76","src/map.rs":"67ac4802ed485359c78a1747c832666095b5ee05d68c686d110bd2e4aa9f06e2","src/osstringext.rs":"a87a5a0685dd8310f6329d5f8e8f54c0fac68eb75595a835aeb1c36208efd5f9","src/strext.rs":"d4418d396069e9c05804f92c042ba7192a4244e46059e2edc98670b45cd2daee","src/suggestions.rs":"1f348d393c0c85e622ca97253fd3f25fed9c2c660996d6ca5ac7e3abfd99783b","src/usage_parser.rs":"cc23ff4156d5bebc8a1bebc45edcf337947d8d217461b052271777e0bf31fa51"},"package":"1b8c532887f1a292d17de05ae858a8fe50a301e196f9ef0ddb7ccd0d1d00f180"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/clap/CHANGELOG.md b/vendor/registry-40351f815f426200/clap/CHANGELOG.md new file mode 100644 index 000000000..f20d4ade5 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/CHANGELOG.md @@ -0,0 +1,2612 @@ + +## v2.27.1 (2017-10-24) + + +#### Bug Fixes + +* Adds `term_size` as an optional dependency (with feature `wrap_help`) to fix compile bug + + +## v2.27.0 (2017-10-24) + +** This release raises the minimum required version of Rust to 1.18 ** + +** This release also contains a very minor breaking change to fix a bug ** + +The only CLIs affected will be those using unrestrained multiple values and subcommands where the +subcommand name can coincide with one of the multiple values. + +See the commit [0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31) for full details. + + +#### Bug Fixes + +* Values from global args are now propagated UP and DOWN! +* fixes a bug where using AppSettings::AllowHyphenValues would allow invalid arguments even when there is no way for them to be valid ([77ed4684](https://github.com/kbknapp/clap-rs/commit/77ed46841fc0263d7aa32fcc5cc49ef703b37c04), closes [#1066](https://github.com/kbknapp/clap-rs/issues/1066)) +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value ([0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31), closes [#1031](https://github.com/kbknapp/clap-rs/issues/1031), breaks [#](https://github.com/kbknapp/clap-rs/issues/), [#](https://github.com/kbknapp/clap-rs/issues/)) +* fixes a bug that prevented number_of_values and default_values to be used together ([5eb342a9](https://github.com/kbknapp/clap-rs/commit/5eb342a99dde07b0f011048efde3e283bc1110fc), closes [#1050](https://github.com/kbknapp/clap-rs/issues/1050), [#1056](https://github.com/kbknapp/clap-rs/issues/1056)) +* fixes a bug that didn't allow args with default values to have conflicts ([58b5b4be](https://github.com/kbknapp/clap-rs/commit/58b5b4be315280888d50d9b15119b91a9028f050), closes [#1071](https://github.com/kbknapp/clap-rs/issues/1071)) +* fixes a panic when using global args and calling App::get_matches_from_safe_borrow multiple times ([d86ec797](https://github.com/kbknapp/clap-rs/commit/d86ec79742c77eb3f663fb30e225954515cf25bb), closes [#1076](https://github.com/kbknapp/clap-rs/issues/1076)) +* fixes issues and potential regressions with global args values not being propagated properly or at all ([a43f9dd4](https://github.com/kbknapp/clap-rs/commit/a43f9dd4aaf1864dd14a3c28dec89ccdd70c61e5), closes [#1010](https://github.com/kbknapp/clap-rs/issues/1010), [#1061](https://github.com/kbknapp/clap-rs/issues/1061), [#978](https://github.com/kbknapp/clap-rs/issues/978)) +* fixes a bug where default values are not applied if the option supports zero values ([9c248cbf](https://github.com/kbknapp/clap-rs/commit/9c248cbf7d8a825119bc387c23e9a1d1989682b0), closes [#1047](https://github.com/kbknapp/clap-rs/issues/1047)) + +#### Documentation + +* adds addtional blurbs about using multiples with subcommands ([03455b77](https://github.com/kbknapp/clap-rs/commit/03455b7751a757e7b2f6ffaf2d16168539c99661)) +* updates the docs to reflect changes to global args and that global args values can now be propagated back up the stack ([ead076f0](https://github.com/kbknapp/clap-rs/commit/ead076f03ada4c322bf3e34203925561ec496d87)) +* add html_root_url attribute ([e67a061b](https://github.com/kbknapp/clap-rs/commit/e67a061bcf567c6518d6c2f58852e01f02764b22)) +* sync README version numbers with crate version ([5536361b](https://github.com/kbknapp/clap-rs/commit/5536361bcda29887ed86bb68e43d0b603cbc423f)) + +#### Improvements + +* args that have require_delimiter(true) is now reflected in help and usage strings ([dce61699](https://github.com/kbknapp/clap-rs/commit/dce616998ed9bd95e8ed3bec1f09a4883da47b85), closes [#1052](https://github.com/kbknapp/clap-rs/issues/1052)) +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed ([4ae7b046](https://github.com/kbknapp/clap-rs/commit/4ae7b0464750bc07ec80ece38e43f003fdd1b8ae), closes [#1046](https://github.com/kbknapp/clap-rs/issues/1046)) + +#### Breaking Changes + +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value ([0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31), closes [#1031](https://github.com/kbknapp/clap-rs/issues/1031), breaks [#](https://github.com/kbknapp/clap-rs/issues/), [#](https://github.com/kbknapp/clap-rs/issues/)) + +#### Deprecations + +* **AppSettings::PropagateGlobalValuesDown:** this setting is no longer required to propagate values down or up ([2bb5ddce](https://github.com/kbknapp/clap-rs/commit/2bb5ddcee61c791ca1aaca494fbeb4bd5e277488)) + + + + +### v2.26.2 (2017-09-14) + + +#### Improvements + +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed ([4ae7b046](https://github.com/kbknapp/clap-rs/commit/4ae7b0464750bc07ec80ece38e43f003fdd1b8ae), closes [#1046](https://github.com/kbknapp/clap-rs/issues/1046)) + +#### Bug Fixes + +* fixes a bug where default values are not applied if the option supports zero values ([9c248cbf](https://github.com/kbknapp/clap-rs/commit/9c248cbf7d8a825119bc387c23e9a1d1989682b0), closes [#1047](https://github.com/kbknapp/clap-rs/issues/1047)) + + + + +### v2.26.1 (2017-09-14) + + +#### Bug Fixes + +* fixes using require_equals(true) and min_values(0) together ([10ae208f](https://github.com/kbknapp/clap-rs/commit/10ae208f68518eff6e98166724065745f4083174), closes [#1044](https://github.com/kbknapp/clap-rs/issues/1044)) +* escape special characters in zsh and fish completions ([87e019fc](https://github.com/kbknapp/clap-rs/commit/87e019fc84ba6193a8c4ddc26c61eb99efffcd25)) +* avoid panic generating default help msg if term width set to 0 due to bug in textwrap 0.7.0 ([b3eadb0d](https://github.com/kbknapp/clap-rs/commit/b3eadb0de516106db4e08f078ad32e8f6d6e7a57)) +* Change `who's` -> `whose` ([53c1ffe8](https://github.com/kbknapp/clap-rs/commit/53c1ffe87f38b05d8804a0f7832412a952845349)) +* adds a debug assertion to ensure all args added to groups actually exist ([7ad123e2](https://github.com/kbknapp/clap-rs/commit/7ad123e2c02577e3ca30f7e205181e896b157d11), closes [#917](https://github.com/kbknapp/clap-rs/issues/917)) +* fixes a bug where args that allow values to start with a hyphen couldnt contain a double hyphen -- as a value ([ab2f4c9e](https://github.com/kbknapp/clap-rs/commit/ab2f4c9e563e36ec739a4b55d5a5b76fdb9e9fa4), closes [#960](https://github.com/kbknapp/clap-rs/issues/960)) +* fixes a bug where positional argument help text is misaligned ([54c16836](https://github.com/kbknapp/clap-rs/commit/54c16836dea4651806a2cfad53146a83fa3abf21)) +* **Help Message:** fixes long_about not being usable ([a8257ea0](https://github.com/kbknapp/clap-rs/commit/a8257ea0ffb812e552aca256c4a3d2aebfd8065b), closes [#1043](https://github.com/kbknapp/clap-rs/issues/1043)) +* **Suggestions:** output for flag after subcommand ([434ea5ba](https://github.com/kbknapp/clap-rs/commit/434ea5ba71395d8c1afcf88e69f0b0d8339b01a1)) + + + + +## v2.26.0 (2017-07-29) + +Minimum version of Rust is now v1.13.0 (Stable) + + +#### Improvements + +* bumps unicode-segmentation to v1.2 ([cd7b40a2](https://github.com/kbknapp/clap-rs/commit/cd7b40a21c77bae17ba453c5512cb82b7d1ce474)) + + +#### Performance + +* update textwrap to version 0.7.0 ([c2d4e637](https://github.com/kbknapp/clap-rs/commit/c2d4e63756a6f070e38c16dff846e9b0a53d6f93)) + + + + + +### v2.25.1 (2017-07-21) + +#### Improvements + +* impl Default for Values + OsValues for any lifetime. ([fb7d6231f1](https://github.com/kbknapp/clap-rs/commit/fb7d6231f13a2f79f411e62dca210b7dc9994c18)) + +#### Documentation + +* Various documentation typos and grammar fixes + + +### v2.25.0 (2017-06-20) + + +#### Features + +* use textwrap crate for wrapping help texts ([b93870c1](https://github.com/kbknapp/clap-rs/commit/b93870c10ae3bd90d233c586a33e086803117285)) + +#### Improvements + +* **Suggestions:** suggests to use flag after subcommand when applicable ([2671ca72](https://github.com/kbknapp/clap-rs/commit/2671ca7260119d4311d21c4075466aafdd9da734)) +* Bumps bitflags crate to v0.9 + +#### Documentation + +* Change `who's` -> `whose` ([53c1ffe8](https://github.com/kbknapp/clap-rs/commit/53c1ffe87f38b05d8804a0f7832412a952845349)) + +#### Documentation + +* **App::template:** adds details about the necessity to use AppSettings::UnifiedHelpMessage when using {unified} tags in the help template ([cbea3d5a](https://github.com/kbknapp/clap-rs/commit/cbea3d5acf3271a7a734498c4d99c709941c331e), closes [#949](https://github.com/kbknapp/clap-rs/issues/949)) +* **Arg::allow_hyphen_values:** updates the docs to include warnings for allow_hyphen_values and multiple(true) used together ([f9b0d657](https://github.com/kbknapp/clap-rs/commit/f9b0d657835d3f517f313d70962177dc30acf4a7)) +* **README.md:** + * added a warning about using ~ deps ([821929b5](https://github.com/kbknapp/clap-rs/commit/821929b51bd60213955705900a436c9a64fcb79f), closes [#964](https://github.com/kbknapp/clap-rs/issues/964)) +* **clap_app!:** adds using the @group specifier to the macro docs ([826048cb](https://github.com/kbknapp/clap-rs/commit/826048cb3cbc0280169303f1498ff0a2b7395883), closes [#932](https://github.com/kbknapp/clap-rs/issues/932)) + + + + +### v2.24.2 (2017-05-15) + + +#### Bug Fixes + +* adds a debug assertion to ensure all args added to groups actually exist ([14f6b8f3](https://github.com/kbknapp/clap-rs/commit/14f6b8f3a2f6df73aeeec9c54a54909b1acfc158), closes [#917](https://github.com/kbknapp/clap-rs/issues/917)) +* fixes a bug where args that allow values to start with a hyphen couldnt contain a double hyphen -- as a value ([ebf73a09](https://github.com/kbknapp/clap-rs/commit/ebf73a09db6f3c03c19cdd76b1ba6113930e1643), closes [#960](https://github.com/kbknapp/clap-rs/issues/960)) +* fixes a bug where positional argument help text is misaligned ([54c16836](https://github.com/kbknapp/clap-rs/commit/54c16836dea4651806a2cfad53146a83fa3abf21)) + +#### Documentation + +* **App::template:** adds details about the necessity to use AppSettings::UnifiedHelpMessage when using {unified} tags in the help template ([cf569438](https://github.com/kbknapp/clap-rs/commit/cf569438f309c199800bb8e46c9f140187de69d7), closes [#949](https://github.com/kbknapp/clap-rs/issues/949)) +* **Arg::allow_hyphen_values:** updates the docs to include warnings for allow_hyphen_values and multiple(true) used together ([ded5a2f1](https://github.com/kbknapp/clap-rs/commit/ded5a2f15474d4a5bd46a67b130ccb8b6781bd01)) +* **clap_app!:** adds using the @group specifier to the macro docs ([fe85fcb1](https://github.com/kbknapp/clap-rs/commit/fe85fcb1772b61f13b20b7ea5290e2437a76190c), closes [#932](https://github.com/kbknapp/clap-rs/issues/932)) + + + + +### v2.24.0 (2017-05-07) + + +#### Bug Fixes + +* fixes a bug where args with last(true) and required(true) set were not being printed in the usage string ([3ac533fe](https://github.com/kbknapp/clap-rs/commit/3ac533fedabf713943eedf006f830a5a486bbe80), closes [#944](https://github.com/kbknapp/clap-rs/issues/944)) +* fixes a bug that was printing the arg name, instead of value name when Arg::last(true) was used ([e1fe8ac3](https://github.com/kbknapp/clap-rs/commit/e1fe8ac3bc1f9cf4e36df0d881f8419755f1787b), closes [#940](https://github.com/kbknapp/clap-rs/issues/940)) +* fixes a bug where flags were parsed as flags AND positional values when specific combinations of settings were used ([20f83292](https://github.com/kbknapp/clap-rs/commit/20f83292d070038b8cee2a6b47e91f6b0a2f7871), closes [#946](https://github.com/kbknapp/clap-rs/issues/946)) + + + + +## v2.24.0 (2017-05-05) + + +#### Documentation + +* **README.md:** fix some typos ([fa34deac](https://github.com/kbknapp/clap-rs/commit/fa34deac079f334c3af97bb7fb151880ba8887f8)) + +#### API Additions + +* **Arg:** add `default_value_os` ([d5ef8955](https://github.com/kbknapp/clap-rs/commit/d5ef8955414b1587060f7218385256105b639c88)) +* **arg_matches.rs:** Added a Default implementation for Values and OsValues iterators. ([0a4384e3](https://github.com/kbknapp/clap-rs/commit/0a4384e350eed74c2a4dc8964c203f21ac64897f)) + + + +### v2.23.2 (2017-04-19) + + +#### Bug Fixes + +* **PowerShell Completions:** fixes a bug where powershells completions cant be used if no subcommands are defined ([a8bce558](https://github.com/kbknapp/clap-rs/commit/a8bce55837dc4e0fb187dc93180884a40ae09c6f), closes [#931](https://github.com/kbknapp/clap-rs/issues/931)) + +#### Improvements + +* bumps term_size to take advantage of better terminal dimension handling ([e05100b7](https://github.com/kbknapp/clap-rs/commit/e05100b73d74066a90876bf38f952adf5e8ee422)) +* **PowerShell Completions:** massively dedups subcommand names in the generate script to make smaller scripts that are still functionally equiv ([85b0e1cc](https://github.com/kbknapp/clap-rs/commit/85b0e1cc4b9755dda75a93d898d79bc38631552b)) + +#### Documentation + +* Fix a typo the minimum rust version required ([71dabba3](https://github.com/kbknapp/clap-rs/commit/71dabba3ea0a17c88b0e2199c9d99f0acbf3bc17)) + + +### v2.23.1 (2017-04-05) + + +#### Bug Fixes + +* fixes a missing newline character in the autogenerated help and version messages in some instances ([5ae9007d](https://github.com/kbknapp/clap-rs/commit/5ae9007d984ae94ae2752df51bcbaeb0ec89bc15)) + + + +## v2.23.0 (2017-04-05) + + +#### API Additions + +* `App::long_about` +* `App::long_version` +* `App::print_long_help` +* `App::write_long_help` +* `App::print_long_version` +* `App::write_long_version` +* `Arg::long_help` + +#### Features + +* allows distinguishing between short and long version messages (-V/short or --version/long) ([59272b06](https://github.com/kbknapp/clap-rs/commit/59272b06cc213289dc604dbc694cb95d383a5d68)) +* allows distinguishing between short and long help with subcommands in the same manner as args ([6b371891](https://github.com/kbknapp/clap-rs/commit/6b371891a1702173a849d1e95f9fecb168bf6fc4)) +* allows specifying a short help vs a long help (i.e. varying levels of detail depending on if -h or --help was used) ([ef1b24c3](https://github.com/kbknapp/clap-rs/commit/ef1b24c3a0dff2f58c5e2e90880fbc2b69df20ee)) +* **clap_app!:** adds support for arg names with hyphens similar to longs with hyphens ([f7a88779](https://github.com/kbknapp/clap-rs/commit/f7a8877978c8f90e6543d4f0d9600c086cf92cd7), closes [#869](https://github.com/kbknapp/clap-rs/issues/869)) + +#### Bug Fixes + +* fixes a bug that wasn't allowing help and version to be properly overridden ([8b2ceb83](https://github.com/kbknapp/clap-rs/commit/8b2ceb8368bcb70689fadf1c7f4b9549184926c1), closes [#922](https://github.com/kbknapp/clap-rs/issues/922)) + +#### Documentation + +* **clap_app!:** documents the `--("some-arg")` method for using args with hyphens inside them ([bc08ef3e](https://github.com/kbknapp/clap-rs/commit/bc08ef3e185393073d969d301989b6319c616c1f), closes [#919](https://github.com/kbknapp/clap-rs/issues/919)) + + + + +### v2.22.2 (2017-03-30) + + +#### Bug Fixes + +* **Custom Usage Strings:** fixes the usage string regression when using help templates ([0e4fd96d](https://github.com/kbknapp/clap-rs/commit/0e4fd96d74280d306d09e60ac44f938a82321769)) + + + + +### v2.22.1 (2017-03-24) + + +#### Bug Fixes + +* **usage:** fixes a big regression with custom usage strings ([2c41caba](https://github.com/kbknapp/clap-rs/commit/2c41caba3c7d723a2894e315d04da796b0e97759)) + + +## v2.22.0 (2017-03-23) + +#### API Additions + +* **App::name:** adds the ability to change the name of the App instance after creation ([d49e8292](https://github.com/kbknapp/clap-rs/commit/d49e8292b026b06e2b70447cd9f08299f4fcba76), closes [#908](https://github.com/kbknapp/clap-rs/issues/908)) +* **Arg::hide_default_value:** adds ability to hide the default value of an argument from the help string ([89e6ea86](https://github.com/kbknapp/clap-rs/commit/89e6ea861e16a1ad56757ca12f6b32d02253e44a), closes [#902](https://github.com/kbknapp/clap-rs/issues/902)) + + + +### v2.21.3 (2017-03-23) + +#### Bug Fixes + +* **yaml:** adds support for loading author info from yaml ([e04c390c](https://github.com/kbknapp/clap-rs/commit/e04c390c597a55fa27e724050342f16c42f1c5c9)) + + + +### v2.21.2 (2017-03-17) + + +#### Improvements + +* add fish subcommand help support ([f8f68cf8](https://github.com/kbknapp/clap-rs/commit/f8f68cf8251669aef4539a25a7c1166f0ac81ea6)) +* options that use `require_equals(true)` now display the equals sign in help messages, usage strings, and errors" ([c8eb0384](https://github.com/kbknapp/clap-rs/commit/c8eb0384d394d2900ccdc1593099c97808a3fa05), closes [#903](https://github.com/kbknapp/clap-rs/issues/903)) + + +#### Bug Fixes + +* setting the max term width now correctly propagates down through child subcommands + + + + +### v2.21.1 (2017-03-12) + + +#### Bug Fixes + +* **ArgRequiredElseHelp:** fixes the precedence of this error to prioritize over other error messages ([74b751ff](https://github.com/kbknapp/clap-rs/commit/74b751ff2e3631e337b7946347c1119829a41c53), closes [#895](https://github.com/kbknapp/clap-rs/issues/895)) +* **Positionals:** fixes some regression bugs resulting from old asserts in debug mode. ([9a3bc98e](https://github.com/kbknapp/clap-rs/commit/9a3bc98e9b55e7514b74b73374c5ac8b6e5e0508), closes [#896](https://github.com/kbknapp/clap-rs/issues/896)) + + + + +## v2.21.0 (2017-03-09) + +#### Performance + +* doesn't run `arg_post_processing` on multiple values anymore ([ec516182](https://github.com/kbknapp/clap-rs/commit/ec5161828729f6a53f0fccec8648f71697f01f78)) +* changes internal use of `VecMap` to `Vec` for matched values of `Arg`s ([22bf137a](https://github.com/kbknapp/clap-rs/commit/22bf137ac581684c6ed460d2c3c640c503d62621)) +* vastly reduces the amount of cloning when adding non-global args minus when they're added from `App::args` which is forced to clone ([8da0303b](https://github.com/kbknapp/clap-rs/commit/8da0303bc02db5fe047cfc0631a9da41d9dc60f7)) +* refactor to remove unneeded vectors and allocations and checks for significant performance increases ([0efa4119](https://github.com/kbknapp/clap-rs/commit/0efa4119632f134fc5b8b9695b007dd94b76735d)) + +#### Documentation + +* Fix examples link in CONTRIBUTING.md ([60cf875d](https://github.com/kbknapp/clap-rs/commit/60cf875d67a252e19bb85054be57696fac2c57a1)) + +#### Improvements + +* when `AppSettings::SubcommandsNegateReqs` and `ArgsNegateSubcommands` are used, a new more accurate double line usage string is shown ([50f02300](https://github.com/kbknapp/clap-rs/commit/50f02300d81788817acefef0697e157e01b6ca32), closes [#871](https://github.com/kbknapp/clap-rs/issues/871)) + +#### API Additions + +* **Arg::last:** adds the ability to mark a positional argument as 'last' which means it should be used with `--` syntax and can be accessed early ([6a7aea90](https://github.com/kbknapp/clap-rs/commit/6a7aea9043b83badd9ab038b4ecc4c787716147e), closes [#888](https://github.com/kbknapp/clap-rs/issues/888)) +* provides `default_value_os` and `default_value_if[s]_os` ([0f2a3782](https://github.com/kbknapp/clap-rs/commit/0f2a378219a6930748d178ba350fe5925be5dad5), closes [#849](https://github.com/kbknapp/clap-rs/issues/849)) +* provides `App::help_message` and `App::version_message` which allows one to override the auto-generated help/version flag associated help ([389c413](https://github.com/kbknapp/clap-rs/commit/389c413b7023dccab8c76aa00577ea1d048e7a99), closes [#889](https://github.com/kbknapp/clap-rs/issues/889)) + +#### New Settings + +* **InferSubcommands:** adds a setting to allow one to infer shortened subcommands or aliases (i.e. for subcommmand "test", "t", "te", or "tes" would be allowed assuming no other ambiguities) ([11602032](https://github.com/kbknapp/clap-rs/commit/11602032f6ff05881e3adf130356e37d5e66e8f9), closes [#863](https://github.com/kbknapp/clap-rs/issues/863)) + +#### Bug Fixes + +* doesn't print the argument sections in the help message if all args in that section are hidden ([ce5ee5f5](https://github.com/kbknapp/clap-rs/commit/ce5ee5f5a76f838104aeddd01c8ec956dd347f50)) +* doesn't include the various [ARGS] [FLAGS] or [OPTIONS] if the only ones available are hidden ([7b4000af](https://github.com/kbknapp/clap-rs/commit/7b4000af97637703645c5fb2ac8bb65bd546b95b), closes [#882](https://github.com/kbknapp/clap-rs/issues/882)) +* now correctly shows subcommand as required in the usage string when AppSettings::SubcommandRequiredElseHelp is used ([8f0884c1](https://github.com/kbknapp/clap-rs/commit/8f0884c1764983a49b45de52a1eddf8d721564d8)) +* fixes some memory leaks when an error is detected and clap exits ([8c2dd287](https://github.com/kbknapp/clap-rs/commit/8c2dd28718262ace4ae0db98563809548e02a86b)) +* fixes a trait that's marked private accidentlly, but should be crate internal public ([1ae21108](https://github.com/kbknapp/clap-rs/commit/1ae21108015cea87e5360402e1747025116c7878)) +* **Completions:** fixes a bug that tried to propogate global args multiple times when generating multiple completion scripts ([5e9b9cf4](https://github.com/kbknapp/clap-rs/commit/5e9b9cf4dd80fa66a624374fd04e6545635c1f94), closes [#846](https://github.com/kbknapp/clap-rs/issues/846)) + +#### Features + +* **Options:** adds the ability to require the equals syntax with options --opt=val ([f002693d](https://github.com/kbknapp/clap-rs/commit/f002693dec6a6959c4e9590cb7b7bfffd6d6e5bc), closes [#833](https://github.com/kbknapp/clap-rs/issues/833)) + + + + +### v2.20.5 (2017-02-18) + + +#### Bug Fixes + +* **clap_app!:** fixes a critical bug of a missing fragment specifier when using `!property` style tags. ([5635c1f94](https://github.com/kbknapp/clap-rs/commit/5e9b9cf4dd80fa66a624374fd04e6545635c1f94)) + + + +### v2.20.4 (2017-02-15) + + +#### Bug Fixes + +* **Completions:** fixes a bug that tried to propogate global args multiple times when generating multiple completion scripts ([5e9b9cf4](https://github.com/kbknapp/clap-rs/commit/5e9b9cf4dd80fa66a624374fd04e6545635c1f94), closes [#846](https://github.com/kbknapp/clap-rs/issues/846)) + +#### Documentation + +* Fix examples link in CONTRIBUTING.md ([60cf875d](https://github.com/kbknapp/clap-rs/commit/60cf875d67a252e19bb85054be57696fac2c57a1)) + + + +### v2.20.3 (2017-02-03) + + +#### Documentation + +* **Macros:** adds a warning about changing values in Cargo.toml not triggering a rebuild automatically ([112aea3e](https://github.com/kbknapp/clap-rs/commit/112aea3e42ae9e0c0a2d33ebad89496dbdd95e5d), closes [#838](https://github.com/kbknapp/clap-rs/issues/838)) + +#### Bug Fixes + +* fixes a println->debugln typo ([279aa62e](https://github.com/kbknapp/clap-rs/commit/279aa62eaf08f56ce090ba16b937bc763cbb45be)) +* fixes bash completions for commands that have an underscore in the name ([7f5cfa72](https://github.com/kbknapp/clap-rs/commit/7f5cfa724f0ac4e098f5fe466c903febddb2d994), closes [#581](https://github.com/kbknapp/clap-rs/issues/581)) +* fixes a bug where ZSH completions would panic if the binary name had an underscore in it ([891a2a00](https://github.com/kbknapp/clap-rs/commit/891a2a006f775e92c556dda48bb32fac9807c4fb), closes [#581](https://github.com/kbknapp/clap-rs/issues/581)) +* allow final word to be wrapped in wrap_help ([564c5f0f](https://github.com/kbknapp/clap-rs/commit/564c5f0f1730f4a2c1cdd128664f1a981c31dcd4), closes [#828](https://github.com/kbknapp/clap-rs/issues/828)) +* fixes a bug where global args weren't included in the generated completion scripts ([9a1e006e](https://github.com/kbknapp/clap-rs/commit/9a1e006eb75ad5a6057ebd119aa90f7e06c0ace8), closes [#841](https://github.com/kbknapp/clap-rs/issues/841)) + + + + +### v2.20.2 (2017-02-03) + +#### Bug Fixes + +* fixes a critical bug where subcommand settings were being propogated too far ([74648c94](https://github.com/kbknapp/clap-rs/commit/74648c94b893df542bfa5bb595e68c7bb8167e36), closes [#832](https://github.com/kbknapp/clap-rs/issues/832)) + + +#### Improvements + +* adds ArgGroup::multiple to the supported YAML fields for building ArgGroups from YAML ([d8590037](https://github.com/kbknapp/clap-rs/commit/d8590037ce07dafd8cd5b26928aa4a9fd3018288), closes [#840](https://github.com/kbknapp/clap-rs/issues/840)) + + +### v2.20.1 (2017-01-31) + +#### Bug Fixes + +* allow final word to be wrapped in wrap_help ([564c5f0f](https://github.com/kbknapp/clap-rs/commit/564c5f0f1730f4a2c1cdd128664f1a981c31dcd4), closes [#828](https://github.com/kbknapp/clap-rs/issues/828)) +* actually show character in debug output ([84d8c547](https://github.com/kbknapp/clap-rs/commit/84d8c5476de95b7f37d61888bc4f13688b712434)) +* include final character in line lenght ([aff4ba18](https://github.com/kbknapp/clap-rs/commit/aff4ba18da8147e1259b04b0bfbc1fcb5c78a3c0)) + +#### Improvements + +* updates libc and term_size deps for the libc version conflict ([6802ac4a](https://github.com/kbknapp/clap-rs/commit/6802ac4a59c142cda9ec55ca0c45ae5cb9a6ab55)) + +#### Documentation + +* fix link from app_from_crate! to crate_authors! (#822) ([5b29be9b](https://github.com/kbknapp/clap-rs/commit/5b29be9b073330ab1f7227cdd19fe4aab39d5dcb)) +* fix spelling of "guaranteed" ([4f30a65b](https://github.com/kbknapp/clap-rs/commit/4f30a65b9c03eb09607eb91a929a6396637dc105)) + + + +#### New Settings + +* **ArgsNegateSubcommands:** disables args being allowed between subcommands ([5e2af8c9](https://github.com/kbknapp/clap-rs/commit/5e2af8c96adb5ab75fa2d1536237ebcb41869494), closes [#793](https://github.com/kbknapp/clap-rs/issues/793)) +* **DontCollapseArgsInUsage:** disables the collapsing of positional args into `[ARGS]` in the usage string ([c2978afc](https://github.com/kbknapp/clap-rs/commit/c2978afc61fb46d5263ab3b2d87ecde1c9ce1553), closes [#769](https://github.com/kbknapp/clap-rs/issues/769)) +* **DisableHelpSubcommand:** disables building the `help` subcommand ([a10fc859](https://github.com/kbknapp/clap-rs/commit/a10fc859ee20159fbd9ff4337be59b76467a64f2)) +* **AllowMissingPositional:** allows one to implement `$ prog [optional] ` style CLIs where the second postional argument is required, but the first is optional ([1110fdc7](https://github.com/kbknapp/clap-rs/commit/1110fdc7a345c108820dc45783a9bf893fa4c214), closes [#636](https://github.com/kbknapp/clap-rs/issues/636)) +* **PropagateGlobalValuesDown:** automatically propagats global arg's values down through *used* subcommands ([985536c8](https://github.com/kbknapp/clap-rs/commit/985536c8ebcc09af98aac835f42a8072ad58c262), closes [#694](https://github.com/kbknapp/clap-rs/issues/694)) + +#### API Additions + +##### Arg + +* **Arg::value_terminator:** adds the ability to terminate multiple values with a given string or char ([be64ce0c](https://github.com/kbknapp/clap-rs/commit/be64ce0c373efc106384baca3f487ea99fe7b8cf), closes [#782](https://github.com/kbknapp/clap-rs/issues/782)) +* **Arg::default_value_if[s]:** adds new methods for *conditional* default values (such as a particular value from another argument was used) ([eb4010e7](https://github.com/kbknapp/clap-rs/commit/eb4010e7b21724447ef837db11ac441915728f22)) +* **Arg::requires_if[s]:** adds the ability to *conditionally* require additional args (such as if a particular value was used) ([198449d6](https://github.com/kbknapp/clap-rs/commit/198449d64393c265f0bc327aaeac23ec4bb97226)) +* **Arg::required_if[s]:** adds the ability for an arg to be *conditionally* required (i.e. "arg X is only required if arg Y was used with value Z") ([ee9cfddf](https://github.com/kbknapp/clap-rs/commit/ee9cfddf345a6b5ae2af42ba72aa5c89e2ca7f59)) +* **Arg::validator_os:** adds ability to validate values which may contain invalid UTF-8 ([47232498](https://github.com/kbknapp/clap-rs/commit/47232498a813db4f3366ccd3e9faf0bff56433a4)) + +##### Macros + +* **crate_description!:** Uses the `Cargo.toml` description field to fill in the `App::about` method at compile time ([4d9a82db](https://github.com/kbknapp/clap-rs/commit/4d9a82db8e875e9b64a9c2a5c6e22c25afc1279d), closes [#778](https://github.com/kbknapp/clap-rs/issues/778)) +* **crate_name!:** Uses the `Cargo.toml` name field to fill in the `App::new` method at compile time ([4d9a82db](https://github.com/kbknapp/clap-rs/commit/4d9a82db8e875e9b64a9c2a5c6e22c25afc1279d), closes [#778](https://github.com/kbknapp/clap-rs/issues/778)) +* **app_from_crate!:** Combines `crate_version!`, `crate_name!`, `crate_description!`, and `crate_authors!` into a single macro call to build a default `App` instance from the `Cargo.toml` fields ([4d9a82db](https://github.com/kbknapp/clap-rs/commit/4d9a82db8e875e9b64a9c2a5c6e22c25afc1279d), closes [#778](https://github.com/kbknapp/clap-rs/issues/778)) + + +#### Features + +* **no_cargo:** adds a `no_cargo` feature to disable Cargo-env-var-dependent macros for those *not* using `cargo` to build their crates (#786) ([6fdd2f9d](https://github.com/kbknapp/clap-rs/commit/6fdd2f9d693aaf1118fc61bd362273950703f43d)) + +#### Bug Fixes + +* **Options:** fixes a critical bug where options weren't forced to have a value ([5a5f2b1e](https://github.com/kbknapp/clap-rs/commit/5a5f2b1e9f598a0d0280ef3e98abbbba2bc41132), closes [#665](https://github.com/kbknapp/clap-rs/issues/665)) +* fixes a bug where calling the help of a subcommand wasn't ignoring required args of parent commands ([d3d34a2b](https://github.com/kbknapp/clap-rs/commit/d3d34a2b51ef31004055b0ab574f766d801c3adf), closes [#789](https://github.com/kbknapp/clap-rs/issues/789)) +* **Help Subcommand:** fixes a bug where the help subcommand couldn't be overriden ([d34ec3e0](https://github.com/kbknapp/clap-rs/commit/d34ec3e032d03e402d8e87af9b2942fe2819b2da), closes [#787](https://github.com/kbknapp/clap-rs/issues/787)) +* **Low Index Multiples:** fixes a bug which caused combinations of LowIndexMultiples and `Arg::allow_hyphen_values` to fail parsing ([26c670ca](https://github.com/kbknapp/clap-rs/commit/26c670ca16d2c80dc26d5c1ce83380ace6357318)) + +#### Improvements + +* **Default Values:** improves the error message when default values are involved ([1f33de54](https://github.com/kbknapp/clap-rs/commit/1f33de545036e7fd2f80faba251fca009bd519b8), closes [#774](https://github.com/kbknapp/clap-rs/issues/774)) +* **YAML:** adds conditional requirements and conditional default values to YAML ([9a4df327](https://github.com/kbknapp/clap-rs/commit/9a4df327893486adb5558ffefba790c634ccdc6e), closes [#764](https://github.com/kbknapp/clap-rs/issues/764)) +* Support `--("some-arg-name")` syntax for defining long arg names when using `clap_app!` macro ([f41ec962](https://github.com/kbknapp/clap-rs/commit/f41ec962c243a5ffff8b1be1ae2ad63970d3d1d4)) +* Support `("some app name")` syntax for defining app names when using `clap_app!` macro ([9895b671](https://github.com/kbknapp/clap-rs/commit/9895b671cff784f35cf56abcd8270f7c2ba09699), closes [#759](https://github.com/kbknapp/clap-rs/issues/759)) +* **Help Wrapping:** long app names (with spaces), authors, and descriptions are now wrapped appropriately ([ad4691b7](https://github.com/kbknapp/clap-rs/commit/ad4691b71a63e951ace346318238d8834e04ad8a), closes [#777](https://github.com/kbknapp/clap-rs/issues/777)) + + +#### Documentation + +* **Conditional Default Values:** fixes the failing doc tests of Arg::default_value_ifs ([4ef09101](https://github.com/kbknapp/clap-rs/commit/4ef091019c083b4db1a0c13f1c1e95ac363259f2)) +* **Conditional Requirements:** adds docs for Arg::requires_ifs ([7f296e29](https://github.com/kbknapp/clap-rs/commit/7f296e29db7d9036e76e5dbcc9c8b20dfe7b25bd)) +* **README.md:** fix some typos ([f22c21b4](https://github.com/kbknapp/clap-rs/commit/f22c21b422d5b287d1a1ac183a379ee02eebf54f)) +* **src/app/mod.rs:** fix some typos ([5c9b0d47](https://github.com/kbknapp/clap-rs/commit/5c9b0d47ca78dea285c5b9dec79063d24c3e451a)) + + +### v2.19.3 (2016-12-28) + + +#### Bug Fixes + +* fixes a bug where calling the help of a subcommand wasn't ignoring required args of parent commands ([a0ee4993](https://github.com/kbknapp/clap-rs/commit/a0ee4993015ea97b06b5bc9f378d8bcb18f1c51c), closes [#789](https://github.com/kbknapp/clap-rs/issues/789)) + + + + +### v2.19.2 (2016-12-08) + +#### Bug Fixes + +* **ZSH Completions:** escapes square brackets in ZSH completions ([7e17d5a3](https://github.com/kbknapp/clap-rs/commit/7e17d5a36b2cc2cc77e7b15796b14d639ed3cbf7), closes [#771](https://github.com/kbknapp/clap-rs/issues/771)) + +#### Documentation + +* **Examples:** adds subcommand examples ([0e0f3354](https://github.com/kbknapp/clap-rs/commit/0e0f33547a6901425afc1d9fbe19f7ae3832d9a4), closes [#766](https://github.com/kbknapp/clap-rs/issues/766)) +* **README.md:** adds guidance on when to use ~ in version pinning, and clarifies breaking change policy ([591eaefc](https://github.com/kbknapp/clap-rs/commit/591eaefc7319142ba921130e502bb0729feed907), closes [#765](https://github.com/kbknapp/clap-rs/issues/765)) + + + + +### v2.19.1 (2016-12-01) + + +#### Bug Fixes + +* **Help Messages:** fixes help message alignment when specific settings are used on options ([cd94b318](https://github.com/kbknapp/clap-rs/commit/cd94b3188d63b63295a319e90e826bca46befcd2), closes [#760](https://github.com/kbknapp/clap-rs/issues/760)) + +#### Improvements + +* **Bash Completion:** allows bash completion to fall back to traidtional bash completion upon no matching completing function ([b1b16d56](https://github.com/kbknapp/clap-rs/commit/b1b16d56d8fddf819bdbe24b3724bb6a9f3fa613))) + + + +## v2.19.0 (2016-11-21) + +#### Features + +* allows specifying AllowLeadingHyphen style values, but only for specific args vice command wide ([c0d70feb](https://github.com/kbknapp/clap-rs/commit/c0d70febad9996a77a54107054daf1914c50d4ef), closes [#742](https://github.com/kbknapp/clap-rs/issues/742)) + +#### Bug Fixes + +* **Required Unless:** fixes a bug where having required_unless set doesn't work when conflicts are also set ([d20331b6](https://github.com/kbknapp/clap-rs/commit/d20331b6f7940ac3a4e919999f8bb4780875125d), closes [#753](https://github.com/kbknapp/clap-rs/issues/753)) +* **ZSH Completions:** fixes an issue where zsh completions caused panics if there were no subcommands ([49e7cdab](https://github.com/kbknapp/clap-rs/commit/49e7cdab76dd1ccc07221e360f07808ec62648aa), closes [#754](https://github.com/kbknapp/clap-rs/issues/754)) + +#### Improvements + +* **Validators:** improves the error messages for validators ([65eb3385](https://github.com/kbknapp/clap-rs/commit/65eb33859d3ff53e7d3277f02a9d3fd9038a9dfb), closes [#744](https://github.com/kbknapp/clap-rs/issues/744)) + +#### Documentation + +* updates the docs landing page ([01e1e33f](https://github.com/kbknapp/clap-rs/commit/01e1e33f377934099a4a725fab5cd6c5ff50eaa2)) +* adds the macro version back to the readme ([45eb9bf1](https://github.com/kbknapp/clap-rs/commit/45eb9bf130329c3f3853aba0342c2fe3c64ff80f)) +* fix broken docs links ([808e7cee](https://github.com/kbknapp/clap-rs/commit/808e7ceeb86d4a319bdc270f51c23a64621dbfb3)) +* **Compatibility Policy:** adds an official compatibility policy to ([760d66dc](https://github.com/kbknapp/clap-rs/commit/760d66dc17310b357f257776624151da933cd25d), closes [#740](https://github.com/kbknapp/clap-rs/issues/740)) +* **Contributing:** updates the readme to improve the readability and contributing sections ([eb51316c](https://github.com/kbknapp/clap-rs/commit/eb51316cdfdc7258d287ba13b67ef2f42bd2b8f6)) + + +## v2.18.0 (2016-11-05) + + +#### Features + +* **Completions:** adds completion support for PowerShell. ([cff82c88](https://github.com/kbknapp/clap-rs/commit/cff82c880e21064fca63351507b80350df6caadf), closes [#729](https://github.com/kbknapp/clap-rs/issues/729)) + + + + +### v2.17.1 (2016-11-02) + + +#### Bug Fixes + +* **Low Index Multiples:** fixes a bug where using low index multiples was propgated to subcommands ([33924e88](https://github.com/kbknapp/clap-rs/commit/33924e884461983c4e6b5ea1330fecc769a4ade7), closes [#725](https://github.com/kbknapp/clap-rs/issues/725)) + + + + +## v2.17.0 (2016-11-01) + + +#### Features + +* **Positional Args:** allows specifying the second to last positional argument as multiple(true) ([1ced2a74](https://github.com/kbknapp/clap-rs/commit/1ced2a7433ea8937a1b260ea65d708f32ca7c95e), closes [#725](https://github.com/kbknapp/clap-rs/issues/725)) + + + + +### v2.16.4 (2016-10-31) + + +#### Improvements + +* **Error Output:** conflicting errors are now symetrical, meaning more consistent and less confusing ([3d37001d](https://github.com/kbknapp/clap-rs/commit/3d37001d1dc647d73cc597ff172f1072d4beb80d), closes [#718](https://github.com/kbknapp/clap-rs/issues/718)) + +#### Documentation + +* Fix typo in example `13a_enum_values_automatic` ([c22fbc07](https://github.com/kbknapp/clap-rs/commit/c22fbc07356e556ffb5d1a79ec04597d149b915e)) +* **README.md:** fixes failing yaml example (#715) ([21fba9e6](https://github.com/kbknapp/clap-rs/commit/21fba9e6cd8c163012999cd0ce271ec8780c5695)) + +#### Bug Fixes + +* **ZSH Completions:** fixes bug that caused panic on subcommands with aliases ([5c70e1a0](https://github.com/kbknapp/clap-rs/commit/5c70e1a01bc977e44c10015d18bb8e215c32dfc8), closes [#714](https://github.com/kbknapp/clap-rs/issues/714)) +* **debug:** fixes the debug feature (#716) ([6c11ccf4](https://github.com/kbknapp/clap-rs/commit/6c11ccf443d46258d51f7cda33fbcc81e7fe8e90)) + + + + +### v2.16.3 (2016-10-28) + + +#### Bug Fixes + +* Derive display order after propagation ([9cb6facf](https://github.com/kbknapp/clap-rs/commit/9cb6facf507aff7cddd124b8c29714d2b0e7bd13), closes [#706](https://github.com/kbknapp/clap-rs/issues/706)) +* **yaml-example:** inconsistent args ([847f7199](https://github.com/kbknapp/clap-rs/commit/847f7199219ead5065561d91d64780d99ae4b587)) + + + + +### v2.16.2 (2016-10-25) + + +#### Bug Fixes + +* **Fish Completions:** fixes a bug where single quotes are not escaped ([780b4a18](https://github.com/kbknapp/clap-rs/commit/780b4a18281b6f7f7071e1b9db2290fae653c406), closes [#704](https://github.com/kbknapp/clap-rs/issues/704)) + + + +### v2.16.1 (2016-10-24) + + +#### Bug Fixes + +* **Help Message:** fixes a regression bug where args with multiple(true) threw off alignment ([ebddac79](https://github.com/kbknapp/clap-rs/commit/ebddac791f3ceac193d5ad833b4b734b9643a7af), closes [#702](https://github.com/kbknapp/clap-rs/issues/702)) + + + + +## v2.16.0 (2016-10-23) + + +#### Features + +* **Completions:** adds ZSH completion support ([3e36b0ba](https://github.com/kbknapp/clap-rs/commit/3e36b0bac491d3f6194aee14604caf7be26b3d56), closes [#699](https://github.com/kbknapp/clap-rs/issues/699)) + + + + +## v2.15.0 (2016-10-21) + + +#### Features + +* **AppSettings:** adds new setting `AppSettings::AllowNegativeNumbers` ([ab064546](https://github.com/kbknapp/clap-rs/commit/ab06454677fb6aa9b9f804644fcca2168b1eaee3), closes [#696](https://github.com/kbknapp/clap-rs/issues/696)) + +#### Documentation + +* **app/settings.rs:** moves variants to roughly alphabetical order ([9ed4d4d7](https://github.com/kbknapp/clap-rs/commit/9ed4d4d7957a23357aef60081e45639ab9e3905f)) + + + +### v2.14.1 (2016-10-20) + + +#### Documentation + +* Improve documentation around features ([4ee85b95](https://github.com/kbknapp/clap-rs/commit/4ee85b95d2d16708a016a3ba4e6e2c93b89b7fad)) +* reword docs for ErrorKind and app::Settings ([3ccde7a4](https://github.com/kbknapp/clap-rs/commit/3ccde7a4b8f7a2ea8b916a5415c04a8ff4b5cb7a)) +* fix tests that fail when the "suggestions" feature is disabled ([996fc381](https://github.com/kbknapp/clap-rs/commit/996fc381763a48d125c7ea8a58fed057fd0b4ac6)) +* fix the OsString-using doc-tests ([af9e1a39](https://github.com/kbknapp/clap-rs/commit/af9e1a393ce6cdda46a03c8a4f48df222b015a24)) +* tag non-rust code blocks as such instead of ignoring them ([0ba9f4b1](https://github.com/kbknapp/clap-rs/commit/0ba9f4b123f281952581b6dec948f7e51dd22890)) +* **ErrorKind:** improve some errors about subcommands ([9f6217a4](https://github.com/kbknapp/clap-rs/commit/9f6217a424da823343d7b801b9c350dee3cd1906)) +* **yaml:** make sure the doc-tests don't fail before "missing file" ([8c0f5551](https://github.com/kbknapp/clap-rs/commit/8c0f55516f4910c78c9f8a2bdbd822729574f95b)) + +#### Improvements + +* Stabilize clap_app! ([cd516006](https://github.com/kbknapp/clap-rs/commit/cd516006e35c37b005f329338560a0a53d1f3e00)) +* **with_defaults:** Deprecate App::with_defaults() ([26085409](https://github.com/kbknapp/clap-rs/commit/2608540940c8bb66e517b65706bc7dea55510682), closes [#638](https://github.com/kbknapp/clap-rs/issues/638)) + +#### Bug Fixes + +* fixes a bug that made determining when to auto-wrap long help messages inconsistent ([468baadb](https://github.com/kbknapp/clap-rs/commit/468baadb8398fc1d37897b0c49374aef4cf97dca), closes [#688](https://github.com/kbknapp/clap-rs/issues/688)) +* **Completions:** fish completions for nested subcommands ([a61eaf8a](https://github.com/kbknapp/clap-rs/commit/a61eaf8aade76cfe90ccc0f7125751ebf60e3254)) +* **features:** Make lints not enable other nightly-requiring features ([835f75e3](https://github.com/kbknapp/clap-rs/commit/835f75e3ba20999117363ed9f916464d777f36ef)) + + + + +## v2.14.0 (2016-10-05) + + +#### Features + +* **arg_aliases:** Ability to alias arguments ([33b5f6ef](https://github.com/kbknapp/clap-rs/commit/33b5f6ef2c9612ecabb31f96b824793e46bfd3dd), closes [#669](https://github.com/kbknapp/clap-rs/issues/669)) +* **flag_aliases:** Ability to alias flags ([40d6dac9](https://github.com/kbknapp/clap-rs/commit/40d6dac973927dded6ab423481634ef47ee7bfd7)) + +#### Bug Fixes + +* **UsageParser:** Handle non-ascii names / options. ([1d6a7c6e](https://github.com/kbknapp/clap-rs/commit/1d6a7c6e7e6aadc527346aa822f19d8587f714f3), closes [#664](https://github.com/kbknapp/clap-rs/issues/664)) + +#### Documentation + +* typo ([bac417fa](https://github.com/kbknapp/clap-rs/commit/bac417fa1cea3d32308334c7cccfcf54546cd9d8)) + + + +## v2.13.0 (2016-09-18) + + +#### Documentation + +* updates README.md with new website information and updated video tutorials info ([0c19c580](https://github.com/kbknapp/clap-rs/commit/0c19c580cf50f1b82ff32f70b36708ae2bcac132)) +* updates the docs about removing implicit value_delimiter(true) ([c81bc722](https://github.com/kbknapp/clap-rs/commit/c81bc722ebb8a86d22be89b5aec98df9fe222a08)) +* **Default Values:** adds better examples on using default values ([57a8d9ab](https://github.com/kbknapp/clap-rs/commit/57a8d9abb2f973c235a8a14f8fc031673d7a7460), closes [#418](https://github.com/kbknapp/clap-rs/issues/418)) + +#### Bug Fixes + +* **Value Delimiters:** fixes the confusion around implicitly setting value delimiters. (default is now `false`) ([09d4d0a9](https://github.com/kbknapp/clap-rs/commit/09d4d0a9038d7ce2df55c2aec95e16f36189fcee), closes [#666](https://github.com/kbknapp/clap-rs/issues/666)) + + + + +### v2.12.1 (2016-09-13) + + +#### Bug Fixes + +* **Help Wrapping:** fixes a regression-bug where the old {n} newline char stopped working ([92ac353b](https://github.com/kbknapp/clap-rs/commit/92ac353b48b7caa2511ad2a046d94da93c236cf6), closes [#661](https://github.com/kbknapp/clap-rs/issues/661)) + + + + +## v2.12.0 (2016-09-13) + + +#### Features + +* **Help:** adds ability to hide the possible values on a per argument basis ([9151ef73](https://github.com/kbknapp/clap-rs/commit/9151ef739871f2e74910c342299c0de196b95dec), closes [#640](https://github.com/kbknapp/clap-rs/issues/640)) +* **help:** allow for limiting detected terminal width ([a43e28af](https://github.com/kbknapp/clap-rs/commit/a43e28af85c9a9deaedd5ef735f4f13008daab29), closes [#653](https://github.com/kbknapp/clap-rs/issues/653)) + +#### Documentation + +* **Help Wrapping:** removes the verbage about using `'{n}'` to insert newlines in help text ([c5a2b352](https://github.com/kbknapp/clap-rs/commit/c5a2b352ca600f5b802290ad945731066cd53611)) +* **Value Delimiters:** updates the docs for the Arg::multiple method WRT value delimiters and default settings ([f9d17a06](https://github.com/kbknapp/clap-rs/commit/f9d17a060aa53f10d0a6e1a7eed5d989d1a59533)) +* **appsettings:** Document AppSetting::DisableVersion ([94501965](https://github.com/kbknapp/clap-rs/commit/945019654d2ca67eb2b1d6014fdf80b84d528d30), closes [#589](https://github.com/kbknapp/clap-rs/issues/589)) + +#### Bug Fixes + +* **AllowLeadingHyphen:** fixes a bug where valid args aren't recognized with this setting ([a9699e4d](https://github.com/kbknapp/clap-rs/commit/a9699e4d7cdc9a06e73b845933ff1fe6d76f016a), closes [#588](https://github.com/kbknapp/clap-rs/issues/588)) + +#### Improvements + +* **Help Wrapping:** + * clap now ignores hard newlines in help messages and properly re-aligns text, but still wraps if the term width is too small ([c7678523](https://github.com/kbknapp/clap-rs/commit/c76785239fd42adc8ca04f9202b6fec615aa9f14), closes [#617](https://github.com/kbknapp/clap-rs/issues/617)) + * makes some minor changes to when next line help is automatically used ([01cae799](https://github.com/kbknapp/clap-rs/commit/01cae7990a33167ac35103fb36c811b4fe6eb98f)) +* **Value Delimiters:** changes the default value delimiter rules ([f9e69254](https://github.com/kbknapp/clap-rs/commit/f9e692548e8c94de15f909432de301407d6bb834), closes [#655](https://github.com/kbknapp/clap-rs/issues/655)) +* **YAML:** supports setting Arg::require_delimiter from YAML ([b9b55a39](https://github.com/kbknapp/clap-rs/commit/b9b55a39dfebcdbdc05dca2692927e503db50816)) + +#### Performance + +* **help:** fix redundant contains() checks ([a8afed74](https://github.com/kbknapp/clap-rs/commit/a8afed7428bf0733f8e93bb11ad6c00d9e970fcc)) + + + + +### v2.11.3 (2016-09-07) + + +#### Documentation + +* **Help Wrapping:** removes the verbage about using `'{n}'` to insert newlines in help text ([c5a2b352](https://github.com/kbknapp/clap-rs/commit/c5a2b352ca600f5b802290ad945731066cd53611)) + +#### Improvements + +* **Help Wrapping:** + * clap now ignores hard newlines in help messages and properly re-aligns text, but still wraps if the term width is too small ([c7678523](https://github.com/kbknapp/clap-rs/commit/c76785239fd42adc8ca04f9202b6fec615aa9f14), closes [#617](https://github.com/kbknapp/clap-rs/issues/617)) + * makes some minor changes to when next line help is automatically used ([01cae799](https://github.com/kbknapp/clap-rs/commit/01cae7990a33167ac35103fb36c811b4fe6eb98f)) +* **YAML:** supports setting Arg::require_delimiter from YAML ([b9b55a39](https://github.com/kbknapp/clap-rs/commit/b9b55a39dfebcdbdc05dca2692927e503db50816)) + + + + + +### v2.11.2 (2016-09-06) + +#### Improvements + +* **Help Wrapping:** makes some minor changes to when next line help is automatically used ([5658b117](https://github.com/kbknapp/clap-rs/commit/5658b117aec3e03adff9c8c52a4c4bc1fcb4e1ff)) + + + +### v2.11.1 (2016-09-05) + + +#### Bug Fixes + +* **Settings:** fixes an issue where settings weren't propogated down through grand-child subcommands ([b3efc107](https://github.com/kbknapp/clap-rs/commit/b3efc107515d78517b20798ff3890b8a2b04498e), closes [#638](https://github.com/kbknapp/clap-rs/issues/638)) + +#### Features + +* **Errors:** Errors with custom description ([58512f2f](https://github.com/kbknapp/clap-rs/commit/58512f2fcb430745f1ee6ee8f1c67f62dc216c73)) + +#### Improvements + +* **help:** use term_size instead of home-grown solution ([fc7327e9](https://github.com/kbknapp/clap-rs/commit/fc7327e9dcf4258ef2baebf0a8714d9c0622855b)) + + + + +### v2.11.0 (2016-08-28) + + +#### Bug Fixes + +* **Groups:** fixes some usage strings that contain both args in groups and ones that conflict with each other ([3d782def](https://github.com/kbknapp/clap-rs/commit/3d782def57725e2de26ca5a5bc5cc2e40ddebefb), closes [#616](https://github.com/kbknapp/clap-rs/issues/616)) + +#### Documentation + +* moves docs to docs.rs ([03209d5e](https://github.com/kbknapp/clap-rs/commit/03209d5e1300906f00bafec1869c2047a92e5071), closes [#634](https://github.com/kbknapp/clap-rs/issues/634)) + +#### Improvements + +* **Completions:** uses standard conventions for bash completion files, namely '{bin}.bash-completion' ([27f5bbfb](https://github.com/kbknapp/clap-rs/commit/27f5bbfbcc9474c2f57c2b92b1feb898ae46ee70), closes [#567](https://github.com/kbknapp/clap-rs/issues/567)) +* **Help:** automatically moves help text to the next line and wraps when term width is determined to be too small, or help text is too long ([150964c4](https://github.com/kbknapp/clap-rs/commit/150964c4e7124d54476c9d9b4b3f2406f0fd00e5), closes [#597](https://github.com/kbknapp/clap-rs/issues/597)) +* **YAML Errors:** vastly improves error messages when using YAML ([f43b7c65](https://github.com/kbknapp/clap-rs/commit/f43b7c65941c53adc0616b8646a21dc255862eb2), closes [#574](https://github.com/kbknapp/clap-rs/issues/574)) + +#### Features + +* adds App::with_defaults to automatically use crate_authors! and crate_version! macros ([5520bb01](https://github.com/kbknapp/clap-rs/commit/5520bb012c127dfd299fd55699443c744d8dcd5b), closes [#600](https://github.com/kbknapp/clap-rs/issues/600)) + + + + +### v2.10.4 (2016-08-25) + + +#### Bug Fixes + +* **Help Wrapping:** fixes a bug where help is wrapped incorrectly and causing a panic with some non-English characters ([d0b442c7](https://github.com/kbknapp/clap-rs/commit/d0b442c7beeecac9764406bc3bd171ced0b8825e), closes [#626](https://github.com/kbknapp/clap-rs/issues/626)) + + + + +### v2.10.3 (2016-08-25) + +#### Features + +* **Help:** adds new short hand way to use source formatting and ignore term width in help messages ([7dfdaf20](https://github.com/kbknapp/clap-rs/commit/7dfdaf200ebb5c431351a045b48f5e0f0d3f31db), closes [#625](https://github.com/kbknapp/clap-rs/issues/625)) + +#### Documentation + +* **Term Width:** adds details about set_term_width(0) ([00b8205d](https://github.com/kbknapp/clap-rs/commit/00b8205d22639d1b54b9c453c55c785aace52cb2)) + +#### Bug Fixes + +* **Unicode:** fixes two bugs where non-English characters were stripped or caused a panic with help wrapping ([763a5c92](https://github.com/kbknapp/clap-rs/commit/763a5c920e23efc74d190af0cb8b5dd714b2d67a), closes [#626](https://github.com/kbknapp/clap-rs/issues/626)) + + + + +### v2.10.2 (2016-08-22) + + +#### Bug Fixes + +* fixes a bug where the help is printed twice ([a643fb28](https://github.com/kbknapp/clap-rs/commit/a643fb283acd9905dc727c4579c5c9fa2ceaa7e7), closes [#623](https://github.com/kbknapp/clap-rs/issues/623)) + + + + +### v2.10.1 (2016-08-21) + + +#### Bug Fixes + +* **Help Subcommand:** fixes misleading usage string when using multi-level subcommmands ([e203515e](https://github.com/kbknapp/clap-rs/commit/e203515e3ac495b405dbba4f78fb6af148fd282e), closes [#618](https://github.com/kbknapp/clap-rs/issues/618)) + +#### Features + +* **YAML:** allows using lists or single values with arg declarations ([9ade2cd4](https://github.com/kbknapp/clap-rs/commit/9ade2cd4b268d6d7fe828319ce6a523c641b9c38), closes [#614](https://github.com/kbknapp/clap-rs/issues/614), [#613](https://github.com/kbknapp/clap-rs/issues/613)) + + + + +## v2.10.0 (2016-07-29) + + +#### Features + +* **Completions:** one can generate a basic fish completions script at compile time ([1979d2f2](https://github.com/kbknapp/clap-rs/commit/1979d2f2f3216e57d02a97e624a8a8f6cf867ed9)) + +#### Bug Fixes + +* **parser:** preserve external subcommand name ([875df243](https://github.com/kbknapp/clap-rs/commit/875df24316c266920a073c13bbefbf546bc1f635)) + +#### Breaking Changes + +* **parser:** preserve external subcommand name ([875df243](https://github.com/kbknapp/clap-rs/commit/875df24316c266920a073c13bbefbf546bc1f635)) + +#### Documentation + +* **YAML:** fixes example 17's incorrect reference to arg_groups instead of groups ([b6c99e13](https://github.com/kbknapp/clap-rs/commit/b6c99e1377f918e78c16c8faced70a71607da931), closes [#601](https://github.com/kbknapp/clap-rs/issues/601)) + + + + +### 2.9.3 (2016-07-24) + + +#### Bug Fixes + +* fixes bug where only first arg in list of required_unless_one is recognized ([1fc3b55b](https://github.com/kbknapp/clap-rs/commit/1fc3b55bd6c8653b02e7c4253749c6b77737d2ac), closes [#575](https://github.com/kbknapp/clap-rs/issues/575)) +* **Settings:** fixes typo subcommandsrequired->subcommandrequired ([fc72cdf5](https://github.com/kbknapp/clap-rs/commit/fc72cdf591d30f5d9375d0b5cc2a2ff3e812f9f6), closes [#593](https://github.com/kbknapp/clap-rs/issues/593)) + +#### Features + +* **Completions:** adds the ability to generate completions to io::Write object ([9f62cf73](https://github.com/kbknapp/clap-rs/commit/9f62cf7378ba5acb5ce8c5bac89b4aa60c30755f)) +* **Settings:** Add unset_setting and unset_settings fns to App (#598) ([0ceba231](https://github.com/kbknapp/clap-rs/commit/0ceba231c6767cd6d88fdb1feeeea41deadf77ff), closes [#590](https://github.com/kbknapp/clap-rs/issues/590)) + + + +### 2.9.2 (2016-07-03) + + +#### Documentation + +* **Completions:** fixes the formatting of the Cargo.toml excerpt in the completions example ([722f2607](https://github.com/kbknapp/clap-rs/commit/722f2607beaef56b6a0e433db5fd09492d9f028c)) + +#### Bug Fixes + +* **Completions:** fixes bug where --help and --version short weren't added to the completion list ([e9f2438e](https://github.com/kbknapp/clap-rs/commit/e9f2438e2ce99af0ae570a2eaf541fc7f55b771b), closes [#536](https://github.com/kbknapp/clap-rs/issues/536)) + + + + +### 2.9.1 (2016-07-02) + + +#### Improvements + +* **Completions:** allows multiple completions to be built by namespacing with bin name ([57484b2d](https://github.com/kbknapp/clap-rs/commit/57484b2daeaac01c1026e8c84efc8bf099e0eb31)) + + + +## v2.9.0 (2016-07-01) + + +#### Documentation + +* **Completions:** + * fixes some errors in the completion docs ([9b359bf0](https://github.com/kbknapp/clap-rs/commit/9b359bf06255d3dad8f489308044b60a9d1e6a87)) + * adds documentation for completion scripts ([c6c519e4](https://github.com/kbknapp/clap-rs/commit/c6c519e40efd6c4533a9ef5efe8e74fd150391b7)) + +#### Features + +* **Completions:** + * one can now generate a bash completions script at compile time! ([e75b6c7b](https://github.com/kbknapp/clap-rs/commit/e75b6c7b75f729afb9eb1d2a2faf61dca7674634), closes [#376](https://github.com/kbknapp/clap-rs/issues/376)) + * completions now include aliases to subcommands, including all subcommand options ([0ab9f840](https://github.com/kbknapp/clap-rs/commit/0ab9f84052a8cf65b5551657f46c0c270841e634), closes [#556](https://github.com/kbknapp/clap-rs/issues/556)) + * completions now continue completing even after first completion ([18fc2e5b](https://github.com/kbknapp/clap-rs/commit/18fc2e5b5af63bf54a94b72cec5e1223d49f4806)) + * allows matching on possible values in options ([89cc2026](https://github.com/kbknapp/clap-rs/commit/89cc2026ba9ac69cf44c5254360bbf99236d4f89), closes [#557](https://github.com/kbknapp/clap-rs/issues/557)) + +#### Bug Fixes + +* **AllowLeadingHyphen:** fixes an issue where isn't ignored like it should be with this setting ([96c24c9a](https://github.com/kbknapp/clap-rs/commit/96c24c9a8fa1f85e06138d3cdd133e51659e19d2), closes [#558](https://github.com/kbknapp/clap-rs/issues/558)) + + +## v2.8.0 (2016-06-30) + + +#### Features + +* **Arg:** adds new setting `Arg::require_delimiter` which requires val delimiter to parse multiple values ([920b5595](https://github.com/kbknapp/clap-rs/commit/920b5595ed72abfb501ce054ab536067d8df2a66)) + +#### Bug Fixes + +* Declare term::Winsize as repr(C) ([5d663d90](https://github.com/kbknapp/clap-rs/commit/5d663d905c9829ce6e7a164f1f0896cdd70236dd)) + +#### Documentation + +* **Arg:** adds docs for ([49af4e38](https://github.com/kbknapp/clap-rs/commit/49af4e38a5dae2ab0a7fc3b4147e2c053d532484)) + + + + +### v2.7.1 (2016-06-29) + + +#### Bug Fixes + +* **Options:** + * options with multiple values and using delimiters no longer parse additional values after a trailing space ([cdc500bd](https://github.com/kbknapp/clap-rs/commit/cdc500bdde6abe238c36ade406ddafc2bafff583)) + * using options with multiple values and with an = no longer parse args after the trailing space as values ([290f61d0](https://github.com/kbknapp/clap-rs/commit/290f61d07177413cf082ada55526d83405f6d011)) + + + + +## v2.7.0 (2016-06-28) + + +#### Documentation + +* fix typos ([43b3d40b](https://github.com/kbknapp/clap-rs/commit/43b3d40b8c38b1571da75af86b5088be96cccec2)) +* **ArgGroup:** vastly improves ArgGroup docs by adding better examples ([9e5f4f5d](https://github.com/kbknapp/clap-rs/commit/9e5f4f5d734d630bca5535c3a0aa4fd4f9db3e39), closes [#534](https://github.com/kbknapp/clap-rs/issues/534)) + +#### Features + +* **ArgGroup:** one can now specify groups which require AT LEAST one of the args ([33689acc](https://github.com/kbknapp/clap-rs/commit/33689acc689b217a8c0ee439f1b1225590c38355), closes [#533](https://github.com/kbknapp/clap-rs/issues/533)) + +#### Bug Fixes + +* **App:** using `App::print_help` now prints the same as would have been printed by `--help` or the like ([e84cc018](https://github.com/kbknapp/clap-rs/commit/e84cc01836bbe0527e97de6db9889bd9e0fd6ba1), closes [#536](https://github.com/kbknapp/clap-rs/issues/536)) +* **Help:** + * prevents invoking help help and displaying incorrect help message ([e3d2893f](https://github.com/kbknapp/clap-rs/commit/e3d2893f377942a2d4cf3c6ff04524d0346e6fdb), closes [#538](https://github.com/kbknapp/clap-rs/issues/538)) + * subcommand help messages requested via help now correctly match --help ([08ad1cff](https://github.com/kbknapp/clap-rs/commit/08ad1cff4fec57224ea957a2891a057b323c01bc), closes [#539](https://github.com/kbknapp/clap-rs/issues/539)) + +#### Improvements + +* **ArgGroup:** Add multiple ArgGroups per Arg ([902e182f](https://github.com/kbknapp/clap-rs/commit/902e182f7a58aff11ff01e0a452abcdbdb2262aa), closes [#426](https://github.com/kbknapp/clap-rs/issues/426)) +* **Usage Strings:** `[FLAGS]` and `[ARGS]` are no longer blindly added to usage strings ([9b2e45b1](https://github.com/kbknapp/clap-rs/commit/9b2e45b170aff567b038d8b3368880b6046c10c6), closes [#537](https://github.com/kbknapp/clap-rs/issues/537)) +* **arg_enum!:** allows using meta items like repr(C) with arg_enum!s ([edf9b233](https://github.com/kbknapp/clap-rs/commit/edf9b2331c17a2cbcc13f961add4c55c2778e773), closes [#543](https://github.com/kbknapp/clap-rs/issues/543)) + + + + +## v2.6.0 (2016-06-14) + + +#### Improvements + +* removes extra newline from help output ([86e61d19](https://github.com/kbknapp/clap-rs/commit/86e61d19a748fb9870fcf1175308984e51ca1115)) +* allows printing version to any io::Write object ([921f5f79](https://github.com/kbknapp/clap-rs/commit/921f5f7916597f1d028cd4a65bfe76a01c801724)) +* removes extra newline when printing version ([7e2e2cbb](https://github.com/kbknapp/clap-rs/commit/7e2e2cbb4a8a0f050bb8072a376f742fc54b8589)) +* **Aliases:** improves readability of asliases in help messages ([ca511de7](https://github.com/kbknapp/clap-rs/commit/ca511de71f5b8c2ac419f1b188658e8c63b67846), closes [#526](https://github.com/kbknapp/clap-rs/issues/526), [#529](https://github.com/kbknapp/clap-rs/issues/529)) +* **Usage Strings:** improves the default usage string when only a single positional arg is present ([ec86f2da](https://github.com/kbknapp/clap-rs/commit/ec86f2dada1545a63fc72355e22fcdc4c466c215), closes [#518](https://github.com/kbknapp/clap-rs/issues/518)) + +#### Features + +* **Help:** allows wrapping at specified term width (Even on Windows!) ([1761dc0d](https://github.com/kbknapp/clap-rs/commit/1761dc0d27d0d621229d792be40c36fbf65c3014), closes [#451](https://github.com/kbknapp/clap-rs/issues/451)) +* **Settings:** + * adds new setting to stop delimiting values with -- or TrailingVarArg ([fc3e0f5a](https://github.com/kbknapp/clap-rs/commit/fc3e0f5afda6d24cdb3c4676614beebe13e1e870), closes [#511](https://github.com/kbknapp/clap-rs/issues/511)) + * one can now set an AppSetting which is propogated down through child subcommands ([e2341835](https://github.com/kbknapp/clap-rs/commit/e23418351a3b98bf08dfd7744bc14377c70d59ee), closes [#519](https://github.com/kbknapp/clap-rs/issues/519)) +* **Subcommands:** adds support for visible aliases ([7b10e7f8](https://github.com/kbknapp/clap-rs/commit/7b10e7f8937a07fdb8d16a6d8df79ce78d080cd3), closes [#522](https://github.com/kbknapp/clap-rs/issues/522)) + +#### Bug Fixes + +* fixes bug where args are printed out of order with templates ([05abb534](https://github.com/kbknapp/clap-rs/commit/05abb534864764102031a0d402e64ac65867aa87)) +* fixes bug where one can't override version or help flags ([90d7d6a2](https://github.com/kbknapp/clap-rs/commit/90d7d6a2ea8240122dd9bf8d82d3c4f5ebb5c703), closes [#514](https://github.com/kbknapp/clap-rs/issues/514)) +* fixes issue where before_help wasn't printed ([b3faff60](https://github.com/kbknapp/clap-rs/commit/b3faff6030f76a23f26afcfa6a90169002ed7106)) +* **Help:** `App::before_help` and `App::after_help` now correctly wrap ([1f4da767](https://github.com/kbknapp/clap-rs/commit/1f4da7676e6e71aa8dda799f3eeefad105a47819), closes [#516](https://github.com/kbknapp/clap-rs/issues/516)) +* **Settings:** fixes bug where new color settings couldn't be converted from strs ([706a7c11](https://github.com/kbknapp/clap-rs/commit/706a7c11b0900be594de6d5a3121938eff197602)) +* **Subcommands:** subcommands with aliases now display help of the aliased subcommand ([5354d14b](https://github.com/kbknapp/clap-rs/commit/5354d14b51f189885ba110e01e6b76cca3752992), closes [#521](https://github.com/kbknapp/clap-rs/issues/521)) +* **Windows:** fixes a failing windows build ([01e7dfd6](https://github.com/kbknapp/clap-rs/commit/01e7dfd6c07228c0be6695b3c7bf9370d82860d4)) +* **YAML:** adds missing YAML methods for App and Arg ([e468faf3](https://github.com/kbknapp/clap-rs/commit/e468faf3f05950fd9f72d84b69aa2061e91c6c64), closes [#528](https://github.com/kbknapp/clap-rs/issues/528)) + + + + +### v2.5.2 (2016-05-31) + + +#### Improvements + +* removes extra newline from help output ([86e61d19](https://github.com/kbknapp/clap-rs/commit/86e61d19a748fb9870fcf1175308984e51ca1115)) +* allows printing version to any io::Write object ([921f5f79](https://github.com/kbknapp/clap-rs/commit/921f5f7916597f1d028cd4a65bfe76a01c801724)) +* removes extra newline when printing version ([7e2e2cbb](https://github.com/kbknapp/clap-rs/commit/7e2e2cbb4a8a0f050bb8072a376f742fc54b8589)) + +#### Bug Fixes + +* fixes bug where args are printed out of order with templates ([3935431d](https://github.com/kbknapp/clap-rs/commit/3935431d5633f577c0826ae2142794b301f4b8ca)) +* fixes bug where one can't override version or help flags ([90d7d6a2](https://github.com/kbknapp/clap-rs/commit/90d7d6a2ea8240122dd9bf8d82d3c4f5ebb5c703), closes [#514](https://github.com/kbknapp/clap-rs/issues/514)) +* fixes issue where before_help wasn't printed ([b3faff60](https://github.com/kbknapp/clap-rs/commit/b3faff6030f76a23f26afcfa6a90169002ed7106)) + +#### Documentation + +* inter-links all types and pages ([3312893d](https://github.com/kbknapp/clap-rs/commit/3312893ddaef3f44d68d8d26ed3d08010be50d97), closes [#505](https://github.com/kbknapp/clap-rs/issues/505)) +* makes all publicly available types viewable in docs ([52ca6505](https://github.com/kbknapp/clap-rs/commit/52ca6505b4fec7b5c2d53d160c072d395eb21da6)) + + +### v2.5.1 (2016-05-11) + + +#### Bug Fixes + +* **Subcommand Aliases**: fixes lifetime issue when setting multiple aliases at once ([ac42f6cf0](https://github.com/kbknapp/clap-rs/commit/ac42f6cf0de6c4920f703807d63061803930b18d)) + + +## v2.5.0 (2016-05-10) + + +#### Improvements + +* **SubCommand Aliases:** adds feature to yaml configs too ([69592195](https://github.com/kbknapp/clap-rs/commit/695921954dde46dfd483399dcdef482c9dd7f34a)) + +#### Features + +* **SubCommands:** adds support for subcommand aliases ([66b4dea6](https://github.com/kbknapp/clap-rs/commit/66b4dea65c44d8f77ff522238a9237aed1bcab6d), closes [#469](https://github.com/kbknapp/clap-rs/issues/469)) + + + +### v2.4.3 (2016-05-10) + + +#### Bug Fixes + +* **Usage Strings:** + * now properly dedups args that are also in groups ([3ca0947c](https://github.com/kbknapp/clap-rs/commit/3ca0947c166b4f8525752255e3a4fa6565eb9689), closes [#498](https://github.com/kbknapp/clap-rs/issues/498)) + * removes duplicate groups from usage strings ([f574fb8a](https://github.com/kbknapp/clap-rs/commit/f574fb8a7cde4d4a2fa4c4481d59be2d0f135427)) + +#### Improvements + +* **Groups:** formats positional args in groups in a better way ([fef11154](https://github.com/kbknapp/clap-rs/commit/fef11154fb7430d1cbf04a672aabb366e456a368)) +* **Help:** + * moves positionals to standard <> formatting ([03dfe5ce](https://github.com/kbknapp/clap-rs/commit/03dfe5ceff1d63f172788ff688567ddad9fe119b)) + * default help subcommand string has been shortened ([5b7fe8e4](https://github.com/kbknapp/clap-rs/commit/5b7fe8e4161e43ab19e2e5fcf55fbe46791134e9), closes [#494](https://github.com/kbknapp/clap-rs/issues/494)) + + +### v2.4.3 (2016-05-10) + +* Ghost Release + + +### v2.4.3 (2016-05-10) + +* Ghost Release + + +## v2.4.0 (2016-05-02) + + +#### Features + +* **Help:** adds support for displaying info before help message ([29fbfa3b](https://github.com/kbknapp/clap-rs/commit/29fbfa3b963f2f3ca7704bf5d3e1201531baa373)) +* **Required:** adds allowing args that are required unless certain args are present ([af1f7916](https://github.com/kbknapp/clap-rs/commit/af1f79168390ea7da4074d0d9777de458ea64971)) + +#### Documentation + +* hides formatting from docs ([cb708093](https://github.com/kbknapp/clap-rs/commit/cb708093a7cd057f08c98b7bd1ed54c2db86ae7e)) +* **required_unless:** adds docs and examples for required_unless ([ca727b52](https://github.com/kbknapp/clap-rs/commit/ca727b52423b9883acd88b2f227b2711bc144573)) + +#### Bug Fixes + +* **Required Args:** fixes issue where missing required args are sometimes duplicatd in error messages ([3beebd81](https://github.com/kbknapp/clap-rs/commit/3beebd81e7bc2faa4115ac109cf570e512c5477f), closes [#492](https://github.com/kbknapp/clap-rs/issues/492)) + + + +## v2.3.0 (2016-04-18) + + +#### Improvements + +* **macros.rs:** Added write_nspaces macro (a new version of write_spaces) ([9d757e86](https://github.com/kbknapp/clap-rs/commit/9d757e8678e334e5a740ac750c76a9ed4e785cba)) +* **parser.rs:** + * Provide a way to create a usage string without the USAGE: title ([a91d378b](https://github.com/kbknapp/clap-rs/commit/a91d378ba0c91b5796457f8c6e881b13226ab735)) + * Make Parser's create_usage public allowing to have function outside the parser to generate the help ([d51945f8](https://github.com/kbknapp/clap-rs/commit/d51945f8b82ebb0963f4f40b384a9e8335783091)) + * Expose Parser's flags, opts and positionals argument as iterators ([9b23e7ee](https://github.com/kbknapp/clap-rs/commit/9b23e7ee40e51f7a823644c4496be955dc6c9d3a)) +* **src/args:** Exposes argument display order by introducing a new Trait ([1321630e](https://github.com/kbknapp/clap-rs/commit/1321630ef56955f152c73376d4d85cceb0bb4a12)) +* **srs/args:** Added longest_filter to AnyArg trait ([65b3f667](https://github.com/kbknapp/clap-rs/commit/65b3f667532685f854c699ddd264d326599cf7e5)) + +#### Features + +* **Authors Macro:** adds a crate_authors macro ([38fb59ab](https://github.com/kbknapp/clap-rs/commit/38fb59abf480eb2b6feca269097412f8b00b5b54), closes [#447](https://github.com/kbknapp/clap-rs/issues/447)) +* **HELP:** + * implements optional colored help messages ([abc8f669](https://github.com/kbknapp/clap-rs/commit/abc8f669c3c8193ffc3a3b0ac6c3ac2198794d4f), closes [#483](https://github.com/kbknapp/clap-rs/issues/483)) + * Add a Templated Help system. ([81e121ed](https://github.com/kbknapp/clap-rs/commit/81e121edd616f7285593f11120c63bcccae0d23e)) + +#### Bug Fixes + +* **HELP:** Adjust Help to semantic changes introduced in 6933b84 ([8d23806b](https://github.com/kbknapp/clap-rs/commit/8d23806bd67530ad412c34a1dcdcb1435555573d)) + + +### v2.2.6 (2016-04-11) + +#### Bug Fixes + +* **Arg Groups**: fixes bug where arg name isn't printed properly ([3019a685](https://github.com/kbknapp/clap-rs/commit/3019a685eee747ccbe6be09ad5dddce0b1d1d4db), closes [#476](https://github.com/kbknapp/clap-rs/issues/476)) + + + +### v2.2.5 (2016-04-03) + + +#### Bug Fixes + +* **Empty Values:** fixes bug where empty values weren't stored ([885d166f](https://github.com/kbknapp/clap-rs/commit/885d166f04eb3fb581898ae5818c6c8032e5a686), closes [#470](https://github.com/kbknapp/clap-rs/issues/470)) +* **Help Message:** fixes bug where arg name is printed twice ([71acf1d5](https://github.com/kbknapp/clap-rs/commit/71acf1d576946658b8bbdb5ae79e6716c43a030f), closes [#472](https://github.com/kbknapp/clap-rs/issues/472)) + + + +### v2.2.4 (2016-03-30) + + +#### Bug Fixes + +* fixes compiling with debug cargo feature ([d4b55450](https://github.com/kbknapp/clap-rs/commit/d4b554509928031ac0808076178075bb21f8c1da)) +* **Empty Values:** fixes bug where empty values weren't stored ([885d166f](https://github.com/kbknapp/clap-rs/commit/885d166f04eb3fb581898ae5818c6c8032e5a686), closes [#470](https://github.com/kbknapp/clap-rs/issues/470)) + + + + +### v2.2.3 (2016-03-28) + + +#### Bug Fixes + +* **Help Subcommand:** fixes issue where help and version flags weren't properly displayed ([205b07bf](https://github.com/kbknapp/clap-rs/commit/205b07bf2e6547851f1290f8cd6b169145e144f1), closes [#466](https://github.com/kbknapp/clap-rs/issues/466)) + + +### v2.2.2 (2016-03-27) + + +#### Bug Fixes + +* **Help Message:** fixes bug with wrapping in the middle of a unicode sequence ([05365ddc](https://github.com/kbknapp/clap-rs/commit/05365ddcc252e4b49e7a75e199d6001a430bd84d), closes [#456](https://github.com/kbknapp/clap-rs/issues/456)) +* **Usage Strings:** fixes small bug where -- would appear needlessly in usage strings ([6933b849](https://github.com/kbknapp/clap-rs/commit/6933b8491c2a7e28cdb61b47dcf10caf33c2f78a), closes [#461](https://github.com/kbknapp/clap-rs/issues/461)) + + + +### 2.2.1 (2016-03-16) + + +#### Features + +* **Help Message:** wraps and aligns the help message of subcommands ([813d75d0](https://github.com/kbknapp/clap-rs/commit/813d75d06fbf077c65762608c0fa5e941cfc393c), closes [#452](https://github.com/kbknapp/clap-rs/issues/452)) + +#### Bug Fixes + +* **Help Message:** fixes a bug where small terminal sizes causing a loop ([1d73b035](https://github.com/kbknapp/clap-rs/commit/1d73b0355236923aeaf6799abc759762ded7e1d0), closes [#453](https://github.com/kbknapp/clap-rs/issues/453)) + + + +## v2.2.0 (2016-03-15) + + +#### Features + +* **Help Message:** can auto wrap and aligning help text to term width ([e36af026](https://github.com/kbknapp/clap-rs/commit/e36af0266635f23e85e951b9088d561e9a5d1bf6), closes [#428](https://github.com/kbknapp/clap-rs/issues/428)) +* **Help Subcommand:** adds support passing additional subcommands to help subcommand ([2c12757b](https://github.com/kbknapp/clap-rs/commit/2c12757bbdf34ce481f3446c074e24c09c2e60fd), closes [#416](https://github.com/kbknapp/clap-rs/issues/416)) +* **Opts and Flags:** adds support for custom ordering in help messages ([9803b51e](https://github.com/kbknapp/clap-rs/commit/9803b51e799904c0befaac457418ee766ccc1ab9)) +* **Settings:** adds support for automatically deriving custom display order of args ([ad86e433](https://github.com/kbknapp/clap-rs/commit/ad86e43334c4f70e86909689a088fb87e26ff95a), closes [#444](https://github.com/kbknapp/clap-rs/issues/444)) +* **Subcommands:** adds support for custom ordering in help messages ([7d2a2ed4](https://github.com/kbknapp/clap-rs/commit/7d2a2ed413f5517d45988eef0765cdcd663b6372), closes [#442](https://github.com/kbknapp/clap-rs/issues/442)) + +#### Bug Fixes + +* **From Usage:** fixes a bug where adding empty lines werent ignored ([c5c58c86](https://github.com/kbknapp/clap-rs/commit/c5c58c86b9c503d8de19da356a5a5cffb59fbe84)) + +#### Documentation + +* **Groups:** explains required ArgGroups better ([4ff0205b](https://github.com/kbknapp/clap-rs/commit/4ff0205b85a45151b59bbaf090a89df13438380f), closes [#439](https://github.com/kbknapp/clap-rs/issues/439)) + + +### v2.1.2 (2016-02-24) + +#### Bug Fixes + +* **Nightly:** fixes failing nightly build ([d752c170](https://github.com/kbknapp/clap-rs/commit/d752c17029598b19037710f204b7943f0830ae75), closes [#434](https://github.com/kbknapp/clap-rs/issues/434)) + + + +### v2.1.1 (2016-02-19) + + +#### Documentation + +* **AppSettings:** clarifies that AppSettings do not propagate ([3c8db0e9](https://github.com/kbknapp/clap-rs/commit/3c8db0e9be1d24edaad364359513cbb02abb4186), closes [#429](https://github.com/kbknapp/clap-rs/issues/429)) +* **Arg Examples:** adds better examples ([1e79cccc](https://github.com/kbknapp/clap-rs/commit/1e79cccc12937bc0e7cd2aad8e404410798e9fff)) + +#### Improvements + +* **Help:** adds setting for next line help by arg ([066df748](https://github.com/kbknapp/clap-rs/commit/066df7486e684cf50a8479a356a12ba972c34ce1), closes [#427](https://github.com/kbknapp/clap-rs/issues/427)) + + + +## v2.1.0 (2016-02-10) + + +#### Features + +* **Defult Values:** adds support for default values in args ([73211952](https://github.com/kbknapp/clap-rs/commit/73211952964a79d97b434dd567e6d7d34be7feb5), closes [#418](https://github.com/kbknapp/clap-rs/issues/418)) + +#### Documentation + +* **Default Values:** adds better examples and notes for default values ([9facd74f](https://github.com/kbknapp/clap-rs/commit/9facd74f843ef3807c5d35259558a344e6c25905)) + + + +### v2.0.6 (2016-02-09) + + +#### Improvements + +* **Positional Arguments:** now displays value name if appropriate ([f0a99916](https://github.com/kbknapp/clap-rs/commit/f0a99916c59ce675515c6dcdfe9a40b130510908), closes [#420](https://github.com/kbknapp/clap-rs/issues/420)) + + + +### v2.0.5 (2016-02-05) + + +#### Bug Fixes + +* **Multiple Values:** fixes bug where number_of_values wasnt respected ([72c387da](https://github.com/kbknapp/clap-rs/commit/72c387da0bb8a6f526f863770f08bb8ca0d3de03)) + + + +### v2.0.4 (2016-02-04) + + +#### Bug Fixes + +* adds support for building ArgGroups from standalone YAML ([fcbc7e12](https://github.com/kbknapp/clap-rs/commit/fcbc7e12f5d7b023b8f30cba8cad28a01cf6cd26)) +* Stop lonely hyphens from causing panic ([85b11468](https://github.com/kbknapp/clap-rs/commit/85b11468b0189d5cc15f1cfac5db40d17a0077dc), closes [#410](https://github.com/kbknapp/clap-rs/issues/410)) +* **AppSettings:** fixes bug where subcmds didn't receive parent ver ([a62e4527](https://github.com/kbknapp/clap-rs/commit/a62e452754b3b0e3ac9a15aa8b5330636229ead1)) + + +### v2.0.3 (2016-02-02) + + +#### Improvements + +* **values:** adds support for up to u64::max values per arg ([c7abf7d7](https://github.com/kbknapp/clap-rs/commit/c7abf7d7611e317b0d31d97632e3d2e13570947c)) +* **occurrences:** Allow for more than 256 occurrences of an argument. ([3731ddb3](https://github.com/kbknapp/clap-rs/commit/3731ddb361163f3d6b86844362871e48c80fa530)) + +#### Features + +* **AppSettings:** adds HidePossibleValuesInHelp to skip writing those values ([cdee7a0e](https://github.com/kbknapp/clap-rs/commit/cdee7a0eb2beeec723cb98acfacf03bf629c1da3)) + +#### Bug Fixes + +* **value_t_or_exit:** fixes typo which causes value_t_or_exit to return a Result ([ee96baff](https://github.com/kbknapp/clap-rs/commit/ee96baffd306cb8d20ddc5575cf739bb1a6354e8)) + + + +### v2.0.2 (2016-01-31) + + +#### Improvements + +* **arg_enum:** enum declared with arg_enum returns [&'static str; #] instead of Vec ([9c4b8a1a](https://github.com/kbknapp/clap-rs/commit/9c4b8a1a6b12949222f17d1074578ad7676b9c0d)) + +#### Bug Fixes + +* clap_app! should be gated by unstable, not nightly feature ([0c8b84af](https://github.com/kbknapp/clap-rs/commit/0c8b84af6161d5baf683688eafc00874846f83fa)) +* **SubCommands:** fixed where subcmds weren't recognized after mult args ([c19c17a8](https://github.com/kbknapp/clap-rs/commit/c19c17a8850602990e24347aeb4427cf43316223), closes [#405](https://github.com/kbknapp/clap-rs/issues/405)) +* **Usage Parser:** fixes a bug where literal single quotes weren't allowed in help strings ([0bcc7120](https://github.com/kbknapp/clap-rs/commit/0bcc71206478074769e311479b34a9f74fe80f5c), closes [#406](https://github.com/kbknapp/clap-rs/issues/406)) + + + +### v2.0.1 (2016-01-30) + + +#### Bug Fixes + +* fixes cargo features to NOT require nightly with unstable features ([dcbcc60c](https://github.com/kbknapp/clap-rs/commit/dcbcc60c9ba17894be636472ea4b07a82d86a9db), closes [#402](https://github.com/kbknapp/clap-rs/issues/402)) + + + +## v2.0.0 (2016-01-28) + + +#### Improvements + +* **From Usage:** vastly improves the usage parser ([fa3a2f86](https://github.com/kbknapp/clap-rs/commit/fa3a2f86bd674c5eb07128c95098fab7d1437247), closes [#350](https://github.com/kbknapp/clap-rs/issues/350)) + +#### Features + +* adds support for external subcommands ([177fe5cc](https://github.com/kbknapp/clap-rs/commit/177fe5cce745c2164a8e38c23be4c4460d2d7211), closes [#372](https://github.com/kbknapp/clap-rs/issues/372)) +* adds support values with a leading hyphen ([e4d429b9](https://github.com/kbknapp/clap-rs/commit/e4d429b9d52e95197bd0b572d59efacecf305a59), closes [#385](https://github.com/kbknapp/clap-rs/issues/385)) +* adds support for turning off the value delimiter ([508db850](https://github.com/kbknapp/clap-rs/commit/508db850a87c2e251cf6b6ddead9ad56b29f9e57), closes [#352](https://github.com/kbknapp/clap-rs/issues/352)) +* adds support changing the value delimiter ([dafeae8a](https://github.com/kbknapp/clap-rs/commit/dafeae8a526162640f6a68da434370c64d190889), closes [#353](https://github.com/kbknapp/clap-rs/issues/353)) +* adds support for comma separated values ([e69da6af](https://github.com/kbknapp/clap-rs/commit/e69da6afcd2fe48a3c458ca031db40997f860eda), closes [#348](https://github.com/kbknapp/clap-rs/issues/348)) +* adds support with options with optional values ([4555736c](https://github.com/kbknapp/clap-rs/commit/4555736cad01441dcde4ea84a285227e0844c16e), closes [#367](https://github.com/kbknapp/clap-rs/issues/367)) +* **UTF-8:** adds support for invalid utf8 in values ([c5c59dec](https://github.com/kbknapp/clap-rs/commit/c5c59dec0bc33b86b2e99d30741336f17ec84282), closes [#269](https://github.com/kbknapp/clap-rs/issues/269)) +* **v2:** implementing the base of 2.x ([a3536054](https://github.com/kbknapp/clap-rs/commit/a3536054512ba833533dc56615ce3663d884381c)) + +#### Bug Fixes + +* fixes nightly build with new lints ([17599195](https://github.com/kbknapp/clap-rs/commit/175991956c37dc83ba9c49396e927a1cb65c5b11)) +* fixes Windows build for 2x release ([674c9b48](https://github.com/kbknapp/clap-rs/commit/674c9b48c7c92079cb180cc650a9e39f34781c32), closes [#392](https://github.com/kbknapp/clap-rs/issues/392)) +* fixes yaml build for 2x base ([adceae64](https://github.com/kbknapp/clap-rs/commit/adceae64c8556d00ab715677377b216f9f468ad7)) + +#### Documentation + +* updates examples for 2x release ([1303b360](https://github.com/kbknapp/clap-rs/commit/1303b3607468f362ab1b452d5614c1a064dc69b4), closes [#394](https://github.com/kbknapp/clap-rs/issues/394)) +* updates examples for 2x release ([0a011f31](https://github.com/kbknapp/clap-rs/commit/0a011f3142aec338d388a6c8bfe22fa7036021bb), closes [#394](https://github.com/kbknapp/clap-rs/issues/394)) +* updates documentation for v2 release ([8d51724e](https://github.com/kbknapp/clap-rs/commit/8d51724ef73dfde5bb94fb9466bc5463a1cc1502)) +* updating docs for 2x release ([576d0e0e](https://github.com/kbknapp/clap-rs/commit/576d0e0e2c7b8f386589179bbf7419b93abacf1c)) +* **README.md:** + * updates readme for v2 release ([acaba01a](https://github.com/kbknapp/clap-rs/commit/acaba01a353c12144b9cd9a3ce447400691849b0), closes [#393](https://github.com/kbknapp/clap-rs/issues/393)) + * fix typo and make documentation conspicuous ([07b9f614](https://github.com/kbknapp/clap-rs/commit/07b9f61495d927f69f7abe6c0d85253f0f4e6107)) + +#### BREAKING CHANGES + +* **Fewer liftimes! Yay!** + * `App<'a, 'b, 'c, 'd, 'e, 'f>` => `App<'a, 'b>` + * `Arg<'a, 'b, 'c, 'd, 'e, 'f>` => `Arg<'a, 'b>` + * `ArgMatches<'a, 'b>` => `ArgMatches<'a>` +* **Simply Renamed** + * `App::arg_group` => `App::group` + * `App::arg_groups` => `App::groups` + * `ArgGroup::add` => `ArgGroup::arg` + * `ArgGroup::add_all` => `ArgGroup::args` + * `ClapError` => `Error` + * struct field `ClapError::error_type` => `Error::kind` + * `ClapResult` => `Result` + * `ClapErrorType` => `ErrorKind` +* **Removed Deprecated Functions and Methods** + * `App::subcommands_negate_reqs` + * `App::subcommand_required` + * `App::arg_required_else_help` + * `App::global_version(bool)` + * `App::versionless_subcommands` + * `App::unified_help_messages` + * `App::wait_on_error` + * `App::subcommand_required_else_help` + * `SubCommand::new` + * `App::error_on_no_subcommand` + * `Arg::new` + * `Arg::mutually_excludes` + * `Arg::mutually_excludes_all` + * `Arg::mutually_overrides_with` + * `simple_enum!` +* **Renamed Error Variants** + * `InvalidUnicode` => `InvalidUtf8` + * `InvalidArgument` => `UnknownArgument` +* **Usage Parser** + * Value names can now be specified inline, i.e. `-o, --option 'some option which takes two files'` + * **There is now a priority of order to determine the name** - This is perhaps the biggest breaking change. See the documentation for full details. Prior to this change, the value name took precedence. **Ensure your args are using the proper names (i.e. typically the long or short and NOT the value name) throughout the code** +* `ArgMatches::values_of` returns an `Values` now which implements `Iterator` (should not break any code) +* `crate_version!` returns `&'static str` instead of `String` +* Using the `clap_app!` macro requires compiling with the `unstable` feature because the syntax could change slightly in the future + + + +### v1.5.5 (2016-01-04) + + +#### Bug Fixes + +* fixes an issue where invalid short args didn't cause an error ([c9bf7e44](https://github.com/kbknapp/clap-rs/commit/c9bf7e4440bd2f9b524ea955311d433c40a7d1e0)) +* prints the name in version and help instead of binary name ([8f3817f6](https://github.com/kbknapp/clap-rs/commit/8f3817f665c0cab6726bc16c56a53b6a61e44448), closes [#368](https://github.com/kbknapp/clap-rs/issues/368)) +* fixes an intentional panic issue discovered via clippy ([ea83a3d4](https://github.com/kbknapp/clap-rs/commit/ea83a3d421ea8856d4cac763942834d108b71406)) + + + +### v1.5.4 (2015-12-18) + + +#### Examples + +* **17_yaml:** conditinonally compile 17_yaml example ([575de089](https://github.com/kbknapp/clap-rs/commit/575de089a3e240c398cb10e6cf5a5c6b68662c01)) + +#### Improvements + +* clippy improvements ([99cdebc2](https://github.com/kbknapp/clap-rs/commit/99cdebc23da3a45a165f14b27bebeb2ed828a2ce)) + +#### Bug Fixes + + +* **errors:** return correct error type in WrongNumValues error builder ([5ba8ba9d](https://github.com/kbknapp/clap-rs/commit/5ba8ba9dcccdfa74dd1c44260e64b359bbb36be6)) +* ArgRequiredElseHelp setting now takes precedence over missing required args ([faad83fb](https://github.com/kbknapp/clap-rs/commit/faad83fbef6752f3093b6e98fca09a9449b830f4), closes [#362](https://github.com/kbknapp/clap-rs/issues/362)) + + + +### v1.5.3 (2015-11-20) + + +#### Bug Fixes + +* **Errors:** fixes some instances when errors are missing a final newline ([c4d2b171](https://github.com/kbknapp/clap-rs/commit/c4d2b1711994479ad64ee52b6b49d2ceccbf2118)) + + + + + +### v1.5.2 (2015-11-14) + + +#### Bug Fixes + +* **Errors:** fixes a compiling bug when built on Windows or without the color feature ([a35f7634](https://github.com/kbknapp/clap-rs/commit/a35f76346fe6ecc88dda6a1eb13627186e7ce185)) + + + + +### v1.5.1 (2015-11-13) + + +#### Bug Fixes + +* **Required Args:** fixes a bug where required args are not correctly accounted for ([f03b88a9](https://github.com/kbknapp/clap-rs/commit/f03b88a9766b331a63879bcd747687f2e5a2661b), closes [#343](https://github.com/kbknapp/clap-rs/issues/343)) + + + + +## v1.5.0 (2015-11-13) + + +#### Bug Fixes + +* fixes a bug with required positional args in usage strings ([c6858f78](https://github.com/kbknapp/clap-rs/commit/c6858f78755f8e860204323c828c8355a066dc83)) + +#### Documentation + +* **FAQ:** updates readme with slight changes to FAQ ([a4ef0fab](https://github.com/kbknapp/clap-rs/commit/a4ef0fab73c8dc68f1b138965d1340459c113398)) + +#### Improvements + +* massive errors overhaul ([cdc29175](https://github.com/kbknapp/clap-rs/commit/cdc29175bc9c53e5b4aec86cbc04c1743154dae6)) +* **ArgMatcher:** huge refactor and deduplication of code ([8988853f](https://github.com/kbknapp/clap-rs/commit/8988853fb8825e8f841fde349834cc12cdbad081)) +* **Errors:** errors have been vastly improved ([e59bc0c1](https://github.com/kbknapp/clap-rs/commit/e59bc0c16046db156a88ba71a037db05028e995c)) +* **Traits:** refactoring some configuration into traits ([5800cdec](https://github.com/kbknapp/clap-rs/commit/5800cdec6dce3def4242b9f7bd136308afb19685)) + +#### Performance + +* **App:** + * more BTreeMap->Vec, Opts and SubCmds ([bc4495b3](https://github.com/kbknapp/clap-rs/commit/bc4495b32ec752b6c4b29719e831c043ef2a26ce)) + * changes flags BTreeMap->Vec ([d357640f](https://github.com/kbknapp/clap-rs/commit/d357640fab55e5964fe83efc3c771e53aa3222fd)) + * removed unneeded BTreeMap ([78971fd6](https://github.com/kbknapp/clap-rs/commit/78971fd68d7dc5c8e6811b4520cdc54e4188f733)) + * changes BTreeMap to VecMap in some instances ([64b921d0](https://github.com/kbknapp/clap-rs/commit/64b921d087fdd03775c95ba0bcf65d3f5d36f812)) + * removed excess clones ([ec0089d4](https://github.com/kbknapp/clap-rs/commit/ec0089d42ed715d293fb668d3a90b0db0aa3ec39)) + + + + +### v1.4.7 (2015-11-03) + + +#### Documentation + +* Clarify behavior of Arg::multiple with options. ([434f497a](https://github.com/kbknapp/clap-rs/commit/434f497ab6d831f8145cf09278c97ca6ee6c6fe7)) +* Fix typos and improve grammar. ([c1f66b5d](https://github.com/kbknapp/clap-rs/commit/c1f66b5de7b5269fbf8760a005ef8c645edd3229)) + +#### Bug Fixes + +* **Error Status:** fixes bug where --help and --version return non-zero exit code ([89b51fdf](https://github.com/kbknapp/clap-rs/commit/89b51fdf8b1ab67607567344e2317ff1a757cb12)) + + + + +### v1.4.6 (2015-10-29) + + +#### Features + +* allows parsing without a binary name for daemons and interactive CLIs ([aff89d57](https://github.com/kbknapp/clap-rs/commit/aff89d579b5b85c3dc81b64f16d5865299ec39a2), closes [#318](https://github.com/kbknapp/clap-rs/issues/318)) + +#### Bug Fixes + +* **Errors:** tones down quoting in some error messages ([34ce59ed](https://github.com/kbknapp/clap-rs/commit/34ce59ede53bfa2eef722c74881cdba7419fd9c7), closes [#309](https://github.com/kbknapp/clap-rs/issues/309)) +* **Help and Version:** only builds help and version once ([e3be87cf](https://github.com/kbknapp/clap-rs/commit/e3be87cfc095fc41c9811adcdc6d2b079f237d5e)) +* **Option Args:** fixes bug with args and multiple values ([c9a9548a](https://github.com/kbknapp/clap-rs/commit/c9a9548a8f96cef8a3dd9a980948325fbbc1b91b), closes [#323](https://github.com/kbknapp/clap-rs/issues/323)) +* **POSIX Overrides:** fixes bug where required args are overridden ([40ed2b50](https://github.com/kbknapp/clap-rs/commit/40ed2b50c3a9fe88bfdbaa43cef9fd6493ecaa8e)) +* **Safe Matches:** using 'safe' forms of the get_matches family no longer exit the process ([c47025dc](https://github.com/kbknapp/clap-rs/commit/c47025dca2b3305dea0a0acfdd741b09af0c0d05), closes [#256](https://github.com/kbknapp/clap-rs/issues/256)) +* **Versionless SubCommands:** fixes a bug where the -V flag was needlessly built ([27df8b9d](https://github.com/kbknapp/clap-rs/commit/27df8b9d98d13709dad3929a009f40ebff089a1a), closes [#329](https://github.com/kbknapp/clap-rs/issues/329)) + +#### Documentation + +* adds comparison in readme ([1a8bf31e](https://github.com/kbknapp/clap-rs/commit/1a8bf31e7a6b87ce48a66af2cde1645b2dd5bc95), closes [#325](https://github.com/kbknapp/clap-rs/issues/325)) + + + + +### v1.4.5 (2015-10-06) + + +#### Bug Fixes + +* fixes crash on invalid arg error ([c78ce128](https://github.com/kbknapp/clap-rs/commit/c78ce128ebbe7b8f730815f8176c29d76f4ade8c)) + + + + +### v1.4.4 (2015-10-06) + + +#### Documentation + +* clean up some formatting ([b7df92d7](https://github.com/kbknapp/clap-rs/commit/b7df92d7ea25835701dd22ddff984b9749f48a00)) +* move the crate-level docs to top of the lib.rs file ([d7233bf1](https://github.com/kbknapp/clap-rs/commit/d7233bf122dbf80ba8fc79e5641be2df8af10e7a)) +* changes doc comments to rustdoc comments ([34b601be](https://github.com/kbknapp/clap-rs/commit/34b601be5fdde76c1a0859385b359b96d66b8732)) +* fixes panic in 14_groups example ([945b00a0](https://github.com/kbknapp/clap-rs/commit/945b00a0c27714b63bdca48d003fe205fcfdc578), closes [#295](https://github.com/kbknapp/clap-rs/issues/295)) +* avoid suggesting star dependencies. ([d33228f4](https://github.com/kbknapp/clap-rs/commit/d33228f40b5fefb84cf3dd51546bfb340dcd9f5a)) +* **Rustdoc:** adds portions of the readme to main rustdoc page ([6f9ee181](https://github.com/kbknapp/clap-rs/commit/6f9ee181e69d90bd4206290e59d6f3f1e8f0cbb2), closes [#293](https://github.com/kbknapp/clap-rs/issues/293)) + +#### Bug Fixes + +* grammar error in some conflicting option errors ([e73b07e1](https://github.com/kbknapp/clap-rs/commit/e73b07e19474323ad2260da66abbf6a6d4ecbd4f)) +* **Unified Help:** sorts both flags and options as a unified category ([2a223dad](https://github.com/kbknapp/clap-rs/commit/2a223dad82901fa2e74baad3bfc4c7b94509300f)) +* **Usage:** fixes a bug where required args aren't filtered properly ([72b453dc](https://github.com/kbknapp/clap-rs/commit/72b453dc170af3050bb123d35364f6da77fc06d7), closes [#277](https://github.com/kbknapp/clap-rs/issues/277)) +* **Usage Strings:** fixes a bug ordering of elements in usage strings ([aaf0d6fe](https://github.com/kbknapp/clap-rs/commit/aaf0d6fe7aa2403e76096c16204d254a9ee61ee2), closes [#298](https://github.com/kbknapp/clap-rs/issues/298)) + +#### Features + +* supports -aValue style options ([0e3733e4](https://github.com/kbknapp/clap-rs/commit/0e3733e4fec2015c2d566a51432dcd92cb69cad3)) +* **Trailing VarArg:** adds opt-in setting for final arg being vararg ([27018b18](https://github.com/kbknapp/clap-rs/commit/27018b1821a4bcd5235cfe92abe71b3c99efc24d), closes [#278](https://github.com/kbknapp/clap-rs/issues/278)) + + + + +### v1.4.3 (2015-09-30) + + +#### Features + +* allows accessing arg values by group name ([c92a4b9e](https://github.com/kbknapp/clap-rs/commit/c92a4b9eff2d679957f61c0c41ff404b40d38a91)) + +#### Documentation + +* use links to examples instead of plain text ([bb4fe237](https://github.com/kbknapp/clap-rs/commit/bb4fe237858535627271465147add537e4556b43)) + +#### Bug Fixes + +* **Help Message:** required args no longer double list in usage ([1412e639](https://github.com/kbknapp/clap-rs/commit/1412e639e0a79df84936d1101a837f90077d1c83), closes [#277](https://github.com/kbknapp/clap-rs/issues/277)) +* **Possible Values:** possible value validation is restored ([f121ae74](https://github.com/kbknapp/clap-rs/commit/f121ae749f8f4bfe754ef2e8a6dfc286504b5b75), closes [#287](https://github.com/kbknapp/clap-rs/issues/287)) + + + + +### v1.4.2 (2015-09-23) + + +#### Bug Fixes + +* **Conflicts:** fixes bug with conflicts not removing required args ([e17fcec5](https://github.com/kbknapp/clap-rs/commit/e17fcec53b3216ad047a13dddc6f740473fad1a1), closes [#271](https://github.com/kbknapp/clap-rs/issues/271)) + + + + +### v1.4.1 (2015-09-22) + + +#### Examples + +* add clap_app quick example ([4ba6249c](https://github.com/kbknapp/clap-rs/commit/4ba6249c3cf4d2e083370d1fe4dcc7025282c28a)) + +#### Features + +* **Unicode:** allows non-panicing on invalid unicode characters ([c5bf7ddc](https://github.com/kbknapp/clap-rs/commit/c5bf7ddc8cfb876ec928a5aaf5591232bbb32e5d)) + +#### Documentation + +* properly names Examples section for rustdoc ([87ba5445](https://github.com/kbknapp/clap-rs/commit/87ba54451d7ec7b1c9b9ef134f90bbe39e6fac69)) +* fixes various typos and spelling ([f85640f9](https://github.com/kbknapp/clap-rs/commit/f85640f9f6d8fd3821a40e9b8b7a34fabb789d02)) +* **Arg:** unhides fields of the Arg struct ([931aea88](https://github.com/kbknapp/clap-rs/commit/931aea88427edf43a3da90d5a500c1ff2b2c3614)) + +#### Bug Fixes + +* flush the buffer in App::print_version() ([cbc42a37](https://github.com/kbknapp/clap-rs/commit/cbc42a37d212d84d22b1777d08e584ff191934e7)) +* Macro benchmarks ([13712da1](https://github.com/kbknapp/clap-rs/commit/13712da1d36dc7614eec3a10ad488257ba615751)) + + + + +## v1.4.0 (2015-09-09) + + +#### Features + +* allows printing help message by library consumers ([56b95f32](https://github.com/kbknapp/clap-rs/commit/56b95f320875c62dda82cb91b29059671e120ed1)) +* allows defining hidden args and subcmds ([2cab4d03](https://github.com/kbknapp/clap-rs/commit/2cab4d0334ea3c2439a1d4bfca5bf9905c7ea9ac), closes [#231](https://github.com/kbknapp/clap-rs/issues/231)) +* Builder macro to assist with App/Arg/Group/SubCommand building ([443841b0](https://github.com/kbknapp/clap-rs/commit/443841b012a8d795cd5c2bd69ae6e23ef9b16477)) +* **Errors:** allows consumers to write to stderr and exit on error ([1e6403b6](https://github.com/kbknapp/clap-rs/commit/1e6403b6a863574fa3cb6946b1fb58f034e8664c)) + + + + +### v1.3.2 (2015-09-08) + + +#### Documentation + +* fixed ErrorKind docs ([dd057843](https://github.com/kbknapp/clap-rs/commit/dd05784327fa070eb6ce5ce89a8507e011d8db94)) +* **ErrorKind:** changed examples content ([b9ca2616](https://github.com/kbknapp/clap-rs/commit/b9ca261634b89613bbf3d98fd74d55cefbb31a8c)) + +#### Bug Fixes + +* fixes a bug where the help subcommand wasn't overridable ([94003db4](https://github.com/kbknapp/clap-rs/commit/94003db4b5eebe552ca337521c1c001295822745)) + +#### Features + +* adds abiltiy not consume self when parsing matches and/or exit on help ([94003db4](https://github.com/kbknapp/clap-rs/commit/94003db4b5eebe552ca337521c1c001295822745)) +* **App:** Added ability for users to handle errors themselves ([934e6fbb](https://github.com/kbknapp/clap-rs/commit/934e6fbb643b2385efc23444fe6fce31494dc288)) + + + + +### v1.3.1 (2015-09-04) + + +#### Examples + +* **17_yaml:** fixed example ([9b848622](https://github.com/kbknapp/clap-rs/commit/9b848622296c8c5c7b9a39b93ddd41f51df790b5)) + +#### Performance + +* changes ArgGroup HashSets to Vec ([3cb4a48e](https://github.com/kbknapp/clap-rs/commit/3cb4a48ebd15c20692f4f3a2a924284dc7fd5e10)) +* changes BTreeSet for Vec in some instances ([baab2e3f](https://github.com/kbknapp/clap-rs/commit/baab2e3f4060e811abee14b1654cbcd5cf3b5fea)) + + + + +## v1.3.0 (2015-09-01) + + +#### Features + +* **YAML:** allows building a CLI from YAML files ([86cf4c45](https://github.com/kbknapp/clap-rs/commit/86cf4c45626a36b8115446952f9069f73c1debc3)) +* **ArgGroups:** adds support for building ArgGroups from yaml ([ecf88665](https://github.com/kbknapp/clap-rs/commit/ecf88665cbff367018b29161a1b75d44a212707d)) +* **Subcommands:** adds support for subcommands from yaml ([e415cf78](https://github.com/kbknapp/clap-rs/commit/e415cf78ba916052d118a8648deba2b9c16b1530)) + +#### Documentation + +* **YAML:** adds examples for using YAML to build a CLI ([ab41d7f3](https://github.com/kbknapp/clap-rs/commit/ab41d7f38219544750e6e1426076dc498073191b)) +* **Args from YAML:** fixes doc examples ([19b348a1](https://github.com/kbknapp/clap-rs/commit/19b348a10050404cd93888dbbbe4f396681b67d0)) +* **Examples:** adds better usage examples instead of having unused variables ([8cbacd88](https://github.com/kbknapp/clap-rs/commit/8cbacd8883004fe71a8ea036ec4391c7dd8efe94)) + +#### Examples + +* Add AppSettings example ([12705079](https://github.com/kbknapp/clap-rs/commit/12705079ca96a709b4dd94f7ddd20a833b26838c)) + +#### Bug Fixes + +* **Unified Help Messages:** fixes a crash from this setting and no opts ([169ffec1](https://github.com/kbknapp/clap-rs/commit/169ffec1003d58d105d7ef2585b3425e57980000), closes [#210](https://github.com/kbknapp/clap-rs/issues/210)) + + + + +### v1.2.5 (2015-08-27) + + +#### Examples + +* add custom validator example ([b9997d1f](https://github.com/kbknapp/clap-rs/commit/b9997d1fca74d4d8f93971f2a01bdf9798f913d5)) +* fix indentation ([d4f1b740](https://github.com/kbknapp/clap-rs/commit/d4f1b740ede410fd2528b9ecd89592c2fd8b1e20)) + +#### Features + +* **Args:** allows opts and args to define a name for help and usage msgs ([ad962ec4](https://github.com/kbknapp/clap-rs/commit/ad962ec478da999c7dba0afdb84c266f4d09b1bd)) + + + + +### v1.2.4 (2015-08-26) + + +#### Bug Fixes + +* **Possible Values:** fixes a bug where suggestions arent made when using --long=value format ([3d5e9a6c](https://github.com/kbknapp/clap-rs/commit/3d5e9a6cedb26668839b481c9978e2fbbab8be6f), closes [#192](https://github.com/kbknapp/clap-rs/issues/192)) + + + + +### v1.2.3 (2015-08-24) + + +#### Bug Fixes + +* **App, Args:** fixed subcommand reqs negation ([b41afa8c](https://github.com/kbknapp/clap-rs/commit/b41afa8c3ded3d1be12f7a2f8ea06cc44afc9458), closes [#188](https://github.com/kbknapp/clap-rs/issues/188)) + + + + +### v1.2.2 (2015-08-23) + + +#### Bug Fixes + +* fixed confusing error message, also added test for it ([fc7a31a7](https://github.com/kbknapp/clap-rs/commit/fc7a31a745efbf1768ee2c62cd3bb72bfe30c708)) +* **App:** fixed requirmets overriding ([9c135eb7](https://github.com/kbknapp/clap-rs/commit/9c135eb790fa16183e5bdb2009ddc3cf9e25f99f)) + + + + +### v1.2.1 (2015-08-20) + + +#### Documentation + +* **README.md:** updates for new features ([16cf9245](https://github.com/kbknapp/clap-rs/commit/16cf9245fb5fc4cf6face898e358368bf9961cbb)) + +#### Features + +* implements posix compatible conflicts for long args ([8c2d48ac](https://github.com/kbknapp/clap-rs/commit/8c2d48acf5473feebd721a9049a9c9b7051e70f9)) +* added overrides to support conflicts in POSIX compatible manner ([0b916a00](https://github.com/kbknapp/clap-rs/commit/0b916a00de26f6941538f6bc5f3365fa302083c1)) +* **Args:** allows defining POSIX compatible argument conflicts ([d715646e](https://github.com/kbknapp/clap-rs/commit/d715646e69759ccd95e01f49b04f489827ecf502)) + +#### Bug Fixes + +* fixed links in cargo and license buttons ([6d9837ad](https://github.com/kbknapp/clap-rs/commit/6d9837ad9a9e006117cd7372fdc60f9a3889c7e2)) + +#### Performance + +* **Args and Apps:** changes HashSet->Vec in some instances for increased performance ([d0c3b379](https://github.com/kbknapp/clap-rs/commit/d0c3b379700757e0a9b0c40af709f8af1f5b4949)) + + + + +### v1.2.0 (2015-08-15) + + +#### Bug Fixes + +* fixed misspell and enum name ([7df170d7](https://github.com/kbknapp/clap-rs/commit/7df170d7f4ecff06608317655d1e0c4298f62076)) +* fixed use for clap crate ([dc3ada73](https://github.com/kbknapp/clap-rs/commit/dc3ada738667d4b689678f79d14251ee82004ece)) + +#### Documentation + +* updates docs for new features ([03496547](https://github.com/kbknapp/clap-rs/commit/034965471782d872ca495045b58d34b31807c5b1)) +* fixed docs for previous changes ([ade36778](https://github.com/kbknapp/clap-rs/commit/ade367780c366425de462506d256e0f554ed3b9c)) + +#### Improvements + +* **AppSettings:** adds ability to add multiple settings at once ([4a00e251](https://github.com/kbknapp/clap-rs/commit/4a00e2510d0ca8d095d5257d51691ba3b61c1374)) + +#### Features + +* Replace application level settings with enum variants ([618dc4e2](https://github.com/kbknapp/clap-rs/commit/618dc4e2c205bf26bc43146164e65eb1f6b920ed)) +* **Args:** allows for custom argument value validations to be defined ([84ae2ddb](https://github.com/kbknapp/clap-rs/commit/84ae2ddbceda34b5cbda98a6959edaa52fde2e1a), closes [#170](https://github.com/kbknapp/clap-rs/issues/170)) + + + + +### v1.1.6 (2015-08-01) + + +#### Bug Fixes + +* fixes two bugs in App when printing newlines in help and subcommands required error ([d63c0136](https://github.com/kbknapp/clap-rs/commit/d63c0136310db9dd2b1c7b4745938311601d8938)) + + + + +### v1.1.5 (2015-07-29) + +#### Performance + +* removes some unneeded allocations ([93e915df](https://github.com/kbknapp/clap-rs/commit/93e915dfe300f7b7d6209ca93323c6a46f89a8c1)) + + +### v1.1.4 (2015-07-20) + + +#### Improvements + +* **Usage Strings** displays a [--] when it may be helpful ([86c3be85](https://github.com/kbknapp/clap-rs/commit/86c3be85fb6f77f83b5a6d2df40ae60937486984)) + +#### Bug Fixes + +* **Macros** fixes a typo in a macro generated error message ([c9195c5f](https://github.com/kbknapp/clap-rs/commit/c9195c5f92abb8cd6a37b4f4fbb2f1fee2a8e368)) +* **Type Errors** fixes formatting of error output when failed type parsing ([fe5d95c6](https://github.com/kbknapp/clap-rs/commit/fe5d95c64f3296e6eddcbec0cb8b86659800145f)) + + + + +### v1.1.3 (2015-07-18) + + +#### Documentation + +* updates README.md to include lack of color support on Windows ([52f81e17](https://github.com/kbknapp/clap-rs/commit/52f81e17377b18d2bd0f34693b642b7f358998ee)) + +#### Bug Fixes + +* fixes formatting bug which prevented compiling on windows ([9cb5dceb](https://github.com/kbknapp/clap-rs/commit/9cb5dceb3e5fe5e0e7b24619ff77e5040672b723), closes [#163](https://github.com/kbknapp/clap-rs/issues/163)) + + + + +### v1.1.2 (2015-07-17) + + +#### Bug Fixes + +* fixes a bug when parsing multiple {n} newlines inside help strings ([6d214b54](https://github.com/kbknapp/clap-rs/commit/6d214b549a9b7e189a94e5fa2b7c92cc333ca637)) + + + + +## v1.1.1 (2015-07-17) + + +#### Bug Fixes + +* fixes a logic bug and allows setting Arg::number_of_values() < 2 ([42b6d1fc](https://github.com/kbknapp/clap-rs/commit/42b6d1fc3c519c92dfb3af15276e7d3b635e6cfe), closes [#161](https://github.com/kbknapp/clap-rs/issues/161)) + + + + +## v1.1.0 (2015-07-16) + + +#### Features + +* allows creating unified help messages, a la docopt or getopts ([52bcd892](https://github.com/kbknapp/clap-rs/commit/52bcd892ea51564ce463bc5865acd64f8fe91cb1), closes [#158](https://github.com/kbknapp/clap-rs/issues/158)) +* allows stating all subcommands should *not* have --version flags ([336c476f](https://github.com/kbknapp/clap-rs/commit/336c476f631d512b54ac56fdca6f29ebdc2c00c5), closes [#156](https://github.com/kbknapp/clap-rs/issues/156)) +* allows setting version number to auto-propagate through subcommands ([bc66d3c6](https://github.com/kbknapp/clap-rs/commit/bc66d3c6deedeca62463fff95369ab1cfcdd366b), closes [#157](https://github.com/kbknapp/clap-rs/issues/157)) + +#### Improvements + +* **Help Strings** properly aligns and handles newlines in long help strings ([f9800a29](https://github.com/kbknapp/clap-rs/commit/f9800a29696dd2cc0b0284bf693b3011831e556f), closes [#145](https://github.com/kbknapp/clap-rs/issues/145)) + + +#### Performance + +* **Help Messages** big performance improvements when printing help messages ([52bcd892](https://github.com/kbknapp/clap-rs/commit/52bcd892ea51564ce463bc5865acd64f8fe91cb1)) + +#### Documentation + +* updates readme with new features ([8232f7bb](https://github.com/kbknapp/clap-rs/commit/8232f7bb52e88862bc13c3d4f99ee4f56cfe4bc0)) +* fix incorrect code example for `App::subcommand_required` ([8889689d](https://github.com/kbknapp/clap-rs/commit/8889689dc6336ccc45b2c9f2cf8e2e483a639e93)) + + + +### v1.0.3 (2015-07-11) + + +#### Improvements + +* **Errors** writes errors to stderr ([cc76ab8c](https://github.com/kbknapp/clap-rs/commit/cc76ab8c2b77c67b42f4717ded530df7806142cf), closes [#154](https://github.com/kbknapp/clap-rs/issues/154)) + +#### Documentation + +* **README.md** updates example help message to new format ([0aca29bd](https://github.com/kbknapp/clap-rs/commit/0aca29bd5d6d1a4e9971bdc88d946ffa58606efa)) + + + + +### v1.0.2 (2015-07-09) + + +#### Improvements + +* **Usage** re-orders optional arguments and required to natural standard ([dc7e1fce](https://github.com/kbknapp/clap-rs/commit/dc7e1fcea5c85d317018fb201d2a9262249131b4), closes [#147](https://github.com/kbknapp/clap-rs/issues/147)) + + + + +### v1.0.1 (2015-07-08) + + +#### Bug Fixes + +* allows empty values when using --long='' syntax ([083f82d3](https://github.com/kbknapp/clap-rs/commit/083f82d333b69720a6ef30074875310921d964d1), closes [#151](https://github.com/kbknapp/clap-rs/issues/151)) + + + + +## v1.0.0 (2015-07-08) + + +#### Documentation + +* **README.md** adds new features to what's new list ([938f7f01](https://github.com/kbknapp/clap-rs/commit/938f7f01340f521969376cf4e2e3d9436bca21f7)) +* **README.md** use with_name for subcommands ([28b7e316](https://github.com/kbknapp/clap-rs/commit/28b7e3161fb772e5309042648fe8c3a420645bac)) + +#### Features + +* args can now be parsed from arbitrary locations, not just std::env::args() ([75312528](https://github.com/kbknapp/clap-rs/commit/753125282b1b9bfff875f1557ce27610edcc59e1)) + + + + +## v1.0.0-beta (2015-06-30) + + +#### Features + +* allows waiting for user input on error ([d0da3bdd](https://github.com/kbknapp/clap-rs/commit/d0da3bdd9d1871541907ea9c645322a74d260e07), closes [#140](https://github.com/kbknapp/clap-rs/issues/140)) +* **Help** allows one to fully override the auto-generated help message ([26d5ae3e](https://github.com/kbknapp/clap-rs/commit/26d5ae3e330d1e150811d5b60b2b01a8f8df854e), closes [#141](https://github.com/kbknapp/clap-rs/issues/141)) + +#### Documentation + +* adds "whats new" section to readme ([ff149a29](https://github.com/kbknapp/clap-rs/commit/ff149a29dd9e179865e6d577cd7dc87c54f8f95c)) + +#### Improvements + +* removes deprecated functions in prep for 1.0 ([274484df](https://github.com/kbknapp/clap-rs/commit/274484dfd08fff4859cefd7e9bef3b73d3a9cb5f)) + + + + +## v0.11.0 (2015-06-17) - BREAKING CHANGE + + +#### Documentation + +* updates docs to new version flag defaults ([ebf442eb](https://github.com/kbknapp/clap-rs/commit/ebf442ebebbcd2ec6bfe2c06566c9d362bccb112)) + +#### Features + +* **Help and Version** default short for version is now `-V` but can be overridden (only breaks manual documentation) (**BREAKING CHANGE** [eb1d9320](https://github.com/kbknapp/clap-rs/commit/eb1d9320c509c1e4e57d7c7959da82bcfe06ada0)) + + + + +### v0.10.5 (2015-06-06) + + +#### Bug Fixes + +* **Global Args** global arguments propogate fully now ([1f377960](https://github.com/kbknapp/clap-rs/commit/1f377960a48c82f54ca5f39eb56bcb393140b046), closes [#137](https://github.com/kbknapp/clap-rs/issues/137)) + + + + +### v0.10.4 (2015-06-06) + + +#### Bug Fixes + +* **Global Args** global arguments propogate fully now ([8f2c0160](https://github.com/kbknapp/clap-rs/commit/8f2c0160c8d844daef375a33dbaec7d89de00a00), closes [#137](https://github.com/kbknapp/clap-rs/issues/137)) + + + + +### v0.10.3 (2015-05-31) + + +#### Bug Fixes + +* **Global Args** fixes a bug where globals only transfer to one subcommand ([a37842ee](https://github.com/kbknapp/clap-rs/commit/a37842eec1ee3162b86fdbda23420b221cdb1e3b), closes [#135](https://github.com/kbknapp/clap-rs/issues/135)) + + + + +### v0.10.2 (2015-05-30) + + +#### Improvements + +* **Binary Names** allows users to override the system determined bin name ([2191fe94](https://github.com/kbknapp/clap-rs/commit/2191fe94bda35771383b52872fb7f5421b178be1), closes [#134](https://github.com/kbknapp/clap-rs/issues/134)) + +#### Documentation + +* adds contributing guidelines ([6f76bd0a](https://github.com/kbknapp/clap-rs/commit/6f76bd0a07e8b7419b391243ab2d6687cd8a9c5f)) + + + + +### v0.10.1 (2015-05-26) + + +#### Features + +* can now specify that an app or subcommand should display help on no args or subcommands ([29ca7b2f](https://github.com/kbknapp/clap-rs/commit/29ca7b2f74376ca0cdb9d8ee3bfa99f7640cc404), closes [#133](https://github.com/kbknapp/clap-rs/issues/133)) + + + + +## v0.10.0 (2015-05-23) + + +#### Features + +* **Global Args** allows args that propagate down to child commands ([2bcc6137](https://github.com/kbknapp/clap-rs/commit/2bcc6137a83cb07757771a0afea953e68e692f0b), closes [#131](https://github.com/kbknapp/clap-rs/issues/131)) + +#### Improvements + +* **Colors** implements more structured colored output ([d6c3ed54](https://github.com/kbknapp/clap-rs/commit/d6c3ed54d21cf7b40d9f130d4280ff5448522fc5), closes [#129](https://github.com/kbknapp/clap-rs/issues/129)) + +#### Deprecations + +* **SubCommand/App** several methods and functions for stable release ([28b73855](https://github.com/kbknapp/clap-rs/commit/28b73855523ad170544afdb20665db98702fbe70)) + +#### Documentation + +* updates for deprecations and new features ([743eefe8](https://github.com/kbknapp/clap-rs/commit/743eefe8dd40c1260065ce086d572e9e9358bc4c)) + + + + +## v0.9.2 (2015-05-20) + + +#### Bug Fixes + +* **help** allows parent requirements to be ignored with help and version ([52218cc1](https://github.com/kbknapp/clap-rs/commit/52218cc1fdb06a42456c964d98cc2c7ac3432412), closes [#124](https://github.com/kbknapp/clap-rs/issues/124)) + + + + +## v0.9.1 (2015-05-18) + + +#### Bug Fixes + +* **help** fixes a bug where requirements are included as program name in help and version ([08ba3f25](https://github.com/kbknapp/clap-rs/commit/08ba3f25cf38b149229ba8b9cb37a5804fe6b789)) + + + + +## v0.9.0 (2015-05-17) + + +#### Improvements + +* **usage** usage strings now include parent command requirements ([dd8f21c7](https://github.com/kbknapp/clap-rs/commit/dd8f21c7c15cde348fdcf44fa7c205f0e98d2e4a), closes [#125](https://github.com/kbknapp/clap-rs/issues/125)) +* **args** allows consumer of clap to decide if empty values are allowed or not ([ab4ec609](https://github.com/kbknapp/clap-rs/commit/ab4ec609ccf692b9b72cccef5c9f74f5577e360d), closes [#122](https://github.com/kbknapp/clap-rs/issues/122)) + +#### Features + +* **subcommands** + * allows optionally specifying that no subcommand is an error ([7554f238](https://github.com/kbknapp/clap-rs/commit/7554f238fd3afdd60b7e4dcf00ff4a9eccf842c1), closes [#126](https://github.com/kbknapp/clap-rs/issues/126)) + * subcommands can optionally negate parent requirements ([4a4229f5](https://github.com/kbknapp/clap-rs/commit/4a4229f500e21c350e1ef78dd09ef27559653288), closes [#123](https://github.com/kbknapp/clap-rs/issues/123)) + + + + +## v0.8.6 (2015-05-17) + + +#### Bug Fixes + +* **args** `-` can now be parsed as a value for an argument ([bc12e78e](https://github.com/kbknapp/clap-rs/commit/bc12e78eadd7eaf9d008a8469fdd2dfd7990cb5d), closes [#121](https://github.com/kbknapp/clap-rs/issues/121)) + + + + +## v0.8.5 (2015-05-15) + + +#### Bug Fixes + +* **macros** makes macro errors consistent with others ([0c264a8c](https://github.com/kbknapp/clap-rs/commit/0c264a8ca57ec1cfdcb74dae79145d766cdc9b97), closes [#118](https://github.com/kbknapp/clap-rs/issues/118)) + +#### Features + +* **macros** + * arg_enum! and simple_enum! provide a Vec<&str> of variant names ([30fa87ba](https://github.com/kbknapp/clap-rs/commit/30fa87ba4e0f3189351d8f4f78b72e616a30d0bd), closes [#119](https://github.com/kbknapp/clap-rs/issues/119)) + * arg_enum! and simple_enum! auto-implement Display ([d1219f0d](https://github.com/kbknapp/clap-rs/commit/d1219f0d1371d872061bd0718057eca4ef47b739), closes [#120](https://github.com/kbknapp/clap-rs/issues/120)) + + + + +## v0.8.4 (2015-05-12) + + +#### Bug Fixes + +* **suggestions** --help and --version now get suggestions ([d2b3b1fa](https://github.com/kbknapp/clap-rs/commit/d2b3b1faa0bdc1c5d2350cc4635aba81e02e9d96), closes [#116](https://github.com/kbknapp/clap-rs/issues/116)) + + + + +## v0.8.3 (2015-05-10) + + +#### Bug Fixes + +* **usage** groups unfold their members in usage strings ([55d15582](https://github.com/kbknapp/clap-rs/commit/55d155827ea4a6b077a83669701e797ce1ad68f4), closes [#114](https://github.com/kbknapp/clap-rs/issues/114)) + +#### Performance + +* **usage** removes unneeded allocations ([fd53cd18](https://github.com/kbknapp/clap-rs/commit/fd53cd188555f5c3dc8bc341c5d7eb04b761a70f)) + + + + +## v0.8.2 (2015-05-08) + + +#### Bug Fixes + +* **usage strings** positional arguments are presented in index order ([eb0e374e](https://github.com/kbknapp/clap-rs/commit/eb0e374ecf952f1eefbc73113f21e0705936e40b), closes [#112](https://github.com/kbknapp/clap-rs/issues/112)) + + + + +## v0.8.1 (2015-05-06) + + +#### Bug Fixes + +* **subcommands** stops parsing multiple values when subcommands are found ([fc79017e](https://github.com/kbknapp/clap-rs/commit/fc79017eced04fd41cc1801331e5054df41fac17), closes [#109](https://github.com/kbknapp/clap-rs/issues/109)) + +#### Improvements + +* **color** reduces color in error messages ([aab44cca](https://github.com/kbknapp/clap-rs/commit/aab44cca6352f47e280c296e50c535f5d752dd46), closes [#110](https://github.com/kbknapp/clap-rs/issues/110)) +* **suggestions** adds suggested arguments to usage strings ([99447414](https://github.com/kbknapp/clap-rs/commit/994474146e9fb8b701af773a52da71553d74d4b7)) + + + + +## v0.8.0 (2015-05-06) + + +#### Bug Fixes + +* **did-you-mean** for review ([0535cfb0](https://github.com/kbknapp/clap-rs/commit/0535cfb0c711331568b4de8080eeef80bd254b68)) +* **Positional** positionals were ignored if they matched a subcmd, even after '--' ([90e7b081](https://github.com/kbknapp/clap-rs/commit/90e7b0818741668b47cbe3becd029bab588e3553)) +* **help** fixes bug where space between arg and help is too long ([632fb115](https://github.com/kbknapp/clap-rs/commit/632fb11514c504999ea86bdce47cdd34f8ebf646)) + +#### Features + +* **from_usage** adds ability to add value names or num of vals in usage string ([3d581976](https://github.com/kbknapp/clap-rs/commit/3d58197674ed7886ca315efb76e411608a327501), closes [#98](https://github.com/kbknapp/clap-rs/issues/98)) +* **did-you-mean** + * gate it behind 'suggestions' ([c0e38351](https://github.com/kbknapp/clap-rs/commit/c0e383515d01bdd5ca459af9c2f7e2cf49e2488b)) + * for possible values ([1cc2deb2](https://github.com/kbknapp/clap-rs/commit/1cc2deb29158e0e4e8b434e4ce26b3d819301a7d)) + * for long flags (i.e. --long) ([52a0b850](https://github.com/kbknapp/clap-rs/commit/52a0b8505c99354bdf5fd1cd256cf41197ac2d81)) + * for subcommands ([06e869b5](https://github.com/kbknapp/clap-rs/commit/06e869b5180258047ed3c60ba099de818dd25fff)) +* **Flags** adds sugestions functionality ([8745071c](https://github.com/kbknapp/clap-rs/commit/8745071c3257dd327c497013516f12a823df9530)) +* **errors** colorizes output red on error ([f8b26b13](https://github.com/kbknapp/clap-rs/commit/f8b26b13da82ba3ba9a932d3d1ab4ea45d1ab036)) + +#### Improvements + +* **arg_enum** allows ascii case insensitivity for enum variants ([b249f965](https://github.com/kbknapp/clap-rs/commit/b249f9657c6921c004764bd80d13ebca81585eec), closes [#104](https://github.com/kbknapp/clap-rs/issues/104)) +* **clap-test** simplified `make test` invocation ([d17dcb29](https://github.com/kbknapp/clap-rs/commit/d17dcb2920637a1f58c61c596b7bd362fd53047c)) + +#### Documentation + +* **README** adds details about optional and new features ([960389de](https://github.com/kbknapp/clap-rs/commit/960389de02c9872aaee9adabe86987f71f986e39)) +* **clap** fix typos caught by codespell ([8891d929](https://github.com/kbknapp/clap-rs/commit/8891d92917aa1a069cca67272be41b99e548356e)) +* **from_usage** explains new usage strings with multiple values ([05476fc6](https://github.com/kbknapp/clap-rs/commit/05476fc61cd1e5f4a4e750d258c878732a3a9c64)) + + + + +## v0.7.6 (2015-05-05) + + +#### Improvements + +* **Options** adds number of values to options in help/usage ([c1c993c4](https://github.com/kbknapp/clap-rs/commit/c1c993c419d18e35c443785053d8de9a2ef88073)) + +#### Features + +* **from_usage** adds ability to add value names or num of vals in usage string ([ad55748c](https://github.com/kbknapp/clap-rs/commit/ad55748c265cf27935c7b210307d2040b6a09125), closes [#98](https://github.com/kbknapp/clap-rs/issues/98)) + +#### Bug Fixes + +* **MultipleValues** properly distinguishes between multiple values and multiple occurrences ([dd2a7564](https://github.com/kbknapp/clap-rs/commit/dd2a75640ca68a91b973faad15f04df891356cef), closes [#99](https://github.com/kbknapp/clap-rs/issues/99)) +* **help** fixes tab alignment with multiple values ([847001ff](https://github.com/kbknapp/clap-rs/commit/847001ff6d8f4d9518e810fefb8edf746dd0f31e)) + +#### Documentation + +* **from_usage** explains new usage strings with multiple values ([5a3a42df](https://github.com/kbknapp/clap-rs/commit/5a3a42dfa3a783537f88dedc0fd5f0edcb8ea372)) + + + + +## v0.7.5 (2015-05-04) + + +#### Bug Fixes + +* **Options** fixes bug where options with no value don't error out ([a1fb94be](https://github.com/kbknapp/clap-rs/commit/a1fb94be53141572ffd97aad037295d4ffec82d0)) + + + + +## v0.7.4 (2015-05-03) + + +#### Bug Fixes + +* **Options** fixes a bug where option arguments in succession get their values skipped ([f66334d0](https://github.com/kbknapp/clap-rs/commit/f66334d0ce984e2b56e5c19abb1dd536fae9342a)) + + + + +## v0.7.3 (2015-05-03) + + +#### Bug Fixes + +* **RequiredValues** fixes a bug where missing values are parsed as missing arguments ([93c4a723](https://github.com/kbknapp/clap-rs/commit/93c4a7231ba1a08152648598f7aa4503ea82e4de)) + +#### Improvements + +* **ErrorMessages** improves error messages and corrections ([a29c3983](https://github.com/kbknapp/clap-rs/commit/a29c3983c4229906655a29146ec15a0e46dd942d)) +* **ArgGroups** improves requirement and confliction support for groups ([c236dc5f](https://github.com/kbknapp/clap-rs/commit/c236dc5ff475110d2a1b80e62903f80296163ad3)) + + + + +## v0.7.2 (2015-05-03) + + +#### Bug Fixes + +* **RequiredArgs** fixes bug where required-by-default arguments are not listed in usage ([12aea961](https://github.com/kbknapp/clap-rs/commit/12aea9612d290845ba86515c240aeeb0a21198db), closes [#96](https://github.com/kbknapp/clap-rs/issues/96)) + + + + +## v0.7.1 (2015-05-01) + + +#### Bug Fixes + +* **MultipleValues** stops evaluating values if the max or exact number of values was reached ([86d92c9f](https://github.com/kbknapp/clap-rs/commit/86d92c9fdbf9f422442e9562977bbaf268dbbae1)) + + + + +## v0.7.0 (2015-04-30) - BREAKING CHANGE + + +#### Bug Fixes + +* **from_usage** removes bug where usage strings have no help text ([ad4e5451](https://github.com/kbknapp/clap-rs/commit/ad4e54510739aeabf75f0da3278fb0952db531b3), closes [#83](https://github.com/kbknapp/clap-rs/issues/83)) + +#### Features + +* **MultipleValues** + * add support for minimum and maximum number of values ([53f6b8c9](https://github.com/kbknapp/clap-rs/commit/53f6b8c9d8dc408b4fa9f833fc3a63683873c42f)) + * adds support limited number and named values ([ae09f05e](https://github.com/kbknapp/clap-rs/commit/ae09f05e92251c1b39a83d372736fcc7b504e432)) + * implement shorthand for options with multiple values ([6669f0a9](https://github.com/kbknapp/clap-rs/commit/6669f0a9687d4f668523145d7bd5c007d1eb59a8)) +* **arg** allow other types besides Vec for multiple value settings (**BREAKING CHANGE** [0cc2f698](https://github.com/kbknapp/clap-rs/commit/0cc2f69839b9b1db5d06330771b494783049a88e), closes [#87](https://github.com/kbknapp/clap-rs/issues/87)) +* **usage** implement smart usage strings on errors ([d77048ef](https://github.com/kbknapp/clap-rs/commit/d77048efb1e595ffe831f1a2bea2f2700db53b9f), closes [#88](https://github.com/kbknapp/clap-rs/issues/88)) + + + + +## v0.6.9 (2015-04-29) + + +#### Bug Fixes + +* **from_usage** removes bug where usage strings have no help text ([ad4e5451](https://github.com/kbknapp/clap-rs/commit/ad4e54510739aeabf75f0da3278fb0952db531b3), closes [#83](https://github.com/kbknapp/clap-rs/issues/83)) + + + + +## 0.6.8 (2015-04-27) + + +#### Bug Fixes + +* **help** change long help --long=long -> --long ([1e25abfc](https://github.com/kbknapp/clap-rs/commit/1e25abfc36679ab89eae71bf98ced4de81992d00)) +* **RequiredArgs** required by default args should no longer be required when their exclusions are present ([4bb4c3cc](https://github.com/kbknapp/clap-rs/commit/4bb4c3cc076b49e86720e882bf8c489877199f2d)) + +#### Features + +* **ArgGroups** add ability to create arg groups ([09eb4d98](https://github.com/kbknapp/clap-rs/commit/09eb4d9893af40c347e50e2b717e1adef552357d)) + + + + +## v0.6.7 (2015-04-22) + + +#### Bug Fixes + +* **from_usage** fix bug causing args to not be required ([b76129e9](https://github.com/kbknapp/clap-rs/commit/b76129e9b71a63365d5c77a7f57b58dbd1e94d49)) + +#### Features + +* **apps** add ability to display additional help info after auto-gen'ed help msg ([65cc259e](https://github.com/kbknapp/clap-rs/commit/65cc259e4559cbe3653c865ec0c4b1e42a389b07)) + + + + +## v0.6.6 (2015-04-19) + + +#### Bug Fixes + +* **from_usage** tabs and spaces should be treated equally ([4fd44181](https://github.com/kbknapp/clap-rs/commit/4fd44181d55d8eb88caab1e625231cfa3129e347)) + +#### Features + +* **macros.rs** add macro to get version from Cargo.toml ([c630969a](https://github.com/kbknapp/clap-rs/commit/c630969aa3bbd386379219cae27ba1305b117f3e)) + + + + +## v0.6.5 (2015-04-19) + + +#### Bug Fixes + +* **macros.rs** fix use statements for trait impls ([86e4075e](https://github.com/kbknapp/clap-rs/commit/86e4075eb111937c8a7bdb344e866e350429f042)) + + + + +## v0.6.4 (2015-04-17) + + +#### Features + +* **macros** add ability to create enums pub or priv with derives ([2c499f80](https://github.com/kbknapp/clap-rs/commit/2c499f8015a199827cdf1fa3ec4f6f171722f8c7)) + + + + +## v0.6.3 (2015-04-16) + + +#### Features + +* **macros** add macro to create custom enums to use as types ([fb672aff](https://github.com/kbknapp/clap-rs/commit/fb672aff561c29db2e343d6c607138f141aca8b6)) + + + + +## v0.6.2 (2015-04-14) + + +#### Features + +* **macros** + * add ability to get mutliple typed values or exit ([0b87251f](https://github.com/kbknapp/clap-rs/commit/0b87251fc088234bee51c323c2b652d7254f7a59)) + * add ability to get a typed multiple values ([e243fe38](https://github.com/kbknapp/clap-rs/commit/e243fe38ddbbf845a46c0b9baebaac3778c80927)) + * add convenience macro to get a typed value or exit ([4b7cd3ea](https://github.com/kbknapp/clap-rs/commit/4b7cd3ea4947780d9daa39f3e1ddab53ad4c7fef)) + * add convenience macro to get a typed value ([8752700f](https://github.com/kbknapp/clap-rs/commit/8752700fbb30e89ee68adbce24489ae9a24d33a9)) + + + + +## v0.6.1 (2015-04-13) + + +#### Bug Fixes + +* **from_usage** trim all whitespace before parsing ([91d29045](https://github.com/kbknapp/clap-rs/commit/91d2904599bd602deef2e515dfc65dc2863bdea0)) + + + + +## v0.6.0 (2015-04-13) + + +#### Bug Fixes + +* **tests** fix failing doc tests ([3710cd69](https://github.com/kbknapp/clap-rs/commit/3710cd69162f87221a62464f63437c1ce843ad3c)) + +#### Features + +* **app** add support for building args from usage strings ([d5d48bcf](https://github.com/kbknapp/clap-rs/commit/d5d48bcf463a4e494ef758836bd69a4c220bbbb5)) +* **args** add ability to create basic arguments from a usage string ([ab409a8f](https://github.com/kbknapp/clap-rs/commit/ab409a8f1db9e37cc70200f6f4a84a162692e618)) + + + + +## v0.5.14 (2015-04-10) + + +#### Bug Fixes + +* **usage** + * remove unneeded space ([51372789](https://github.com/kbknapp/clap-rs/commit/5137278942121bc2593ce6e5dc224ec2682549e6)) + * remove warning about unused variables ([ba817b9d](https://github.com/kbknapp/clap-rs/commit/ba817b9d815e37320650973f1bea0e7af3030fd7)) + +#### Features + +* **usage** add ability to get usage string for subcommands too ([3636afc4](https://github.com/kbknapp/clap-rs/commit/3636afc401c2caa966efb5b1869ef4f1ed3384aa)) + + + + +## v0.5.13 (2015-04-09) + + +#### Features + +* **SubCommands** add method to get name and subcommand matches together ([64e53928](https://github.com/kbknapp/clap-rs/commit/64e539280e23e567cf5de393b346eb0ca20e7eb5)) +* **ArgMatches** add method to get default usage string ([02462150](https://github.com/kbknapp/clap-rs/commit/02462150ca750bdc7012627d7e8d96379d494d7f)) + + + + +## v0.5.12 (2015-04-08) + + +#### Features + +* **help** sort arguments by name so as to not display a random order ([f4b2bf57](https://github.com/kbknapp/clap-rs/commit/f4b2bf5767386013069fb74862e6e938dacf44d2)) + + + + +## v0.5.11 (2015-04-08) + + +#### Bug Fixes + +* **flags** fix bug not allowing users to specify -v or -h ([90e72cff](https://github.com/kbknapp/clap-rs/commit/90e72cffdee321b79eea7a2207119533540062b4)) + + + + +## v0.5.10 (2015-04-08) + + +#### Bug Fixes + +* **help** fix spacing when option argument has not long version ([ca17fa49](https://github.com/kbknapp/clap-rs/commit/ca17fa494b68e92da83ee364bf64b0687006824b)) + + + + +## v0.5.9 (2015-04-08) + + +#### Bug Fixes + +* **positional args** all previous positional args become required when a latter one is required ([c14c3f31](https://github.com/kbknapp/clap-rs/commit/c14c3f31fd557c165570b60911d8ee483d89d6eb), closes [#50](https://github.com/kbknapp/clap-rs/issues/50)) +* **clap** remove unstable features for Rust 1.0 ([9abdb438](https://github.com/kbknapp/clap-rs/commit/9abdb438e36e364d41550e7f5d44ebcaa8ee6b10)) +* **args** improve error messages for arguments with mutual exclusions ([18dbcf37](https://github.com/kbknapp/clap-rs/commit/18dbcf37024daf2b76ca099a6f118b53827aa339), closes [#51](https://github.com/kbknapp/clap-rs/issues/51)) + + + + +## v0.5.8 (2015-04-08) + + +#### Bug Fixes + +* **option args** fix bug in getting the wrong number of occurrences for options ([82ad6ad7](https://github.com/kbknapp/clap-rs/commit/82ad6ad77539cf9f9a03b78db466f575ebd972cc)) +* **help** fix formatting for option arguments with no long ([e8691004](https://github.com/kbknapp/clap-rs/commit/e869100423d93fa3acff03c4620cbcc0d0e790a1)) +* **flags** add assertion to catch flags with specific value sets ([a0a2a40f](https://github.com/kbknapp/clap-rs/commit/a0a2a40fed57f7c5ad9d68970d090e9856306c7d), closes [#52](https://github.com/kbknapp/clap-rs/issues/52)) +* **args** improve error messages for arguments with mutual exclusions ([bff945fc](https://github.com/kbknapp/clap-rs/commit/bff945fc5d03bba4266533340adcffb002508d1b), closes [#51](https://github.com/kbknapp/clap-rs/issues/51)) +* **tests** add missing .takes_value(true) to option2 ([bdb0e88f](https://github.com/kbknapp/clap-rs/commit/bdb0e88f696c8595c3def3bfb0e52d538c7be085)) +* **positional args** all previous positional args become required when a latter one is required ([343d47dc](https://github.com/kbknapp/clap-rs/commit/343d47dcbf83786a45c0d0f01b27fd9dd76725de), closes [#50](https://github.com/kbknapp/clap-rs/issues/50)) + + + + +## v0.5.7 (2015-04-08) + + +#### Bug Fixes + +* **args** fix bug in arguments who are required and mutually exclusive ([6ceb88a5](https://github.com/kbknapp/clap-rs/commit/6ceb88a594caae825605abc1cdad95204996bf29)) + + + + +## v0.5.6 (2015-04-08) + + +#### Bug Fixes + +* **help** fix formatting of help and usage ([28691b52](https://github.com/kbknapp/clap-rs/commit/28691b52f67e65c599e10e4ea2a0f6f9765a06b8)) + + + + +## v0.5.5 (2015-04-08) + + +#### Bug Fixes + +* **help** fix formatting of help for flags and options ([6ec10115](https://github.com/kbknapp/clap-rs/commit/6ec1011563a746f0578a93b76d45e63878e0f9a8)) + + + + +## v0.5.4 (2015-04-08) + + +#### Features + +* **help** add '...' to indicate multiple values supported ([297ddba7](https://github.com/kbknapp/clap-rs/commit/297ddba77000e2228762ab0eca50b480f7467386)) + + + + +## v0.5.3 (2015-04-08) + + +#### Features + +* **positionals** + * add assertions for positional args with multiple vals ([b7fa72d4](https://github.com/kbknapp/clap-rs/commit/b7fa72d40f18806ec2042dd67a518401c2cf5681)) + * add support for multiple values ([80784009](https://github.com/kbknapp/clap-rs/commit/807840094109fbf90b348039ae22669ef27889ba)) + + + + +## v0.5.2 (2015-04-08) + + +#### Bug Fixes + +* **apps** allow use of hyphens in application and subcommand names ([da549dcb](https://github.com/kbknapp/clap-rs/commit/da549dcb6c7e0d773044ab17829744483a8b0f7f)) + + + + +## v0.5.1 (2015-04-08) + + +#### Bug Fixes + +* **args** determine if the only arguments allowed are also required ([0a09eb36](https://github.com/kbknapp/clap-rs/commit/0a09eb365ced9a03faf8ed24f083ef730acc90e8)) + + + + +## v0.5.0 (2015-04-08) + + +#### Features + +* **args** add support for a specific set of allowed values on options or positional arguments ([270eb889](https://github.com/kbknapp/clap-rs/commit/270eb88925b6dc2881bff1f31ee344f085d31809)) + + + + +## v0.4.18 (2015-04-08) + + +#### Bug Fixes + +* **usage** display required args in usage, even if only required by others ([1b7316d4](https://github.com/kbknapp/clap-rs/commit/1b7316d4a8df70b0aa584ccbfd33f68966ad2a54)) + +#### Features + +* **subcommands** properly list subcommands in help and usage ([4ee02344](https://github.com/kbknapp/clap-rs/commit/4ee023442abc3dba54b68138006a52b714adf331)) + + + + +## v0.4.17 (2015-04-08) + + +#### Bug Fixes + +* **tests** remove cargo test from claptests makefile ([1cf73817](https://github.com/kbknapp/clap-rs/commit/1cf73817d6fb1dccb5b6a23b46c2efa8b567ad62)) + + + + +## v0.4.16 (2015-04-08) + + +#### Bug Fixes + +* **option** fix bug with option occurrence values ([9af52e93](https://github.com/kbknapp/clap-rs/commit/9af52e93cef9e17ac9974963f132013d0b97b946)) +* **tests** fix testing script bug and formatting ([d8f03a55](https://github.com/kbknapp/clap-rs/commit/d8f03a55c4f74d126710ee06aad5a667246a8001)) + +#### Features + +* **arg** allow lifetimes other than 'static in arguments ([9e8c1fb9](https://github.com/kbknapp/clap-rs/commit/9e8c1fb9406f8448873ca58bab07fe905f1551e5)) diff --git a/vendor/registry-40351f815f426200/clap/CONTRIBUTORS.md b/vendor/registry-40351f815f426200/clap/CONTRIBUTORS.md new file mode 100644 index 000000000..4f86b4557 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/CONTRIBUTORS.md @@ -0,0 +1,79 @@ +the following is a list of contributors: + + +[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[little-dude](https://github.com/little-dude) |[sru](https://github.com/sru) | +:---: |:---: |:---: |:---: |:---: |:---: | +[kbknapp](https://github.com/kbknapp) |[homu](https://github.com/homu) |[Vinatorul](https://github.com/Vinatorul) |[tormol](https://github.com/tormol) |[little-dude](https://github.com/little-dude) |[sru](https://github.com/sru) | + +[nabijaczleweli](https://github.com/nabijaczleweli) |[mgeisler](https://github.com/mgeisler) |[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[nateozem](https://github.com/nateozem) |[james-darkfox](https://github.com/james-darkfox) | +:---: |:---: |:---: |:---: |:---: |:---: | +[nabijaczleweli](https://github.com/nabijaczleweli) |[mgeisler](https://github.com/mgeisler) |[Byron](https://github.com/Byron) |[hgrecco](https://github.com/hgrecco) |[nateozem](https://github.com/nateozem) |[james-darkfox](https://github.com/james-darkfox) | + +[Arnavion](https://github.com/Arnavion) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | +:---: |:---: |:---: |:---: |:---: |:---: | +[Arnavion](https://github.com/Arnavion) |[rtaycher](https://github.com/rtaycher) |[glowing-chemist](https://github.com/glowing-chemist) |[untitaker](https://github.com/untitaker) |[afiune](https://github.com/afiune) |[crazymerlyn](https://github.com/crazymerlyn) | + +[SuperFluffy](https://github.com/SuperFluffy) |[japaric](https://github.com/japaric) |[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[tshepang](https://github.com/tshepang) |[gohyda](https://github.com/gohyda) | +:---: |:---: |:---: |:---: |:---: |:---: | +[SuperFluffy](https://github.com/SuperFluffy) |[japaric](https://github.com/japaric) |[matthiasbeyer](https://github.com/matthiasbeyer) |[SShrike](https://github.com/SShrike) |[tshepang](https://github.com/tshepang) |[gohyda](https://github.com/gohyda) | + +[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[golem131](https://github.com/golem131) |[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | +:---: |:---: |:---: |:---: |:---: |:---: | +[jimmycuadra](https://github.com/jimmycuadra) |[Nemo157](https://github.com/Nemo157) |[golem131](https://github.com/golem131) |[porglezomp](https://github.com/porglezomp) |[wdv4758h](https://github.com/wdv4758h) |[frewsxcv](https://github.com/frewsxcv) | + +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[ignatenkobrain](https://github.com/ignatenkobrain) |[shepmaster](https://github.com/shepmaster) |[cstorey](https://github.com/cstorey) | +:---: |:---: |:---: |:---: |:---: |:---: | +[hoodie](https://github.com/hoodie) |[huonw](https://github.com/huonw) |[GrappigPanda](https://github.com/GrappigPanda) |[ignatenkobrain](https://github.com/ignatenkobrain) |[shepmaster](https://github.com/shepmaster) |[cstorey](https://github.com/cstorey) | + +[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | +:---: |:---: |:---: |:---: |:---: |:---: | +[kieraneglin](https://github.com/kieraneglin) |[musoke](https://github.com/musoke) |[nelsonjchen](https://github.com/nelsonjchen) |[pkgw](https://github.com/pkgw) |[Deedasmi](https://github.com/Deedasmi) |[vmchale](https://github.com/vmchale) | + +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | +:---: |:---: |:---: |:---: |:---: |:---: | +[messense](https://github.com/messense) |[Keats](https://github.com/Keats) |[starkat99](https://github.com/starkat99) |[alex-gulyas](https://github.com/alex-gulyas) |[cite-reader](https://github.com/cite-reader) |[alexbool](https://github.com/alexbool) | + +[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[pixelistik](https://github.com/pixelistik) | +:---: |:---: |:---: |:---: |:---: |:---: | +[AluisioASG](https://github.com/AluisioASG) |[BurntSushi](https://github.com/BurntSushi) |[nox](https://github.com/nox) |[mitsuhiko](https://github.com/mitsuhiko) |[brennie](https://github.com/brennie) |[pixelistik](https://github.com/pixelistik) | + +[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[casey](https://github.com/casey) | +:---: |:---: |:---: |:---: |:---: |:---: | +[Bilalh](https://github.com/Bilalh) |[dotdash](https://github.com/dotdash) |[bradurani](https://github.com/bradurani) |[Seeker14491](https://github.com/Seeker14491) |[brianp](https://github.com/brianp) |[casey](https://github.com/casey) | + +[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | +:---: |:---: |:---: |:---: |:---: |:---: | +[volks73](https://github.com/volks73) |[daboross](https://github.com/daboross) |[mernen](https://github.com/mernen) |[dguo](https://github.com/dguo) |[davidszotten](https://github.com/davidszotten) |[drusellers](https://github.com/drusellers) | + +[eddyb](https://github.com/eddyb) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) | +:---: |:---: |:---: |:---: |:---: |:---: | +[eddyb](https://github.com/eddyb) |[birkenfeld](https://github.com/birkenfeld) |[guanqun](https://github.com/guanqun) |[tanakh](https://github.com/tanakh) |[SirVer](https://github.com/SirVer) |[idmit](https://github.com/idmit) | + +[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[jdanford](https://github.com/jdanford) | +:---: |:---: |:---: |:---: |:---: |:---: | +[archer884](https://github.com/archer884) |[jacobmischka](https://github.com/jacobmischka) |[jespino](https://github.com/jespino) |[jtdowney](https://github.com/jtdowney) |[andete](https://github.com/andete) |[jdanford](https://github.com/jdanford) | + +[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[malbarbo](https://github.com/malbarbo) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) | +:---: |:---: |:---: |:---: |:---: |:---: | +[joshtriplett](https://github.com/joshtriplett) |[Kalwyn](https://github.com/Kalwyn) |[manuel-rhdt](https://github.com/manuel-rhdt) |[malbarbo](https://github.com/malbarbo) |[Marwes](https://github.com/Marwes) |[mdaffin](https://github.com/mdaffin) | + +[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) | +:---: |:---: |:---: |:---: |:---: |:---: | +[iliekturtles](https://github.com/iliekturtles) |[nicompte](https://github.com/nicompte) |[NickeZ](https://github.com/NickeZ) |[nvzqz](https://github.com/nvzqz) |[nuew](https://github.com/nuew) |[Geogi](https://github.com/Geogi) | + +[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) | +:---: |:---: |:---: |:---: |:---: |:---: | +[flying-sheep](https://github.com/flying-sheep) |[Phlosioneer](https://github.com/Phlosioneer) |[peppsac](https://github.com/peppsac) |[golddranks](https://github.com/golddranks) |[hexjelly](https://github.com/hexjelly) |[rnelson](https://github.com/rnelson) | + +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) | +:---: |:---: |:---: |:---: |:---: |:---: | +[swatteau](https://github.com/swatteau) |[tspiteri](https://github.com/tspiteri) |[vks](https://github.com/vks) |[th4t](https://github.com/th4t) |[mineo](https://github.com/mineo) |[wabain](https://github.com/wabain) | + +[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | +:---: |:---: |:---: |:---: |:---: | +[grossws](https://github.com/grossws) |[kennytm](https://github.com/kennytm) |[mvaude](https://github.com/mvaude) |[panicbit](https://github.com/panicbit) |[ogham](https://github.com/ogham) | + + + + +This list was generated by [mgechev/github-contributors-list](https://github.com/mgechev/github-contributors-list) diff --git a/vendor/registry-40351f815f426200/clap/Cargo.toml b/vendor/registry-40351f815f426200/clap/Cargo.toml new file mode 100644 index 000000000..1d3f577b5 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/Cargo.toml @@ -0,0 +1,126 @@ +# 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 = "clap" +version = "2.27.1" +authors = ["Kevin K. "] +exclude = ["examples/*", "clap-test/*", "tests/*", "benches/*", "*.png", "clap-perf/*", "*.dot"] +description = "A simple to use, efficient, and full featured Command Line Argument Parser\n" +homepage = "https://clap.rs/" +documentation = "https://docs.rs/clap/" +readme = "README.md" +keywords = ["argument", "command", "arg", "parser", "parse"] +categories = ["command-line-interface"] +license = "MIT" +repository = "https://github.com/kbknapp/clap-rs.git" +[package.metadata.docs.rs] +features = ["doc"] +[profile.test] +opt-level = 1 +lto = false +codegen-units = 4 +debug = true +debug-assertions = true +rpath = false + +[profile.doc] +opt-level = 0 +lto = false +codegen-units = 4 +debug = true +debug-assertions = true +rpath = false + +[profile.bench] +opt-level = 3 +lto = true +debug = false +debug-assertions = false +rpath = false + +[profile.dev] +opt-level = 0 +lto = false +codegen-units = 4 +debug = true +debug-assertions = true +rpath = false + +[profile.release] +opt-level = 3 +lto = true +debug = false +debug-assertions = false +rpath = false +[dependencies.bitflags] +version = "0.9" + +[dependencies.clippy] +version = "~0.0.166" +optional = true + +[dependencies.ansi_term] +version = "0.9.0" +optional = true + +[dependencies.vec_map] +version = "0.8" +optional = true + +[dependencies.strsim] +version = "0.6.0" +optional = true + +[dependencies.atty] +version = "0.2.2" +optional = true + +[dependencies.unicode-width] +version = "0.1.4" + +[dependencies.textwrap] +version = "0.9.0" + +[dependencies.term_size] +version = "0.3.0" +optional = true + +[dependencies.yaml-rust] +version = "0.3.5" +optional = true +[dev-dependencies.regex] +version = "0.2" + +[dev-dependencies.lazy_static] +version = "0.2" + +[dev-dependencies.version-sync] +version = "0.3" + +[features] +debug = [] +no_cargo = [] +yaml = ["yaml-rust"] +nightly = [] +color = ["ansi_term", "atty"] +suggestions = ["strsim"] +default = ["suggestions", "color", "vec_map"] +wrap_help = ["term_size", "textwrap/term_size"] +lints = ["clippy"] +unstable = [] +doc = ["yaml"] +[badges.appveyor] +repository = "kbknapp/clap-rs" + +[badges.travis-ci] +repository = "kbknapp/clap-rs" diff --git a/vendor/registry-40351f815f426200/clap/LICENSE-MIT b/vendor/registry-40351f815f426200/clap/LICENSE-MIT new file mode 100644 index 000000000..5acedf041 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/LICENSE-MIT @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015-2016 Kevin B. Knapp + +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/vendor/registry-40351f815f426200/clap/README.md b/vendor/registry-40351f815f426200/clap/README.md new file mode 100644 index 000000000..c383b7bdf --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/README.md @@ -0,0 +1,754 @@ +clap +==== + +[![Crates.io](https://img.shields.io/crates/v/clap.svg)](https://crates.io/crates/clap) [![Crates.io](https://img.shields.io/crates/d/clap.svg)](https://crates.io/crates/clap) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kbknapp/clap-rs/blob/master/LICENSE-MIT) [![Coverage Status](https://coveralls.io/repos/kbknapp/clap-rs/badge.svg?branch=master&service=github)](https://coveralls.io/github/kbknapp/clap-rs?branch=master) [![Join the chat at https://gitter.im/kbknapp/clap-rs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/kbknapp/clap-rs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +Linux: [![Build Status](https://travis-ci.org/kbknapp/clap-rs.svg?branch=master)](https://travis-ci.org/kbknapp/clap-rs) +Windows: [![Build status](https://ci.appveyor.com/api/projects/status/ejg8c33dn31nhv36/branch/master?svg=true)](https://ci.appveyor.com/project/kbknapp/clap-rs/branch/master) + +Command Line Argument Parser for Rust + +It is a simple-to-use, efficient, and full-featured library for parsing command line arguments and subcommands when writing console/terminal applications. + +## [documentation](https://docs.rs/clap/) +## [website](https://clap.rs/) +## [blog](https://blog.clap.rs/) + +Table of Contents +================= + +* [What's New](#whats-new) +* [About](#about) +* [FAQ](#faq) +* [Features](#features) +* [Quick Example](#quick-example) +* [Try it!](#try-it) + * [Pre-Built Test](#pre-built-test) + * [BYOB (Build Your Own Binary)](#byob-build-your-own-binary) +* [Usage](#usage) + * [Optional Dependencies / Features](#optional-dependencies--features) + * [Dependencies Tree](#dependencies-tree) + * [More Information](#more-information) + * [Video Tutorials](#video-tutorials) +* [How to Contribute](#how-to-contribute) + * [Testing Code](#testing-code) + * [Linting Code](#linting-code) + * [Debugging Code](#debugging-code) + * [Goals](#goals) + * [Compatibility Policy](#compatibility-policy) + * [Minimum Version of Rust](#minimum-version-of-rust) +* [License](#license) +* [Recent Breaking Changes](#recent-breaking-changes) + * [Deprecations](#deprecations) + +Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) + +## What's New + +Here's whats new in 2.27.1: + +** This release also contains a very minor breaking change to fix a bug ** + +The only CLIs affected will be those using unrestrained multiple values and subcommands where the +subcommand name can coincide with one of the multiple values. + +See the commit [0c223f54](https://github.com/kbknapp/clap-rs/commit/0c223f54ed46da406bc8b43a5806e0b227863b31) for full details. + +* Adds `term_size` as an optional dependency (with feature `wrap_help`) to fix compile bug +* **The minimum required version of Rust is now 1.18.0 (Stable)** +* Values from global args are now propagated UP and DOWN! +* fixes a bug where using AppSettings::AllowHyphenValues would allow invalid arguments even when there is no way for them to be valid +* when an argument requires a value and that value happens to match a subcommand name, its parsed as a value +* fixes a bug that prevented number_of_values and default_values to be used together +* fixes a bug that didn't allow args with default values to have conflicts +* fixes a panic when using global args and calling App::get_matches_from_safe_borrow multiple times +* fixes issues and potential regressions with global args values not being propagated properly or at all +* fixes a bug where default values are not applied if the option supports zero values +* adds addtional blurbs about using multiples with subcommands +* updates the docs to reflect changes to global args and that global args values can now be propagated back up the stack +* add html_root_url attribute +* sync README version numbers with crate version +* args that have require_delimiter(true) is now reflected in help and usage strings +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed +* fixes when an argument requires a value and that value happens to match a subcommand name, its parsed as a value +* **AppSettings::PropagateGlobalValuesDown:** this setting deprecated and is no longer required to propagate values down or up + +Here's the highlights for v2.21.0 to v2.26.2 + +* if all subcommands are hidden, the subcommands section of the help message is no longer displayed +* fixes a bug where default values are not applied if the option supports zero values +* fixes using require_equals(true) and min_values(0) together +* escape special characters in zsh and fish completions +* avoid panic generating default help msg if term width set to 0 due to bug in textwrap 0.7.0 +* Change `who's` -> `whose` in documentation +* **Help Message:** fixes `App::long_about` not being displayed +* **Suggestions:** output for flag after subcommand +* **The minimum required version of Rust is now 1.13.0 (Stable)** +* bumps unicode-segmentation to v1.2 +* update textwrap to version 0.7.0 which increases the performance of writing help strings +* impl Default for Values + OsValues for any lifetime. +* use textwrap crate for wrapping help texts +* suggests to use flag after subcommand when applicable +* Bumps bitflags crate to v0.9 +* fixes a bug where args that allow values to start with a hyphen couldnt contain a double hyphen -- as a value +* fixes a bug where positional argument help text is misaligned +* **App::template docs:** adds details about the necessity to use AppSettings::UnifiedHelpMessage when using {unified} tags in the help template +* **Arg::allow_hyphen_values docs:** updates the docs to include warnings for allow_hyphen_values and multiple(true) used together +* **clap_app! docs:** adds using the @group specifier to the macro docs +* adds a debug assertion to ensure all args added to groups actually exist +* fixes a bug where args with last(true) and required(true) set were not being printed in the usage string +* fixes a bug that was printing the arg name, instead of value name when Arg::last(true) was used +* fixes a bug where flags were parsed as flags AND positional values when specific combinations of settings were used +* **README.md:** fix some typos +* **Arg:** add `default_value_os` +* **arg_matches.rs:** Added a Default implementation for Values and OsValues iterators. +* **PowerShell Completions:** + * fixes a bug where powershells completions cant be used if no subcommands are defined + * massively dedups subcommand names in the generate script to make smaller scripts that are still functionally equiv +* allows specifying a short help vs a long help (i.e. varying levels of detail depending on if -h or --help was used) +* **clap_app!:** adds support for arg names with hyphens similar to longs with hyphens +* fixes a bug that wasn't allowing help and version to be properly overridden + * This may break code that was relying on this bug! If you add a flag with a long of `help` manually *and* rely on the help message to be printed automatically your code could break. Please see the commit link in the full CHANGELOG.md +* `App::long_about` +* `App::long_version` +* `App::print_long_help` +* `App::write_long_help` +* `App::print_long_version` +* `App::write_long_version` +* `Arg::long_help` +* **clap_app!:** documents the `--("some-arg")` method for using args with hyphens inside them +* fixes the usage string regression when using help templates +* fixes a big regression with custom usage strings +* adds the ability to change the name of the App instance after creation +* adds ability to hide the default value of an argument from the help string +* fixes support for loading author info from yaml +* adds fish subcommand help support +* options that use `require_equals(true)` now display the equals sign in help messages, usage strings, and errors +* setting the max term width now correctly propagates down through child subcommands +* fixes the precedence of this error to prioritize over other error messages +* fixes some regression bugs resulting from old asserts in debug mode. +* adds the ability to mark a positional argument as 'last' which means it should be used with `--` syntax and can be accessed early to effectivly skip other positional args +* Some performance improvements by reducing the ammount of duplicate work, cloning, and allocations in all cases. +* Some massive performance gains when using many args (i.e. things like shell glob expansions) +* adds a setting to allow one to infer shortened subcommands or aliases (i.e. for subcommmand "test", "t", "te", or "tes" would be allowed assuming no other ambiguities) +* when `AppSettings::SubcommandsNegateReqs` and `ArgsNegateSubcommands` are used, a new more accurate double line usage string is shown +* provides `default_value_os` and `default_value_if[s]_os` +* provides `App::help_message` and `App::version_message` which allows one to override the auto-generated help/version flag associated help +* adds the ability to require the equals syntax with options `--opt=val` +* doesn't print the argument sections in the help message if all args in that section are hidden +* doesn't include the various `[ARGS]` `[FLAGS]` or `[OPTIONS]` if the only ones available are hidden +* now correctly shows subcommand as required in the usage string when AppSettings::SubcommandRequiredElseHelp is used +* fixes some "memory leaks" when an error is detected and clap exits +* fixes a trait that's marked private accidentlly, but should be crate internal public +* fixes a bug that tried to propogate global args multiple times when generating multiple completion scripts +* Fixes a critical bug in the `clap_app!` macro of a missing fragment specifier when using `!property` style tags. +* Fix examples link in CONTRIBUTING.md + +For full details, see [CHANGELOG.md](https://github.com/kbknapp/clap-rs/blob/master/CHANGELOG.md) + +## About + +`clap` is used to parse *and validate* the string of command line arguments provided by the user at runtime. You provide the list of valid possibilities, and `clap` handles the rest. This means you focus on your *applications* functionality, and less on the parsing and validating of arguments. + +`clap` also provides the traditional version and help switches (or flags) 'for free' meaning automatically with no configuration. It does this by checking list of valid possibilities you supplied and adding only the ones you haven't already defined. If you are using subcommands, `clap` will also auto-generate a `help` subcommand for you in addition to the traditional flags. + +Once `clap` parses the user provided string of arguments, it returns the matches along with any applicable values. If the user made an error or typo, `clap` informs them of the mistake and exits gracefully (or returns a `Result` type and allows you to perform any clean up prior to exit). Because of this, you can make reasonable assumptions in your code about the validity of the arguments. + +## FAQ + +For a full FAQ and more in depth details, see [the wiki page](https://github.com/kbknapp/clap-rs/wiki/FAQ) + +### Comparisons + +First, let me say that these comparisons are highly subjective, and not meant in a critical or harsh manner. All the argument parsing libraries out there (to include `clap`) have their own strengths and weaknesses. Sometimes it just comes down to personal taste when all other factors are equal. When in doubt, try them all and pick one that you enjoy :) There's plenty of room in the Rust community for multiple implementations! + +#### How does `clap` compare to [getopts](https://github.com/rust-lang-nursery/getopts)? + +`getopts` is a very basic, fairly minimalist argument parsing library. This isn't a bad thing, sometimes you don't need tons of features, you just want to parse some simple arguments, and have some help text generated for you based on valid arguments you specify. The downside to this approach is that you must manually implement most of the common features (such as checking to display help messages, usage strings, etc.). If you want a highly custom argument parser, and don't mind writing the majority of the functionality yourself, `getopts` is an excellent base. + +`getopts` also doesn't allocate much, or at all. This gives it a very small performance boost. Although, as you start implementing additional features, that boost quickly disappears. + +Personally, I find many, many uses of `getopts` are manually implementing features that `clap` provides by default. Using `clap` simplifies your codebase allowing you to focus on your application, and not argument parsing. + +#### How does `clap` compare to [docopt.rs](https://github.com/docopt/docopt.rs)? + +I first want to say I'm a big a fan of BurntSushi's work, the creator of `Docopt.rs`. I aspire to produce the quality of libraries that this man does! When it comes to comparing these two libraries they are very different. `docopt` tasks you with writing a help message, and then it parsers that message for you to determine all valid arguments and their use. Some people LOVE this approach, others do not. If you're willing to write a detailed help message, it's nice that you can stick that in your program and have `docopt` do the rest. On the downside, it's far less flexible. + +`docopt` is also excellent at translating arguments into Rust types automatically. There is even a syntax extension which will do all this for you, if you're willing to use a nightly compiler (use of a stable compiler requires you to somewhat manually translate from arguments to Rust types). To use BurntSushi's words, `docopt` is also a sort of black box. You get what you get, and it's hard to tweak implementation or customize the experience for your use case. + +Because `docopt` is doing a ton of work to parse your help messages and determine what you were trying to communicate as valid arguments, it's also one of the more heavy weight parsers performance-wise. For most applications this isn't a concern and this isn't to say `docopt` is slow, in fact far from it. This is just something to keep in mind while comparing. + +#### All else being equal, what are some reasons to use `clap`? + +`clap` is as fast, and as lightweight as possible while still giving all the features you'd expect from a modern argument parser. In fact, for the amount and type of features `clap` offers it remains about as fast as `getopts`. If you use `clap` when just need some simple arguments parsed, you'll find it's a walk in the park. `clap` also makes it possible to represent extremely complex, and advanced requirements, without too much thought. `clap` aims to be intuitive, easy to use, and fully capable for wide variety use cases and needs. + +## Features + +Below are a few of the features which `clap` supports, full descriptions and usage can be found in the [documentation](https://docs.rs/clap/) and [examples/](examples) directory + +* **Auto-generated Help, Version, and Usage information** + - Can optionally be fully, or partially overridden if you want a custom help, version, or usage +* **Auto-generated bash completion scripts at compile time** + - Even works through many multiple levels of subcommands + - Works with options which only accept certain values + - Works with subcommand aliases +* **Flags / Switches** (i.e. bool fields) + - Both short and long versions supported (i.e. `-f` and `--flag` respectively) + - Supports combining short versions (i.e. `-fBgoZ` is the same as `-f -B -g -o -Z`) + - Supports multiple occurrences (i.e. `-vvv` or `-v -v -v`) +* **Positional Arguments** (i.e. those which are based off an index from the program name) + - Supports multiple values (i.e. `myprog ...` such as `myprog file1.txt file2.txt` being two values for the same "file" argument) + - Supports Specific Value Sets (See below) + - Can set value parameters (such as the minimum number of values, the maximum number of values, or the exact number of values) + - Can set custom validations on values to extend the argument parsing capability to truly custom domains +* **Option Arguments** (i.e. those that take values) + - Both short and long versions supported (i.e. `-o value`, `-ovalue`, `-o=value` and `--option value` or `--option=value` respectively) + - Supports multiple values (i.e. `-o -o ` or `-o `) + - Supports delimited values (i.e. `-o=val1,val2,val3`, can also change the delimiter) + - Supports Specific Value Sets (See below) + - Supports named values so that the usage/help info appears as `-o ` etc. for when you require specific multiple values + - Can set value parameters (such as the minimum number of values, the maximum number of values, or the exact number of values) + - Can set custom validations on values to extend the argument parsing capability to truly custom domains +* **Sub-Commands** (i.e. `git add ` where `add` is a sub-command of `git`) + - Support their own sub-arguments, and sub-sub-commands independent of the parent + - Get their own auto-generated Help, Version, and Usage independent of parent +* **Support for building CLIs from YAML** - This keeps your Rust source nice and tidy and makes supporting localized translation very simple! +* **Requirement Rules**: Arguments can define the following types of requirement rules + - Can be required by default + - Can be required only if certain arguments are present + - Can require other arguments to be present +* **Confliction Rules**: Arguments can optionally define the following types of exclusion rules + - Can be disallowed when certain arguments are present + - Can disallow use of other arguments when present +* **Groups**: Arguments can be made part of a group + - Fully compatible with other relational rules (requirements, conflicts, and overrides) which allows things like requiring the use of any arg in a group, or denying the use of an entire group conditionally +* **Specific Value Sets**: Positional or Option Arguments can define a specific set of allowed values (i.e. imagine a `--mode` option which may *only* have one of two values `fast` or `slow` such as `--mode fast` or `--mode slow`) +* **Default Values** +* **Automatic Version from Cargo.toml**: `clap` is fully compatible with Rust's `env!()` macro for automatically setting the version of your application to the version in your Cargo.toml. See [09_auto_version example](examples/09_auto_version.rs) for how to do this (Thanks to [jhelwig](https://github.com/jhelwig) for pointing this out) +* **Typed Values**: You can use several convenience macros provided by `clap` to get typed values (i.e. `i32`, `u8`, etc.) from positional or option arguments so long as the type you request implements `std::str::FromStr` See the [12_typed_values example](examples/12_typed_values.rs). You can also use `clap`s `arg_enum!` macro to create an enum with variants that automatically implement `std::str::FromStr`. See [13a_enum_values_automatic example](examples/13a_enum_values_automatic.rs) for details +* **Suggestions**: Suggests corrections when the user enters a typo. For example, if you defined a `--myoption` argument, and the user mistakenly typed `--moyption` (notice `y` and `o` transposed), they would receive a `Did you mean '--myoption'?` error and exit gracefully. This also works for subcommands and flags. (Thanks to [Byron](https://github.com/Byron) for the implementation) (This feature can optionally be disabled, see 'Optional Dependencies / Features') +* **Colorized Errors (Non Windows OS only)**: Error message are printed in in colored text (this feature can optionally be disabled, see 'Optional Dependencies / Features'). +* **Global Arguments**: Arguments can optionally be defined once, and be available to all child subcommands. +* **Custom Validations**: You can define a function to use as a validator of argument values. Imagine defining a function to validate IP addresses, or fail parsing upon error. This means your application logic can be solely focused on *using* values. +* **POSIX Compatible Conflicts/Overrides** - In POSIX args can be conflicting, but not fail parsing because whichever arg comes *last* "wins" so to speak. This allows things such as aliases (i.e. `alias ls='ls -l'` but then using `ls -C` in your terminal which ends up passing `ls -l -C` as the final arguments. Since `-l` and `-C` aren't compatible, this effectively runs `ls -C` in `clap` if you choose...`clap` also supports hard conflicts that fail parsing). (Thanks to [Vinatorul](https://github.com/Vinatorul)!) +* Supports the Unix `--` meaning, only positional arguments follow + +## Quick Example + +The following examples show a quick example of some of the very basic functionality of `clap`. For more advanced usage, such as requirements, conflicts, groups, multiple values and occurrences see the [documentation](https://docs.rs/clap/), [examples/](examples) directory of this repository or the [video tutorials](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U). + + **NOTE:** All of these examples are functionally the same, but show different styles in which to use `clap` + +The first example shows a method that allows more advanced configuration options (not shown in this small example), or even dynamically generating arguments when desired. The downside is it's more verbose. + +```rust +// (Full example with detailed comments in examples/01b_quick_example.rs) +// +// This example demonstrates clap's full 'builder pattern' style of creating arguments which is +// more verbose, but allows easier editing, and at times more advanced options, or the possibility +// to generate arguments dynamically. +extern crate clap; +use clap::{Arg, App, SubCommand}; + +fn main() { + let matches = App::new("My Super Program") + .version("1.0") + .author("Kevin K. ") + .about("Does awesome things") + .arg(Arg::with_name("config") + .short("c") + .long("config") + .value_name("FILE") + .help("Sets a custom config file") + .takes_value(true)) + .arg(Arg::with_name("INPUT") + .help("Sets the input file to use") + .required(true) + .index(1)) + .arg(Arg::with_name("v") + .short("v") + .multiple(true) + .help("Sets the level of verbosity")) + .subcommand(SubCommand::with_name("test") + .about("controls testing features") + .version("1.3") + .author("Someone E. ") + .arg(Arg::with_name("debug") + .short("d") + .help("print debug information verbosely"))) + .get_matches(); + + // Gets a value for config if supplied by user, or defaults to "default.conf" + let config = matches.value_of("config").unwrap_or("default.conf"); + println!("Value for config: {}", config); + + // Calling .unwrap() is safe here because "INPUT" is required (if "INPUT" wasn't + // required we could have used an 'if let' to conditionally get the value) + println!("Using input file: {}", matches.value_of("INPUT").unwrap()); + + // Vary the output based on how many times the user used the "verbose" flag + // (i.e. 'myprog -v -v -v' or 'myprog -vvv' vs 'myprog -v' + match matches.occurrences_of("v") { + 0 => println!("No verbose info"), + 1 => println!("Some verbose info"), + 2 => println!("Tons of verbose info"), + 3 | _ => println!("Don't be crazy"), + } + + // You can handle information about subcommands by requesting their matches by name + // (as below), requesting just the name used, or both at the same time + if let Some(matches) = matches.subcommand_matches("test") { + if matches.is_present("debug") { + println!("Printing debug info..."); + } else { + println!("Printing normally..."); + } + } + + // more program logic goes here... +} +``` + +The next example shows a far less verbose method, but sacrifices some of the advanced configuration options (not shown in this small example). This method also takes a *very* minor runtime penalty. + +```rust +// (Full example with detailed comments in examples/01a_quick_example.rs) +// +// This example demonstrates clap's "usage strings" method of creating arguments +// which is less verbose +extern crate clap; +use clap::{Arg, App, SubCommand}; + +fn main() { + let matches = App::new("myapp") + .version("1.0") + .author("Kevin K. ") + .about("Does awesome things") + .args_from_usage( + "-c, --config=[FILE] 'Sets a custom config file' + 'Sets the input file to use' + -v... 'Sets the level of verbosity'") + .subcommand(SubCommand::with_name("test") + .about("controls testing features") + .version("1.3") + .author("Someone E. ") + .arg_from_usage("-d, --debug 'Print debug information'")) + .get_matches(); + + // Same as previous example... +} +``` + +This third method shows how you can use a YAML file to build your CLI and keep your Rust source tidy +or support multiple localized translations by having different YAML files for each localization. + +First, create the `cli.yml` file to hold your CLI options, but it could be called anything we like: + +```yaml +name: myapp +version: "1.0" +author: Kevin K. +about: Does awesome things +args: + - config: + short: c + long: config + value_name: FILE + help: Sets a custom config file + takes_value: true + - INPUT: + help: Sets the input file to use + required: true + index: 1 + - verbose: + short: v + multiple: true + help: Sets the level of verbosity +subcommands: + - test: + about: controls testing features + version: "1.3" + author: Someone E. + args: + - debug: + short: d + help: print debug information +``` + +Since this feature requires additional dependencies that not everyone may want, it is *not* compiled in by default and we need to enable a feature flag in Cargo.toml: + +Simply change your `clap = "2.27"` to `clap = {version = "2.27", features = ["yaml"]}`. + +At last we create our `main.rs` file just like we would have with the previous two examples: + +```rust +// (Full example with detailed comments in examples/17_yaml.rs) +// +// This example demonstrates clap's building from YAML style of creating arguments which is far +// more clean, but takes a very small performance hit compared to the other two methods. +#[macro_use] +extern crate clap; +use clap::App; + +fn main() { + // The YAML file is found relative to the current file, similar to how modules are found + let yaml = load_yaml!("cli.yml"); + let matches = App::from_yaml(yaml).get_matches(); + + // Same as previous examples... +} +``` + +Finally there is a macro version, which is like a hybrid approach offering the speed of the builder pattern (the first example), but without all the verbosity. + +```rust +#[macro_use] +extern crate clap; + +fn main() { + let matches = clap_app!(myapp => + (version: "1.0") + (author: "Kevin K. ") + (about: "Does awesome things") + (@arg CONFIG: -c --config +takes_value "Sets a custom config file") + (@arg INPUT: +required "Sets the input file to use") + (@arg debug: -d ... "Sets the level of debugging information") + (@subcommand test => + (about: "controls testing features") + (version: "1.3") + (author: "Someone E. ") + (@arg verbose: -v --verbose "Print test information verbosely") + ) + ).get_matches(); + + // Same as before... +} +``` + +If you were to compile any of the above programs and run them with the flag `--help` or `-h` (or `help` subcommand, since we defined `test` as a subcommand) the following would be output + +```sh +$ myprog --help +My Super Program 1.0 +Kevin K. +Does awesome things + +USAGE: + MyApp [FLAGS] [OPTIONS] [SUBCOMMAND] + +FLAGS: + -h, --help Prints this message + -v Sets the level of verbosity + -V, --version Prints version information + +OPTIONS: + -c, --config Sets a custom config file + +ARGS: + INPUT The input file to use + +SUBCOMMANDS: + help Prints this message + test Controls testing features +``` + +**NOTE:** You could also run `myapp test --help` to see similar output and options for the `test` subcommand. + +## Try it! + +### Pre-Built Test + +To try out the pre-built example, use the following steps: + +* Clone the repository `$ git clone https://github.com/kbknapp/clap-rs && cd clap-rs/tests` +* Compile the example `$ cargo build --release` +* Run the help info `$ ./target/release/claptests --help` +* Play with the arguments! + +### BYOB (Build Your Own Binary) + +To test out `clap`'s default auto-generated help/version follow these steps: +* Create a new cargo project `$ cargo new fake --bin && cd fake` +* Add `clap` to your `Cargo.toml` +* +```toml +[dependencies] +clap = "2" +``` + +* Add the following to your `src/main.rs` + +```rust +extern crate clap; +use clap::App; + +fn main() { + App::new("fake").version("v1.0-beta").get_matches(); +} +``` + +* Build your program `$ cargo build --release` +* Run with help or version `$ ./target/release/fake --help` or `$ ./target/release/fake --version` + +## Usage + +For full usage, add `clap` as a dependency in your `Cargo.toml` () to use from crates.io: + +```toml +[dependencies] +clap = "~2.27" +``` + +(**note**: If you are concerned with supporting a minimum version of Rust that is *older* than the current stable Rust minus 2 stable releases, it's recommended to use the `~major.minor.patch` style versions in your `Cargo.toml` which will only update the patch version automatically. For more information see the [Compatibility Policy](#compatibility-policy)) + +Then add `extern crate clap;` to your crate root. + +Define a list of valid arguments for your program (see the [documentation](https://docs.rs/clap/) or [examples/](examples) directory of this repo) + +Then run `cargo build` or `cargo update && cargo build` for your project. + +### Optional Dependencies / Features + +#### Features enabled by default + +* **"suggestions"**: Turns on the `Did you mean '--myoption'?` feature for when users make typos. (builds dependency `strsim`) +* **"color"**: Turns on colored error messages. This feature only works on non-Windows OSs. (builds dependency `ansi-term`) +* **"wrap_help"**: Wraps the help at the actual terminal width when available, instead of 120 characters. (builds dependency `term_size`) +* **"vec_map"**: Use [`VecMap`](https://crates.io/crates/vec_map) internally instead of a [`BTreeMap`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html). This feature provides a _slight_ performance improvement. (builds dependency `vec_map`) + +To disable these, add this to your `Cargo.toml`: + +```toml +[dependencies.clap] +version = "2.27" +default-features = false +``` + +You can also selectively enable only the features you'd like to include, by adding: + +```toml +[dependencies.clap] +version = "2.27" +default-features = false + +# Cherry-pick the features you'd like to use +features = [ "suggestions", "color" ] +``` + +#### Opt-in features + +* **"yaml"**: Enables building CLIs from YAML documents. (builds dependency `yaml-rust`) +* **"unstable"**: Enables unstable `clap` features that may change from release to release + +### Dependencies Tree + +The following graphic depicts `clap`s dependency graph (generated using [cargo-graph](https://github.com/kbknapp/cargo-graph)). + + * **Dashed** Line: Optional dependency + * **Red** Color: **NOT** included by default (must use cargo `features` to enable) + * **Blue** Color: Dev dependency, only used while developing. + +![clap dependencies](clap_dep_graph.png) + +### More Information + +You can find complete documentation on the [docs.rs](https://docs.rs/clap/) for this project. + +You can also find usage examples in the [examples/](examples) directory of this repo. + +#### Video Tutorials + +There's also the video tutorial series [Argument Parsing with Rust v2](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U). + +These videos slowly trickle out as I finish them and currently a work in progress. + +## How to Contribute + +Contributions are always welcome! And there is a multitude of ways in which you can help depending on what you like to do, or are good at. Anything from documentation, code cleanup, issue completion, new features, you name it, even filing issues is contributing and greatly appreciated! + +Another really great way to help is if you find an interesting, or helpful way in which to use `clap`. You can either add it to the [examples/](examples) directory, or file an issue and tell me. I'm all about giving credit where credit is due :) + +Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) before you start contributing. + + +### Testing Code + +To test with all features both enabled and disabled, you can run these commands: + +```sh +$ cargo test --no-default-features +$ cargo test --features "yaml unstable" +``` + +Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the prebuilt recipes. *Not* using `just` is perfectly fine as well, it simply bundles commands automatically. + +For example, to test the code, as above simply run: + +```sh +$ just run-tests +``` + +From here on, I will list the appropriate `cargo` command as well as the `just` command. + +Sometimes it's helpful to only run a subset of the tests, which can be done via: + +```sh +$ cargo test --test + +# Or + +$ just run-test +``` + +### Linting Code + +During the CI process `clap` runs against many different lints using [`clippy`](https://github.com/Manishearth/rust-clippy). In order to check if these lints pass on your own computer prior to submitting a PR you'll need a nightly compiler. + +In order to check the code for lints run either: + +```sh +$ rustup override add nightly +$ cargo build --features lints +$ rustup override remove + +# Or + +$ just lint +``` + +### Debugging Code + +Another helpful technique is to see the `clap` debug output while developing features. In order to see the debug output while running the full test suite or individual tests, run: + +```sh +$ cargo test --features debug + +# Or for individual tests +$ cargo test --test --features debug + +# The corresponding just command for individual debugging tests is: +$ just debug +``` + +### Goals + +There are a few goals of `clap` that I'd like to maintain throughout contributions. If your proposed changes break, or go against any of these goals we'll discuss the changes further before merging (but will *not* be ignored, all contributes are welcome!). These are by no means hard-and-fast rules, as I'm no expert and break them myself from time to time (even if by mistake or ignorance :P). + +* Remain backwards compatible when possible + - If backwards compatibility *must* be broken, use deprecation warnings if at all possible before removing legacy code + - This does not apply for security concerns +* Parse arguments quickly + - Parsing of arguments shouldn't slow down usage of the main program + - This is also true of generating help and usage information (although *slightly* less stringent, as the program is about to exit) +* Try to be cognizant of memory usage + - Once parsing is complete, the memory footprint of `clap` should be low since the main program is the star of the show +* `panic!` on *developer* error, exit gracefully on *end-user* error + +### Compatibility Policy + +Because `clap` takes SemVer and compatibility seriously, this is the official policy regarding breaking changes and minimum required versions of Rust. + +`clap` will pin the minimum required version of Rust to the CI builds. Bumping the minimum version of Rust is considered a minor breaking change, meaning *at a minimum* the minor version of `clap` will be bumped. + +In order to keep from being surprised of breaking changes, it is **highly** recommended to use the `~major.minor.patch` style in your `Cargo.toml` only if you wish to target a version of Rust that is *older* than current stable minus two releases: + +```toml +[dependencies] +clap = "~2.27" +``` + +This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore cannot break due to new features, or bumped minimum versions of Rust. + +#### Warning about '~' Dependencies + +Using `~` can cause issues in certain circumstances. + +From @alexcrichton: + +Right now Cargo's version resolution is pretty naive, it's just a brute-force search of the solution space, returning the first resolvable graph. This also means that it currently won't terminate until it proves there is not possible resolvable graph. This leads to situations where workspaces with multiple binaries, for example, have two different dependencies such as: + +```toml,no_sync + +# In one Cargo.toml +[dependencies] +clap = "~2.27.0" + +# In another Cargo.toml +[dependencies] +clap = "2.27" + +``` + +This is inherently an unresolvable crate graph in Cargo right now. Cargo requires there's only one major version of a crate, and being in the same workspace these two crates must share a version. This is impossible in this location, though, as these version constraints cannot be met. + +#### Minimum Version of Rust + +`clap` will officially support current stable Rust, minus two releases, but may work with prior releases as well. For example, current stable Rust at the time of this writing is 1.21.0, meaning `clap` is guaranteed to compile with 1.19.0 and beyond. + +At the 1.22.0 stable release, `clap` will be guaranteed to compile with 1.20.0 and beyond, etc. + +Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be clearly annotated in the `CHANGELOG.md` + +#### Breaking Changes + +`clap` takes a similar policy to Rust and will bump the major version number upon breaking changes with only the following exceptions: + + * The breaking change is to fix a security concern + * The breaking change is to be fixing a bug (i.e. relying on a bug as a feature) + * The breaking change is a feature isn't used in the wild, or all users of said feature have given approval *prior* to the change + +## License + +`clap` is licensed under the MIT license. Please read the [LICENSE-MIT](LICENSE-MIT) file in this repository for more information. + +## Recent Breaking Changes + +`clap` follows semantic versioning, so breaking changes should only happen upon major version bumps. The only exception to this rule is breaking changes that happen due to implementation that was deemed to be a bug, security concerns, or it can be reasonably proved to affect no code. For the full details, see [CHANGELOG.md](./CHANGELOG.md). + +As of 2.0.0 (From 1.x) + +* **Fewer lifetimes! Yay!** + * `App<'a, 'b, 'c, 'd, 'e, 'f>` => `App<'a, 'b>` + * `Arg<'a, 'b, 'c, 'd, 'e, 'f>` => `Arg<'a, 'b>` + * `ArgMatches<'a, 'b>` => `ArgMatches<'a>` +* **Simply Renamed** + * `App::arg_group` => `App::group` + * `App::arg_groups` => `App::groups` + * `ArgGroup::add` => `ArgGroup::arg` + * `ArgGroup::add_all` => `ArgGroup::args` + * `ClapError` => `Error` + * struct field `ClapError::error_type` => `Error::kind` + * `ClapResult` => `Result` + * `ClapErrorType` => `ErrorKind` +* **Removed Deprecated Functions and Methods** + * `App::subcommands_negate_reqs` + * `App::subcommand_required` + * `App::arg_required_else_help` + * `App::global_version(bool)` + * `App::versionless_subcommands` + * `App::unified_help_messages` + * `App::wait_on_error` + * `App::subcommand_required_else_help` + * `SubCommand::new` + * `App::error_on_no_subcommand` + * `Arg::new` + * `Arg::mutually_excludes` + * `Arg::mutually_excludes_all` + * `Arg::mutually_overrides_with` + * `simple_enum!` +* **Renamed Error Variants** + * `InvalidUnicode` => `InvalidUtf8` + * `InvalidArgument` => `UnknownArgument` +* **Usage Parser** + * Value names can now be specified inline, i.e. `-o, --option 'some option which takes two files'` + * **There is now a priority of order to determine the name** - This is perhaps the biggest breaking change. See the documentation for full details. Prior to this change, the value name took precedence. **Ensure your args are using the proper names (i.e. typically the long or short and NOT the value name) throughout the code** +* `ArgMatches::values_of` returns an `Values` now which implements `Iterator` (should not break any code) +* `crate_version!` returns `&'static str` instead of `String` + +### Deprecations + +Old method names will be left around for several minor version bumps, or one major version bump. + +As of 2.27.0: + +* **AppSettings::PropagateGlobalValuesDown:** this setting deprecated and is no longer required to propagate values down or up diff --git a/vendor/registry-40351f815f426200/clap/SPONSORS.md b/vendor/registry-40351f815f426200/clap/SPONSORS.md new file mode 100644 index 000000000..397e005a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/SPONSORS.md @@ -0,0 +1,7 @@ +The following is a list of [sponsors](https://www.clap.rs/sponsor/) for the clap-rs project: + +[Noelia Seva-Gonzalez](http://vsgrealestategroup.com.realproserver.com/About) +Noelia Seva-Gonzalez + +[Rob Tsuk](https://github.com/rtsuk) +Rob Tsuk \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/clap/clap-test.rs b/vendor/registry-40351f815f426200/clap/clap-test.rs new file mode 100644 index 000000000..2f91b9e81 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/clap-test.rs @@ -0,0 +1,76 @@ +#[allow(unused_imports, dead_code)] +mod test { + use std::str; + use std::io::{Cursor, Write}; + + use regex::Regex; + + use clap::{App, Arg, SubCommand, ArgGroup}; + + fn compare(l: S, r: S2) -> bool + where S: AsRef, + S2: AsRef + { + let re = Regex::new("\x1b[^m]*m").unwrap(); + // Strip out any mismatching \r character on windows that might sneak in on either side + let ls = l.as_ref().trim().replace("\r", ""); + let rs = r.as_ref().trim().replace("\r", ""); + let left = re.replace_all(&*ls, ""); + let right = re.replace_all(&*rs, ""); + let b = left == right; + if !b { + println!(""); + println!("--> left"); + println!("{}", left); + println!("--> right"); + println!("{}", right); + println!("--") + } + b + } + + pub fn compare_output(l: App, args: &str, right: &str, stderr: bool) -> bool { + let mut buf = Cursor::new(Vec::with_capacity(50)); + let res = l.get_matches_from_safe(args.split(' ').collect::>()); + let err = res.unwrap_err(); + err.write_to(&mut buf).unwrap(); + let content = buf.into_inner(); + let left = String::from_utf8(content).unwrap(); + assert_eq!(stderr, err.use_stderr()); + compare(left, right) + } + + // Legacy tests from the pyhton script days + + pub fn complex_app() -> App<'static, 'static> { + let args = "-o --option=[opt]... 'tests options' + [positional] 'tests positionals'"; + let opt3_vals = ["fast", "slow"]; + let pos3_vals = ["vi", "emacs"]; + App::new("clap-test") + .version("v1.4.8") + .about("tests clap library") + .author("Kevin K. ") + .args_from_usage(args) + .arg(Arg::from_usage("-f --flag... 'tests flags'") + .global(true)) + .args(&[ + Arg::from_usage("[flag2] -F 'tests flags with exclusions'").conflicts_with("flag").requires("long-option-2"), + Arg::from_usage("--long-option-2 [option2] 'tests long options with exclusions'").conflicts_with("option").requires("positional2"), + Arg::from_usage("[positional2] 'tests positionals with exclusions'"), + Arg::from_usage("-O --Option [option3] 'specific vals'").possible_values(&opt3_vals), + Arg::from_usage("[positional3]... 'tests specific values'").possible_values(&pos3_vals), + Arg::from_usage("--multvals [one] [two] 'Tests mutliple values, not mult occs'"), + Arg::from_usage("--multvalsmo... [one] [two] 'Tests mutliple values, and mult occs'"), + Arg::from_usage("--minvals2 [minvals]... 'Tests 2 min vals'").min_values(2), + Arg::from_usage("--maxvals3 [maxvals]... 'Tests 3 max vals'").max_values(3) + ]) + .subcommand(SubCommand::with_name("subcmd") + .about("tests subcommands") + .version("0.1") + .author("Kevin K. ") + .arg_from_usage("-o --option [scoption]... 'tests options'") + .arg_from_usage("-s --subcmdarg [subcmdarg] 'tests other args'") + .arg_from_usage("[scpositional] 'tests positionals'")) + } +} diff --git a/vendor/registry-40351f815f426200/clap/index.html b/vendor/registry-40351f815f426200/clap/index.html new file mode 100644 index 000000000..600dff932 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/index.html @@ -0,0 +1 @@ + diff --git a/vendor/registry-40351f815f426200/clap/justfile b/vendor/registry-40351f815f426200/clap/justfile new file mode 100644 index 000000000..e9385c6bf --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/justfile @@ -0,0 +1,39 @@ +@update-contributors: + echo 'Removing old CONTRIBUTORS.md' + mv CONTRIBUTORS.md CONTRIBUTORS.md.bak + echo 'Downloading a list of new contributors' + echo "the following is a list of contributors:" > CONTRIBUTORS.md + echo "" >> CONTRIBUTORS.md + echo "" >> CONTRIBUTORS.md + githubcontrib --owner kbknapp --repo clap-rs --sha master --cols 6 --format md --showlogin true --sortBy contributions --sortOrder desc >> CONTRIBUTORS.md + echo "" >> CONTRIBUTORS.md + echo "" >> CONTRIBUTORS.md + echo "This list was generated by [mgechev/github-contributors-list](https://github.com/mgechev/github-contributors-list)" >> CONTRIBUTORS.md + rm CONTRIBUTORS.md.bak + +run-test TEST: + cargo test --test {{TEST}} + +debug TEST: + cargo test --test {{TEST}} --features debug + +run-tests: + cargo test --features "yaml unstable" + +@bench: nightly + cargo bench && just remove-nightly + +nightly: + rustup override add nightly + +remove-nightly: + rustup override remove + +@lint: nightly + cargo build --features lints && just remove-nightly + +clean: + cargo clean + find . -type f -name "*.orig" -exec rm {} \; + find . -type f -name "*.bk" -exec rm {} \; + find . -type f -name ".*~" -exec rm {} \; diff --git a/vendor/registry-40351f815f426200/clap/rustfmt.toml b/vendor/registry-40351f815f426200/clap/rustfmt.toml new file mode 100644 index 000000000..0136d86e3 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/rustfmt.toml @@ -0,0 +1,4 @@ +format_strings = false +chain_overflow_last = false +same_line_if_else = true +fn_single_line = true diff --git a/vendor/registry-40351f815f426200/clap/src/app/help.rs b/vendor/registry-40351f815f426200/clap/src/app/help.rs new file mode 100644 index 000000000..2bea1e455 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/help.rs @@ -0,0 +1,1005 @@ +// Std +use std::borrow::Cow; +use std::cmp; +use std::collections::BTreeMap; +use std::fmt::Display; +use std::io::{self, Cursor, Read, Write}; +use std::usize; + +// Internal +use app::{App, AppSettings}; +use app::parser::Parser; +use args::{AnyArg, ArgSettings, DispOrder}; +use errors::{Error, Result as ClapResult}; +use fmt::{Colorizer, ColorizerOption, Format}; +use app::usage; +use map::VecMap; +use INTERNAL_ERROR_MSG; + +// Third Party +use unicode_width::UnicodeWidthStr; +#[cfg(feature = "wrap_help")] +use term_size; +use textwrap; + +#[cfg(not(feature = "wrap_help"))] +mod term_size { + pub fn dimensions() -> Option<(usize, usize)> { None } +} + +fn str_width(s: &str) -> usize { UnicodeWidthStr::width(s) } + +const TAB: &'static str = " "; + +// These are just convenient traits to make the code easier to read. +trait ArgWithDisplay<'b, 'c>: AnyArg<'b, 'c> + Display {} +impl<'b, 'c, T> ArgWithDisplay<'b, 'c> for T +where + T: AnyArg<'b, 'c> + Display, +{ +} + +trait ArgWithOrder<'b, 'c>: ArgWithDisplay<'b, 'c> + DispOrder { + fn as_base(&self) -> &ArgWithDisplay<'b, 'c>; +} +impl<'b, 'c, T> ArgWithOrder<'b, 'c> for T +where + T: ArgWithDisplay<'b, 'c> + DispOrder, +{ + fn as_base(&self) -> &ArgWithDisplay<'b, 'c> { self } +} + +fn as_arg_trait<'a, 'b, T: ArgWithOrder<'a, 'b>>(x: &T) -> &ArgWithOrder<'a, 'b> { x } + +impl<'b, 'c> DispOrder for App<'b, 'c> { + fn disp_ord(&self) -> usize { 999 } +} + +macro_rules! color { + ($_self:ident, $s:expr, $c:ident) => { + if $_self.color { + write!($_self.writer, "{}", $_self.cizer.$c($s)) + } else { + write!($_self.writer, "{}", $s) + } + }; + ($_self:ident, $fmt_s:expr, $v:expr, $c:ident) => { + if $_self.color { + write!($_self.writer, "{}", $_self.cizer.$c(format!($fmt_s, $v))) + } else { + write!($_self.writer, $fmt_s, $v) + } + }; +} + +/// `clap` Help Writer. +/// +/// Wraps a writer stream providing different methods to generate help for `clap` objects. +pub struct Help<'a> { + writer: &'a mut Write, + next_line_help: bool, + hide_pv: bool, + term_w: usize, + color: bool, + cizer: Colorizer, + longest: usize, + force_next_line: bool, + use_long: bool, +} + +// Public Functions +impl<'a> Help<'a> { + /// Create a new `Help` instance. + #[cfg_attr(feature = "cargo-clippy", allow(too_many_arguments))] + pub fn new( + w: &'a mut Write, + next_line_help: bool, + hide_pv: bool, + color: bool, + cizer: Colorizer, + term_w: Option, + max_w: Option, + use_long: bool, + ) -> Self { + debugln!("Help::new;"); + Help { + writer: w, + next_line_help: next_line_help, + hide_pv: hide_pv, + term_w: match term_w { + Some(width) => if width == 0 { + usize::MAX + } else { + width + }, + None => cmp::min( + term_size::dimensions().map_or(120, |(w, _)| w), + match max_w { + None | Some(0) => usize::MAX, + Some(mw) => mw, + }, + ), + }, + color: color, + cizer: cizer, + longest: 0, + force_next_line: false, + use_long: use_long, + } + } + + /// Reads help settings from an App + /// and write its help to the wrapped stream. + pub fn write_app_help(w: &'a mut Write, app: &App, use_long: bool) -> ClapResult<()> { + debugln!("Help::write_app_help;"); + Self::write_parser_help(w, &app.p, use_long) + } + + /// Reads help settings from a Parser + /// and write its help to the wrapped stream. + pub fn write_parser_help(w: &'a mut Write, parser: &Parser, use_long: bool) -> ClapResult<()> { + debugln!("Help::write_parser_help;"); + Self::_write_parser_help(w, parser, false, use_long) + } + + /// Reads help settings from a Parser + /// and write its help to the wrapped stream which will be stderr. This method prevents + /// formatting when required. + pub fn write_parser_help_to_stderr(w: &'a mut Write, parser: &Parser) -> ClapResult<()> { + debugln!("Help::write_parser_help;"); + Self::_write_parser_help(w, parser, true, false) + } + + #[doc(hidden)] + pub fn _write_parser_help( + w: &'a mut Write, + parser: &Parser, + stderr: bool, + use_long: bool, + ) -> ClapResult<()> { + debugln!("Help::write_parser_help;"); + let nlh = parser.is_set(AppSettings::NextLineHelp); + let hide_v = parser.is_set(AppSettings::HidePossibleValuesInHelp); + let color = parser.is_set(AppSettings::ColoredHelp); + let cizer = Colorizer::new(ColorizerOption { + use_stderr: stderr, + when: parser.color(), + }); + Self::new( + w, + nlh, + hide_v, + color, + cizer, + parser.meta.term_w, + parser.meta.max_w, + use_long, + ).write_help(parser) + } + + /// Writes the parser help to the wrapped stream. + pub fn write_help(&mut self, parser: &Parser) -> ClapResult<()> { + debugln!("Help::write_help;"); + if let Some(h) = parser.meta.help_str { + write!(self.writer, "{}", h).map_err(Error::from)?; + } else if let Some(tmpl) = parser.meta.template { + self.write_templated_help(parser, tmpl)?; + } else { + self.write_default_help(parser)?; + } + Ok(()) + } +} + +// Methods to write AnyArg help. +impl<'a> Help<'a> { + /// Writes help for each argument in the order they were declared to the wrapped stream. + fn write_args_unsorted<'b: 'd, 'c: 'd, 'd, I: 'd>(&mut self, args: I) -> io::Result<()> + where + I: Iterator>, + { + debugln!("Help::write_args_unsorted;"); + // The shortest an arg can legally be is 2 (i.e. '-x') + self.longest = 2; + let mut arg_v = Vec::with_capacity(10); + for arg in args.filter(|arg| { + !(arg.is_set(ArgSettings::Hidden)) || arg.is_set(ArgSettings::NextLineHelp) + }) { + if arg.longest_filter() { + self.longest = cmp::max(self.longest, str_width(arg.to_string().as_str())); + } + arg_v.push(arg) + } + let mut first = true; + for arg in arg_v { + if first { + first = false; + } else { + self.writer.write_all(b"\n")?; + } + self.write_arg(arg.as_base())?; + } + Ok(()) + } + + /// Sorts arguments by length and display order and write their help to the wrapped stream. + fn write_args<'b: 'd, 'c: 'd, 'd, I: 'd>(&mut self, args: I) -> io::Result<()> + where + I: Iterator>, + { + debugln!("Help::write_args;"); + // The shortest an arg can legally be is 2 (i.e. '-x') + self.longest = 2; + let mut ord_m = VecMap::new(); + // Determine the longest + for arg in args.filter(|arg| { + // If it's NextLineHelp, but we don't care to compute how long because it may be + // NextLineHelp on purpose *because* it's so long and would throw off all other + // args alignment + !arg.is_set(ArgSettings::Hidden) || arg.is_set(ArgSettings::NextLineHelp) + }) { + if arg.longest_filter() { + debugln!("Help::write_args: Current Longest...{}", self.longest); + self.longest = cmp::max(self.longest, str_width(arg.to_string().as_str())); + debugln!("Help::write_args: New Longest...{}", self.longest); + } + let btm = ord_m.entry(arg.disp_ord()).or_insert(BTreeMap::new()); + btm.insert(arg.name(), arg); + } + let mut first = true; + for btm in ord_m.values() { + for arg in btm.values() { + if first { + first = false; + } else { + self.writer.write_all(b"\n")?; + } + self.write_arg(arg.as_base())?; + } + } + Ok(()) + } + + /// Writes help for an argument to the wrapped stream. + fn write_arg<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>) -> io::Result<()> { + debugln!("Help::write_arg;"); + self.short(arg)?; + self.long(arg)?; + let spec_vals = self.val(arg)?; + self.help(arg, &*spec_vals)?; + Ok(()) + } + + /// Writes argument's short command to the wrapped stream. + fn short<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>) -> io::Result<()> { + debugln!("Help::short;"); + write!(self.writer, "{}", TAB)?; + if let Some(s) = arg.short() { + color!(self, "-{}", s, good) + } else if arg.has_switch() { + write!(self.writer, "{}", TAB) + } else { + Ok(()) + } + } + + /// Writes argument's long command to the wrapped stream. + fn long<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>) -> io::Result<()> { + debugln!("Help::long;"); + if !arg.has_switch() { + return Ok(()); + } + if arg.takes_value() { + if let Some(l) = arg.long() { + if arg.short().is_some() { + write!(self.writer, ", ")?; + } + color!(self, "--{}", l, good)? + } + + let sep = if arg.is_set(ArgSettings::RequireEquals) { + "=" + } else { + " " + }; + write!(self.writer, "{}", sep)?; + } else if let Some(l) = arg.long() { + if arg.short().is_some() { + write!(self.writer, ", ")?; + } + color!(self, "--{}", l, good)?; + } + Ok(()) + } + + /// Writes argument's possible values to the wrapped stream. + fn val<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>) -> Result { + debugln!("Help::val: arg={}", arg); + if arg.takes_value() { + let delim = if arg.is_set(ArgSettings::RequireDelimiter) { + arg.val_delim().expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }; + if let Some(vec) = arg.val_names() { + let mut it = vec.iter().peekable(); + while let Some((_, val)) = it.next() { + color!(self, "<{}>", val, good)?; + if it.peek().is_some() { + write!(self.writer, "{}", delim)?; + } + } + let num = vec.len(); + if arg.is_set(ArgSettings::Multiple) && num == 1 { + color!(self, "...", good)?; + } + } else if let Some(num) = arg.num_vals() { + let mut it = (0..num).peekable(); + while let Some(_) = it.next() { + color!(self, "<{}>", arg.name(), good)?; + if it.peek().is_some() { + write!(self.writer, "{}", delim)?; + } + } + if arg.is_set(ArgSettings::Multiple) && num == 1 { + color!(self, "...", good)?; + } + } else if arg.has_switch() { + color!(self, "<{}>", arg.name(), good)?; + if arg.is_set(ArgSettings::Multiple) { + color!(self, "...", good)?; + } + } else { + color!(self, "{}", arg, good)?; + } + } + + let spec_vals = self.spec_vals(arg); + let h = arg.help().unwrap_or(""); + let h_w = str_width(h) + str_width(&*spec_vals); + let nlh = self.next_line_help || arg.is_set(ArgSettings::NextLineHelp); + let taken = self.longest + 12; + self.force_next_line = !nlh && self.term_w >= taken + && (taken as f32 / self.term_w as f32) > 0.40 + && h_w > (self.term_w - taken); + + debug!("Help::val: Has switch..."); + if arg.has_switch() { + sdebugln!("Yes"); + debugln!("Help::val: force_next_line...{:?}", self.force_next_line); + debugln!("Help::val: nlh...{:?}", nlh); + debugln!("Help::val: taken...{}", taken); + debugln!( + "Help::val: help_width > (width - taken)...{} > ({} - {})", + h_w, + self.term_w, + taken + ); + debugln!("Help::val: longest...{}", self.longest); + debug!("Help::val: next_line..."); + if !(nlh || self.force_next_line) { + sdebugln!("No"); + let self_len = str_width(arg.to_string().as_str()); + // subtract ourself + let mut spcs = self.longest - self_len; + // Since we're writing spaces from the tab point we first need to know if we + // had a long and short, or just short + if arg.long().is_some() { + // Only account 4 after the val + spcs += 4; + } else { + // Only account for ', --' + 4 after the val + spcs += 8; + } + + write_nspaces!(self.writer, spcs); + } else { + sdebugln!("Yes"); + } + } else if !(nlh || self.force_next_line) { + sdebugln!("No, and not next_line"); + write_nspaces!( + self.writer, + self.longest + 4 - (str_width(arg.to_string().as_str())) + ); + } else { + sdebugln!("No"); + } + Ok(spec_vals) + } + + fn write_before_after_help(&mut self, h: &str) -> io::Result<()> { + debugln!("Help::write_before_after_help;"); + let mut help = String::from(h); + // determine if our help fits or needs to wrap + debugln!( + "Help::write_before_after_help: Term width...{}", + self.term_w + ); + let too_long = str_width(h) >= self.term_w; + + debug!("Help::write_before_after_help: Too long..."); + if too_long || h.contains("{n}") { + sdebugln!("Yes"); + debugln!("Help::write_before_after_help: help: {}", help); + debugln!( + "Help::write_before_after_help: help width: {}", + str_width(&*help) + ); + // Determine how many newlines we need to insert + debugln!( + "Help::write_before_after_help: Usable space: {}", + self.term_w + ); + help = wrap_help(&help.replace("{n}", "\n"), self.term_w); + } else { + sdebugln!("No"); + } + write!(self.writer, "{}", help)?; + Ok(()) + } + + /// Writes argument's help to the wrapped stream. + fn help<'b, 'c>(&mut self, arg: &ArgWithDisplay<'b, 'c>, spec_vals: &str) -> io::Result<()> { + debugln!("Help::help;"); + let h = if self.use_long { + arg.long_help().unwrap_or_else(|| arg.help().unwrap_or("")) + } else { + arg.help().unwrap_or_else(|| arg.long_help().unwrap_or("")) + }; + let mut help = String::from(h) + spec_vals; + let nlh = self.next_line_help || arg.is_set(ArgSettings::NextLineHelp) || self.use_long; + debugln!("Help::help: Next Line...{:?}", nlh); + + let spcs = if nlh || self.force_next_line { + 12 // "tab" * 3 + } else { + self.longest + 12 + }; + + let too_long = spcs + str_width(h) + str_width(&*spec_vals) >= self.term_w; + + // Is help on next line, if so then indent + if nlh || self.force_next_line { + write!(self.writer, "\n{}{}{}", TAB, TAB, TAB)?; + } + + debug!("Help::help: Too long..."); + if too_long && spcs <= self.term_w || h.contains("{n}") { + sdebugln!("Yes"); + debugln!("Help::help: help...{}", help); + debugln!("Help::help: help width...{}", str_width(&*help)); + // Determine how many newlines we need to insert + let avail_chars = self.term_w - spcs; + debugln!("Help::help: Usable space...{}", avail_chars); + help = wrap_help(&help.replace("{n}", "\n"), avail_chars); + } else { + sdebugln!("No"); + } + if let Some(part) = help.lines().next() { + write!(self.writer, "{}", part)?; + } + for part in help.lines().skip(1) { + write!(self.writer, "\n")?; + if nlh || self.force_next_line { + write!(self.writer, "{}{}{}", TAB, TAB, TAB)?; + } else if arg.has_switch() { + write_nspaces!(self.writer, self.longest + 12); + } else { + write_nspaces!(self.writer, self.longest + 8); + } + write!(self.writer, "{}", part)?; + } + if !help.contains('\n') && (nlh || self.force_next_line) { + write!(self.writer, "\n")?; + } + Ok(()) + } + + fn spec_vals(&self, a: &ArgWithDisplay) -> String { + debugln!("Help::spec_vals: a={}", a); + let mut spec_vals = vec![]; + if let Some(ref env) = a.env() { + debugln!( + "Help::spec_vals: Found environment variable...[{:?}:{:?}]", + env.0, + env.1 + ); + spec_vals.push(format!( + " [env:{}: {}]", + env.0.to_string_lossy(), + env.1.map_or(Cow::Borrowed(""), |val| val.to_string_lossy()) + )); + } + if !a.is_set(ArgSettings::HideDefaultValue) { + if let Some(pv) = a.default_val() { + debugln!("Help::spec_vals: Found default value...[{:?}]", pv); + spec_vals.push(format!( + " [default: {}]", + if self.color { + self.cizer.good(pv.to_string_lossy()) + } else { + Format::None(pv.to_string_lossy()) + } + )); + } + } + if let Some(ref aliases) = a.aliases() { + debugln!("Help::spec_vals: Found aliases...{:?}", aliases); + spec_vals.push(format!( + " [aliases: {}]", + if self.color { + aliases + .iter() + .map(|v| format!("{}", self.cizer.good(v))) + .collect::>() + .join(", ") + } else { + aliases.join(", ") + } + )); + } + if !self.hide_pv && !a.is_set(ArgSettings::HidePossibleValues) { + if let Some(pv) = a.possible_vals() { + debugln!("Help::spec_vals: Found possible vals...{:?}", pv); + spec_vals.push(if self.color { + format!( + " [values: {}]", + pv.iter() + .map(|v| format!("{}", self.cizer.good(v))) + .collect::>() + .join(", ") + ) + } else { + format!(" [values: {}]", pv.join(", ")) + }); + } + } + spec_vals.join(" ") + } +} + + +// Methods to write Parser help. +impl<'a> Help<'a> { + /// Writes help for all arguments (options, flags, args, subcommands) + /// including titles of a Parser Object to the wrapped stream. + #[cfg_attr(feature = "lints", allow(useless_let_if_seq))] + #[cfg_attr(feature = "cargo-clippy", allow(useless_let_if_seq))] + pub fn write_all_args(&mut self, parser: &Parser) -> ClapResult<()> { + debugln!("Help::write_all_args;"); + let flags = parser.has_flags(); + let pos = parser + .positionals() + .filter(|arg| !arg.is_set(ArgSettings::Hidden)) + .count() > 0; + let opts = parser.has_opts(); + let subcmds = parser.has_visible_subcommands(); + + let unified_help = parser.is_set(AppSettings::UnifiedHelpMessage); + + let mut first = true; + + if unified_help && (flags || opts) { + let opts_flags = parser + .flags() + .map(as_arg_trait) + .chain(parser.opts().map(as_arg_trait)); + color!(self, "OPTIONS:\n", warning)?; + self.write_args(opts_flags)?; + first = false; + } else { + if flags { + color!(self, "FLAGS:\n", warning)?; + self.write_args(parser.flags().map(as_arg_trait))?; + first = false; + } + if opts { + if !first { + self.writer.write_all(b"\n\n")?; + } + color!(self, "OPTIONS:\n", warning)?; + self.write_args(parser.opts().map(as_arg_trait))?; + first = false; + } + } + + if pos { + if !first { + self.writer.write_all(b"\n\n")?; + } + color!(self, "ARGS:\n", warning)?; + self.write_args_unsorted(parser.positionals().map(as_arg_trait))?; + first = false; + } + + if subcmds { + if !first { + self.writer.write_all(b"\n\n")?; + } + color!(self, "SUBCOMMANDS:\n", warning)?; + self.write_subcommands(parser)?; + } + + Ok(()) + } + + /// Writes help for subcommands of a Parser Object to the wrapped stream. + fn write_subcommands(&mut self, parser: &Parser) -> io::Result<()> { + debugln!("Help::write_subcommands;"); + // The shortest an arg can legally be is 2 (i.e. '-x') + self.longest = 2; + let mut ord_m = VecMap::new(); + for sc in parser + .subcommands + .iter() + .filter(|s| !s.p.is_set(AppSettings::Hidden)) + { + let btm = ord_m.entry(sc.p.meta.disp_ord).or_insert(BTreeMap::new()); + self.longest = cmp::max(self.longest, str_width(sc.p.meta.name.as_str())); + //self.longest = cmp::max(self.longest, sc.p.meta.name.len()); + btm.insert(sc.p.meta.name.clone(), sc.clone()); + } + + let mut first = true; + for btm in ord_m.values() { + for sc in btm.values() { + if first { + first = false; + } else { + self.writer.write_all(b"\n")?; + } + self.write_arg(sc)?; + } + } + Ok(()) + } + + /// Writes version of a Parser Object to the wrapped stream. + fn write_version(&mut self, parser: &Parser) -> io::Result<()> { + debugln!("Help::write_version;"); + write!(self.writer, "{}", parser.meta.version.unwrap_or(""))?; + Ok(()) + } + + /// Writes binary name of a Parser Object to the wrapped stream. + fn write_bin_name(&mut self, parser: &Parser) -> io::Result<()> { + debugln!("Help::write_bin_name;"); + macro_rules! write_name { + () => {{ + let mut name = parser.meta.name.clone(); + name = name.replace("{n}", "\n"); + color!(self, wrap_help(&name, self.term_w), good)?; + }}; + } + if let Some(bn) = parser.meta.bin_name.as_ref() { + if bn.contains(' ') { + // Incase we're dealing with subcommands i.e. git mv is translated to git-mv + color!(self, bn.replace(" ", "-"), good)? + } else { + write_name!(); + } + } else { + write_name!(); + } + Ok(()) + } + + /// Writes default help for a Parser Object to the wrapped stream. + pub fn write_default_help(&mut self, parser: &Parser) -> ClapResult<()> { + debugln!("Help::write_default_help;"); + if let Some(h) = parser.meta.pre_help { + self.write_before_after_help(h)?; + self.writer.write_all(b"\n\n")?; + } + + macro_rules! write_thing { + ($thing:expr) => {{ + let mut owned_thing = $thing.to_owned(); + owned_thing = owned_thing.replace("{n}", "\n"); + write!(self.writer, "{}\n", + wrap_help(&owned_thing, self.term_w))? + }}; + } + // Print the version + self.write_bin_name(parser)?; + self.writer.write_all(b" ")?; + self.write_version(parser)?; + self.writer.write_all(b"\n")?; + if let Some(author) = parser.meta.author { + write_thing!(author) + } + if self.use_long { + if let Some(about) = parser.meta.long_about { + debugln!("Help::write_default_help: writing long about"); + write_thing!(about) + } else if let Some(about) = parser.meta.about { + debugln!("Help::write_default_help: writing about"); + write_thing!(about) + } + } else if let Some(about) = parser.meta.about { + debugln!("Help::write_default_help: writing about"); + write_thing!(about) + } else if let Some(about) = parser.meta.long_about { + debugln!("Help::write_default_help: writing long about"); + write_thing!(about) + } + + color!(self, "\nUSAGE:", warning)?; + write!( + self.writer, + "\n{}{}\n\n", + TAB, + usage::create_usage_no_title(parser, &[]) + )?; + + let flags = parser.has_flags(); + let pos = parser.has_positionals(); + let opts = parser.has_opts(); + let subcmds = parser.has_subcommands(); + + if flags || opts || pos || subcmds { + self.write_all_args(parser)?; + } + + if let Some(h) = parser.meta.more_help { + if flags || opts || pos || subcmds { + self.writer.write_all(b"\n\n")?; + } + self.write_before_after_help(h)?; + } + + self.writer.flush().map_err(Error::from) + } +} + +/// Possible results for a copying function that stops when a given +/// byte was found. +enum CopyUntilResult { + DelimiterFound(usize), + DelimiterNotFound(usize), + ReaderEmpty, + ReadError(io::Error), + WriteError(io::Error), +} + +/// Copies the contents of a reader into a writer until a delimiter byte is found. +/// On success, the total number of bytes that were +/// copied from reader to writer is returned. +fn copy_until(r: &mut R, w: &mut W, delimiter_byte: u8) -> CopyUntilResult { + debugln!("copy_until;"); + + let mut count = 0; + for wb in r.bytes() { + match wb { + Ok(b) => { + if b == delimiter_byte { + return CopyUntilResult::DelimiterFound(count); + } + match w.write(&[b]) { + Ok(c) => count += c, + Err(e) => return CopyUntilResult::WriteError(e), + } + } + Err(e) => return CopyUntilResult::ReadError(e), + } + } + if count > 0 { + CopyUntilResult::DelimiterNotFound(count) + } else { + CopyUntilResult::ReaderEmpty + } +} + +/// Copies the contents of a reader into a writer until a {tag} is found, +/// copying the tag content to a buffer and returning its size. +/// In addition to errors, there are three possible outputs: +/// - `None`: The reader was consumed. +/// - `Some(Ok(0))`: No tag was captured but the reader still contains data. +/// - `Some(Ok(length>0))`: a tag with `length` was captured to the `tag_buffer`. +fn copy_and_capture( + r: &mut R, + w: &mut W, + tag_buffer: &mut Cursor>, +) -> Option> { + use self::CopyUntilResult::*; + debugln!("copy_and_capture;"); + + // Find the opening byte. + match copy_until(r, w, b'{') { + // The end of the reader was reached without finding the opening tag. + // (either with or without having copied data to the writer) + // Return None indicating that we are done. + ReaderEmpty | DelimiterNotFound(_) => None, + + // Something went wrong. + ReadError(e) | WriteError(e) => Some(Err(e)), + + // The opening byte was found. + // (either with or without having copied data to the writer) + DelimiterFound(_) => { + // Lets reset the buffer first and find out how long it is. + tag_buffer.set_position(0); + let buffer_size = tag_buffer.get_ref().len(); + + // Find the closing byte,limiting the reader to the length of the buffer. + let mut rb = r.take(buffer_size as u64); + match copy_until(&mut rb, tag_buffer, b'}') { + // We were already at the end of the reader. + // Return None indicating that we are done. + ReaderEmpty => None, + + // The closing tag was found. + // Return the tag_length. + DelimiterFound(tag_length) => Some(Ok(tag_length)), + + // The end of the reader was found without finding the closing tag. + // Write the opening byte and captured text to the writer. + // Return 0 indicating that nothing was caputred but the reader still contains data. + DelimiterNotFound(not_tag_length) => match w.write(b"{") { + Err(e) => Some(Err(e)), + _ => match w.write(&tag_buffer.get_ref()[0..not_tag_length]) { + Err(e) => Some(Err(e)), + _ => Some(Ok(0)), + }, + }, + + ReadError(e) | WriteError(e) => Some(Err(e)), + } + } + } +} + + +// Methods to write Parser help using templates. +impl<'a> Help<'a> { + /// Write help to stream for the parser in the format defined by the template. + /// + /// Tags arg given inside curly brackets: + /// Valid tags are: + /// * `{bin}` - Binary name. + /// * `{version}` - Version number. + /// * `{author}` - Author information. + /// * `{usage}` - Automatically generated or given usage string. + /// * `{all-args}` - Help for all arguments (options, flags, positionals arguments, + /// and subcommands) including titles. + /// * `{unified}` - Unified help for options and flags. + /// * `{flags}` - Help for flags. + /// * `{options}` - Help for options. + /// * `{positionals}` - Help for positionals arguments. + /// * `{subcommands}` - Help for subcommands. + /// * `{after-help}` - Info to be displayed after the help message. + /// * `{before-help}` - Info to be displayed before the help message. + /// + /// The template system is, on purpose, very simple. Therefore the tags have to writen + /// in the lowercase and without spacing. + fn write_templated_help(&mut self, parser: &Parser, template: &str) -> ClapResult<()> { + debugln!("Help::write_templated_help;"); + let mut tmplr = Cursor::new(&template); + let mut tag_buf = Cursor::new(vec![0u8; 15]); + + // The strategy is to copy the template from the the reader to wrapped stream + // until a tag is found. Depending on its value, the appropriate content is copied + // to the wrapped stream. + // The copy from template is then resumed, repeating this sequence until reading + // the complete template. + + loop { + let tag_length = match copy_and_capture(&mut tmplr, &mut self.writer, &mut tag_buf) { + None => return Ok(()), + Some(Err(e)) => return Err(Error::from(e)), + Some(Ok(val)) if val > 0 => val, + _ => continue, + }; + + debugln!("Help::write_template_help:iter: tag_buf={};", unsafe { + String::from_utf8_unchecked( + tag_buf.get_ref()[0..tag_length] + .iter() + .map(|&i| i) + .collect::>(), + ) + }); + match &tag_buf.get_ref()[0..tag_length] { + b"?" => { + self.writer.write_all(b"Could not decode tag name")?; + } + b"bin" => { + self.write_bin_name(parser)?; + } + b"version" => { + write!( + self.writer, + "{}", + parser.meta.version.unwrap_or("unknown version") + )?; + } + b"author" => { + write!( + self.writer, + "{}", + parser.meta.author.unwrap_or("unknown author") + )?; + } + b"about" => { + write!( + self.writer, + "{}", + parser.meta.about.unwrap_or("unknown about") + )?; + } + b"long-about" => { + write!( + self.writer, + "{}", + parser.meta.long_about.unwrap_or("unknown about") + )?; + } + b"usage" => { + write!(self.writer, "{}", usage::create_usage_no_title(parser, &[]))?; + } + b"all-args" => { + self.write_all_args(parser)?; + } + b"unified" => { + let opts_flags = parser + .flags() + .map(as_arg_trait) + .chain(parser.opts().map(as_arg_trait)); + self.write_args(opts_flags)?; + } + b"flags" => { + self.write_args(parser.flags().map(as_arg_trait))?; + } + b"options" => { + self.write_args(parser.opts().map(as_arg_trait))?; + } + b"positionals" => { + self.write_args(parser.positionals().map(as_arg_trait))?; + } + b"subcommands" => { + self.write_subcommands(parser)?; + } + b"after-help" => { + write!( + self.writer, + "{}", + parser.meta.more_help.unwrap_or("unknown after-help") + )?; + } + b"before-help" => { + write!( + self.writer, + "{}", + parser.meta.pre_help.unwrap_or("unknown before-help") + )?; + } + // Unknown tag, write it back. + r => { + self.writer.write_all(b"{")?; + self.writer.write_all(r)?; + self.writer.write_all(b"}")?; + } + } + } + } +} + +fn wrap_help(help: &str, avail_chars: usize) -> String { + let wrapper = textwrap::Wrapper::new(avail_chars).break_words(false); + help.lines() + .map(|line| wrapper.fill(line)) + .collect::>() + .join("\n") +} + +#[cfg(test)] +mod test { + use super::wrap_help; + + #[test] + fn wrap_help_last_word() { + let help = String::from("foo bar baz"); + assert_eq!(wrap_help(&help, 5), "foo\nbar\nbaz"); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/macros.rs b/vendor/registry-40351f815f426200/clap/src/app/macros.rs new file mode 100644 index 000000000..099f326e4 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/macros.rs @@ -0,0 +1,165 @@ +macro_rules! remove_overriden { + (@remove_requires $rem_from:expr, $a:ident.$ov:ident) => { + if let Some(ora) = $a.$ov() { + for i in (0 .. $rem_from.len()).rev() { + let should_remove = ora.iter().any(|&(_, ref name)| name == &$rem_from[i]); + if should_remove { $rem_from.swap_remove(i); } + } + } + }; + (@remove $rem_from:expr, $a:ident.$ov:ident) => { + if let Some(ora) = $a.$ov() { + vec_remove_all!($rem_from, ora.iter()); + } + }; + (@arg $_self:ident, $arg:ident) => { + remove_overriden!(@remove_requires $_self.required, $arg.requires); + remove_overriden!(@remove $_self.blacklist, $arg.blacklist); + remove_overriden!(@remove $_self.overrides, $arg.overrides); + }; + ($_self:ident, $name:expr) => { + debugln!("remove_overriden!;"); + if let Some(o) = $_self.opts.iter() .find(|o| o.b.name == *$name) { + remove_overriden!(@arg $_self, o); + } else if let Some(f) = $_self.flags.iter() .find(|f| f.b.name == *$name) { + remove_overriden!(@arg $_self, f); + } else { + let p = $_self.positionals.values() + .find(|p| p.b.name == *$name) + .expect(INTERNAL_ERROR_MSG); + remove_overriden!(@arg $_self, p); + } + }; +} + +macro_rules! arg_post_processing { + ($me:ident, $arg:ident, $matcher:ident) => { + debugln!("arg_post_processing!;"); + // Handle POSIX overrides + debug!("arg_post_processing!: Is '{}' in overrides...", $arg.to_string()); + if $me.overrides.contains(&$arg.name()) { + if let Some(ref name) = find_name_from!($me, &$arg.name(), overrides, $matcher) { + sdebugln!("Yes by {}", name); + $matcher.remove(name); + remove_overriden!($me, name); + } + } else { sdebugln!("No"); } + + // Add overrides + debug!("arg_post_processing!: Does '{}' have overrides...", $arg.to_string()); + if let Some(or) = $arg.overrides() { + sdebugln!("Yes"); + $matcher.remove_all(or); + for pa in or { remove_overriden!($me, pa); } + $me.overrides.extend(or); + vec_remove_all!($me.required, or.iter()); + } else { sdebugln!("No"); } + + // Handle conflicts + debug!("arg_post_processing!: Does '{}' have conflicts...", $arg.to_string()); + if let Some(bl) = $arg.blacklist() { + sdebugln!("Yes"); + + for c in bl { + // Inject two-way conflicts + debug!("arg_post_processing!: Has '{}' already been matched...", c); + if $matcher.contains(c) { + sdebugln!("Yes"); + // find who blacklisted us... + $me.blacklist.push(&$arg.b.name); + } else { + sdebugln!("No"); + } + } + + $me.blacklist.extend_from_slice(bl); + vec_remove_all!($me.overrides, bl.iter()); + // vec_remove_all!($me.required, bl.iter()); + } else { sdebugln!("No"); } + + // Add all required args which aren't already found in matcher to the master + // list + debug!("arg_post_processing!: Does '{}' have requirements...", $arg.to_string()); + if let Some(reqs) = $arg.requires() { + for n in reqs.iter() + .filter(|&&(val, _)| val.is_none()) + .filter(|&&(_, req)| !$matcher.contains(&req)) + .map(|&(_, name)| name) { + + $me.required.push(n); + } + } else { sdebugln!("No"); } + + _handle_group_reqs!($me, $arg); + }; +} + +macro_rules! _handle_group_reqs{ + ($me:ident, $arg:ident) => ({ + use args::AnyArg; + debugln!("_handle_group_reqs!;"); + for grp in &$me.groups { + let found = if grp.args.contains(&$arg.name()) { + if let Some(ref reqs) = grp.requires { + debugln!("_handle_group_reqs!: Adding {:?} to the required list", reqs); + $me.required.extend(reqs); + } + if let Some(ref bl) = grp.conflicts { + $me.blacklist.extend(bl); + } + true // What if arg is in more than one group with different reqs? + } else { + false + }; + debugln!("_handle_group_reqs!:iter: grp={}, found={:?}", grp.name, found); + if found { + for i in (0 .. $me.required.len()).rev() { + let should_remove = grp.args.contains(&$me.required[i]); + if should_remove { $me.required.swap_remove(i); } + } + debugln!("_handle_group_reqs!:iter: Adding args from group to blacklist...{:?}", grp.args); + if !grp.multiple { + $me.blacklist.extend(&grp.args); + debugln!("_handle_group_reqs!: removing {:?} from blacklist", $arg.name()); + for i in (0 .. $me.blacklist.len()).rev() { + let should_remove = $me.blacklist[i] == $arg.name(); + if should_remove { $me.blacklist.swap_remove(i); } + } + } + } + } + }) +} + +macro_rules! parse_positional { + ( + $_self:ident, + $p:ident, + $arg_os:ident, + $pos_counter:ident, + $matcher:ident + ) => { + debugln!("parse_positional!;"); + + if !$_self.is_set(AS::TrailingValues) && + ($_self.is_set(AS::TrailingVarArg) && + $pos_counter == $_self.positionals.len()) { + $_self.settings.set(AS::TrailingValues); + } + let _ = $_self.add_val_to_arg($p, &$arg_os, $matcher)?; + + $matcher.inc_occurrence_of($p.b.name); + let _ = $_self.groups_for_arg($p.b.name) + .and_then(|vec| Some($matcher.inc_occurrences_of(&*vec))); + if $_self.cache.map_or(true, |name| name != $p.b.name) { + arg_post_processing!($_self, $p, $matcher); + $_self.cache = Some($p.b.name); + } + + $_self.settings.set(AS::ValidArgFound); + // Only increment the positional counter if it doesn't allow multiples + if !$p.b.settings.is_set(ArgSettings::Multiple) { + $pos_counter += 1; + } + }; +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/meta.rs b/vendor/registry-40351f815f426200/clap/src/app/meta.rs new file mode 100644 index 000000000..6fbf412ce --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/meta.rs @@ -0,0 +1,27 @@ +#[doc(hidden)] +#[allow(missing_debug_implementations)] +#[derive(Default, Clone)] +pub struct AppMeta<'b> { + pub name: String, + pub bin_name: Option, + pub author: Option<&'b str>, + pub version: Option<&'b str>, + pub long_version: Option<&'b str>, + pub about: Option<&'b str>, + pub long_about: Option<&'b str>, + pub more_help: Option<&'b str>, + pub pre_help: Option<&'b str>, + pub aliases: Option>, // (name, visible) + pub usage_str: Option<&'b str>, + pub usage: Option, + pub help_str: Option<&'b str>, + pub disp_ord: usize, + pub term_w: Option, + pub max_w: Option, + pub template: Option<&'b str>, +} + +impl<'b> AppMeta<'b> { + pub fn new() -> Self { Default::default() } + pub fn with_name(s: String) -> Self { AppMeta { name: s, disp_ord: 999, ..Default::default() } } +} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/clap/src/app/mod.rs b/vendor/registry-40351f815f426200/clap/src/app/mod.rs new file mode 100644 index 000000000..d08f9de00 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/mod.rs @@ -0,0 +1,1818 @@ +mod settings; +#[macro_use] +mod macros; +pub mod parser; +mod meta; +mod help; +mod validator; +mod usage; + +// Std +use std::env; +use std::ffi::{OsStr, OsString}; +use std::fmt; +use std::io::{self, BufRead, BufWriter, Write}; +use std::path::Path; +use std::process; +use std::rc::Rc; +use std::result::Result as StdResult; + +// Third Party +#[cfg(feature = "yaml")] +use yaml_rust::Yaml; + +// Internal +use app::help::Help; +use app::parser::Parser; +use args::{AnyArg, Arg, ArgGroup, ArgMatcher, ArgMatches, ArgSettings}; +use errors::Result as ClapResult; +pub use self::settings::AppSettings; +use completions::Shell; +use map::{self, VecMap}; + +/// Used to create a representation of a command line program and all possible command line +/// arguments. Application settings are set using the "builder pattern" with the +/// [`App::get_matches`] family of methods being the terminal methods that starts the +/// runtime-parsing process. These methods then return information about the user supplied +/// arguments (or lack there of). +/// +/// **NOTE:** There aren't any mandatory "options" that one must set. The "options" may +/// also appear in any order (so long as one of the [`App::get_matches`] methods is the last method +/// called). +/// +/// # Examples +/// +/// ```no_run +/// # use clap::{App, Arg}; +/// let m = App::new("My Program") +/// .author("Me, me@mail.com") +/// .version("1.0.2") +/// .about("Explains in brief what the program does") +/// .arg( +/// Arg::with_name("in_file").index(1) +/// ) +/// .after_help("Longer explanation to appear after the options when \ +/// displaying the help information from --help or -h") +/// .get_matches(); +/// +/// // Your program logic starts here... +/// ``` +/// [`App::get_matches`]: ./struct.App.html#method.get_matches +#[allow(missing_debug_implementations)] +pub struct App<'a, 'b> + where 'a: 'b +{ + #[doc(hidden)] + pub p: Parser<'a, 'b>, +} + + +impl<'a, 'b> App<'a, 'b> { + /// Creates a new instance of an application requiring a name. The name may be, but doesn't + /// have to be same as the binary. The name will be displayed to the user when they request to + /// print version or help and usage information. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let prog = App::new("My Program") + /// # ; + /// ``` + pub fn new>(n: S) -> Self { App { p: Parser::with_name(n.into()) } } + + /// Get the name of the app + pub fn get_name(&self) -> &str { &self.p.meta.name } + + /// Get the name of the binary + pub fn get_bin_name(&self) -> Option<&str> { self.p.meta.bin_name.as_ref().map(|s| s.as_str()) } + + /// Creates a new instance of an application requiring a name, but uses the [`crate_authors!`] + /// and [`crate_version!`] macros to fill in the [`App::author`] and [`App::version`] fields. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let prog = App::with_defaults("My Program") + /// # ; + /// ``` + /// [`crate_authors!`]: ./macro.crate_authors!.html + /// [`crate_version!`]: ./macro.crate_version!.html + /// [`App::author`]: ./struct.App.html#method.author + /// [`App::version`]: ./struct.App.html#method.author + #[deprecated(since="2.14.1", note="Can never work; use explicit App::author() and App::version() calls instead")] + pub fn with_defaults>(n: S) -> Self { + let mut a = App { p: Parser::with_name(n.into()) }; + a.p.meta.author = Some("Kevin K. "); + a.p.meta.version = Some("2.19.2"); + a + } + + /// Creates a new instance of [`App`] from a .yml (YAML) file. A full example of supported YAML + /// objects can be found in [`examples/17_yaml.rs`] and [`examples/17_yaml.yml`]. One great use + /// for using YAML is when supporting multiple languages and dialects, as each language could + /// be a distinct YAML file and determined at compiletime via `cargo` "features" in your + /// `Cargo.toml` + /// + /// In order to use this function you must compile `clap` with the `features = ["yaml"]` in + /// your settings for the `[dependencies.clap]` table of your `Cargo.toml` + /// + /// **NOTE:** Due to how the YAML objects are built there is a convenience macro for loading + /// the YAML file at compile time (relative to the current file, like modules work). That YAML + /// object can then be passed to this function. + /// + /// # Panics + /// + /// The YAML file must be properly formatted or this function will [`panic!`]. A good way to + /// ensure this doesn't happen is to run your program with the `--help` switch. If this passes + /// without error, you needn't worry because the YAML is properly formatted. + /// + /// # Examples + /// + /// The following example shows how to load a properly formatted YAML file to build an instance + /// of an [`App`] struct. + /// + /// ```ignore + /// # #[macro_use] + /// # extern crate clap; + /// # use clap::App; + /// # fn main() { + /// let yml = load_yaml!("app.yml"); + /// let app = App::from_yaml(yml); + /// + /// // continued logic goes here, such as `app.get_matches()` etc. + /// # } + /// ``` + /// [`App`]: ./struct.App.html + /// [`examples/17_yaml.rs`]: https://github.com/kbknapp/clap-rs/blob/master/examples/17_yaml.rs + /// [`examples/17_yaml.yml`]: https://github.com/kbknapp/clap-rs/blob/master/examples/17_yaml.yml + /// [`panic!`]: https://doc.rust-lang.org/std/macro.panic!.html + #[cfg(feature = "yaml")] + pub fn from_yaml(yaml: &'a Yaml) -> App<'a, 'a> { App::from(yaml) } + + /// Sets a string of author(s) that will be displayed to the user when they + /// request the help information with `--help` or `-h`. + /// + /// **Pro-tip:** Use `clap`s convenience macro [`crate_authors!`] to automatically set your + /// application's author(s) to the same thing as your crate at compile time. See the [`examples/`] + /// directory for more information + /// + /// See the [`examples/`] + /// directory for more information + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .author("Me, me@mymain.com") + /// # ; + /// ``` + /// [`crate_authors!`]: ./macro.crate_authors!.html + /// [`examples/`]: https://github.com/kbknapp/clap-rs/tree/master/examples + pub fn author>(mut self, author: S) -> Self { + self.p.meta.author = Some(author.into()); + self + } + + /// Overrides the system-determined binary name. This should only be used when absolutely + /// necessary, such as when the binary name for your application is misleading, or perhaps + /// *not* how the user should invoke your program. + /// + /// **Pro-tip:** When building things such as third party `cargo` subcommands, this setting + /// **should** be used! + /// + /// **NOTE:** This command **should not** be used for [`SubCommand`]s. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("My Program") + /// .bin_name("my_binary") + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + pub fn bin_name>(mut self, name: S) -> Self { + self.p.meta.bin_name = Some(name.into()); + self + } + + /// Sets a string describing what the program does. This will be displayed when displaying help + /// information with `-h`. + /// + /// **NOTE:** If only `about` is provided, and not [`App::long_about`] but the user requests + /// `--help` clap will still display the contents of `about` appropriately + /// + /// **NOTE:** Only [`App::about`] is used in completion script generation in order to be + /// concise + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .about("Does really amazing things to great people") + /// # ; + /// ``` + /// [`App::long_about`]: ./struct.App.html#method.long_about + pub fn about>(mut self, about: S) -> Self { + self.p.meta.about = Some(about.into()); + self + } + + /// Sets a string describing what the program does. This will be displayed when displaying help + /// information. + /// + /// **NOTE:** If only `long_about` is provided, and not [`App::about`] but the user requests + /// `-h` clap will still display the contents of `long_about` appropriately + /// + /// **NOTE:** Only [`App::about`] is used in completion script generation in order to be + /// concise + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .long_about( + /// "Does really amazing things to great people. Now let's talk a little + /// more in depth about how this subcommand really works. It may take about + /// a few lines of text, but that's ok!") + /// # ; + /// ``` + /// [`App::about`]: ./struct.App.html#method.about + pub fn long_about>(mut self, about: S) -> Self { + self.p.meta.long_about = Some(about.into()); + self + } + + /// Sets the program's name. This will be displayed when displaying help information. + /// + /// **Pro-top:** This function is particularly useful when configuring a program via + /// [`App::from_yaml`] in conjunction with the [`crate_name!`] macro to derive the program's + /// name from its `Cargo.toml`. + /// + /// # Examples + /// ```ignore + /// # #[macro_use] + /// # extern crate clap; + /// # use clap::App; + /// # fn main() { + /// let yml = load_yaml!("app.yml"); + /// let app = App::from_yaml(yml) + /// .name(crate_name!()); + /// + /// // continued logic goes here, such as `app.get_matches()` etc. + /// # } + /// ``` + /// + /// [`App::from_yaml`]: ./struct.App.html#method.from_yaml + /// [`crate_name!`]: ./macro.crate_name.html + pub fn name>(mut self, name: S) -> Self { + self.p.meta.name = name.into(); + self + } + + /// Adds additional help information to be displayed in addition to auto-generated help. This + /// information is displayed **after** the auto-generated help information. This is often used + /// to describe how to use the arguments, or caveats to be noted. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::App; + /// App::new("myprog") + /// .after_help("Does really amazing things to great people...but be careful with -R") + /// # ; + /// ``` + pub fn after_help>(mut self, help: S) -> Self { + self.p.meta.more_help = Some(help.into()); + self + } + + /// Adds additional help information to be displayed in addition to auto-generated help. This + /// information is displayed **before** the auto-generated help information. This is often used + /// for header information. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::App; + /// App::new("myprog") + /// .before_help("Some info I'd like to appear before the help info") + /// # ; + /// ``` + pub fn before_help>(mut self, help: S) -> Self { + self.p.meta.pre_help = Some(help.into()); + self + } + + /// Sets a string of the version number to be displayed when displaying version or help + /// information with `-V`. + /// + /// **NOTE:** If only `version` is provided, and not [`App::long_version`] but the user + /// requests `--version` clap will still display the contents of `version` appropriately + /// + /// **Pro-tip:** Use `clap`s convenience macro [`crate_version!`] to automatically set your + /// application's version to the same thing as your crate at compile time. See the [`examples/`] + /// directory for more information + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .version("v0.1.24") + /// # ; + /// ``` + /// [`crate_version!`]: ./macro.crate_version!.html + /// [`examples/`]: https://github.com/kbknapp/clap-rs/tree/master/examples + /// [`App::long_version`]: ./struct.App.html#method.long_version + pub fn version>(mut self, ver: S) -> Self { + self.p.meta.version = Some(ver.into()); + self + } + + /// Sets a string of the version number to be displayed when displaying version or help + /// information with `--version`. + /// + /// **NOTE:** If only `long_version` is provided, and not [`App::version`] but the user + /// requests `-V` clap will still display the contents of `long_version` appropriately + /// + /// **Pro-tip:** Use `clap`s convenience macro [`crate_version!`] to automatically set your + /// application's version to the same thing as your crate at compile time. See the [`examples/`] + /// directory for more information + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .long_version( + /// "v0.1.24 + /// commit: abcdef89726d + /// revision: 123 + /// release: 2 + /// binary: myprog") + /// # ; + /// ``` + /// [`crate_version!`]: ./macro.crate_version!.html + /// [`examples/`]: https://github.com/kbknapp/clap-rs/tree/master/examples + /// [`App::version`]: ./struct.App.html#method.version + pub fn long_version>(mut self, ver: S) -> Self { + self.p.meta.long_version = Some(ver.into()); + self + } + + /// Sets a custom usage string to override the auto-generated usage string. + /// + /// This will be displayed to the user when errors are found in argument parsing, or when you + /// call [`ArgMatches::usage`] + /// + /// **CAUTION:** Using this setting disables `clap`s "context-aware" usage strings. After this + /// setting is set, this will be the only usage string displayed to the user! + /// + /// **NOTE:** You do not need to specify the "USAGE: \n\t" portion, as that will + /// still be applied by `clap`, you only need to specify the portion starting + /// with the binary name. + /// + /// **NOTE:** This will not replace the entire help message, *only* the portion + /// showing the usage. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .usage("myapp [-clDas] ") + /// # ; + /// ``` + /// [`ArgMatches::usage`]: ./struct.ArgMatches.html#method.usage + pub fn usage>(mut self, usage: S) -> Self { + self.p.meta.usage_str = Some(usage.into()); + self + } + + /// Sets a custom help message and overrides the auto-generated one. This should only be used + /// when the auto-generated message does not suffice. + /// + /// This will be displayed to the user when they use `--help` or `-h` + /// + /// **NOTE:** This replaces the **entire** help message, so nothing will be auto-generated. + /// + /// **NOTE:** This **only** replaces the help message for the current command, meaning if you + /// are using subcommands, those help messages will still be auto-generated unless you + /// specify a [`Arg::help`] for them as well. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myapp") + /// .help("myapp v1.0\n\ + /// Does awesome things\n\ + /// (C) me@mail.com\n\n\ + /// + /// USAGE: myapp \n\n\ + /// + /// Options:\n\ + /// -h, --helpe Dispay this message\n\ + /// -V, --version Display version info\n\ + /// -s Do something with stuff\n\ + /// -v Be verbose\n\n\ + /// + /// Commmands:\n\ + /// help Prints this message\n\ + /// work Do some work") + /// # ; + /// ``` + /// [`Arg::help`]: ./struct.Arg.html#method.help + pub fn help>(mut self, help: S) -> Self { + self.p.meta.help_str = Some(help.into()); + self + } + + /// Sets the [`short`] for the auto-generated `help` argument. + /// + /// By default `clap` automatically assigns `h`, but this can be overridden if you have a + /// different argument which you'd prefer to use the `-h` short with. This can be done by + /// defining your own argument with a lowercase `h` as the [`short`]. + /// + /// `clap` lazily generates these `help` arguments **after** you've defined any arguments of + /// your own. + /// + /// **NOTE:** Any leading `-` characters will be stripped, and only the first + /// non `-` character will be used as the [`short`] version + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .help_short("H") // Using an uppercase `H` instead of the default lowercase `h` + /// # ; + /// ``` + /// [`short`]: ./struct.Arg.html#method.short + pub fn help_short + 'b>(mut self, s: S) -> Self { + self.p.help_short(s.as_ref()); + self + } + + /// Sets the [`short`] for the auto-generated `version` argument. + /// + /// By default `clap` automatically assigns `V`, but this can be overridden if you have a + /// different argument which you'd prefer to use the `-V` short with. This can be done by + /// defining your own argument with an uppercase `V` as the [`short`]. + /// + /// `clap` lazily generates these `version` arguments **after** you've defined any arguments of + /// your own. + /// + /// **NOTE:** Any leading `-` characters will be stripped, and only the first + /// non `-` character will be used as the `short` version + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .version_short("v") // Using a lowercase `v` instead of the default capital `V` + /// # ; + /// ``` + /// [`short`]: ./struct.Arg.html#method.short + pub fn version_short>(mut self, s: S) -> Self { + self.p.version_short(s.as_ref()); + self + } + + /// Sets the help text for the auto-generated `help` argument. + /// + /// By default `clap` sets this to `"Prints help information"`, but if you're using a + /// different convention for your help messages and would prefer a different phrasing you can + /// override it. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .help_message("Print help information") // Perhaps you want imperative help messages + /// + /// # ; + /// ``` + pub fn help_message>(mut self, s: S) -> Self { + self.p.help_message = Some(s.into()); + self + } + + /// Sets the help text for the auto-generated `version` argument. + /// + /// By default `clap` sets this to `"Prints version information"`, but if you're using a + /// different convention for your help messages and would prefer a different phrasing then you + /// can change it. + /// + /// # Examples + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .version_message("Print version information") // Perhaps you want imperative help messages + /// # ; + /// ``` + pub fn version_message>(mut self, s: S) -> Self { + self.p.version_message = Some(s.into()); + self + } + + /// Sets the help template to be used, overriding the default format. + /// + /// Tags arg given inside curly brackets. + /// + /// Valid tags are: + /// + /// * `{bin}` - Binary name. + /// * `{version}` - Version number. + /// * `{author}` - Author information. + /// * `{about}` - General description (from [`App::about`]) + /// * `{usage}` - Automatically generated or given usage string. + /// * `{all-args}` - Help for all arguments (options, flags, positionals arguments, + /// and subcommands) including titles. + /// * `{unified}` - Unified help for options and flags. Note, you must *also* set + /// [`AppSettings::UnifiedHelpMessage`] to fully merge both options and + /// flags, otherwise the ordering is "best effort" + /// * `{flags}` - Help for flags. + /// * `{options}` - Help for options. + /// * `{positionals}` - Help for positionals arguments. + /// * `{subcommands}` - Help for subcommands. + /// * `{after-help}` - Help from [`App::after_help`] + /// * `{before-help}` - Help from [`App::before_help`] + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .version("1.0") + /// .template("{bin} ({version}) - {usage}") + /// # ; + /// ``` + /// **NOTE:**The template system is, on purpose, very simple. Therefore the tags have to writen + /// in the lowercase and without spacing. + /// [`App::about`]: ./struct.App.html#method.about + /// [`App::after_help`]: ./struct.App.html#method.after_help + /// [`App::before_help`]: ./struct.App.html#method.before_help + /// [`AppSettings::UnifiedHelpMessage`]: ./enum.AppSettings.html#variant.UnifiedHelpMessage + pub fn template>(mut self, s: S) -> Self { + self.p.meta.template = Some(s.into()); + self + } + + /// Enables a single command, or [`SubCommand`], level settings. + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::SubcommandRequired) + /// .setting(AppSettings::WaitOnError) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn setting(mut self, setting: AppSettings) -> Self { + self.p.set(setting); + self + } + + /// Enables multiple command, or [`SubCommand`], level settings + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .settings(&[AppSettings::SubcommandRequired, + /// AppSettings::WaitOnError]) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn settings(mut self, settings: &[AppSettings]) -> Self { + for s in settings { + self.p.set(*s); + } + self + } + + /// Enables a single setting that is propagated down through all child [`SubCommand`]s. + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// **NOTE**: The setting is *only* propagated *down* and not up through parent commands. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .global_setting(AppSettings::SubcommandRequired) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn global_setting(mut self, setting: AppSettings) -> Self { + self.p.set(setting); + self.p.g_settings.set(setting); + self + } + + /// Enables multiple settings which are propagated *down* through all child [`SubCommand`]s. + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// **NOTE**: The setting is *only* propagated *down* and not up through parent commands. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .global_settings(&[AppSettings::SubcommandRequired, + /// AppSettings::ColoredHelp]) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn global_settings(mut self, settings: &[AppSettings]) -> Self { + for s in settings { + self.p.set(*s); + self.p.g_settings.set(*s) + } + self + } + + /// Disables a single command, or [`SubCommand`], level setting. + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, AppSettings}; + /// App::new("myprog") + /// .unset_setting(AppSettings::ColorAuto) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn unset_setting(mut self, setting: AppSettings) -> Self { + self.p.unset(setting); + self + } + + /// Disables multiple command, or [`SubCommand`], level settings. + /// + /// See [`AppSettings`] for a full list of possibilities and examples. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, AppSettings}; + /// App::new("myprog") + /// .unset_settings(&[AppSettings::ColorAuto, + /// AppSettings::AllowInvalidUtf8]) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings`]: ./enum.AppSettings.html + pub fn unset_settings(mut self, settings: &[AppSettings]) -> Self { + for s in settings { + self.p.unset(*s); + } + self + } + + /// Sets the terminal width at which to wrap help messages. Defaults to `120`. Using `0` will + /// ignore terminal widths and use source formatting. + /// + /// `clap` automatically tries to determine the terminal width on Unix, Linux, OSX and Windows + /// if the `wrap_help` cargo "feature" has been used while compiling. If the terminal width + /// cannot be determined, `clap` defaults to `120`. + /// + /// **NOTE:** This setting applies globally and *not* on a per-command basis. + /// + /// **NOTE:** This setting must be set **before** any subcommands are added! + /// + /// # Platform Specific + /// + /// Only Unix, Linux, OSX and Windows support automatic determination of terminal width. + /// Even on those platforms, this setting is useful if for any reason the terminal width + /// cannot be determined. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::App; + /// App::new("myprog") + /// .set_term_width(80) + /// # ; + /// ``` + pub fn set_term_width(mut self, width: usize) -> Self { + self.p.meta.term_w = Some(width); + self + } + + /// Sets the max terminal width at which to wrap help messages. Using `0` will ignore terminal + /// widths and use source formatting. + /// + /// `clap` automatically tries to determine the terminal width on Unix, Linux, OSX and Windows + /// if the `wrap_help` cargo "feature" has been used while compiling, but one might want to + /// limit the size (e.g. when the terminal is running fullscreen). + /// + /// **NOTE:** This setting applies globally and *not* on a per-command basis. + /// + /// **NOTE:** This setting must be set **before** any subcommands are added! + /// + /// # Platform Specific + /// + /// Only Unix, Linux, OSX and Windows support automatic determination of terminal width. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::App; + /// App::new("myprog") + /// .max_term_width(100) + /// # ; + /// ``` + pub fn max_term_width(mut self, w: usize) -> Self { + self.p.meta.max_w = Some(w); + self + } + + /// Adds an [argument] to the list of valid possibilities. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// // Adding a single "flag" argument with a short and help text, using Arg::with_name() + /// .arg( + /// Arg::with_name("debug") + /// .short("d") + /// .help("turns on debugging mode") + /// ) + /// // Adding a single "option" argument with a short, a long, and help text using the less + /// // verbose Arg::from_usage() + /// .arg( + /// Arg::from_usage("-c --config=[CONFIG] 'Optionally sets a config file to use'") + /// ) + /// # ; + /// ``` + /// [argument]: ./struct.Arg.html + pub fn arg>>(mut self, a: A) -> Self { + self.p.add_arg(a.into()); + self + } + + /// Adds multiple [arguments] to the list of valid possibilties + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .args( + /// &[Arg::from_usage("[debug] -d 'turns on debugging info'"), + /// Arg::with_name("input").index(1).help("the input file to use")] + /// ) + /// # ; + /// ``` + /// [arguments]: ./struct.Arg.html + pub fn args(mut self, args: &[Arg<'a, 'b>]) -> Self { + for arg in args { + self.p.add_arg_ref(arg); + } + self + } + + /// A convenience method for adding a single [argument] from a usage type string. The string + /// used follows the same rules and syntax as [`Arg::from_usage`] + /// + /// **NOTE:** The downside to using this method is that you can not set any additional + /// properties of the [`Arg`] other than what [`Arg::from_usage`] supports. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .arg_from_usage("-c --config= 'Sets a configuration file to use'") + /// # ; + /// ``` + /// [arguments]: ./struct.Arg.html + /// [`Arg`]: ./struct.Arg.html + /// [`Arg::from_usage`]: ./struct.Arg.html#method.from_usage + pub fn arg_from_usage(mut self, usage: &'a str) -> Self { + self.p.add_arg(Arg::from_usage(usage)); + self + } + + /// Adds multiple [arguments] at once from a usage string, one per line. See + /// [`Arg::from_usage`] for details on the syntax and rules supported. + /// + /// **NOTE:** Like [`App::arg_from_usage`] the downside is you only set properties for the + /// [`Arg`]s which [`Arg::from_usage`] supports. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// App::new("myprog") + /// .args_from_usage( + /// "-c --config=[FILE] 'Sets a configuration file to use' + /// [debug]... -d 'Sets the debugging level' + /// 'The input file to use'" + /// ) + /// # ; + /// ``` + /// [arguments]: ./struct.Arg.html + /// [`Arg::from_usage`]: ./struct.Arg.html#method.from_usage + /// [`App::arg_from_usage`]: ./struct.App.html#method.arg_from_usage + /// [`Arg`]: ./struct.Arg.html + pub fn args_from_usage(mut self, usage: &'a str) -> Self { + for line in usage.lines() { + let l = line.trim(); + if l.is_empty() { + continue; + } + self.p.add_arg(Arg::from_usage(l)); + } + self + } + + /// Allows adding a [`SubCommand`] alias, which function as "hidden" subcommands that + /// automatically dispatch as if this subcommand was used. This is more efficient, and easier + /// than creating multiple hidden subcommands as one only needs to check for the existence of + /// this command, and not all variants. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let m = App::new("myprog") + /// .subcommand(SubCommand::with_name("test") + /// .alias("do-stuff")) + /// .get_matches_from(vec!["myprog", "do-stuff"]); + /// assert_eq!(m.subcommand_name(), Some("test")); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + pub fn alias>(mut self, name: S) -> Self { + if let Some(ref mut als) = self.p.meta.aliases { + als.push((name.into(), false)); + } else { + self.p.meta.aliases = Some(vec![(name.into(), false)]); + } + self + } + + /// Allows adding [`SubCommand`] aliases, which function as "hidden" subcommands that + /// automatically dispatch as if this subcommand was used. This is more efficient, and easier + /// than creating multiple hidden subcommands as one only needs to check for the existence of + /// this command, and not all variants. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, SubCommand}; + /// let m = App::new("myprog") + /// .subcommand(SubCommand::with_name("test") + /// .aliases(&["do-stuff", "do-tests", "tests"])) + /// .arg(Arg::with_name("input") + /// .help("the file to add") + /// .index(1) + /// .required(false)) + /// .get_matches_from(vec!["myprog", "do-tests"]); + /// assert_eq!(m.subcommand_name(), Some("test")); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + pub fn aliases(mut self, names: &[&'b str]) -> Self { + if let Some(ref mut als) = self.p.meta.aliases { + for n in names { + als.push((n, false)); + } + } else { + self.p.meta.aliases = Some(names.iter().map(|n| (*n, false)).collect::>()); + } + self + } + + /// Allows adding a [`SubCommand`] alias that functions exactly like those defined with + /// [`App::alias`], except that they are visible inside the help message. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let m = App::new("myprog") + /// .subcommand(SubCommand::with_name("test") + /// .visible_alias("do-stuff")) + /// .get_matches_from(vec!["myprog", "do-stuff"]); + /// assert_eq!(m.subcommand_name(), Some("test")); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`App::alias`]: ./struct.App.html#method.alias + pub fn visible_alias>(mut self, name: S) -> Self { + if let Some(ref mut als) = self.p.meta.aliases { + als.push((name.into(), true)); + } else { + self.p.meta.aliases = Some(vec![(name.into(), true)]); + } + self + } + + /// Allows adding multiple [`SubCommand`] aliases that functions exactly like those defined + /// with [`App::aliases`], except that they are visible inside the help message. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let m = App::new("myprog") + /// .subcommand(SubCommand::with_name("test") + /// .visible_aliases(&["do-stuff", "tests"])) + /// .get_matches_from(vec!["myprog", "do-stuff"]); + /// assert_eq!(m.subcommand_name(), Some("test")); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`App::aliases`]: ./struct.App.html#method.aliases + pub fn visible_aliases(mut self, names: &[&'b str]) -> Self { + if let Some(ref mut als) = self.p.meta.aliases { + for n in names { + als.push((n, true)); + } + } else { + self.p.meta.aliases = Some(names.iter().map(|n| (*n, true)).collect::>()); + } + self + } + + /// Adds an [`ArgGroup`] to the application. [`ArgGroup`]s are a family of related arguments. + /// By placing them in a logical group, you can build easier requirement and exclusion rules. + /// For instance, you can make an entire [`ArgGroup`] required, meaning that one (and *only* + /// one) argument from that group must be present at runtime. + /// + /// You can also do things such as name an [`ArgGroup`] as a conflict to another argument. + /// Meaning any of the arguments that belong to that group will cause a failure if present with + /// the conflicting argument. + /// + /// Another added benfit of [`ArgGroup`]s is that you can extract a value from a group instead + /// of determining exactly which argument was used. + /// + /// Finally, using [`ArgGroup`]s to ensure exclusion between arguments is another very common + /// use + /// + /// # Examples + /// + /// The following example demonstrates using an [`ArgGroup`] to ensure that one, and only one, + /// of the arguments from the specified group is present at runtime. + /// + /// ```no_run + /// # use clap::{App, ArgGroup}; + /// App::new("app") + /// .args_from_usage( + /// "--set-ver [ver] 'set the version manually' + /// --major 'auto increase major' + /// --minor 'auto increase minor' + /// --patch 'auto increase patch'") + /// .group(ArgGroup::with_name("vers") + /// .args(&["set-ver", "major", "minor","patch"]) + /// .required(true)) + /// # ; + /// ``` + /// [`ArgGroup`]: ./struct.ArgGroup.html + pub fn group(mut self, group: ArgGroup<'a>) -> Self { + self.p.add_group(group); + self + } + + /// Adds multiple [`ArgGroup`]s to the [`App`] at once. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, ArgGroup}; + /// App::new("app") + /// .args_from_usage( + /// "--set-ver [ver] 'set the version manually' + /// --major 'auto increase major' + /// --minor 'auto increase minor' + /// --patch 'auto increase patch' + /// -c [FILE] 'a config file' + /// -i [IFACE] 'an interface'") + /// .groups(&[ + /// ArgGroup::with_name("vers") + /// .args(&["set-ver", "major", "minor","patch"]) + /// .required(true), + /// ArgGroup::with_name("input") + /// .args(&["c", "i"]) + /// ]) + /// # ; + /// ``` + /// [`ArgGroup`]: ./struct.ArgGroup.html + /// [`App`]: ./struct.App.html + pub fn groups(mut self, groups: &[ArgGroup<'a>]) -> Self { + for g in groups { + self = self.group(g.into()); + } + self + } + + /// Adds a [`SubCommand`] to the list of valid possibilities. Subcommands are effectively + /// sub-[`App`]s, because they can contain their own arguments, subcommands, version, usage, + /// etc. They also function just like [`App`]s, in that they get their own auto generated help, + /// version, and usage. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// App::new("myprog") + /// .subcommand(SubCommand::with_name("config") + /// .about("Controls configuration features") + /// .arg_from_usage(" 'Required configuration file to use'")) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`App`]: ./struct.App.html + pub fn subcommand(mut self, subcmd: App<'a, 'b>) -> Self { + self.p.add_subcommand(subcmd); + self + } + + /// Adds multiple subcommands to the list of valid possibilities by iterating over an + /// [`IntoIterator`] of [`SubCommand`]s + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, SubCommand}; + /// # App::new("myprog") + /// .subcommands( vec![ + /// SubCommand::with_name("config").about("Controls configuration functionality") + /// .arg(Arg::with_name("config_file").index(1)), + /// SubCommand::with_name("debug").about("Controls debug functionality")]) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`IntoIterator`]: https://doc.rust-lang.org/std/iter/trait.IntoIterator.html + pub fn subcommands(mut self, subcmds: I) -> Self + where I: IntoIterator> + { + for subcmd in subcmds { + self.p.add_subcommand(subcmd); + } + self + } + + /// Allows custom ordering of [`SubCommand`]s within the help message. Subcommands with a lower + /// value will be displayed first in the help message. This is helpful when one would like to + /// emphasise frequently used subcommands, or prioritize those towards the top of the list. + /// Duplicate values **are** allowed. Subcommands with duplicate display orders will be + /// displayed in alphabetical order. + /// + /// **NOTE:** The default is 999 for all subcommands. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, SubCommand}; + /// let m = App::new("cust-ord") + /// .subcommand(SubCommand::with_name("alpha") // typically subcommands are grouped + /// // alphabetically by name. Subcommands + /// // without a display_order have a value of + /// // 999 and are displayed alphabetically with + /// // all other 999 subcommands + /// .about("Some help and text")) + /// .subcommand(SubCommand::with_name("beta") + /// .display_order(1) // In order to force this subcommand to appear *first* + /// // all we have to do is give it a value lower than 999. + /// // Any other subcommands with a value of 1 will be displayed + /// // alphabetically with this one...then 2 values, then 3, etc. + /// .about("I should be first!")) + /// .get_matches_from(vec![ + /// "cust-ord", "--help" + /// ]); + /// ``` + /// + /// The above example displays the following help message + /// + /// ```text + /// cust-ord + /// + /// USAGE: + /// cust-ord [FLAGS] [OPTIONS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// + /// SUBCOMMANDS: + /// beta I should be first! + /// alpha Some help and text + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + pub fn display_order(mut self, ord: usize) -> Self { + self.p.meta.disp_ord = ord; + self + } + + /// Prints the full help message to [`io::stdout()`] using a [`BufWriter`] using the same + /// method as if someone ran `-h` to request the help message + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" help messages + /// depending on if the user ran [`-h` (short)] or [`--help` (long)] + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// let mut app = App::new("myprog"); + /// app.print_help(); + /// ``` + /// [`io::stdout()`]: https://doc.rust-lang.org/std/io/fn.stdout.html + /// [`BufWriter`]: https://doc.rust-lang.org/std/io/struct.BufWriter.html + /// [`-h` (short)]: ./struct.Arg.html#method.help + /// [`--help` (long)]: ./struct.Arg.html#method.long_help + pub fn print_help(&mut self) -> ClapResult<()> { + // If there are global arguments, or settings we need to propgate them down to subcommands + // before parsing incase we run into a subcommand + self.p.propagate_globals(); + self.p.propagate_settings(); + self.p.derive_display_order(); + + self.p.create_help_and_version(); + let out = io::stdout(); + let mut buf_w = BufWriter::new(out.lock()); + self.write_help(&mut buf_w) + } + + /// Prints the full help message to [`io::stdout()`] using a [`BufWriter`] using the same + /// method as if someone ran `--help` to request the help message + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" help messages + /// depending on if the user ran [`-h` (short)] or [`--help` (long)] + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// let mut app = App::new("myprog"); + /// app.print_long_help(); + /// ``` + /// [`io::stdout()`]: https://doc.rust-lang.org/std/io/fn.stdout.html + /// [`BufWriter`]: https://doc.rust-lang.org/std/io/struct.BufWriter.html + /// [`-h` (short)]: ./struct.Arg.html#method.help + /// [`--help` (long)]: ./struct.Arg.html#method.long_help + pub fn print_long_help(&mut self) -> ClapResult<()> { + // If there are global arguments, or settings we need to propgate them down to subcommands + // before parsing incase we run into a subcommand + self.p.propagate_globals(); + self.p.propagate_settings(); + self.p.derive_display_order(); + + self.p.create_help_and_version(); + let out = io::stdout(); + let mut buf_w = BufWriter::new(out.lock()); + self.write_long_help(&mut buf_w) + } + + /// Writes the full help message to the user to a [`io::Write`] object in the same method as if + /// the user ran `-h` + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" help messages + /// depending on if the user ran [`-h` (short)] or [`--help` (long)] + /// + /// **NOTE:** There is a known bug where this method does not write propagated global arguments + /// or autogenerated arguments (i.e. the default help/version args). Prefer + /// [`App::write_long_help`] instead if possibe! + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// use std::io; + /// let mut app = App::new("myprog"); + /// let mut out = io::stdout(); + /// app.write_help(&mut out).expect("failed to write to stdout"); + /// ``` + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html + /// [`-h` (short)]: ./struct.Arg.html#method.help + /// [`--help` (long)]: ./struct.Arg.html#method.long_help + pub fn write_help(&self, w: &mut W) -> ClapResult<()> { + // PENDING ISSUE: 808 + // https://github.com/kbknapp/clap-rs/issues/808 + // If there are global arguments, or settings we need to propgate them down to subcommands + // before parsing incase we run into a subcommand + // self.p.propagate_globals(); + // self.p.propagate_settings(); + // self.p.derive_display_order(); + // self.p.create_help_and_version(); + + Help::write_app_help(w, self, false) + } + + /// Writes the full help message to the user to a [`io::Write`] object in the same method as if + /// the user ran `--help` + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" help messages + /// depending on if the user ran [`-h` (short)] or [`--help` (long)] + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// use std::io; + /// let mut app = App::new("myprog"); + /// let mut out = io::stdout(); + /// app.write_long_help(&mut out).expect("failed to write to stdout"); + /// ``` + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html + /// [`-h` (short)]: ./struct.Arg.html#method.help + /// [`--help` (long)]: ./struct.Arg.html#method.long_help + pub fn write_long_help(&mut self, w: &mut W) -> ClapResult<()> { + self.p.propagate_globals(); + self.p.propagate_settings(); + self.p.derive_display_order(); + self.p.create_help_and_version(); + + Help::write_app_help(w, self, true) + } + + /// Writes the version message to the user to a [`io::Write`] object as if the user ran `-V`. + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" version messages + /// depending on if the user ran [`-V` (short)] or [`--version` (long)] + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// use std::io; + /// let mut app = App::new("myprog"); + /// let mut out = io::stdout(); + /// app.write_version(&mut out).expect("failed to write to stdout"); + /// ``` + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html + /// [`-V` (short)]: ./struct.App.html#method.version + /// [`--version` (long)]: ./struct.App.html#method.long_version + pub fn write_version(&self, w: &mut W) -> ClapResult<()> { + self.p.write_version(w, false).map_err(From::from) + } + + /// Writes the version message to the user to a [`io::Write`] object + /// + /// **NOTE:** clap has the ability to distinguish between "short" and "long" version messages + /// depending on if the user ran [`-V` (short)] or [`--version` (long)] + /// + /// # Examples + /// + /// ```rust + /// # use clap::App; + /// use std::io; + /// let mut app = App::new("myprog"); + /// let mut out = io::stdout(); + /// app.write_long_version(&mut out).expect("failed to write to stdout"); + /// ``` + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html + /// [`-V` (short)]: ./struct.App.html#method.version + /// [`--version` (long)]: ./struct.App.html#method.long_version + pub fn write_long_version(&self, w: &mut W) -> ClapResult<()> { + self.p.write_version(w, true).map_err(From::from) + } + + /// Generate a completions file for a specified shell at compile time. + /// + /// **NOTE:** to generate the this file at compile time you must use a `build.rs` "Build Script" + /// + /// # Examples + /// + /// The following example generates a bash completion script via a `build.rs` script. In this + /// simple example, we'll demo a very small application with only a single subcommand and two + /// args. Real applications could be many multiple levels deep in subcommands, and have tens or + /// potentially hundreds of arguments. + /// + /// First, it helps if we separate out our `App` definition into a separate file. Whether you + /// do this as a function, or bare App definition is a matter of personal preference. + /// + /// ``` + /// // src/cli.rs + /// + /// use clap::{App, Arg, SubCommand}; + /// + /// pub fn build_cli() -> App<'static, 'static> { + /// App::new("compl") + /// .about("Tests completions") + /// .arg(Arg::with_name("file") + /// .help("some input file")) + /// .subcommand(SubCommand::with_name("test") + /// .about("tests things") + /// .arg(Arg::with_name("case") + /// .long("case") + /// .takes_value(true) + /// .help("the case to test"))) + /// } + /// ``` + /// + /// In our regular code, we can simply call this `build_cli()` function, then call + /// `get_matches()`, or any of the other normal methods directly after. For example: + /// + /// ```ignore + /// // src/main.rs + /// + /// mod cli; + /// + /// fn main() { + /// let m = cli::build_cli().get_matches(); + /// + /// // normal logic continues... + /// } + /// ``` + /// + /// Next, we set up our `Cargo.toml` to use a `build.rs` build script. + /// + /// ```toml + /// # Cargo.toml + /// build = "build.rs" + /// + /// [build-dependencies] + /// clap = "2.23" + /// ``` + /// + /// Next, we place a `build.rs` in our project root. + /// + /// ```ignore + /// extern crate clap; + /// + /// use clap::Shell; + /// + /// include!("src/cli.rs"); + /// + /// fn main() { + /// let outdir = match env::var_os("OUT_DIR") { + /// None => return, + /// Some(outdir) => outdir, + /// }; + /// let mut app = build_cli(); + /// app.gen_completions("myapp", // We need to specify the bin name manually + /// Shell::Bash, // Then say which shell to build completions for + /// outdir); // Then say where write the completions to + /// } + /// ``` + /// Now, once we combile there will be a `{bin_name}.bash-completion` file in the directory. + /// Assuming we compiled with debug mode, it would be somewhere similar to + /// `/target/debug/build/myapp-/out/myapp.bash-completion`. + /// + /// Fish shell completions will use the file format `{bin_name}.fish` + pub fn gen_completions, S: Into>(&mut self, + bin_name: S, + for_shell: Shell, + out_dir: T) { + self.p.meta.bin_name = Some(bin_name.into()); + self.p.gen_completions(for_shell, out_dir.into()); + } + + + /// Generate a completions file for a specified shell at runtime. Until `cargo install` can + /// install extra files like a completion script, this may be used e.g. in a command that + /// outputs the contents of the completion script, to be redirected into a file by the user. + /// + /// # Examples + /// + /// Assuming a separate `cli.rs` like the [example above](./struct.App.html#method.gen_completions), + /// we can let users generate a completion script using a command: + /// + /// ```ignore + /// // src/main.rs + /// + /// mod cli; + /// use std::io; + /// + /// fn main() { + /// let matches = cli::build_cli().get_matches(); + /// + /// if matches.is_present("generate-bash-completions") { + /// cli::build_cli().gen_completions_to("myapp", Shell::Bash, &mut io::stdout()); + /// } + /// + /// // normal logic continues... + /// } + /// + /// ``` + /// + /// Usage: + /// + /// ```shell + /// $ myapp generate-bash-completions > /etc/bash_completion.d/myapp + /// ``` + pub fn gen_completions_to>(&mut self, + bin_name: S, + for_shell: Shell, + buf: &mut W) { + self.p.meta.bin_name = Some(bin_name.into()); + self.p.gen_completions_to(for_shell, buf); + } + + /// Starts the parsing process, upon a failed parse an error will be displayed to the user and + /// the process will exit with the appropriate error code. By default this method gets all user + /// provided arguments from [`env::args_os`] in order to allow for invalid UTF-8 code points, + /// which are legal on many platforms. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let matches = App::new("myprog") + /// // Args and options go here... + /// .get_matches(); + /// ``` + /// [`env::args_os`]: https://doc.rust-lang.org/std/env/fn.args_os.html + pub fn get_matches(self) -> ArgMatches<'a> { self.get_matches_from(&mut env::args_os()) } + + /// Starts the parsing process. This method will return a [`clap::Result`] type instead of exiting + /// the process on failed parse. By default this method gets matches from [`env::args_os`] + /// + /// **NOTE:** This method WILL NOT exit when `--help` or `--version` (or short versions) are + /// used. It will return a [`clap::Error`], where the [`kind`] is a + /// [`ErrorKind::HelpDisplayed`] or [`ErrorKind::VersionDisplayed`] respectively. You must call + /// [`Error::exit`] or perform a [`std::process::exit`]. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let matches = App::new("myprog") + /// // Args and options go here... + /// .get_matches_safe() + /// .unwrap_or_else( |e| e.exit() ); + /// ``` + /// [`env::args_os`]: https://doc.rust-lang.org/std/env/fn.args_os.html + /// [`ErrorKind::HelpDisplayed`]: ./enum.ErrorKind.html#variant.HelpDisplayed + /// [`ErrorKind::VersionDisplayed`]: ./enum.ErrorKind.html#variant.VersionDisplayed + /// [`Error::exit`]: ./struct.Error.html#method.exit + /// [`std::process::exit`]: https://doc.rust-lang.org/std/process/fn.exit.html + /// [`clap::Result`]: ./type.Result.html + /// [`clap::Error`]: ./struct.Error.html + /// [`kind`]: ./struct.Error.html + pub fn get_matches_safe(self) -> ClapResult> { + // Start the parsing + self.get_matches_from_safe(&mut env::args_os()) + } + + /// Starts the parsing process. Like [`App::get_matches`] this method does not return a [`clap::Result`] + /// and will automatically exit with an error message. This method, however, lets you specify + /// what iterator to use when performing matches, such as a [`Vec`] of your making. + /// + /// **NOTE:** The first argument will be parsed as the binary name unless + /// [`AppSettings::NoBinaryName`] is used + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let arg_vec = vec!["my_prog", "some", "args", "to", "parse"]; + /// + /// let matches = App::new("myprog") + /// // Args and options go here... + /// .get_matches_from(arg_vec); + /// ``` + /// [`App::get_matches`]: ./struct.App.html#method.get_matches + /// [`clap::Result`]: ./type.Result.html + /// [`Vec`]: https://doc.rust-lang.org/std/vec/struct.Vec.html + /// [`AppSettings::NoBinaryName`]: ./enum.AppSettings.html#variant.NoBinaryName + pub fn get_matches_from(mut self, itr: I) -> ArgMatches<'a> + where I: IntoIterator, + T: Into + Clone + { + self.get_matches_from_safe_borrow(itr).unwrap_or_else(|e| { + // Otherwise, write to stderr and exit + if e.use_stderr() { + wlnerr!("{}", e.message); + if self.p.is_set(AppSettings::WaitOnError) { + wlnerr!("\nPress [ENTER] / [RETURN] to continue..."); + let mut s = String::new(); + let i = io::stdin(); + i.lock().read_line(&mut s).unwrap(); + } + drop(self); + drop(e); + process::exit(1); + } + + drop(self); + e.exit() + }) + } + + /// Starts the parsing process. A combination of [`App::get_matches_from`], and + /// [`App::get_matches_safe`] + /// + /// **NOTE:** This method WILL NOT exit when `--help` or `--version` (or short versions) are + /// used. It will return a [`clap::Error`], where the [`kind`] is a [`ErrorKind::HelpDisplayed`] + /// or [`ErrorKind::VersionDisplayed`] respectively. You must call [`Error::exit`] or + /// perform a [`std::process::exit`] yourself. + /// + /// **NOTE:** The first argument will be parsed as the binary name unless + /// [`AppSettings::NoBinaryName`] is used + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let arg_vec = vec!["my_prog", "some", "args", "to", "parse"]; + /// + /// let matches = App::new("myprog") + /// // Args and options go here... + /// .get_matches_from_safe(arg_vec) + /// .unwrap_or_else( |e| { panic!("An error occurs: {}", e) }); + /// ``` + /// [`App::get_matches_from`]: ./struct.App.html#method.get_matches_from + /// [`App::get_matches_safe`]: ./struct.App.html#method.get_matches_safe + /// [`ErrorKind::HelpDisplayed`]: ./enum.ErrorKind.html#variant.HelpDisplayed + /// [`ErrorKind::VersionDisplayed`]: ./enum.ErrorKind.html#variant.VersionDisplayed + /// [`Error::exit`]: ./struct.Error.html#method.exit + /// [`std::process::exit`]: https://doc.rust-lang.org/std/process/fn.exit.html + /// [`clap::Error`]: ./struct.Error.html + /// [`Error::exit`]: ./struct.Error.html#method.exit + /// [`kind`]: ./struct.Error.html + /// [`AppSettings::NoBinaryName`]: ./enum.AppSettings.html#variant.NoBinaryName + pub fn get_matches_from_safe(mut self, itr: I) -> ClapResult> + where I: IntoIterator, + T: Into + Clone + { + self.get_matches_from_safe_borrow(itr) + } + + /// Starts the parsing process without consuming the [`App`] struct `self`. This is normally not + /// the desired functionality, instead prefer [`App::get_matches_from_safe`] which *does* + /// consume `self`. + /// + /// **NOTE:** The first argument will be parsed as the binary name unless + /// [`AppSettings::NoBinaryName`] is used + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg}; + /// let arg_vec = vec!["my_prog", "some", "args", "to", "parse"]; + /// + /// let mut app = App::new("myprog"); + /// // Args and options go here... + /// let matches = app.get_matches_from_safe_borrow(arg_vec) + /// .unwrap_or_else( |e| { panic!("An error occurs: {}", e) }); + /// ``` + /// [`App`]: ./struct.App.html + /// [`App::get_matches_from_safe`]: ./struct.App.html#method.get_matches_from_safe + /// [`AppSettings::NoBinaryName`]: ./enum.AppSettings.html#variant.NoBinaryName + pub fn get_matches_from_safe_borrow(&mut self, itr: I) -> ClapResult> + where I: IntoIterator, + T: Into + Clone + { + // If there are global arguments, or settings we need to propgate them down to subcommands + // before parsing incase we run into a subcommand + if !self.p.is_set(AppSettings::Propagated) { + self.p.propagate_globals(); + self.p.propagate_settings(); + self.p.derive_display_order(); + self.p.set(AppSettings::Propagated); + } + + let mut matcher = ArgMatcher::new(); + + let mut it = itr.into_iter(); + // Get the name of the program (argument 1 of env::args()) and determine the + // actual file + // that was used to execute the program. This is because a program called + // ./target/release/my_prog -a + // will have two arguments, './target/release/my_prog', '-a' but we don't want + // to display + // the full path when displaying help messages and such + if !self.p.is_set(AppSettings::NoBinaryName) { + if let Some(name) = it.next() { + let bn_os = name.into(); + let p = Path::new(&*bn_os); + if let Some(f) = p.file_name() { + if let Some(s) = f.to_os_string().to_str() { + if self.p.meta.bin_name.is_none() { + self.p.meta.bin_name = Some(s.to_owned()); + } + } + } + } + } + + // do the real parsing + if let Err(e) = self.p.get_matches_with(&mut matcher, &mut it.peekable()) { + return Err(e); + } + + let global_arg_vec : Vec<&str> = (&self).p.global_args.iter().map(|ga| ga.b.name).collect(); + matcher.propagate_globals(&global_arg_vec); + + Ok(matcher.into()) + } +} + +#[cfg(feature = "yaml")] +impl<'a> From<&'a Yaml> for App<'a, 'a> { + fn from(mut yaml: &'a Yaml) -> Self { + use args::SubCommand; + // We WANT this to panic on error...so expect() is good. + let mut is_sc = None; + let mut a = if let Some(name) = yaml["name"].as_str() { + App::new(name) + } else { + let yaml_hash = yaml.as_hash().unwrap(); + let sc_key = yaml_hash.keys().nth(0).unwrap(); + is_sc = Some(yaml_hash.get(sc_key).unwrap()); + App::new(sc_key.as_str().unwrap()) + }; + yaml = if let Some(sc) = is_sc { sc } else { yaml }; + + macro_rules! yaml_str { + ($a:ident, $y:ident, $i:ident) => { + if let Some(v) = $y[stringify!($i)].as_str() { + $a = $a.$i(v); + } else if $y[stringify!($i)] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to a string", $y[stringify!($i)]); + } + }; + } + + yaml_str!(a, yaml, version); + yaml_str!(a, yaml, author); + yaml_str!(a, yaml, bin_name); + yaml_str!(a, yaml, about); + yaml_str!(a, yaml, before_help); + yaml_str!(a, yaml, after_help); + yaml_str!(a, yaml, template); + yaml_str!(a, yaml, usage); + yaml_str!(a, yaml, help); + yaml_str!(a, yaml, help_short); + yaml_str!(a, yaml, version_short); + yaml_str!(a, yaml, help_message); + yaml_str!(a, yaml, version_message); + yaml_str!(a, yaml, alias); + yaml_str!(a, yaml, visible_alias); + + if let Some(v) = yaml["display_order"].as_i64() { + a = a.display_order(v as usize); + } else if yaml["display_order"] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to a u64", + yaml["display_order"]); + } + if let Some(v) = yaml["setting"].as_str() { + a = a.setting(v.parse().expect("unknown AppSetting found in YAML file")); + } else if yaml["setting"] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to an AppSetting", + yaml["setting"]); + } + if let Some(v) = yaml["settings"].as_vec() { + for ys in v { + if let Some(s) = ys.as_str() { + a = a.setting(s.parse().expect("unknown AppSetting found in YAML file")); + } + } + } else if let Some(v) = yaml["settings"].as_str() { + a = a.setting(v.parse().expect("unknown AppSetting found in YAML file")); + } else if yaml["settings"] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to a string", + yaml["settings"]); + } + if let Some(v) = yaml["global_setting"].as_str() { + a = a.setting(v.parse().expect("unknown AppSetting found in YAML file")); + } else if yaml["global_setting"] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to an AppSetting", + yaml["setting"]); + } + if let Some(v) = yaml["global_settings"].as_vec() { + for ys in v { + if let Some(s) = ys.as_str() { + a = a.global_setting(s.parse() + .expect("unknown AppSetting found in YAML file")); + } + } + } else if let Some(v) = yaml["global_settings"].as_str() { + a = a.global_setting(v.parse().expect("unknown AppSetting found in YAML file")); + } else if yaml["global_settings"] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to a string", + yaml["global_settings"]); + } + + macro_rules! vec_or_str { + ($a:ident, $y:ident, $as_vec:ident, $as_single:ident) => {{ + let maybe_vec = $y[stringify!($as_vec)].as_vec(); + if let Some(vec) = maybe_vec { + for ys in vec { + if let Some(s) = ys.as_str() { + $a = $a.$as_single(s); + } else { + panic!("Failed to convert YAML value {:?} to a string", ys); + } + } + } else { + if let Some(s) = $y[stringify!($as_vec)].as_str() { + $a = $a.$as_single(s); + } else if $y[stringify!($as_vec)] != Yaml::BadValue { + panic!("Failed to convert YAML value {:?} to either a vec or string", $y[stringify!($as_vec)]); + } + } + $a + } + }; + } + + a = vec_or_str!(a, yaml, aliases, alias); + a = vec_or_str!(a, yaml, visible_aliases, visible_alias); + + if let Some(v) = yaml["args"].as_vec() { + for arg_yaml in v { + a = a.arg(Arg::from_yaml(arg_yaml.as_hash().unwrap())); + } + } + if let Some(v) = yaml["subcommands"].as_vec() { + for sc_yaml in v { + a = a.subcommand(SubCommand::from_yaml(sc_yaml)); + } + } + if let Some(v) = yaml["groups"].as_vec() { + for ag_yaml in v { + a = a.group(ArgGroup::from(ag_yaml.as_hash().unwrap())); + } + } + + a + } +} + +impl<'a, 'b> Clone for App<'a, 'b> { + fn clone(&self) -> Self { App { p: self.p.clone() } } +} + +impl<'n, 'e> AnyArg<'n, 'e> for App<'n, 'e> { + fn name(&self) -> &'n str { + unreachable!("App struct does not support AnyArg::name, this is a bug!") + } + fn overrides(&self) -> Option<&[&'e str]> { None } + fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]> { None } + fn blacklist(&self) -> Option<&[&'e str]> { None } + fn required_unless(&self) -> Option<&[&'e str]> { None } + fn val_names(&self) -> Option<&VecMap<&'e str>> { None } + fn is_set(&self, _: ArgSettings) -> bool { false } + fn val_terminator(&self) -> Option<&'e str> { None } + fn set(&mut self, _: ArgSettings) { + unreachable!("App struct does not support AnyArg::set, this is a bug!") + } + fn has_switch(&self) -> bool { false } + fn max_vals(&self) -> Option { None } + fn num_vals(&self) -> Option { None } + fn possible_vals(&self) -> Option<&[&'e str]> { None } + fn validator(&self) -> Option<&Rc StdResult<(), String>>> { None } + fn validator_os(&self) -> Option<&Rc StdResult<(), OsString>>> { None } + fn min_vals(&self) -> Option { None } + fn short(&self) -> Option { None } + fn long(&self) -> Option<&'e str> { None } + fn val_delim(&self) -> Option { None } + fn takes_value(&self) -> bool { true } + fn help(&self) -> Option<&'e str> { self.p.meta.about } + fn long_help(&self) -> Option<&'e str> { self.p.meta.long_about } + fn default_val(&self) -> Option<&'e OsStr> { None } + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + None + } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { None } + fn longest_filter(&self) -> bool { true } + fn aliases(&self) -> Option> { + if let Some(ref aliases) = self.p.meta.aliases { + let vis_aliases: Vec<_> = + aliases.iter().filter_map(|&(n, v)| if v { Some(n) } else { None }).collect(); + if vis_aliases.is_empty() { + None + } else { + Some(vis_aliases) + } + } else { + None + } + } +} + +impl<'n, 'e> fmt::Display for App<'n, 'e> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.p.meta.name) } +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/parser.rs b/vendor/registry-40351f815f426200/clap/src/app/parser.rs new file mode 100644 index 000000000..dafcf076a --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/parser.rs @@ -0,0 +1,1941 @@ +// Std +use std::ffi::{OsStr, OsString}; +use std::fmt::Display; +use std::fs::File; +use std::io::{self, BufWriter, Write}; +#[cfg(feature = "debug")] +use std::os::unix::ffi::OsStrExt; +use std::path::PathBuf; +use std::slice::Iter; +use std::iter::Peekable; + +// Internal +use INTERNAL_ERROR_MSG; +use INVALID_UTF8; +use SubCommand; +use app::App; +use app::help::Help; +use app::meta::AppMeta; +use app::settings::AppFlags; +use args::{AnyArg, ArgMatcher, Base, Switched, Arg, ArgGroup, FlagBuilder, OptBuilder, PosBuilder}; +use args::settings::ArgSettings; +use completions::ComplGen; +use errors::{Error, ErrorKind}; +use errors::Result as ClapResult; +use fmt::ColorWhen; +use osstringext::OsStrExt2; +use completions::Shell; +use suggestions; +use app::settings::AppSettings as AS; +use app::validator::Validator; +use app::usage; +use map::{self, VecMap}; + +#[derive(Debug, PartialEq, Copy, Clone)] +#[doc(hidden)] +pub enum ParseResult<'a> { + Flag, + Opt(&'a str), + Pos(&'a str), + MaybeHyphenValue, + MaybeNegNum, + NotFound, + ValuesDone, +} + +#[allow(missing_debug_implementations)] +#[doc(hidden)] +#[derive(Clone, Default)] +pub struct Parser<'a, 'b> + where 'a: 'b +{ + pub meta: AppMeta<'b>, + settings: AppFlags, + pub g_settings: AppFlags, + pub flags: Vec>, + pub opts: Vec>, + pub positionals: VecMap>, + pub subcommands: Vec>, + pub groups: Vec>, + pub global_args: Vec>, + pub required: Vec<&'a str>, + pub r_ifs: Vec<(&'a str, &'b str, &'a str)>, + pub blacklist: Vec<&'b str>, + pub overrides: Vec<&'b str>, + help_short: Option, + version_short: Option, + cache: Option<&'a str>, + pub help_message: Option<&'a str>, + pub version_message: Option<&'a str>, +} + +impl<'a, 'b> Parser<'a, 'b> + where 'a: 'b +{ + pub fn with_name(n: String) -> Self { + Parser { + meta: AppMeta::with_name(n), + ..Default::default() + } + } + + pub fn help_short(&mut self, s: &str) { + let c = s.trim_left_matches(|c| c == '-') + .chars() + .nth(0) + .unwrap_or('h'); + self.help_short = Some(c); + } + + pub fn version_short(&mut self, s: &str) { + let c = s.trim_left_matches(|c| c == '-') + .chars() + .nth(0) + .unwrap_or('V'); + self.version_short = Some(c); + } + + pub fn gen_completions_to(&mut self, for_shell: Shell, buf: &mut W) { + if !self.is_set(AS::Propagated) { + self.propagate_help_version(); + self.build_bin_names(); + self.propagate_globals(); + self.propagate_settings(); + self.set(AS::Propagated); + } + + ComplGen::new(self).generate(for_shell, buf) + } + + pub fn gen_completions(&mut self, for_shell: Shell, od: OsString) { + use std::error::Error; + + let out_dir = PathBuf::from(od); + let name = &*self.meta.bin_name.as_ref().unwrap().clone(); + let file_name = match for_shell { + Shell::Bash => format!("{}.bash-completion", name), + Shell::Fish => format!("{}.fish", name), + Shell::Zsh => format!("_{}", name), + Shell::PowerShell => format!("_{}.ps1", name), + }; + + let mut file = match File::create(out_dir.join(file_name)) { + Err(why) => panic!("couldn't create completion file: {}", why.description()), + Ok(file) => file, + }; + self.gen_completions_to(for_shell, &mut file) + } + + #[inline] + fn app_debug_asserts(&mut self) -> bool { + assert!(self.verify_positionals()); + let should_err = self.groups + .iter() + .all(|g| { + g.args + .iter() + .all(|arg| { + (self.flags.iter().any(|f| &f.b.name == arg) || + self.opts.iter().any(|o| &o.b.name == arg) || + self.positionals.values().any(|p| &p.b.name == arg) || + self.groups.iter().any(|g| &g.name == arg)) + }) + }); + let g = self.groups + .iter() + .find(|g| { + g.args + .iter() + .any(|arg| { + !(self.flags.iter().any(|f| &f.b.name == arg) || + self.opts.iter().any(|o| &o.b.name == arg) || + self.positionals.values().any(|p| &p.b.name == arg) || + self.groups.iter().any(|g| &g.name == arg)) + }) + }); + assert!(should_err, + "The group '{}' contains the arg '{}' that doesn't actually exist.", + g.unwrap().name, + g.unwrap() + .args + .iter() + .find(|arg| { + !(self.flags.iter().any(|f| &&f.b.name == arg) || + self.opts.iter().any(|o| &&o.b.name == arg) || + self.positionals.values().any(|p| &&p.b.name == arg) || + self.groups.iter().any(|g| &&g.name == arg)) + }) + .unwrap()); + true + } + + #[inline] + fn debug_asserts(&self, a: &Arg) -> bool { + assert!(!arg_names!(self).any(|name| name == a.b.name), + format!("Non-unique argument name: {} is already in use", a.b.name)); + if let Some(l) = a.s.long { + assert!(!self.contains_long(l), + "Argument long must be unique\n\n\t--{} is already in use", + l); + } + if let Some(s) = a.s.short { + assert!(!self.contains_short(s), + "Argument short must be unique\n\n\t-{} is already in use", + s); + } + let i = if a.index.is_none() { + (self.positionals.len() + 1) + } else { + a.index.unwrap() as usize + }; + assert!(!self.positionals.contains_key(i), + "Argument \"{}\" has the same index as another positional \ + argument\n\n\tPerhaps try .multiple(true) to allow one positional argument \ + to take multiple values", + a.b.name); + assert!(!(a.is_set(ArgSettings::Required) && a.is_set(ArgSettings::Global)), + "Global arguments cannot be required.\n\n\t'{}' is marked as \ + global and required", + a.b.name); + if a.b.is_set(ArgSettings::Last) { + assert!(!self.positionals + .values() + .any(|p| p.b.is_set(ArgSettings::Last)), + "Only one positional argument may have last(true) set. Found two."); + assert!(a.s.long.is_none(), + "Flags or Options may not have last(true) set. {} has both a long and last(true) set.", + a.b.name); + assert!(a.s.short.is_none(), + "Flags or Options may not have last(true) set. {} has both a short and last(true) set.", + a.b.name); + } + true + } + + #[inline] + fn add_conditional_reqs(&mut self, a: &Arg<'a, 'b>) { + if let Some(ref r_ifs) = a.r_ifs { + for &(arg, val) in r_ifs { + self.r_ifs.push((arg, val, a.b.name)); + } + } + } + + #[inline] + fn add_arg_groups(&mut self, a: &Arg<'a, 'b>) { + if let Some(ref grps) = a.b.groups { + for g in grps { + let mut found = false; + if let Some(ref mut ag) = self.groups.iter_mut().find(|grp| &grp.name == g) { + ag.args.push(a.b.name); + found = true; + } + if !found { + let mut ag = ArgGroup::with_name(g); + ag.args.push(a.b.name); + self.groups.push(ag); + } + } + } + } + + #[inline] + fn add_reqs(&mut self, a: &Arg<'a, 'b>) { + if a.is_set(ArgSettings::Required) { + // If the arg is required, add all it's requirements to master required list + if let Some(ref areqs) = a.b.requires { + for name in areqs + .iter() + .filter(|&&(val, _)| val.is_none()) + .map(|&(_, name)| name) { + self.required.push(name); + } + } + self.required.push(a.b.name); + } + } + + #[inline] + fn implied_settings(&mut self, a: &Arg<'a, 'b>) { + if a.is_set(ArgSettings::Last) { + // if an arg has `Last` set, we need to imply DontCollapseArgsInUsage so that args + // in the usage string don't get confused or left out. + self.set(AS::DontCollapseArgsInUsage); + self.set(AS::ContainsLast); + } + if let Some(l) = a.s.long { + if l == "version" { + self.unset(AS::NeedsLongVersion); + } else if l == "help" { + self.unset(AS::NeedsLongHelp); + } + } + } + + // actually adds the arguments + pub fn add_arg(&mut self, a: Arg<'a, 'b>) { + // if it's global we have to clone anyways + if a.is_set(ArgSettings::Global) { + return self.add_arg_ref(&a); + } + debug_assert!(self.debug_asserts(&a)); + self.add_conditional_reqs(&a); + self.add_arg_groups(&a); + self.add_reqs(&a); + self.implied_settings(&a); + if a.index.is_some() || (a.s.short.is_none() && a.s.long.is_none()) { + let i = if a.index.is_none() { + (self.positionals.len() + 1) + } else { + a.index.unwrap() as usize + }; + self.positionals + .insert(i, PosBuilder::from_arg(a, i as u64)); + } else if a.is_set(ArgSettings::TakesValue) { + let mut ob = OptBuilder::from(a); + ob.s.unified_ord = self.flags.len() + self.opts.len(); + self.opts.push(ob); + } else { + let mut fb = FlagBuilder::from(a); + fb.s.unified_ord = self.flags.len() + self.opts.len(); + self.flags.push(fb); + } + } + // actually adds the arguments but from a borrow (which means we have to do some clonine) + pub fn add_arg_ref(&mut self, a: &Arg<'a, 'b>) { + debug_assert!(self.debug_asserts(a)); + self.add_conditional_reqs(a); + self.add_arg_groups(a); + self.add_reqs(a); + self.implied_settings(a); + if a.index.is_some() || (a.s.short.is_none() && a.s.long.is_none()) { + let i = if a.index.is_none() { + (self.positionals.len() + 1) + } else { + a.index.unwrap() as usize + }; + let pb = PosBuilder::from_arg_ref(a, i as u64); + self.positionals.insert(i, pb); + } else if a.is_set(ArgSettings::TakesValue) { + let mut ob = OptBuilder::from(a); + ob.s.unified_ord = self.flags.len() + self.opts.len(); + self.opts.push(ob); + } else { + let mut fb = FlagBuilder::from(a); + fb.s.unified_ord = self.flags.len() + self.opts.len(); + self.flags.push(fb); + } + if a.is_set(ArgSettings::Global) { + self.global_args.push(a.into()); + } + } + + pub fn add_group(&mut self, group: ArgGroup<'a>) { + if group.required { + self.required.push(group.name); + if let Some(ref reqs) = group.requires { + self.required.extend_from_slice(reqs); + } + if let Some(ref bl) = group.conflicts { + self.blacklist.extend_from_slice(bl); + } + } + if self.groups.iter().any(|g| g.name == group.name) { + let grp = self.groups + .iter_mut() + .find(|g| g.name == group.name) + .expect(INTERNAL_ERROR_MSG); + grp.args.extend_from_slice(&group.args); + grp.requires = group.requires.clone(); + grp.conflicts = group.conflicts.clone(); + grp.required = group.required; + } else { + self.groups.push(group); + } + } + + pub fn add_subcommand(&mut self, mut subcmd: App<'a, 'b>) { + debugln!("Parser::add_subcommand: term_w={:?}, name={}", + self.meta.term_w, + subcmd.p.meta.name); + subcmd.p.meta.term_w = self.meta.term_w; + if subcmd.p.meta.name == "help" { + self.unset(AS::NeedsSubcommandHelp); + } + + self.subcommands.push(subcmd); + } + + pub fn propagate_settings(&mut self) { + debugln!("Parser::propagate_settings: self={}, g_settings={:#?}", + self.meta.name, + self.g_settings); + for sc in &mut self.subcommands { + debugln!("Parser::propagate_settings: sc={}, settings={:#?}, g_settings={:#?}", + sc.p.meta.name, + sc.p.settings, + sc.p.g_settings); + // We have to create a new scope in order to tell rustc the borrow of `sc` is + // done and to recursively call this method + { + let vsc = self.settings.is_set(AS::VersionlessSubcommands); + let gv = self.settings.is_set(AS::GlobalVersion); + + if vsc { + sc.p.set(AS::DisableVersion); + } + if gv && sc.p.meta.version.is_none() && self.meta.version.is_some() { + sc.p.set(AS::GlobalVersion); + sc.p.meta.version = Some(self.meta.version.unwrap()); + } + sc.p.settings = sc.p.settings | self.g_settings; + sc.p.g_settings = sc.p.g_settings | self.g_settings; + sc.p.meta.term_w = self.meta.term_w; + sc.p.meta.max_w = self.meta.max_w; + } + sc.p.propagate_settings(); + } + } + + #[cfg_attr(feature = "lints", allow(needless_borrow))] + pub fn derive_display_order(&mut self) { + if self.is_set(AS::DeriveDisplayOrder) { + let unified = self.is_set(AS::UnifiedHelpMessage); + for (i, o) in self.opts + .iter_mut() + .enumerate() + .filter(|&(_, ref o)| o.s.disp_ord == 999) { + o.s.disp_ord = if unified { o.s.unified_ord } else { i }; + } + for (i, f) in self.flags + .iter_mut() + .enumerate() + .filter(|&(_, ref f)| f.s.disp_ord == 999) { + f.s.disp_ord = if unified { f.s.unified_ord } else { i }; + } + for (i, sc) in &mut self.subcommands + .iter_mut() + .enumerate() + .filter(|&(_, ref sc)| sc.p.meta.disp_ord == 999) { + sc.p.meta.disp_ord = i; + } + } + for sc in &mut self.subcommands { + sc.p.derive_display_order(); + } + } + + pub fn required(&self) -> Iter<&str> { self.required.iter() } + + #[cfg_attr(feature = "lints", allow(needless_borrow))] + #[inline] + pub fn has_args(&self) -> bool { + !(self.flags.is_empty() && self.opts.is_empty() && self.positionals.is_empty()) + } + + #[inline] + pub fn has_opts(&self) -> bool { !self.opts.is_empty() } + + #[inline] + pub fn has_flags(&self) -> bool { !self.flags.is_empty() } + + #[inline] + pub fn has_positionals(&self) -> bool { !self.positionals.is_empty() } + + #[inline] + pub fn has_subcommands(&self) -> bool { !self.subcommands.is_empty() } + + #[inline] + pub fn has_visible_opts(&self) -> bool { + if self.opts.is_empty() { + return false; + } + self.opts.iter().any(|o| !o.is_set(ArgSettings::Hidden)) + } + + #[inline] + pub fn has_visible_flags(&self) -> bool { + if self.flags.is_empty() { + return false; + } + self.flags.iter().any(|f| !f.is_set(ArgSettings::Hidden)) + } + + #[inline] + pub fn has_visible_positionals(&self) -> bool { + if self.positionals.is_empty() { + return false; + } + self.positionals + .values() + .any(|p| !p.is_set(ArgSettings::Hidden)) + } + + #[inline] + pub fn has_visible_subcommands(&self) -> bool { + self.has_subcommands() && self.subcommands.iter().filter(|sc| sc.p.meta.name != "help").any(|sc| !sc.p.is_set(AS::Hidden)) + } + + #[inline] + pub fn is_set(&self, s: AS) -> bool { self.settings.is_set(s) } + + #[inline] + pub fn set(&mut self, s: AS) { self.settings.set(s) } + + #[inline] + pub fn unset(&mut self, s: AS) { self.settings.unset(s) } + + #[cfg_attr(feature = "lints", allow(block_in_if_condition_stmt))] + pub fn verify_positionals(&mut self) -> bool { + // Because you must wait until all arguments have been supplied, this is the first chance + // to make assertions on positional argument indexes + // + // Firt we verify that the index highest supplied index, is equal to the number of + // positional arguments to verify there are no gaps (i.e. supplying an index of 1 and 3 + // but no 2) + if let Some((idx, p)) = self.positionals.iter().rev().next() { + assert!(!(idx != self.positionals.len()), + "Found positional argument \"{}\" whose index is {} but there \ + are only {} positional arguments defined", + p.b.name, + idx, + self.positionals.len()); + } + + // Next we verify that only the highest index has a .multiple(true) (if any) + if self.positionals + .values() + .any(|a| { + a.b.is_set(ArgSettings::Multiple) && + (a.index as usize != self.positionals.len()) + }) { + let mut it = self.positionals.values().rev(); + let last = it.next().unwrap(); + let second_to_last = it.next().unwrap(); + // Either the final positional is required + // Or the second to last has a terminator or .last(true) set + let ok = last.is_set(ArgSettings::Required) || + (second_to_last.v.terminator.is_some() || + second_to_last.b.is_set(ArgSettings::Last)) || + last.is_set(ArgSettings::Last); + assert!(ok, + "When using a positional argument with .multiple(true) that is *not the \ + last* positional argument, the last positional argument (i.e the one \ + with the highest index) *must* have .required(true) or .last(true) set."); + let ok = second_to_last.is_set(ArgSettings::Multiple) || last.is_set(ArgSettings::Last); + assert!(ok, + "Only the last positional argument, or second to last positional \ + argument may be set to .multiple(true)"); + + let count = self.positionals + .values() + .filter(|p| p.b.settings.is_set(ArgSettings::Multiple) && p.v.num_vals.is_none()) + .count(); + let ok = count <= 1 || + (last.is_set(ArgSettings::Last) && last.is_set(ArgSettings::Multiple) && + second_to_last.is_set(ArgSettings::Multiple) && + count == 2); + assert!(ok, + "Only one positional argument with .multiple(true) set is allowed per \ + command, unless the second one also has .last(true) set"); + } + + + if self.is_set(AS::AllowMissingPositional) { + // Check that if a required positional argument is found, all positions with a lower + // index are also required. + let mut found = false; + let mut foundx2 = false; + for p in self.positionals.values().rev() { + if foundx2 && !p.b.settings.is_set(ArgSettings::Required) { + assert!(p.b.is_set(ArgSettings::Required), + "Found positional argument which is not required with a lower \ + index than a required positional argument by two or more: {:?} \ + index {}", + p.b.name, + p.index); + } else if p.b.is_set(ArgSettings::Required) && !p.b.is_set(ArgSettings::Last) { + // Args that .last(true) don't count since they can be required and have + // positionals with a lower index that aren't required + // Imagine: prog [opt1] -- + // Both of these are valid invocations: + // $ prog r1 -- r2 + // $ prog r1 o1 -- r2 + if found { + foundx2 = true; + continue; + } + found = true; + continue; + } else { + found = false; + } + } + } else { + // Check that if a required positional argument is found, all positions with a lower + // index are also required + let mut found = false; + for p in self.positionals.values().rev() { + if found { + assert!(p.b.is_set(ArgSettings::Required), + "Found positional argument which is not required with a lower \ + index than a required positional argument: {:?} index {}", + p.b.name, + p.index); + } else if p.b.is_set(ArgSettings::Required) && !p.b.is_set(ArgSettings::Last) { + // Args that .last(true) don't count since they can be required and have + // positionals with a lower index that aren't required + // Imagine: prog [opt1] -- + // Both of these are valid invocations: + // $ prog r1 -- r2 + // $ prog r1 o1 -- r2 + found = true; + continue; + } + } + } + if self.positionals + .values() + .any(|p| { + p.b.is_set(ArgSettings::Last) && p.b.is_set(ArgSettings::Required) + }) && self.has_subcommands() && + !self.is_set(AS::SubcommandsNegateReqs) { + panic!("Having a required positional argument with .last(true) set *and* child \ + subcommands without setting SubcommandsNegateReqs isn't compatible."); + } + + true + } + + pub fn propagate_globals(&mut self) { + for sc in &mut self.subcommands { + // We have to create a new scope in order to tell rustc the borrow of `sc` is + // done and to recursively call this method + { + for a in &self.global_args { + sc.p.add_arg_ref(a); + } + } + sc.p.propagate_globals(); + } + } + + // Checks if the arg matches a subcommand name, or any of it's aliases (if defined) + fn possible_subcommand(&self, arg_os: &OsStr) -> (bool, Option<&str>) { + debugln!("Parser::possible_subcommand: arg={:?}", arg_os); + fn starts(h: &str, n: &OsStr) -> bool { + #[cfg(not(target_os = "windows"))] + use std::os::unix::ffi::OsStrExt; + #[cfg(target_os = "windows")] + use osstringext::OsStrExt3; + + let n_bytes = n.as_bytes(); + let h_bytes = OsStr::new(h).as_bytes(); + + h_bytes.starts_with(n_bytes) + } + + if self.is_set(AS::ArgsNegateSubcommands) && self.is_set(AS::ValidArgFound) { + return (false, None); + } + if !self.is_set(AS::InferSubcommands) { + if let Some(sc) = find_subcmd!(self, arg_os) { + return (true, Some(&sc.p.meta.name)); + } + } else { + let v = self.subcommands + .iter() + .filter(|s| { + starts(&s.p.meta.name[..], &*arg_os) || + (s.p.meta.aliases.is_some() && + s.p + .meta + .aliases + .as_ref() + .unwrap() + .iter() + .filter(|&&(a, _)| starts(a, &*arg_os)) + .count() == 1) + }) + .map(|sc| &sc.p.meta.name) + .collect::>(); + + if v.len() == 1 { + return (true, Some(v[0])); + } + } + (false, None) + } + + fn parse_help_subcommand(&self, it: &mut I) -> ClapResult> + where I: Iterator, + T: Into + { + debugln!("Parser::parse_help_subcommand;"); + let cmds: Vec = it.map(|c| c.into()).collect(); + let mut help_help = false; + let mut bin_name = self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name) + .clone(); + let mut sc = { + let mut sc: &Parser = self; + for (i, cmd) in cmds.iter().enumerate() { + if &*cmd.to_string_lossy() == "help" { + // cmd help help + help_help = true; + } + if let Some(c) = sc.subcommands + .iter() + .find(|s| &*s.p.meta.name == cmd) + .map(|sc| &sc.p) { + sc = c; + if i == cmds.len() - 1 { + break; + } + } else if let Some(c) = sc.subcommands + .iter() + .find(|s| if let Some(ref als) = s.p.meta.aliases { + als.iter().any(|&(a, _)| a == &*cmd.to_string_lossy()) + } else { + false + }) + .map(|sc| &sc.p) { + sc = c; + if i == cmds.len() - 1 { + break; + } + } else { + return Err(Error::unrecognized_subcommand(cmd.to_string_lossy().into_owned(), + self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name), + self.color())); + } + bin_name = format!("{} {}", bin_name, &*sc.meta.name); + } + sc.clone() + }; + if help_help { + let mut pb = PosBuilder::new("subcommand", 1); + pb.b.help = Some("The subcommand whose help message to display"); + pb.set(ArgSettings::Multiple); + sc.positionals.insert(1, pb); + sc.settings = sc.settings | self.g_settings; + } else { + sc.create_help_and_version(); + } + if sc.meta.bin_name != self.meta.bin_name { + sc.meta.bin_name = Some(format!("{} {}", bin_name, sc.meta.name)); + } + Err(sc._help(false)) + } + + // allow wrong self convention due to self.valid_neg_num = true and it's a private method + #[cfg_attr(feature = "lints", allow(wrong_self_convention))] + fn is_new_arg(&mut self, arg_os: &OsStr, needs_val_of: ParseResult<'a>) -> bool { + debugln!("Parser::is_new_arg: arg={:?}, Needs Val of={:?}", + arg_os, + needs_val_of); + let app_wide_settings = if self.is_set(AS::AllowLeadingHyphen) { + true + } else if self.is_set(AS::AllowNegativeNumbers) { + let a = arg_os.to_string_lossy(); + if a.parse::().is_ok() || a.parse::().is_ok() { + self.set(AS::ValidNegNumFound); + true + } else { + false + } + } else { + false + }; + let arg_allows_tac = match needs_val_of { + ParseResult::Opt(name) => { + let o = self.opts + .iter() + .find(|o| o.b.name == name) + .expect(INTERNAL_ERROR_MSG); + (o.is_set(ArgSettings::AllowLeadingHyphen) || app_wide_settings) + } + ParseResult::Pos(name) => { + let p = self.positionals + .values() + .find(|p| p.b.name == name) + .expect(INTERNAL_ERROR_MSG); + (p.is_set(ArgSettings::AllowLeadingHyphen) || app_wide_settings) + } + _ => false, + }; + debugln!("Parser::is_new_arg: Arg::allow_leading_hyphen({:?})", + arg_allows_tac); + + // Is this a new argument, or values from a previous option? + let mut ret = if arg_os.starts_with(b"--") { + debugln!("Parser::is_new_arg: -- found"); + if arg_os.len_() == 2 && !arg_allows_tac { + return true; // We have to return true so override everything else + } else if arg_allows_tac { + return false; + } + true + } else if arg_os.starts_with(b"-") { + debugln!("Parser::is_new_arg: - found"); + // a singe '-' by itself is a value and typically means "stdin" on unix systems + !(arg_os.len_() == 1) + } else { + debugln!("Parser::is_new_arg: probably value"); + false + }; + + ret = ret && !arg_allows_tac; + + debugln!("Parser::is_new_arg: starts_new_arg={:?}", ret); + ret + } + + // The actual parsing function + #[cfg_attr(feature = "lints", allow(while_let_on_iterator, collapsible_if))] + pub fn get_matches_with(&mut self, + matcher: &mut ArgMatcher<'a>, + it: &mut Peekable) + -> ClapResult<()> + where I: Iterator, + T: Into + Clone + { + debugln!("Parser::get_matches_with;"); + // Verify all positional assertions pass + debug_assert!(self.app_debug_asserts()); + if self.positionals + .values() + .any(|a| { + a.b.is_set(ArgSettings::Multiple) && + (a.index as usize != self.positionals.len()) + }) && + self.positionals + .values() + .last() + .map_or(false, |p| !p.is_set(ArgSettings::Last)) { + self.settings.set(AS::LowIndexMultiplePositional); + } + let has_args = self.has_args(); + + // Next we create the `--help` and `--version` arguments and add them if + // necessary + self.create_help_and_version(); + + let mut subcmd_name: Option = None; + let mut needs_val_of: ParseResult<'a> = ParseResult::NotFound; + let mut pos_counter = 1; + while let Some(arg) = it.next() { + let arg_os = arg.into(); + debugln!("Parser::get_matches_with: Begin parsing '{:?}' ({:?})", + arg_os, + &*arg_os.as_bytes()); + + self.unset(AS::ValidNegNumFound); + // Is this a new argument, or values from a previous option? + let starts_new_arg = self.is_new_arg(&arg_os, needs_val_of); + if arg_os.starts_with(b"--") && arg_os.len_() == 2 && starts_new_arg { + debugln!("Parser::get_matches_with: setting TrailingVals=true"); + self.set(AS::TrailingValues); + continue; + } + + // Has the user already passed '--'? Meaning only positional args follow + if !self.is_set(AS::TrailingValues) { + // Does the arg match a subcommand name, or any of it's aliases (if defined) + { + match needs_val_of { + ParseResult::Opt(_) | ParseResult::Pos(_) =>(), + _ => { + let (is_match, sc_name) = self.possible_subcommand(&arg_os); + debugln!("Parser::get_matches_with: possible_sc={:?}, sc={:?}", + is_match, + sc_name); + if is_match { + let sc_name = sc_name.expect(INTERNAL_ERROR_MSG); + if sc_name == "help" && self.is_set(AS::NeedsSubcommandHelp) { + self.parse_help_subcommand(it)?; + } + subcmd_name = Some(sc_name.to_owned()); + break; + } + } + } + } + + if !starts_new_arg { + if let ParseResult::Opt(name) = needs_val_of { + // Check to see if parsing a value from a previous arg + let arg = self.opts + .iter() + .find(|o| o.b.name == name) + .expect(INTERNAL_ERROR_MSG); + // get the OptBuilder so we can check the settings + needs_val_of = self.add_val_to_arg(arg, &arg_os, matcher)?; + // get the next value from the iterator + continue; + } + } else if arg_os.starts_with(b"--") { + needs_val_of = self.parse_long_arg(matcher, &arg_os)?; + debugln!("Parser:get_matches_with: After parse_long_arg {:?}", + needs_val_of); + match needs_val_of { + ParseResult::Flag | + ParseResult::Opt(..) | + ParseResult::ValuesDone => continue, + _ => (), + } + } else if arg_os.starts_with(b"-") && arg_os.len_() != 1 { + // Try to parse short args like normal, if AllowLeadingHyphen or + // AllowNegativeNumbers is set, parse_short_arg will *not* throw + // an error, and instead return Ok(None) + needs_val_of = self.parse_short_arg(matcher, &arg_os)?; + // If it's None, we then check if one of those two AppSettings was set + debugln!("Parser:get_matches_with: After parse_short_arg {:?}", + needs_val_of); + match needs_val_of { + ParseResult::MaybeNegNum => { + if !(arg_os.to_string_lossy().parse::().is_ok() || + arg_os.to_string_lossy().parse::().is_ok()) { + return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), + "", + &*usage::create_error_usage(self, matcher, None), + self.color())); + } + } + ParseResult::Opt(..) | + ParseResult::Flag | + ParseResult::ValuesDone => continue, + _ => (), + } + } + + if !(self.is_set(AS::ArgsNegateSubcommands) && self.is_set(AS::ValidArgFound)) && + !self.is_set(AS::InferSubcommands) { + if let Some(cdate) = suggestions::did_you_mean(&*arg_os.to_string_lossy(), + sc_names!(self)) { + return Err(Error::invalid_subcommand(arg_os + .to_string_lossy() + .into_owned(), + cdate, + self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name), + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + } + } + + let low_index_mults = self.is_set(AS::LowIndexMultiplePositional) && + pos_counter == (self.positionals.len() - 1); + let missing_pos = self.is_set(AS::AllowMissingPositional) && + pos_counter == (self.positionals.len() - 1); + debugln!("Parser::get_matches_with: Positional counter...{}", + pos_counter); + debugln!("Parser::get_matches_with: Low index multiples...{:?}", + low_index_mults); + if low_index_mults || missing_pos { + if let Some(na) = it.peek() { + let n = (*na).clone().into(); + needs_val_of = if needs_val_of != ParseResult::ValuesDone { + if let Some(p) = self.positionals.get(pos_counter) { + ParseResult::Pos(p.b.name) + } else { + ParseResult::ValuesDone + } + } else { + ParseResult::ValuesDone + }; + let sc_match = { + self.possible_subcommand(&n).0 + }; + if self.is_new_arg(&n, needs_val_of) || sc_match || + suggestions::did_you_mean(&n.to_string_lossy(), sc_names!(self)).is_some() { + debugln!("Parser::get_matches_with: Bumping the positional counter..."); + pos_counter += 1; + } + } else { + debugln!("Parser::get_matches_with: Bumping the positional counter..."); + pos_counter += 1; + } + } else if self.is_set(AS::ContainsLast) && self.is_set(AS::TrailingValues) { + // Came to -- and one postional has .last(true) set, so we go immediately + // to the last (highest index) positional + debugln!("Parser::get_matches_with: .last(true) and --, setting last pos"); + pos_counter = self.positionals.len(); + } + if let Some(p) = self.positionals.get(pos_counter) { + if p.is_set(ArgSettings::Last) && !self.is_set(AS::TrailingValues) { + return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), + "", + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + parse_positional!(self, p, arg_os, pos_counter, matcher); + self.settings.set(AS::ValidArgFound); + } else if self.is_set(AS::AllowExternalSubcommands) { + // Get external subcommand name + let sc_name = match arg_os.to_str() { + Some(s) => s.to_string(), + None => { + if !self.is_set(AS::StrictUtf8) { + return Err(Error::invalid_utf8(&*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + arg_os.to_string_lossy().into_owned() + } + }; + + // Collect the external subcommand args + let mut sc_m = ArgMatcher::new(); + while let Some(v) = it.next() { + let a = v.into(); + if a.to_str().is_none() && !self.is_set(AS::StrictUtf8) { + return Err(Error::invalid_utf8(&*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + sc_m.add_val_to("", &a); + } + + matcher.subcommand(SubCommand { + name: sc_name, + matches: sc_m.into(), + }); + } else if !((self.is_set(AS::AllowLeadingHyphen) || + self.is_set(AS::AllowNegativeNumbers)) && arg_os.starts_with(b"-")) && + !self.is_set(AS::InferSubcommands) { + return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), + "", + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } else if !has_args || self.is_set(AS::InferSubcommands) && self.has_subcommands() { + if let Some(cdate) = suggestions::did_you_mean(&*arg_os.to_string_lossy(), + sc_names!(self)) { + return Err(Error::invalid_subcommand(arg_os.to_string_lossy().into_owned(), + cdate, + self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name), + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } else { + return Err(Error::unrecognized_subcommand(arg_os + .to_string_lossy() + .into_owned(), + self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name), + self.color())); + } + } else { + return Err(Error::unknown_argument(&*arg_os.to_string_lossy(), + "", + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + } + + if let Some(ref pos_sc_name) = subcmd_name { + let sc_name = { + find_subcmd!(self, pos_sc_name) + .expect(INTERNAL_ERROR_MSG) + .p + .meta + .name + .clone() + }; + self.parse_subcommand(&*sc_name, matcher, it)?; + } else if self.is_set(AS::SubcommandRequired) { + let bn = self.meta.bin_name.as_ref().unwrap_or(&self.meta.name); + return Err(Error::missing_subcommand(bn, + &usage::create_error_usage(self, matcher, None), + self.color())); + } else if self.is_set(AS::SubcommandRequiredElseHelp) { + debugln!("Parser::get_matches_with: SubcommandRequiredElseHelp=true"); + let mut out = vec![]; + self.write_help_err(&mut out)?; + return Err(Error { + message: String::from_utf8_lossy(&*out).into_owned(), + kind: ErrorKind::MissingArgumentOrSubcommand, + info: None, + }); + } + + Validator::new(self).validate(needs_val_of, subcmd_name, matcher) + } + + + fn propagate_help_version(&mut self) { + debugln!("Parser::propagate_help_version;"); + self.create_help_and_version(); + for sc in &mut self.subcommands { + sc.p.propagate_help_version(); + } + } + + fn build_bin_names(&mut self) { + debugln!("Parser::build_bin_names;"); + for sc in &mut self.subcommands { + debug!("Parser::build_bin_names:iter: bin_name set..."); + if sc.p.meta.bin_name.is_none() { + sdebugln!("No"); + let bin_name = format!("{}{}{}", + self.meta + .bin_name + .as_ref() + .unwrap_or(&self.meta.name.clone()), + if self.meta.bin_name.is_some() { + " " + } else { + "" + }, + &*sc.p.meta.name); + debugln!("Parser::build_bin_names:iter: Setting bin_name of {} to {}", + self.meta.name, + bin_name); + sc.p.meta.bin_name = Some(bin_name); + } else { + sdebugln!("yes ({:?})", sc.p.meta.bin_name); + } + debugln!("Parser::build_bin_names:iter: Calling build_bin_names from...{}", + sc.p.meta.name); + sc.p.build_bin_names(); + } + } + + fn parse_subcommand(&mut self, + sc_name: &str, + matcher: &mut ArgMatcher<'a>, + it: &mut Peekable) + -> ClapResult<()> + where I: Iterator, + T: Into + Clone + { + use std::fmt::Write; + debugln!("Parser::parse_subcommand;"); + let mut mid_string = String::new(); + if !self.is_set(AS::SubcommandsNegateReqs) { + let mut hs: Vec<&str> = self.required.iter().map(|n| &**n).collect(); + for k in matcher.arg_names() { + hs.push(k); + } + let reqs = usage::get_required_usage_from(self, &hs, Some(matcher), None, false); + + for s in &reqs { + write!(&mut mid_string, " {}", s).expect(INTERNAL_ERROR_MSG); + } + } + mid_string.push_str(" "); + if let Some(ref mut sc) = self.subcommands + .iter_mut() + .find(|s| s.p.meta.name == sc_name) { + let mut sc_matcher = ArgMatcher::new(); + // bin_name should be parent's bin_name + [] + the sc's name separated by + // a space + sc.p.meta.usage = Some(format!("{}{}{}", + self.meta.bin_name.as_ref().unwrap_or(&String::new()), + if self.meta.bin_name.is_some() { + &*mid_string + } else { + "" + }, + &*sc.p.meta.name)); + sc.p.meta.bin_name = + Some(format!("{}{}{}", + self.meta.bin_name.as_ref().unwrap_or(&String::new()), + if self.meta.bin_name.is_some() { + " " + } else { + "" + }, + &*sc.p.meta.name)); + debugln!("Parser::parse_subcommand: About to parse sc={}", + sc.p.meta.name); + debugln!("Parser::parse_subcommand: sc settings={:#?}", sc.p.settings); + sc.p.get_matches_with(&mut sc_matcher, it)?; + matcher.subcommand(SubCommand { + name: sc.p.meta.name.clone(), + matches: sc_matcher.into(), + }); + } + Ok(()) + } + + pub fn groups_for_arg(&self, name: &str) -> Option> { + debugln!("Parser::groups_for_arg: name={}", name); + + if self.groups.is_empty() { + debugln!("Parser::groups_for_arg: No groups defined"); + return None; + } + let mut res = vec![]; + debugln!("Parser::groups_for_arg: Searching through groups..."); + for grp in &self.groups { + for a in &grp.args { + if a == &name { + sdebugln!("\tFound '{}'", grp.name); + res.push(&*grp.name); + } + } + } + if res.is_empty() { + return None; + } + + Some(res) + } + + pub fn args_in_group(&self, group: &str) -> Vec { + let mut g_vec = vec![]; + let mut args = vec![]; + + for n in &self.groups + .iter() + .find(|g| g.name == group) + .expect(INTERNAL_ERROR_MSG) + .args { + if let Some(f) = self.flags.iter().find(|f| &f.b.name == n) { + args.push(f.to_string()); + } else if let Some(f) = self.opts.iter().find(|o| &o.b.name == n) { + args.push(f.to_string()); + } else if let Some(p) = self.positionals.values().find(|p| &p.b.name == n) { + args.push(p.b.name.to_owned()); + } else { + g_vec.push(*n); + } + } + + for av in g_vec.iter().map(|g| self.args_in_group(g)) { + args.extend(av); + } + args.dedup(); + args.iter().map(ToOwned::to_owned).collect() + } + + pub fn arg_names_in_group(&self, group: &str) -> Vec<&'a str> { + let mut g_vec = vec![]; + let mut args = vec![]; + + for n in &self.groups + .iter() + .find(|g| g.name == group) + .expect(INTERNAL_ERROR_MSG) + .args { + if self.groups.iter().any(|g| g.name == *n) { + args.extend(self.arg_names_in_group(n)); + g_vec.push(*n); + } else if !args.contains(n) { + args.push(*n); + } + } + + args.iter().map(|s| *s).collect() + } + + pub fn create_help_and_version(&mut self) { + debugln!("Parser::create_help_and_version;"); + // name is "hclap_help" because flags are sorted by name + if !self.contains_long("help") { + debugln!("Parser::create_help_and_version: Building --help"); + if self.help_short.is_none() && !self.contains_short('h') { + self.help_short = Some('h'); + } + let arg = FlagBuilder { + b: Base { + name: "hclap_help", + help: self.help_message.or(Some("Prints help information")), + ..Default::default() + }, + s: Switched { + short: self.help_short, + long: Some("help"), + ..Default::default() + }, + }; + self.flags.push(arg); + } + if !self.is_set(AS::DisableVersion) && !self.contains_long("version") { + debugln!("Parser::create_help_and_version: Building --version"); + if self.version_short.is_none() && !self.contains_short('V') { + self.version_short = Some('V'); + } + // name is "vclap_version" because flags are sorted by name + let arg = FlagBuilder { + b: Base { + name: "vclap_version", + help: self.version_message.or(Some("Prints version information")), + ..Default::default() + }, + s: Switched { + short: self.version_short, + long: Some("version"), + ..Default::default() + }, + }; + self.flags.push(arg); + } + if !self.subcommands.is_empty() && !self.is_set(AS::DisableHelpSubcommand) && + self.is_set(AS::NeedsSubcommandHelp) { + debugln!("Parser::create_help_and_version: Building help"); + self.subcommands + .push(App::new("help") + .about("Prints this message or the help of the given subcommand(s)")); + } + } + + // Retrieves the names of all args the user has supplied thus far, except required ones + // because those will be listed in self.required + fn check_for_help_and_version_str(&self, arg: &OsStr) -> ClapResult<()> { + debugln!("Parser::check_for_help_and_version_str;"); + debug!("Parser::check_for_help_and_version_str: Checking if --{} is help or version...", + arg.to_str().unwrap()); + if arg == "help" && self.is_set(AS::NeedsLongHelp) { + sdebugln!("Help"); + return Err(self._help(true)); + } + if arg == "version" && self.is_set(AS::NeedsLongVersion) { + sdebugln!("Version"); + return Err(self._version(true)); + } + sdebugln!("Neither"); + + Ok(()) + } + + fn check_for_help_and_version_char(&self, arg: char) -> ClapResult<()> { + debugln!("Parser::check_for_help_and_version_char;"); + debug!("Parser::check_for_help_and_version_char: Checking if -{} is help or version...", + arg); + if let Some(h) = self.help_short { + if arg == h && self.is_set(AS::NeedsLongHelp) { + sdebugln!("Help"); + return Err(self._help(false)); + } + } + if let Some(v) = self.version_short { + if arg == v && self.is_set(AS::NeedsLongVersion) { + sdebugln!("Version"); + return Err(self._version(false)); + } + } + sdebugln!("Neither"); + Ok(()) + } + + fn use_long_help(&self) -> bool { + self.meta.long_about.is_some() || + self.flags.iter().any(|f| f.b.long_help.is_some()) || + self.opts.iter().any(|o| o.b.long_help.is_some()) || + self.positionals.values().any(|p| p.b.long_help.is_some()) || + self.subcommands + .iter() + .any(|s| s.p.meta.long_about.is_some()) + } + + fn _help(&self, mut use_long: bool) -> Error { + debugln!("Parser::_help: use_long={:?}", use_long); + use_long = use_long && self.use_long_help(); + let mut buf = vec![]; + match Help::write_parser_help(&mut buf, self, use_long) { + Err(e) => e, + _ => Error { + message: String::from_utf8(buf).unwrap_or_default(), + kind: ErrorKind::HelpDisplayed, + info: None, + } + } + } + + fn _version(&self, use_long: bool) -> Error { + debugln!("Parser::_version: "); + let out = io::stdout(); + let mut buf_w = BufWriter::new(out.lock()); + match self.print_version(&mut buf_w, use_long) { + Err(e) => e, + _ => Error { + message: String::new(), + kind: ErrorKind::VersionDisplayed, + info: None, + } + } + } + + fn parse_long_arg(&mut self, + matcher: &mut ArgMatcher<'a>, + full_arg: &OsStr) + -> ClapResult> { + // maybe here lifetime should be 'a + debugln!("Parser::parse_long_arg;"); + let mut val = None; + debug!("Parser::parse_long_arg: Does it contain '='..."); + let arg = if full_arg.contains_byte(b'=') { + let (p0, p1) = full_arg.trim_left_matches(b'-').split_at_byte(b'='); + sdebugln!("Yes '{:?}'", p1); + val = Some(p1); + p0 + } else { + sdebugln!("No"); + full_arg.trim_left_matches(b'-') + }; + + if let Some(opt) = find_opt_by_long!(@os self, arg) { + debugln!("Parser::parse_long_arg: Found valid opt '{}'", + opt.to_string()); + self.settings.set(AS::ValidArgFound); + let ret = self.parse_opt(val, opt, val.is_some(), matcher)?; + if self.cache.map_or(true, |name| name != opt.b.name) { + arg_post_processing!(self, opt, matcher); + self.cache = Some(opt.b.name); + } + + return Ok(ret); + } else if let Some(flag) = find_flag_by_long!(@os self, arg) { + debugln!("Parser::parse_long_arg: Found valid flag '{}'", + flag.to_string()); + self.settings.set(AS::ValidArgFound); + // Only flags could be help or version, and we need to check the raw long + // so this is the first point to check + self.check_for_help_and_version_str(arg)?; + + self.parse_flag(flag, matcher)?; + + // Handle conflicts, requirements, etc. + // if self.cache.map_or(true, |name| name != flag.b.name) { + arg_post_processing!(self, flag, matcher); + // self.cache = Some(flag.b.name); + // } + + return Ok(ParseResult::Flag); + } else if self.is_set(AS::AllowLeadingHyphen) { + return Ok(ParseResult::MaybeHyphenValue); + } else if self.is_set(AS::ValidNegNumFound) { + return Ok(ParseResult::MaybeNegNum); + } + + debugln!("Parser::parse_long_arg: Didn't match anything"); + self.did_you_mean_error(arg.to_str().expect(INVALID_UTF8), matcher) + .map(|_| ParseResult::NotFound) + } + + #[cfg_attr(feature = "lints", allow(len_zero))] + fn parse_short_arg(&mut self, + matcher: &mut ArgMatcher<'a>, + full_arg: &OsStr) + -> ClapResult> { + debugln!("Parser::parse_short_arg: full_arg={:?}", full_arg); + let arg_os = full_arg.trim_left_matches(b'-'); + let arg = arg_os.to_string_lossy(); + + // If AllowLeadingHyphen is set, we want to ensure `-val` gets parsed as `-val` and not + // `-v` `-a` `-l` assuming `v` `a` and `l` are all, or mostly, valid shorts. + if self.is_set(AS::AllowLeadingHyphen) { + if arg.chars().any(|c| !self.contains_short(c)) { + debugln!("Parser::parse_short_arg: LeadingHyphenAllowed yet -{} isn't valid", + arg); + return Ok(ParseResult::MaybeHyphenValue); + } + } else if self.is_set(AS::ValidNegNumFound) { + // TODO: Add docs about having AllowNegativeNumbers and `-2` as a valid short + // May be better to move this to *after* not finding a valid flag/opt? + debugln!("Parser::parse_short_arg: Valid negative num..."); + return Ok(ParseResult::MaybeNegNum); + } + + let mut ret = ParseResult::NotFound; + for c in arg.chars() { + debugln!("Parser::parse_short_arg:iter:{}", c); + // Check for matching short options, and return the name if there is no trailing + // concatenated value: -oval + // Option: -o + // Value: val + if let Some(opt) = find_opt_by_short!(self, c) { + debugln!("Parser::parse_short_arg:iter:{}: Found valid opt", c); + self.settings.set(AS::ValidArgFound); + // Check for trailing concatenated value + let p: Vec<_> = arg.splitn(2, c).collect(); + debugln!("Parser::parse_short_arg:iter:{}: p[0]={:?}, p[1]={:?}", + c, + p[0].as_bytes(), + p[1].as_bytes()); + let i = p[0].as_bytes().len() + 1; + let val = if p[1].as_bytes().len() > 0 { + debugln!("Parser::parse_short_arg:iter:{}: val={:?} (bytes), val={:?} (ascii)", + c, + arg_os.split_at(i).1.as_bytes(), + arg_os.split_at(i).1); + Some(arg_os.split_at(i).1) + } else { + None + }; + + // Default to "we're expecting a value later" + let ret = self.parse_opt(val, opt, false, matcher)?; + + if self.cache.map_or(true, |name| name != opt.b.name) { + arg_post_processing!(self, opt, matcher); + self.cache = Some(opt.b.name); + } + + return Ok(ret); + } else if let Some(flag) = find_flag_by_short!(self, c) { + debugln!("Parser::parse_short_arg:iter:{}: Found valid flag", c); + self.settings.set(AS::ValidArgFound); + // Only flags can be help or version + self.check_for_help_and_version_char(c)?; + ret = self.parse_flag(flag, matcher)?; + + // Handle conflicts, requirements, overrides, etc. + // Must be called here due to mutablilty + if self.cache.map_or(true, |name| name != flag.b.name) { + arg_post_processing!(self, flag, matcher); + self.cache = Some(flag.b.name); + } + } else { + let arg = format!("-{}", c); + return Err(Error::unknown_argument(&*arg, + "", + &*usage::create_error_usage(self, + matcher, + None), + self.color())); + } + } + Ok(ret) + } + + fn parse_opt(&self, + val: Option<&OsStr>, + opt: &OptBuilder<'a, 'b>, + had_eq: bool, + matcher: &mut ArgMatcher<'a>) + -> ClapResult> { + debugln!("Parser::parse_opt; opt={}, val={:?}", opt.b.name, val); + debugln!("Parser::parse_opt; opt.settings={:?}", opt.b.settings); + let mut has_eq = false; + let no_val = val.is_none(); + let empty_vals = opt.is_set(ArgSettings::EmptyValues); + let min_vals_zero = opt.v.min_vals.unwrap_or(1) == 0; + let needs_eq = opt.is_set(ArgSettings::RequireEquals); + + debug!("Parser::parse_opt; Checking for val..."); + if let Some(fv) = val { + has_eq = fv.starts_with(&[b'=']) || had_eq; + let v = fv.trim_left_matches(b'='); + if !empty_vals && + (v.len_() == 0 || (needs_eq && !has_eq)) { + sdebugln!("Found Empty - Error"); + return Err(Error::empty_value(opt, + &*usage::create_error_usage(self, matcher, None), + self.color())); + } + sdebugln!("Found - {:?}, len: {}", v, v.len_()); + debugln!("Parser::parse_opt: {:?} contains '='...{:?}", + fv, + fv.starts_with(&[b'='])); + self.add_val_to_arg(opt, v, matcher)?; + } else if needs_eq && !(empty_vals || min_vals_zero) { + sdebugln!("None, but requires equals...Error"); + return Err(Error::empty_value(opt, + &*usage::create_error_usage(self, matcher, None), + self.color())); + + } else { + sdebugln!("None"); + } + + matcher.inc_occurrence_of(opt.b.name); + // Increment or create the group "args" + self.groups_for_arg(opt.b.name) + .and_then(|vec| Some(matcher.inc_occurrences_of(&*vec))); + + let needs_delim = opt.is_set(ArgSettings::RequireDelimiter); + let mult = opt.is_set(ArgSettings::Multiple); + if no_val && min_vals_zero && !has_eq && needs_eq { + debugln!("Parser::parse_opt: More arg vals not required..."); + return Ok(ParseResult::ValuesDone); + } else if no_val || (mult && !needs_delim) && !has_eq && matcher.needs_more_vals(opt) { + debugln!("Parser::parse_opt: More arg vals required..."); + return Ok(ParseResult::Opt(opt.b.name)); + } + debugln!("Parser::parse_opt: More arg vals not required..."); + Ok(ParseResult::ValuesDone) + } + + fn add_val_to_arg(&self, + arg: &A, + val: &OsStr, + matcher: &mut ArgMatcher<'a>) + -> ClapResult> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Parser::add_val_to_arg; arg={}, val={:?}", arg.name(), val); + debugln!("Parser::add_val_to_arg; trailing_vals={:?}, DontDelimTrailingVals={:?}", + self.is_set(AS::TrailingValues), + self.is_set(AS::DontDelimitTrailingValues)); + if !(self.is_set(AS::TrailingValues) && self.is_set(AS::DontDelimitTrailingValues)) { + if let Some(delim) = arg.val_delim() { + if val.is_empty_() { + Ok(self.add_single_val_to_arg(arg, val, matcher)?) + } else { + let mut iret = ParseResult::ValuesDone; + for v in val.split(delim as u32 as u8) { + iret = self.add_single_val_to_arg(arg, v, matcher)?; + } + // If there was a delimiter used, we're not looking for more values + if val.contains_byte(delim as u32 as u8) || + arg.is_set(ArgSettings::RequireDelimiter) { + iret = ParseResult::ValuesDone; + } + Ok(iret) + } + } else { + self.add_single_val_to_arg(arg, val, matcher) + } + } else { + self.add_single_val_to_arg(arg, val, matcher) + } + } + + fn add_single_val_to_arg(&self, + arg: &A, + v: &OsStr, + matcher: &mut ArgMatcher<'a>) + -> ClapResult> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Parser::add_single_val_to_arg;"); + debugln!("Parser::add_single_val_to_arg: adding val...{:?}", v); + if let Some(t) = arg.val_terminator() { + if t == v { + return Ok(ParseResult::ValuesDone); + } + } + matcher.add_val_to(arg.name(), v); + + // Increment or create the group "args" + if let Some(grps) = self.groups_for_arg(arg.name()) { + for grp in grps { + matcher.add_val_to(&*grp, v); + } + } + + if matcher.needs_more_vals(arg) { + return Ok(ParseResult::Opt(arg.name())); + } + Ok(ParseResult::ValuesDone) + } + + + fn parse_flag(&self, + flag: &FlagBuilder<'a, 'b>, + matcher: &mut ArgMatcher<'a>) + -> ClapResult> { + debugln!("Parser::parse_flag;"); + + matcher.inc_occurrence_of(flag.b.name); + // Increment or create the group "args" + self.groups_for_arg(flag.b.name) + .and_then(|vec| Some(matcher.inc_occurrences_of(&*vec))); + + Ok(ParseResult::Flag) + } + + fn did_you_mean_error(&self, arg: &str, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + + // Didn't match a flag or option + let suffix = + suggestions::did_you_mean_flag_suffix(arg, longs!(self), &self.subcommands); + + // Add the arg to the matches to build a proper usage string + if let Some(name) = suffix.1 { + if let Some(opt) = find_opt_by_long!(self, name) { + self.groups_for_arg(&*opt.b.name) + .and_then(|grps| Some(matcher.inc_occurrences_of(&*grps))); + matcher.insert(&*opt.b.name); + } else if let Some(flg) = find_flag_by_long!(self, name) { + self.groups_for_arg(&*flg.b.name) + .and_then(|grps| Some(matcher.inc_occurrences_of(&*grps))); + matcher.insert(&*flg.b.name); + } + } + + let used_arg = format!("--{}", arg); + Err(Error::unknown_argument(&*used_arg, + &*suffix.0, + &*usage::create_error_usage(self, matcher, None), + self.color())) + } + + // Prints the version to the user and exits if quit=true + fn print_version(&self, w: &mut W, use_long: bool) -> ClapResult<()> { + self.write_version(w, use_long)?; + w.flush().map_err(Error::from) + } + + pub fn write_version(&self, w: &mut W, use_long: bool) -> io::Result<()> { + let ver = if use_long { + self.meta + .long_version + .unwrap_or_else(|| self.meta.version.unwrap_or("")) + } else { + self.meta + .version + .unwrap_or_else(|| self.meta.long_version.unwrap_or("")) + }; + if let Some(bn) = self.meta.bin_name.as_ref() { + if bn.contains(' ') { + // Incase we're dealing with subcommands i.e. git mv is translated to git-mv + write!(w, "{} {}", bn.replace(" ", "-"), ver) + } else { + write!(w, "{} {}", &self.meta.name[..], ver) + } + } else { + write!(w, "{} {}", &self.meta.name[..], ver) + } + } + + pub fn print_help(&self) -> ClapResult<()> { + let out = io::stdout(); + let mut buf_w = BufWriter::new(out.lock()); + self.write_help(&mut buf_w) + } + + pub fn write_help(&self, w: &mut W) -> ClapResult<()> { + Help::write_parser_help(w, self, false) + } + + pub fn write_long_help(&self, w: &mut W) -> ClapResult<()> { + Help::write_parser_help(w, self, true) + } + + pub fn write_help_err(&self, w: &mut W) -> ClapResult<()> { + Help::write_parser_help_to_stderr(w, self) + } + + pub fn add_defaults(&mut self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + debugln!("Parser::add_defaults;"); + macro_rules! add_val { + (@default $_self:ident, $a:ident, $m:ident) => { + if let Some(ref val) = $a.v.default_val { + debugln!("Parser::add_defaults:iter:{}: has default vals", $a.b.name); + if $m.get($a.b.name).map(|ma| ma.vals.len()).map(|len| len == 0).unwrap_or(false) { + debugln!("Parser::add_defaults:iter:{}: has no user defined vals", $a.b.name); + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } else if $m.get($a.b.name).is_some() { + debugln!("Parser::add_defaults:iter:{}: has user defined vals", $a.b.name); + } else { + debugln!("Parser::add_defaults:iter:{}: wasn't used", $a.b.name); + + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } + } else { + debugln!("Parser::add_defaults:iter:{}: doesn't have default vals", $a.b.name); + } + }; + ($_self:ident, $a:ident, $m:ident) => { + if let Some(ref vm) = $a.v.default_vals_ifs { + sdebugln!(" has conditional defaults"); + let mut done = false; + if $m.get($a.b.name).is_none() { + for &(arg, val, default) in vm.values() { + let add = if let Some(a) = $m.get(arg) { + if let Some(v) = val { + a.vals.iter().any(|value| v == value) + } else { + true + } + } else { + false + }; + if add { + $_self.add_val_to_arg($a, OsStr::new(default), $m)?; + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + done = true; + break; + } + } + } + + if done { + continue; // outer loop (outside macro) + } + } else { + sdebugln!(" doesn't have conditional defaults"); + } + add_val!(@default $_self, $a, $m) + }; + } + + for o in &self.opts { + debug!("Parser::add_defaults:iter:{}:", o.b.name); + add_val!(self, o, matcher); + } + for p in self.positionals.values() { + debug!("Parser::add_defaults:iter:{}:", p.b.name); + add_val!(self, p, matcher); + } + Ok(()) + } + + pub fn add_env(&mut self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + macro_rules! add_val { + ($_self:ident, $a:ident, $m:ident) => { + if let Some(ref val) = $a.v.env { + if $m.get($a.b.name).map(|ma| ma.vals.len()).map(|len| len == 0).unwrap_or(false) { + if let Some(ref val) = val.1 { + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } + } else { + if let Some(ref val) = val.1 { + $_self.add_val_to_arg($a, OsStr::new(val), $m)?; + + if $_self.cache.map_or(true, |name| name != $a.name()) { + arg_post_processing!($_self, $a, $m); + $_self.cache = Some($a.name()); + } + } + } + } + }; + } + + for o in &self.opts { + add_val!(self, o, matcher); + } + for p in self.positionals.values() { + add_val!(self, p, matcher); + } + Ok(()) + } + + pub fn flags(&self) -> Iter> { self.flags.iter() } + + pub fn opts(&self) -> Iter> { self.opts.iter() } + + pub fn positionals(&self) -> map::Values> { self.positionals.values() } + + pub fn subcommands(&self) -> Iter { self.subcommands.iter() } + + // Should we color the output? None=determined by output location, true=yes, false=no + #[doc(hidden)] + pub fn color(&self) -> ColorWhen { + debugln!("Parser::color;"); + debug!("Parser::color: Color setting..."); + if self.is_set(AS::ColorNever) { + sdebugln!("Never"); + ColorWhen::Never + } else if self.is_set(AS::ColorAlways) { + sdebugln!("Always"); + ColorWhen::Always + } else { + sdebugln!("Auto"); + ColorWhen::Auto + } + } + + pub fn find_any_arg(&self, name: &str) -> Option<&AnyArg> { + if let Some(f) = find_by_name!(self, name, flags, iter) { + return Some(f); + } + if let Some(o) = find_by_name!(self, name, opts, iter) { + return Some(o); + } + if let Some(p) = find_by_name!(self, name, positionals, values) { + return Some(p); + } + None + } + + /// Check is a given string matches the binary name for this parser + fn is_bin_name(&self, value: &str) -> bool { + self.meta.bin_name + .as_ref() + .and_then(|name| Some(value == name)) + .unwrap_or(false) + } + + /// Check is a given string is an alias for this parser + fn is_alias(&self, value: &str) -> bool { + self.meta.aliases + .as_ref() + .and_then(|aliases| { + for alias in aliases { + if alias.0 == value { + return Some(true); + } + } + Some(false) + }) + .unwrap_or(false) + } + + // Only used for completion scripts due to bin_name messiness + #[cfg_attr(feature = "lints", allow(block_in_if_condition_stmt))] + pub fn find_subcommand(&'b self, sc: &str) -> Option<&'b App<'a, 'b>> { + debugln!("Parser::find_subcommand: sc={}", sc); + debugln!("Parser::find_subcommand: Currently in Parser...{}", + self.meta.bin_name.as_ref().unwrap()); + for s in &self.subcommands { + if s.p.is_bin_name(sc) { + return Some(s); + } + // XXX: why do we split here? + // isn't `sc` supposed to be single word already? + let last = sc.split(' ').rev().next().expect(INTERNAL_ERROR_MSG); + if s.p.is_alias(last) { + return Some(s); + } + + if let Some(app) = s.p.find_subcommand(sc) { + return Some(app); + } + } + None + } + + #[inline] + fn contains_long(&self, l: &str) -> bool { longs!(self).any(|al| al == &l) } + + #[inline] + fn contains_short(&self, s: char) -> bool { shorts!(self).any(|arg_s| arg_s == &s) } +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/settings.rs b/vendor/registry-40351f815f426200/clap/src/app/settings.rs new file mode 100644 index 000000000..d1bba53fc --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/settings.rs @@ -0,0 +1,986 @@ +// Std +use std::ascii::AsciiExt; +use std::str::FromStr; +use std::ops::BitOr; + +bitflags! { + struct Flags: u64 { + const SC_NEGATE_REQS = 1; + const SC_REQUIRED = 1 << 1; + const A_REQUIRED_ELSE_HELP = 1 << 2; + const GLOBAL_VERSION = 1 << 3; + const VERSIONLESS_SC = 1 << 4; + const UNIFIED_HELP = 1 << 5; + const WAIT_ON_ERROR = 1 << 6; + const SC_REQUIRED_ELSE_HELP= 1 << 7; + const NEEDS_LONG_HELP = 1 << 8; + const NEEDS_LONG_VERSION = 1 << 9; + const NEEDS_SC_HELP = 1 << 10; + const DISABLE_VERSION = 1 << 11; + const HIDDEN = 1 << 12; + const TRAILING_VARARG = 1 << 13; + const NO_BIN_NAME = 1 << 14; + const ALLOW_UNK_SC = 1 << 15; + const UTF8_STRICT = 1 << 16; + const UTF8_NONE = 1 << 17; + const LEADING_HYPHEN = 1 << 18; + const NO_POS_VALUES = 1 << 19; + const NEXT_LINE_HELP = 1 << 20; + const DERIVE_DISP_ORDER = 1 << 21; + const COLORED_HELP = 1 << 22; + const COLOR_ALWAYS = 1 << 23; + const COLOR_AUTO = 1 << 24; + const COLOR_NEVER = 1 << 25; + const DONT_DELIM_TRAIL = 1 << 26; + const ALLOW_NEG_NUMS = 1 << 27; + const LOW_INDEX_MUL_POS = 1 << 28; + const DISABLE_HELP_SC = 1 << 29; + const DONT_COLLAPSE_ARGS = 1 << 30; + const ARGS_NEGATE_SCS = 1 << 31; + const PROPAGATE_VALS_DOWN = 1 << 32; + const ALLOW_MISSING_POS = 1 << 33; + const TRAILING_VALUES = 1 << 34; + const VALID_NEG_NUM_FOUND = 1 << 35; + const PROPAGATED = 1 << 36; + const VALID_ARG_FOUND = 1 << 37; + const INFER_SUBCOMMANDS = 1 << 38; + const CONTAINS_LAST = 1 << 39; + } +} + +#[doc(hidden)] +#[derive(Debug, Copy, Clone, PartialEq)] +pub struct AppFlags(Flags); + +impl BitOr for AppFlags { + type Output = Self; + fn bitor(self, rhs: Self) -> Self { AppFlags(self.0 | rhs.0) } +} + +impl Default for AppFlags { + fn default() -> Self { + AppFlags(NEEDS_LONG_VERSION | NEEDS_LONG_HELP | NEEDS_SC_HELP | UTF8_NONE | COLOR_AUTO) + } +} + +impl AppFlags { + pub fn new() -> Self { AppFlags::default() } + + impl_settings! { AppSettings, + ArgRequiredElseHelp => A_REQUIRED_ELSE_HELP, + ArgsNegateSubcommands => ARGS_NEGATE_SCS, + AllowExternalSubcommands => ALLOW_UNK_SC, + AllowInvalidUtf8 => UTF8_NONE, + AllowLeadingHyphen => LEADING_HYPHEN, + AllowNegativeNumbers => ALLOW_NEG_NUMS, + AllowMissingPositional => ALLOW_MISSING_POS, + ColoredHelp => COLORED_HELP, + ColorAlways => COLOR_ALWAYS, + ColorAuto => COLOR_AUTO, + ColorNever => COLOR_NEVER, + DontDelimitTrailingValues => DONT_DELIM_TRAIL, + DontCollapseArgsInUsage => DONT_COLLAPSE_ARGS, + DeriveDisplayOrder => DERIVE_DISP_ORDER, + DisableHelpSubcommand => DISABLE_HELP_SC, + DisableVersion => DISABLE_VERSION, + GlobalVersion => GLOBAL_VERSION, + HidePossibleValuesInHelp => NO_POS_VALUES, + Hidden => HIDDEN, + LowIndexMultiplePositional => LOW_INDEX_MUL_POS, + NeedsLongHelp => NEEDS_LONG_HELP, + NeedsLongVersion => NEEDS_LONG_VERSION, + NeedsSubcommandHelp => NEEDS_SC_HELP, + NoBinaryName => NO_BIN_NAME, + PropagateGlobalValuesDown=> PROPAGATE_VALS_DOWN, + StrictUtf8 => UTF8_STRICT, + SubcommandsNegateReqs => SC_NEGATE_REQS, + SubcommandRequired => SC_REQUIRED, + SubcommandRequiredElseHelp => SC_REQUIRED_ELSE_HELP, + TrailingVarArg => TRAILING_VARARG, + UnifiedHelpMessage => UNIFIED_HELP, + NextLineHelp => NEXT_LINE_HELP, + VersionlessSubcommands => VERSIONLESS_SC, + WaitOnError => WAIT_ON_ERROR, + TrailingValues => TRAILING_VALUES, + ValidNegNumFound => VALID_NEG_NUM_FOUND, + Propagated => PROPAGATED, + ValidArgFound => VALID_ARG_FOUND, + InferSubcommands => INFER_SUBCOMMANDS, + ContainsLast => CONTAINS_LAST + } +} + +/// Application level settings, which affect how [`App`] operates +/// +/// **NOTE:** When these settings are used, they apply only to current command, and are *not* +/// propagated down or up through child or parent subcommands +/// +/// [`App`]: ./struct.App.html +#[derive(Debug, PartialEq, Copy, Clone)] +pub enum AppSettings { + /// Specifies that any invalid UTF-8 code points should *not* be treated as an error. + /// This is the default behavior of `clap`. + /// + /// **NOTE:** Using argument values with invalid UTF-8 code points requires using + /// [`ArgMatches::os_value_of`], [`ArgMatches::os_values_of`], [`ArgMatches::lossy_value_of`], + /// or [`ArgMatches::lossy_values_of`] for those particular arguments which may contain invalid + /// UTF-8 values + /// + /// **NOTE:** This rule only applies to argument values, as flags, options, and + /// [`SubCommand`]s themselves only allow valid UTF-8 code points. + /// + /// # Platform Specific + /// + /// Non Windows systems only + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, AppSettings}; + /// use std::ffi::OsString; + /// use std::os::unix::ffi::{OsStrExt,OsStringExt}; + /// + /// let r = App::new("myprog") + /// //.setting(AppSettings::AllowInvalidUtf8) + /// .arg_from_usage(" 'some positional arg'") + /// .get_matches_from_safe( + /// vec![ + /// OsString::from("myprog"), + /// OsString::from_vec(vec![0xe9])]); + /// + /// assert!(r.is_ok()); + /// let m = r.unwrap(); + /// assert_eq!(m.value_of_os("arg").unwrap().as_bytes(), &[0xe9]); + /// ``` + /// [`ArgMatches::os_value_of`]: ./struct.ArgMatches.html#method.os_value_of + /// [`ArgMatches::os_values_of`]: ./struct.ArgMatches.html#method.os_values_of + /// [`ArgMatches::lossy_value_of`]: ./struct.ArgMatches.html#method.lossy_value_of + /// [`ArgMatches::lossy_values_of`]: ./struct.ArgMatches.html#method.lossy_values_of + AllowInvalidUtf8, + + /// Specifies that leading hyphens are allowed in argument *values*, such as negative numbers + /// like `-10`. (which would otherwise be parsed as another flag or option) + /// + /// **NOTE:** Use this setting with caution as it silences certain circumstances which would + /// otherwise be an error (such as accidentally forgetting to specify a value for leading + /// option). It is preferred to set this on a per argument basis, via [`Arg::allow_hyphen_values`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{Arg, App, AppSettings}; + /// // Imagine you needed to represent negative numbers as well, such as -10 + /// let m = App::new("nums") + /// .setting(AppSettings::AllowLeadingHyphen) + /// .arg(Arg::with_name("neg").index(1)) + /// .get_matches_from(vec![ + /// "nums", "-20" + /// ]); + /// + /// assert_eq!(m.value_of("neg"), Some("-20")); + /// # ; + /// ``` + /// [`Arg::allow_hyphen_values`]: ./struct.Arg.html#method.allow_hyphen_values + AllowLeadingHyphen, + + /// Allows negative numbers to pass as values. This is similar to + /// `AllowLeadingHyphen` except that it only allows numbers, all + /// other undefined leading hyphens will fail to parse. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// let res = App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::AllowNegativeNumbers) + /// .arg(Arg::with_name("num")) + /// .get_matches_from_safe(vec![ + /// "myprog", "-20" + /// ]); + /// assert!(res.is_ok()); + /// let m = res.unwrap(); + /// assert_eq!(m.value_of("num").unwrap(), "-20"); + /// ``` + /// [`AllowLeadingHyphen`]: ./enum.AppSettings.html#variant.AllowLeadingHyphen + AllowNegativeNumbers, + + /// Allows one to implement a CLI where the second to last positional argument is optional, but + /// the final positional argument is required. Such as `$ prog [optional] ` where one + /// of the two following usages is allowed: + /// + /// * `$ prog [optional] ` + /// * `$ prog ` + /// + /// This would otherwise not be allowed. This is useful when `[optional]` has a default value. + /// + /// **Note:** In addition to using this setting, the second positional argument *must* be + /// [required] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// // Assume there is an external subcommand named "subcmd" + /// let m = App::new("myprog") + /// .setting(AppSettings::AllowMissingPositional) + /// .arg(Arg::with_name("arg1") + /// .default_value("something")) + /// .arg(Arg::with_name("arg2") + /// .required(true)) + /// .get_matches_from(vec![ + /// "myprog", "other" + /// ]); + /// + /// assert_eq!(m.value_of("arg1"), Some("something")); + /// assert_eq!(m.value_of("arg2"), Some("other")); + /// ``` + /// [required]: ./struct.Arg.html#method.required + AllowMissingPositional, + + /// Specifies that an unexpected positional argument, + /// which would otherwise cause a [`ErrorKind::UnknownArgument`] error, + /// should instead be treated as a [`SubCommand`] within the [`ArgMatches`] struct. + /// + /// **NOTE:** Use this setting with caution, + /// as a truly unexpected argument (i.e. one that is *NOT* an external subcommand) + /// will **not** cause an error and instead be treated as a potential subcommand. + /// One should check for such cases manually and inform the user appropriately. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings}; + /// // Assume there is an external subcommand named "subcmd" + /// let m = App::new("myprog") + /// .setting(AppSettings::AllowExternalSubcommands) + /// .get_matches_from(vec![ + /// "myprog", "subcmd", "--option", "value", "-fff", "--flag" + /// ]); + /// + /// // All trailing arguments will be stored under the subcommand's sub-matches using an empty + /// // string argument name + /// match m.subcommand() { + /// (external, Some(ext_m)) => { + /// let ext_args: Vec<&str> = ext_m.values_of("").unwrap().collect(); + /// assert_eq!(external, "subcmd"); + /// assert_eq!(ext_args, ["--option", "value", "-fff", "--flag"]); + /// }, + /// _ => {}, + /// } + /// ``` + /// [`ErrorKind::UnknownArgument`]: ./enum.ErrorKind.html#variant.UnknownArgument + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`ArgMatches`]: ./struct.ArgMatches.html + AllowExternalSubcommands, + + /// Specifies that use of a valid [argument] negates [subcomands] being used after. By default + /// `clap` allows arguments between subcommands such as + /// ` [cmd_args] [cmd2_args] [cmd3_args]`. This setting disables that + /// functionality and says that arguments can only follow the *final* subcommand. For instance + /// using this setting makes only the following invocations possible: + /// + /// * ` [cmd3_args]` + /// * ` [cmd2_args]` + /// * ` [cmd_args]` + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ArgsNegateSubcommands) + /// # ; + /// ``` + /// [subcommands]: ./struct.SubCommand.html + /// [argument]: ./struct.Arg.html + ArgsNegateSubcommands, + + /// Specifies that the help text should be displayed (and then exit gracefully), + /// if no arguments are present at runtime (i.e. an empty run such as, `$ myprog`. + /// + /// **NOTE:** [`SubCommand`]s count as arguments + /// + /// **NOTE:** Setting [`Arg::default_value`] effectively disables this option as it will + /// ensure that some argument is always present. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ArgRequiredElseHelp) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`Arg::default_value`]: ./struct.Arg.html#method.default_value + ArgRequiredElseHelp, + + /// Uses colorized help messages. + /// + /// **NOTE:** Must be compiled with the `color` cargo feature + /// + /// # Platform Specific + /// + /// This setting only applies to Unix, Linux, and OSX (i.e. non-Windows platforms) + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ColoredHelp) + /// .get_matches(); + /// ``` + ColoredHelp, + + /// Enables colored output only when the output is going to a terminal or TTY. + /// + /// **NOTE:** This is the default behavior of `clap`. + /// + /// **NOTE:** Must be compiled with the `color` cargo feature. + /// + /// # Platform Specific + /// + /// This setting only applies to Unix, Linux, and OSX (i.e. non-Windows platforms). + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ColorAuto) + /// .get_matches(); + /// ``` + ColorAuto, + + /// Enables colored output regardless of whether or not the output is going to a terminal/TTY. + /// + /// **NOTE:** Must be compiled with the `color` cargo feature. + /// + /// # Platform Specific + /// + /// This setting only applies to Unix, Linux, and OSX (i.e. non-Windows platforms). + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ColorAlways) + /// .get_matches(); + /// ``` + ColorAlways, + + /// Disables colored output no matter if the output is going to a terminal/TTY, or not. + /// + /// **NOTE:** Must be compiled with the `color` cargo feature + /// + /// # Platform Specific + /// + /// This setting only applies to Unix, Linux, and OSX (i.e. non-Windows platforms) + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::ColorNever) + /// .get_matches(); + /// ``` + ColorNever, + + /// Disables the automatic collapsing of positional args into `[ARGS]` inside the usage string + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::DontCollapseArgsInUsage) + /// .get_matches(); + /// ``` + DontCollapseArgsInUsage, + + /// Disables the automatic delimiting of values when `--` or [`AppSettings::TrailingVarArg`] + /// was used. + /// + /// **NOTE:** The same thing can be done manually by setting the final positional argument to + /// [`Arg::use_delimiter(false)`]. Using this setting is safer, because it's easier to locate + /// when making changes. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::DontDelimitTrailingValues) + /// .get_matches(); + /// ``` + /// [`AppSettings::TrailingVarArg`]: ./enum.AppSettings.html#variant.TrailingVarArg + /// [`Arg::use_delimiter(false)`]: ./struct.Arg.html#method.use_delimiter + DontDelimitTrailingValues, + + /// Disables the `help` subcommand + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings, ErrorKind, SubCommand}; + /// let res = App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::DisableHelpSubcommand) + /// // Normally, creating a subcommand causes a `help` subcommand to automaticaly + /// // be generated as well + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", "help" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + DisableHelpSubcommand, + + /// Disables `-V` and `--version` [`App`] without affecting any of the [`SubCommand`]s + /// (Defaults to `false`; application *does* have a version flag) + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings, ErrorKind}; + /// let res = App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::DisableVersion) + /// .get_matches_from_safe(vec![ + /// "myprog", "-V" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// + /// ```rust + /// # use clap::{App, SubCommand, AppSettings, ErrorKind}; + /// let res = App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::DisableVersion) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", "test", "-V" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::VersionDisplayed); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + DisableVersion, + + /// Displays the arguments and [`SubCommand`]s in the help message in the order that they were + /// declared in, and not alphabetically which is the default. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::DeriveDisplayOrder) + /// .get_matches(); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + DeriveDisplayOrder, + + /// Specifies to use the version of the current command for all child [`SubCommand`]s. + /// (Defaults to `false`; subcommands have independant version strings from their parents.) + /// + /// **NOTE:** The version for the current command **and** this setting must be set **prior** to + /// adding any child subcommands + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::GlobalVersion) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches(); + /// // running `$ myprog test --version` will display + /// // "myprog-test v1.1" + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + GlobalVersion, + + /// Specifies that this [`SubCommand`] should be hidden from help messages + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, SubCommand}; + /// App::new("myprog") + /// .subcommand(SubCommand::with_name("test") + /// .setting(AppSettings::Hidden)) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + Hidden, + + /// Tells `clap` *not* to print possible values when displaying help information. + /// This can be useful if there are many values, or they are explained elsewhere. + HidePossibleValuesInHelp, + + /// Tries to match unknown args to partial [`subcommands`] or their [aliases]. For example to + /// match a subcommand named `test`, one could use `t`, `te`, `tes`, and `test`. + /// + /// **NOTE:** The match *must not* be ambiguous at all in order to succeed. i.e. to match `te` + /// to `test` there could not also be a subcommand or alias `temp` because both start with `te` + /// + /// **CAUTION:** This setting can interfere with [positional/free arguments], take care when + /// designing CLIs which allow inferred subcommands and have potential positional/free + /// arguments whose values could start with the same characters as subcommands. If this is the + /// case, it's recommended to use settings such as [`AppSeettings::ArgsNegateSubcommands`] in + /// conjuction with this setting. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// let m = App::new("prog") + /// .setting(AppSettings::InferSubcommands) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from(vec![ + /// "prog", "te" + /// ]); + /// assert_eq!(m.subcommand_name(), Some("test")); + /// ``` + /// [`subcommands`]: ./struct.SubCommand.html + /// [positional/free arguments]: ./struct.Arg.html#method.index + /// [aliases]: ./struct.App.html#method.alias + /// [`AppSeettings::ArgsNegateSubcommands`]: ./enum.AppSettings.html#variant.ArgsNegateSubcommands + InferSubcommands, + + /// Specifies that the parser should not assume the first argument passed is the binary name. + /// This is normally the case when using a "daemon" style mode, or an interactive CLI where one + /// one would not normally type the binary or program name for each command. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// let m = App::new("myprog") + /// .setting(AppSettings::NoBinaryName) + /// .arg(Arg::from_usage("... 'commands to run'")) + /// .get_matches_from(vec!["command", "set"]); + /// + /// let cmds: Vec<&str> = m.values_of("cmd").unwrap().collect(); + /// assert_eq!(cmds, ["command", "set"]); + /// ``` + NoBinaryName, + + /// Places the help string for all arguments on the line after the argument. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::NextLineHelp) + /// .get_matches(); + /// ``` + NextLineHelp, + + /// **DEPRECATED**: This setting is no longer required in order to propagate values up or down + /// + /// Specifies that the parser should propagate global arg's values down or up through any *used* + /// child subcommands. Meaning, if a subcommand wasn't used, the values won't be propagated to + /// said subcommand. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, SubCommand}; + /// let m = App::new("myprog") + /// .arg(Arg::from_usage("[cmd] 'command to run'") + /// .global(true)) + /// .subcommand(SubCommand::with_name("foo")) + /// .get_matches_from(vec!["myprog", "set", "foo"]); + /// + /// assert_eq!(m.value_of("cmd"), Some("set")); + /// + /// let sub_m = m.subcommand_matches("foo").unwrap(); + /// assert_eq!(sub_m.value_of("cmd"), Some("set")); + /// ``` + /// Now doing the same thing, but *not* using any subcommands will result in the value not being + /// propagated down. + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, SubCommand}; + /// let m = App::new("myprog") + /// .arg(Arg::from_usage("[cmd] 'command to run'") + /// .global(true)) + /// .subcommand(SubCommand::with_name("foo")) + /// .get_matches_from(vec!["myprog", "set"]); + /// + /// assert_eq!(m.value_of("cmd"), Some("set")); + /// + /// assert!(m.subcommand_matches("foo").is_none()); + /// ``` + #[deprecated(since = "2.27.0", note = "No longer required to propagate values")] + PropagateGlobalValuesDown, + + /// Allows [`SubCommand`]s to override all requirements of the parent command. + /// For example if you had a subcommand or top level application with a required argument + /// that is only required as long as there is no subcommand present, + /// using this setting would allow you to set those arguments to [`Arg::required(true)`] + /// and yet receive no error so long as the user uses a valid subcommand instead. + /// + /// **NOTE:** This defaults to false (using subcommand does *not* negate requirements) + /// + /// # Examples + /// + /// This first example shows that it is an error to not use a required argument + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, SubCommand, ErrorKind}; + /// let err = App::new("myprog") + /// .setting(AppSettings::SubcommandsNegateReqs) + /// .arg(Arg::with_name("opt").required(true)) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog" + /// ]); + /// assert!(err.is_err()); + /// assert_eq!(err.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// # ; + /// ``` + /// + /// This next example shows that it is no longer error to not use a required argument if a + /// valid subcommand is used. + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, SubCommand, ErrorKind}; + /// let noerr = App::new("myprog") + /// .setting(AppSettings::SubcommandsNegateReqs) + /// .arg(Arg::with_name("opt").required(true)) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", "test" + /// ]); + /// assert!(noerr.is_ok()); + /// # ; + /// ``` + /// [`Arg::required(true)`]: ./struct.Arg.html#method.required + /// [`SubCommand`]: ./struct.SubCommand.html + SubcommandsNegateReqs, + + /// Specifies that the help text should be displayed (before exiting gracefully) if no + /// [`SubCommand`]s are present at runtime (i.e. an empty run such as `$ myprog`). + /// + /// **NOTE:** This should *not* be used with [`AppSettings::SubcommandRequired`] as they do + /// nearly same thing; this prints the help text, and the other prints an error. + /// + /// **NOTE:** If the user specifies arguments at runtime, but no subcommand the help text will + /// still be displayed and exit. If this is *not* the desired result, consider using + /// [`AppSettings::ArgRequiredElseHelp`] instead. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::SubcommandRequiredElseHelp) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings::SubcommandRequired`]: ./enum.AppSettings.html#variant.SubcommandRequired + /// [`AppSettings::ArgRequiredElseHelp`]: ./enum.AppSettings.html#variant.ArgRequiredElseHelp + SubcommandRequiredElseHelp, + + /// Specifies that any invalid UTF-8 code points should be treated as an error and fail + /// with a [`ErrorKind::InvalidUtf8`] error. + /// + /// **NOTE:** This rule only applies to argument values; Things such as flags, options, and + /// [`SubCommand`]s themselves only allow valid UTF-8 code points. + /// + /// # Platform Specific + /// + /// Non Windows systems only + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, AppSettings, ErrorKind}; + /// use std::ffi::OsString; + /// use std::os::unix::ffi::OsStringExt; + /// + /// let m = App::new("myprog") + /// .setting(AppSettings::StrictUtf8) + /// .arg_from_usage(" 'some positional arg'") + /// .get_matches_from_safe( + /// vec![ + /// OsString::from("myprog"), + /// OsString::from_vec(vec![0xe9])]); + /// + /// assert!(m.is_err()); + /// assert_eq!(m.unwrap_err().kind, ErrorKind::InvalidUtf8); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`ErrorKind::InvalidUtf8`]: ./enum.ErrorKind.html#variant.InvalidUtf8 + StrictUtf8, + + /// Allows specifying that if no [`SubCommand`] is present at runtime, + /// error and exit gracefully. + /// + /// **NOTE:** This defaults to `false` (subcommands do *not* need to be present) + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings, SubCommand, ErrorKind}; + /// let err = App::new("myprog") + /// .setting(AppSettings::SubcommandRequired) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", + /// ]); + /// assert!(err.is_err()); + /// assert_eq!(err.unwrap_err().kind, ErrorKind::MissingSubcommand); + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + SubcommandRequired, + + /// Specifies that the final positional argument is a "VarArg" and that `clap` should not + /// attempt to parse any further args. + /// + /// The values of the trailing positional argument will contain all args from itself on. + /// + /// **NOTE:** The final positional argument **must** have [`Arg::multiple(true)`] or the usage + /// string equivalent. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// let m = App::new("myprog") + /// .setting(AppSettings::TrailingVarArg) + /// .arg(Arg::from_usage("... 'commands to run'")) + /// .get_matches_from(vec!["myprog", "arg1", "-r", "val1"]); + /// + /// let trail: Vec<&str> = m.values_of("cmd").unwrap().collect(); + /// assert_eq!(trail, ["arg1", "-r", "val1"]); + /// ``` + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + TrailingVarArg, + + /// Groups flags and options together, presenting a more unified help message + /// (a la `getopts` or `docopt` style). + /// + /// The default is that the auto-generated help message will group flags, and options + /// separately. + /// + /// **NOTE:** This setting is cosmetic only and does not affect any functionality. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::UnifiedHelpMessage) + /// .get_matches(); + /// // running `myprog --help` will display a unified "docopt" or "getopts" style help message + /// ``` + UnifiedHelpMessage, + + /// Disables `-V` and `--version` for all [`SubCommand`]s + /// (Defaults to `false`; subcommands *do* have version flags.) + /// + /// **NOTE:** This setting must be set **prior** adding any subcommands + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, SubCommand, AppSettings, ErrorKind}; + /// let res = App::new("myprog") + /// .version("v1.1") + /// .setting(AppSettings::VersionlessSubcommands) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", "test", "-V" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + VersionlessSubcommands, + + /// Will display a message "Press [ENTER]/[RETURN] to continue..." and wait for user before + /// exiting + /// + /// This is most useful when writing an application which is run from a GUI shortcut, or on + /// Windows where a user tries to open the binary by double-clicking instead of using the + /// command line. + /// + /// **NOTE:** This setting is **not** recursive with [`SubCommand`]s, meaning if you wish this + /// behavior for all subcommands, you must set this on each command (needing this is extremely + /// rare) + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings}; + /// App::new("myprog") + /// .setting(AppSettings::WaitOnError) + /// # ; + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + WaitOnError, + + #[doc(hidden)] + NeedsLongVersion, + + #[doc(hidden)] + NeedsLongHelp, + + #[doc(hidden)] + NeedsSubcommandHelp, + + #[doc(hidden)] + LowIndexMultiplePositional, + + #[doc(hidden)] + TrailingValues, + + #[doc(hidden)] + ValidNegNumFound, + + #[doc(hidden)] + Propagated, + + #[doc(hidden)] + ValidArgFound, + + #[doc(hidden)] + ContainsLast, +} + +impl FromStr for AppSettings { + type Err = String; + fn from_str(s: &str) -> Result::Err> { + match &*s.to_ascii_lowercase() { + "argrequiredelsehelp" => Ok(AppSettings::ArgRequiredElseHelp), + "argsnegatesubcommands" => Ok(AppSettings::ArgsNegateSubcommands), + "allowinvalidutf8" => Ok(AppSettings::AllowInvalidUtf8), + "allowleadinghyphen" => Ok(AppSettings::AllowLeadingHyphen), + "allowexternalsubcommands" => Ok(AppSettings::AllowExternalSubcommands), + "allownegativenumbers" => Ok(AppSettings::AllowNegativeNumbers), + "colorauto" => Ok(AppSettings::ColorAuto), + "coloralways" => Ok(AppSettings::ColorAlways), + "colornever" => Ok(AppSettings::ColorNever), + "coloredhelp" => Ok(AppSettings::ColoredHelp), + "derivedisplayorder" => Ok(AppSettings::DeriveDisplayOrder), + "dontcollapseargsinusage" => Ok(AppSettings::DontCollapseArgsInUsage), + "dontdelimittrailingvalues" => Ok(AppSettings::DontDelimitTrailingValues), + "disablehelpsubcommand" => Ok(AppSettings::DisableHelpSubcommand), + "disableversion" => Ok(AppSettings::DisableVersion), + "globalversion" => Ok(AppSettings::GlobalVersion), + "hidden" => Ok(AppSettings::Hidden), + "hidepossiblevaluesinhelp" => Ok(AppSettings::HidePossibleValuesInHelp), + "infersubcommands" => Ok(AppSettings::InferSubcommands), + "lowindexmultiplepositional" => Ok(AppSettings::LowIndexMultiplePositional), + "nobinaryname" => Ok(AppSettings::NoBinaryName), + "nextlinehelp" => Ok(AppSettings::NextLineHelp), + "strictutf8" => Ok(AppSettings::StrictUtf8), + "subcommandsnegatereqs" => Ok(AppSettings::SubcommandsNegateReqs), + "subcommandrequired" => Ok(AppSettings::SubcommandRequired), + "subcommandrequiredelsehelp" => Ok(AppSettings::SubcommandRequiredElseHelp), + "trailingvararg" => Ok(AppSettings::TrailingVarArg), + "unifiedhelpmessage" => Ok(AppSettings::UnifiedHelpMessage), + "versionlesssubcommands" => Ok(AppSettings::VersionlessSubcommands), + "waitonerror" => Ok(AppSettings::WaitOnError), + "validnegnumfound" => Ok(AppSettings::ValidNegNumFound), + "validargfound" => Ok(AppSettings::ValidArgFound), + "propagated" => Ok(AppSettings::Propagated), + "trailingvalues" => Ok(AppSettings::TrailingValues), + _ => Err("unknown AppSetting, cannot convert from str".to_owned()), + } + } +} + +#[cfg(test)] +mod test { + use super::AppSettings; + + #[test] + fn app_settings_fromstr() { + assert_eq!("argsnegatesubcommands".parse::().unwrap(), + AppSettings::ArgsNegateSubcommands); + assert_eq!("argrequiredelsehelp".parse::().unwrap(), + AppSettings::ArgRequiredElseHelp); + assert_eq!("allowexternalsubcommands".parse::().unwrap(), + AppSettings::AllowExternalSubcommands); + assert_eq!("allowinvalidutf8".parse::().unwrap(), + AppSettings::AllowInvalidUtf8); + assert_eq!("allowleadinghyphen".parse::().unwrap(), + AppSettings::AllowLeadingHyphen); + assert_eq!("allownegativenumbers".parse::().unwrap(), + AppSettings::AllowNegativeNumbers); + assert_eq!("coloredhelp".parse::().unwrap(), + AppSettings::ColoredHelp); + assert_eq!("colorauto".parse::().unwrap(), + AppSettings::ColorAuto); + assert_eq!("coloralways".parse::().unwrap(), + AppSettings::ColorAlways); + assert_eq!("colornever".parse::().unwrap(), + AppSettings::ColorNever); + assert_eq!("disablehelpsubcommand".parse::().unwrap(), + AppSettings::DisableHelpSubcommand); + assert_eq!("disableversion".parse::().unwrap(), + AppSettings::DisableVersion); + assert_eq!("dontcollapseargsinusage".parse::().unwrap(), + AppSettings::DontCollapseArgsInUsage); + assert_eq!("dontdelimittrailingvalues".parse::().unwrap(), + AppSettings::DontDelimitTrailingValues); + assert_eq!("derivedisplayorder".parse::().unwrap(), + AppSettings::DeriveDisplayOrder); + assert_eq!("globalversion".parse::().unwrap(), + AppSettings::GlobalVersion); + assert_eq!("hidden".parse::().unwrap(), + AppSettings::Hidden); + assert_eq!("hidepossiblevaluesinhelp".parse::().unwrap(), + AppSettings::HidePossibleValuesInHelp); + assert_eq!("lowindexmultiplePositional".parse::().unwrap(), + AppSettings::LowIndexMultiplePositional); + assert_eq!("nobinaryname".parse::().unwrap(), + AppSettings::NoBinaryName); + assert_eq!("nextlinehelp".parse::().unwrap(), + AppSettings::NextLineHelp); + assert_eq!("subcommandsnegatereqs".parse::().unwrap(), + AppSettings::SubcommandsNegateReqs); + assert_eq!("subcommandrequired".parse::().unwrap(), + AppSettings::SubcommandRequired); + assert_eq!("subcommandrequiredelsehelp".parse::().unwrap(), + AppSettings::SubcommandRequiredElseHelp); + assert_eq!("strictutf8".parse::().unwrap(), + AppSettings::StrictUtf8); + assert_eq!("trailingvararg".parse::().unwrap(), + AppSettings::TrailingVarArg); + assert_eq!("unifiedhelpmessage".parse::().unwrap(), + AppSettings::UnifiedHelpMessage); + assert_eq!("versionlesssubcommands".parse::().unwrap(), + AppSettings::VersionlessSubcommands); + assert_eq!("waitonerror".parse::().unwrap(), + AppSettings::WaitOnError); + assert_eq!("validnegnumfound".parse::().unwrap(), + AppSettings::ValidNegNumFound); + assert_eq!("validargfound".parse::().unwrap(), + AppSettings::ValidArgFound); + assert_eq!("propagated".parse::().unwrap(), + AppSettings::Propagated); + assert_eq!("trailingvalues".parse::().unwrap(), + AppSettings::TrailingValues); + assert_eq!("infersubcommands".parse::().unwrap(), + AppSettings::InferSubcommands); + assert!("hahahaha".parse::().is_err()); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/usage.rs b/vendor/registry-40351f815f426200/clap/src/app/usage.rs new file mode 100644 index 000000000..39489dc75 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/usage.rs @@ -0,0 +1,439 @@ +// std +use std::collections::{BTreeMap, VecDeque}; + +// Internal +use INTERNAL_ERROR_MSG; +use args::{AnyArg, ArgMatcher, PosBuilder}; +use args::settings::ArgSettings; +use app::settings::AppSettings as AS; +use app::parser::Parser; + +// Creates a usage string for display. This happens just after all arguments were parsed, but before +// any subcommands have been parsed (so as to give subcommands their own usage recursively) +pub fn create_usage_with_title(p: &Parser, used: &[&str]) -> String { + debugln!("usage::create_usage_with_title;"); + let mut usage = String::with_capacity(75); + usage.push_str("USAGE:\n "); + usage.push_str(&*create_usage_no_title(p, used)); + usage +} + +// Creates a usage string to be used in error message (i.e. one with currently used args) +pub fn create_error_usage<'a, 'b>(p: &Parser<'a, 'b>, + matcher: &'b ArgMatcher<'a>, + extra: Option<&str>) + -> String { + let mut args: Vec<_> = matcher.arg_names() + .iter() + .filter(|n| { + if let Some(o) = find_by_name!(p, **n, opts, iter) { + !o.b.is_set(ArgSettings::Required) && !o.b.is_set(ArgSettings::Hidden) + } else if let Some(p) = find_by_name!(p, **n, positionals, values) { + !p.b.is_set(ArgSettings::Required) && p.b.is_set(ArgSettings::Hidden) + } else { + true // flags can't be required, so they're always true + } + }) + .map(|&n| n) + .collect(); + if let Some(r) = extra { + args.push(r); + } + create_usage_with_title(p, &*args) +} + +// Creates a usage string (*without title*) if one was not provided by the user manually. +pub fn create_usage_no_title(p: &Parser, used: &[&str]) -> String { + debugln!("usage::create_usage_no_title;"); + if let Some(u) = p.meta.usage_str { + String::from(&*u) + } else if used.is_empty() { + create_help_usage(p, true) + } else { + create_smart_usage(p, used) + } +} + +// Creates a usage string for display in help messages (i.e. not for errors) +pub fn create_help_usage(p: &Parser, incl_reqs: bool) -> String { + let mut usage = String::with_capacity(75); + let name = p.meta + .usage + .as_ref() + .unwrap_or_else(|| { + p.meta + .bin_name + .as_ref() + .unwrap_or(&p.meta.name) + }); + usage.push_str(&*name); + let req_string = if incl_reqs { + let mut reqs: Vec<&str> = p.required().map(|r| &**r).collect(); + reqs.sort(); + reqs.dedup(); + get_required_usage_from(p, &reqs, None, None, false).iter().fold(String::new(), |a, s| { + a + &format!(" {}", s)[..] + }) + } else { + String::new() + }; + + let flags = needs_flags_tag(p); + if flags && !p.is_set(AS::UnifiedHelpMessage) { + usage.push_str(" [FLAGS]"); + } else if flags { + usage.push_str(" [OPTIONS]"); + } + if !p.is_set(AS::UnifiedHelpMessage) && + p.opts.iter().any(|o| !o.is_set(ArgSettings::Required) && !o.is_set(ArgSettings::Hidden)) { + usage.push_str(" [OPTIONS]"); + } + + usage.push_str(&req_string[..]); + + let has_last = p.positionals.values().any(|p| p.is_set(ArgSettings::Last)); + // places a '--' in the usage string if there are args and options + // supporting multiple values + if p.opts.iter().any(|o| o.is_set(ArgSettings::Multiple)) && + p.positionals.values().any(|p| !p.is_set(ArgSettings::Required)) && + !p.has_visible_subcommands() && !has_last { + usage.push_str(" [--]"); + } + let not_req_or_hidden = + |p: &PosBuilder| (!p.is_set(ArgSettings::Required) || p.is_set(ArgSettings::Last)) && !p.is_set(ArgSettings::Hidden); + if p.has_positionals() && p.positionals.values().any(not_req_or_hidden) { + if let Some(args_tag) = get_args_tag(p, incl_reqs) { + usage.push_str(&*args_tag); + } else { + usage.push_str(" [ARGS]"); + } + if has_last && incl_reqs { + let pos = p.positionals + .values() + .find(|p| p.b.is_set(ArgSettings::Last)) + .expect(INTERNAL_ERROR_MSG); + debugln!("usage::create_help_usage: '{}' has .last(true)", pos.name()); + let req = pos.is_set(ArgSettings::Required); + if req && p.positionals.values().any(|p| !p.is_set(ArgSettings::Required)) { + usage.push_str(" -- <"); + } else if req { + usage.push_str(" [--] <"); + } else { + usage.push_str(" [-- <"); + } + usage.push_str(&*pos.name_no_brackets()); + usage.push_str(">"); + usage.push_str(pos.multiple_str()); + if !req { + usage.push_str("]"); + } + } + } + + // incl_reqs is only false when this function is called recursively + if p.has_visible_subcommands() && incl_reqs { + if p.is_set(AS::SubcommandsNegateReqs) || p.is_set(AS::ArgsNegateSubcommands) { + if !p.is_set(AS::ArgsNegateSubcommands) { + usage.push_str("\n "); + usage.push_str(&*create_help_usage(p, false)); + usage.push_str(" "); + } else { + usage.push_str("\n "); + usage.push_str(&*name); + usage.push_str(" "); + } + } else if p.is_set(AS::SubcommandRequired) || p.is_set(AS::SubcommandRequiredElseHelp) { + usage.push_str(" "); + } else { + usage.push_str(" [SUBCOMMAND]"); + } + } + usage.shrink_to_fit(); + debugln!("usage::create_help_usage: usage={}", usage); + usage +} + +// Creates a context aware usage string, or "smart usage" from currently used +// args, and requirements +fn create_smart_usage(p: &Parser, used: &[&str]) -> String { + debugln!("usage::smart_usage;"); + let mut usage = String::with_capacity(75); + let mut hs: Vec<&str> = p.required().map(|s| &**s).collect(); + hs.extend_from_slice(used); + + let r_string = + get_required_usage_from(p, &hs, None, None, false).iter().fold(String::new(), |acc, s| { + acc + &format!(" {}", s)[..] + }); + + usage.push_str(&p.meta + .usage + .as_ref() + .unwrap_or_else(|| { + p.meta + .bin_name + .as_ref() + .unwrap_or(&p.meta.name) + }) + [..]); + usage.push_str(&*r_string); + if p.is_set(AS::SubcommandRequired) { + usage.push_str(" "); + } + usage.shrink_to_fit(); + usage +} + +// Gets the `[ARGS]` tag for the usage string +fn get_args_tag(p: &Parser, incl_reqs: bool) -> Option { + debugln!("usage::get_args_tag;"); + let mut count = 0; + 'outer: for pos in p.positionals + .values() + .filter(|pos| !pos.is_set(ArgSettings::Required)) + .filter(|pos| !pos.is_set(ArgSettings::Hidden)) + .filter(|pos| !pos.is_set(ArgSettings::Last)) { + debugln!("usage::get_args_tag:iter:{}:", pos.b.name); + if let Some(g_vec) = p.groups_for_arg(pos.b.name) { + for grp_s in &g_vec { + debugln!("usage::get_args_tag:iter:{}:iter:{};", pos.b.name, grp_s); + // if it's part of a required group we don't want to count it + if p.groups.iter().any(|g| g.required && (&g.name == grp_s)) { + continue 'outer; + } + } + } + count += 1; + debugln!("usage::get_args_tag:iter: {} Args not required or hidden", + count); + } + if !p.is_set(AS::DontCollapseArgsInUsage) && count > 1 { + debugln!("usage::get_args_tag:iter: More than one, returning [ARGS]"); + return None; // [ARGS] + } else if count == 1 && incl_reqs { + let pos = p.positionals + .values() + .find(|pos| { + !pos.is_set(ArgSettings::Required) && !pos.is_set(ArgSettings::Hidden) && + !pos.is_set(ArgSettings::Last) + }) + .expect(INTERNAL_ERROR_MSG); + debugln!("usage::get_args_tag:iter: Exactly one, returning '{}'", + pos.name()); + return Some(format!(" [{}]{}", pos.name_no_brackets(), pos.multiple_str())); + } else if p.is_set(AS::DontCollapseArgsInUsage) && !p.positionals.is_empty() && incl_reqs { + debugln!("usage::get_args_tag:iter: Don't collapse returning all"); + return Some(p.positionals + .values() + .filter(|pos| !pos.is_set(ArgSettings::Required)) + .filter(|pos| !pos.is_set(ArgSettings::Hidden)) + .filter(|pos| !pos.is_set(ArgSettings::Last)) + .map(|pos| { + format!(" [{}]{}", pos.name_no_brackets(), pos.multiple_str()) + }) + .collect::>() + .join("")); + } else if !incl_reqs { + debugln!("usage::get_args_tag:iter: incl_reqs=false, building secondary usage string"); + let highest_req_pos = p.positionals + .iter() + .filter_map(|(idx, pos)| if pos.b.is_set(ArgSettings::Required) && + !pos.b.is_set(ArgSettings::Last) { + Some(idx) + } else { + None + }) + .max() + .unwrap_or_else(|| p.positionals.len()); + return Some(p.positionals + .iter() + .filter_map(|(idx, pos)| if idx <= highest_req_pos { + Some(pos) + } else { + None + }) + .filter(|pos| !pos.is_set(ArgSettings::Required)) + .filter(|pos| !pos.is_set(ArgSettings::Hidden)) + .filter(|pos| !pos.is_set(ArgSettings::Last)) + .map(|pos| { + format!(" [{}]{}", pos.name_no_brackets(), pos.multiple_str()) + }) + .collect::>() + .join("")); + } + Some("".into()) +} + +// Determines if we need the `[FLAGS]` tag in the usage string +fn needs_flags_tag(p: &Parser) -> bool { + debugln!("usage::needs_flags_tag;"); + 'outer: for f in &p.flags { + debugln!("usage::needs_flags_tag:iter: f={};", f.b.name); + if let Some(l) = f.s.long { + if l == "help" || l == "version" { + // Don't print `[FLAGS]` just for help or version + continue; + } + } + if let Some(g_vec) = p.groups_for_arg(f.b.name) { + for grp_s in &g_vec { + debugln!("usage::needs_flags_tag:iter:iter: grp_s={};", grp_s); + if p.groups.iter().any(|g| &g.name == grp_s && g.required) { + debugln!("usage::needs_flags_tag:iter:iter: Group is required"); + continue 'outer; + } + } + } + if f.is_set(ArgSettings::Hidden) { + continue; + } + debugln!("usage::needs_flags_tag:iter: [FLAGS] required"); + return true; + } + + debugln!("usage::needs_flags_tag: [FLAGS] not required"); + false +} + +// Returns the required args in usage string form by fully unrolling all groups +pub fn get_required_usage_from<'a, 'b>(p: &Parser<'a, 'b>, + reqs: &[&'a str], + matcher: Option<&ArgMatcher<'a>>, + extra: Option<&str>, + incl_last: bool) + -> VecDeque { + debugln!("usage::get_required_usage_from: reqs={:?}, extra={:?}", + reqs, + extra); + let mut desc_reqs: Vec<&str> = vec![]; + desc_reqs.extend(extra); + let mut new_reqs: Vec<&str> = vec![]; + macro_rules! get_requires { + (@group $a: ident, $v:ident, $p:ident) => {{ + if let Some(rl) = p.groups.iter() + .filter(|g| g.requires.is_some()) + .find(|g| &g.name == $a) + .map(|g| g.requires.as_ref().unwrap()) { + for r in rl { + if !$p.contains(&r) { + debugln!("usage::get_required_usage_from:iter:{}: adding group req={:?}", + $a, r); + $v.push(r); + } + } + } + }}; + ($a:ident, $what:ident, $how:ident, $v:ident, $p:ident) => {{ + if let Some(rl) = p.$what.$how() + .filter(|a| a.b.requires.is_some()) + .find(|arg| &arg.b.name == $a) + .map(|a| a.b.requires.as_ref().unwrap()) { + for &(_, r) in rl.iter() { + if !$p.contains(&r) { + debugln!("usage::get_required_usage_from:iter:{}: adding arg req={:?}", + $a, r); + $v.push(r); + } + } + } + }}; + } + // initialize new_reqs + for a in reqs { + get_requires!(a, flags, iter, new_reqs, reqs); + get_requires!(a, opts, iter, new_reqs, reqs); + get_requires!(a, positionals, values, new_reqs, reqs); + get_requires!(@group a, new_reqs, reqs); + } + desc_reqs.extend_from_slice(&*new_reqs); + debugln!("usage::get_required_usage_from: after init desc_reqs={:?}", + desc_reqs); + loop { + let mut tmp = vec![]; + for a in &new_reqs { + get_requires!(a, flags, iter, tmp, desc_reqs); + get_requires!(a, opts, iter, tmp, desc_reqs); + get_requires!(a, positionals, values, tmp, desc_reqs); + get_requires!(@group a, tmp, desc_reqs); + } + if tmp.is_empty() { + debugln!("usage::get_required_usage_from: no more children"); + break; + } else { + debugln!("usage::get_required_usage_from: after iter tmp={:?}", tmp); + debugln!("usage::get_required_usage_from: after iter new_reqs={:?}", + new_reqs); + desc_reqs.extend_from_slice(&*new_reqs); + new_reqs.clear(); + new_reqs.extend_from_slice(&*tmp); + debugln!("usage::get_required_usage_from: after iter desc_reqs={:?}", + desc_reqs); + } + } + desc_reqs.extend_from_slice(reqs); + desc_reqs.sort(); + desc_reqs.dedup(); + debugln!("usage::get_required_usage_from: final desc_reqs={:?}", + desc_reqs); + let mut ret_val = VecDeque::new(); + let args_in_groups = p.groups + .iter() + .filter(|gn| desc_reqs.contains(&gn.name)) + .flat_map(|g| p.arg_names_in_group(g.name)) + .collect::>(); + + let pmap = if let Some(m) = matcher { + desc_reqs.iter() + .filter(|a| p.positionals.values().any(|p| &&p.b.name == a)) + .filter(|&pos| !m.contains(pos)) + .filter_map(|pos| p.positionals.values().find(|x| &x.b.name == pos)) + .filter(|&pos| incl_last || !pos.is_set(ArgSettings::Last)) + .filter(|pos| !args_in_groups.contains(&pos.b.name)) + .map(|pos| (pos.index, pos)) + .collect::>() // sort by index + } else { + desc_reqs.iter() + .filter(|a| p.positionals.values().any(|pos| &&pos.b.name == a)) + .filter_map(|pos| p.positionals.values().find(|x| &x.b.name == pos)) + .filter(|&pos| incl_last || !pos.is_set(ArgSettings::Last)) + .filter(|pos| !args_in_groups.contains(&pos.b.name)) + .map(|pos| (pos.index, pos)) + .collect::>() // sort by index + }; + debugln!("usage::get_required_usage_from: args_in_groups={:?}", + args_in_groups); + for &p in pmap.values() { + let s = p.to_string(); + if args_in_groups.is_empty() || !args_in_groups.contains(&&*s) { + ret_val.push_back(s); + } + } + for a in desc_reqs.iter() + .filter(|name| !p.positionals.values().any(|p| &&p.b.name == name)) + .filter(|name| !p.groups.iter().any(|g| &&g.name == name)) + .filter(|name| !args_in_groups.contains(name)) + .filter(|name| !(matcher.is_some() && matcher.as_ref().unwrap().contains(name))) { + debugln!("usage::get_required_usage_from:iter:{}:", a); + let arg = find_by_name!(p, *a, flags, iter) + .map(|f| f.to_string()) + .unwrap_or_else(|| { + find_by_name!(p, *a, opts, iter) + .map(|o| o.to_string()) + .expect(INTERNAL_ERROR_MSG) + }); + ret_val.push_back(arg); + } + let mut g_vec: Vec = vec![]; + for g in desc_reqs.iter().filter(|n| p.groups.iter().any(|g| &&g.name == n)) { + let g_string = p.args_in_group(g).join("|"); + let elem = format!("<{}>", &g_string[..g_string.len()]); + if !g_vec.contains(&elem) { + g_vec.push(elem); + } + } + for g in g_vec { + ret_val.push_back(g); + } + + ret_val +} diff --git a/vendor/registry-40351f815f426200/clap/src/app/validator.rs b/vendor/registry-40351f815f426200/clap/src/app/validator.rs new file mode 100644 index 000000000..fd152a835 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/app/validator.rs @@ -0,0 +1,460 @@ +// std +use std::fmt::Display; + +// Internal +use INTERNAL_ERROR_MSG; +use INVALID_UTF8; +use args::{AnyArg, ArgMatcher, MatchedArg}; +use args::settings::ArgSettings; +use errors::{Error, ErrorKind}; +use errors::Result as ClapResult; +use osstringext::OsStrExt2; +use app::settings::AppSettings as AS; +use app::parser::{Parser, ParseResult}; +use fmt::{Colorizer, ColorizerOption}; +use app::usage; + +pub struct Validator<'a, 'b, 'z>(&'z mut Parser<'a, 'b>) + where 'a: 'b, + 'b: 'z; + +impl<'a, 'b, 'z> Validator<'a, 'b, 'z> { + pub fn new(p: &'z mut Parser<'a, 'b>) -> Self { Validator(p) } + + pub fn validate(&mut self, + needs_val_of: ParseResult<'a>, + subcmd_name: Option, + matcher: &mut ArgMatcher<'a>) + -> ClapResult<()> { + debugln!("Validator::validate;"); + let mut reqs_validated = false; + self.0.add_env(matcher)?; + self.0.add_defaults(matcher)?; + if let ParseResult::Opt(a) = needs_val_of { + debugln!("Validator::validate: needs_val_of={:?}", a); + let o = self.0 + .opts + .iter() + .find(|o| o.b.name == a) + .expect(INTERNAL_ERROR_MSG); + self.validate_required(matcher)?; + reqs_validated = true; + let should_err = if let Some(v) = matcher.0.args.get(&*o.b.name) { + v.vals.is_empty() && !(o.v.min_vals.is_some() && o.v.min_vals.unwrap() == 0) + } else { + true + }; + if should_err { + return Err(Error::empty_value(o, + &*usage::create_error_usage(self.0, matcher, None), + self.0.color())); + } + } + + if matcher.is_empty() && matcher.subcommand_name().is_none() && + self.0.is_set(AS::ArgRequiredElseHelp) { + let mut out = vec![]; + self.0.write_help_err(&mut out)?; + return Err(Error { + message: String::from_utf8_lossy(&*out).into_owned(), + kind: ErrorKind::MissingArgumentOrSubcommand, + info: None, + }); + } + self.validate_blacklist(matcher)?; + if !(self.0.is_set(AS::SubcommandsNegateReqs) && subcmd_name.is_some()) && !reqs_validated { + self.validate_required(matcher)?; + } + self.validate_matched_args(matcher)?; + matcher.usage(usage::create_usage_with_title(self.0, &[])); + + Ok(()) + } + + fn validate_values(&self, + arg: &A, + ma: &MatchedArg, + matcher: &ArgMatcher<'a>) + -> ClapResult<()> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Validator::validate_values: arg={:?}", arg.name()); + for val in &ma.vals { + if self.0.is_set(AS::StrictUtf8) && val.to_str().is_none() { + debugln!("Validator::validate_values: invalid UTF-8 found in val {:?}", + val); + return Err(Error::invalid_utf8(&*usage::create_error_usage(self.0, matcher, None), + self.0.color())); + } + if let Some(p_vals) = arg.possible_vals() { + debugln!("Validator::validate_values: possible_vals={:?}", p_vals); + let val_str = val.to_string_lossy(); + if !p_vals.contains(&&*val_str) { + return Err(Error::invalid_value(val_str, + p_vals, + arg, + &*usage::create_error_usage(self.0, + matcher, + None), + self.0.color())); + } + } + if !arg.is_set(ArgSettings::EmptyValues) && val.is_empty_() && + matcher.contains(&*arg.name()) { + debugln!("Validator::validate_values: illegal empty val found"); + return Err(Error::empty_value(arg, + &*usage::create_error_usage(self.0, matcher, None), + self.0.color())); + } + if let Some(vtor) = arg.validator() { + debug!("Validator::validate_values: checking validator..."); + if let Err(e) = vtor(val.to_string_lossy().into_owned()) { + sdebugln!("error"); + return Err(Error::value_validation(Some(arg), e, self.0.color())); + } else { + sdebugln!("good"); + } + } + if let Some(vtor) = arg.validator_os() { + debug!("Validator::validate_values: checking validator_os..."); + if let Err(e) = vtor(val) { + sdebugln!("error"); + return Err(Error::value_validation(Some(arg), + (*e).to_string_lossy().to_string(), + self.0.color())); + } else { + sdebugln!("good"); + } + } + } + Ok(()) + } + + fn validate_blacklist(&self, matcher: &mut ArgMatcher) -> ClapResult<()> { + debugln!("Validator::validate_blacklist: blacklist={:?}", + self.0.blacklist); + macro_rules! build_err { + ($p:expr, $name:expr, $matcher:ident) => ({ + debugln!("build_err!: name={}", $name); + let mut c_with = find_from!($p, &$name, blacklist, &$matcher); + c_with = c_with.or( + $p.find_any_arg(&$name).map_or(None, |aa| aa.blacklist()) + .map_or(None, + |bl| bl.iter().find(|arg| $matcher.contains(arg))) + .map_or(None, |an| $p.find_any_arg(an)) + .map_or(None, |aa| Some(format!("{}", aa))) + ); + debugln!("build_err!: '{:?}' conflicts with '{}'", c_with, &$name); + $matcher.remove(&$name); + let usg = usage::create_error_usage($p, $matcher, None); + if let Some(f) = find_by_name!($p, $name, flags, iter) { + debugln!("build_err!: It was a flag..."); + Error::argument_conflict(f, c_with, &*usg, self.0.color()) + } else if let Some(o) = find_by_name!($p, $name, opts, iter) { + debugln!("build_err!: It was an option..."); + Error::argument_conflict(o, c_with, &*usg, self.0.color()) + } else { + match find_by_name!($p, $name, positionals, values) { + Some(p) => { + debugln!("build_err!: It was a positional..."); + Error::argument_conflict(p, c_with, &*usg, self.0.color()) + }, + None => panic!(INTERNAL_ERROR_MSG) + } + } + }); + } + + for name in &self.0.blacklist { + debugln!("Validator::validate_blacklist:iter:{}: Checking blacklisted arg", name); + let mut should_err = false; + if self.0.groups.iter().any(|g| &g.name == name) { + debugln!("Validator::validate_blacklist:iter:{}: groups contains it...", name); + for n in self.0.arg_names_in_group(name) { + debugln!("Validator::validate_blacklist:iter:{}:iter:{}: looking in group...", name, n); + if matcher.contains(n) { + debugln!("Validator::validate_blacklist:iter:{}:iter:{}: matcher contains it...", name, n); + return Err(build_err!(self.0, n, matcher)); + } + } + } else if let Some(ma) = matcher.get(name) { + debugln!("Validator::validate_blacklist:iter:{}: matcher contains it...", name); + should_err = ma.occurs > 0; + } + if should_err { + return Err(build_err!(self.0, *name, matcher)); + } + } + Ok(()) + } + + fn validate_matched_args(&self, matcher: &mut ArgMatcher<'a>) -> ClapResult<()> { + debugln!("Validator::validate_matched_args;"); + for (name, ma) in matcher.iter() { + debugln!("Validator::validate_matched_args:iter:{}: vals={:#?}", + name, + ma.vals); + if let Some(opt) = find_by_name!(self.0, *name, opts, iter) { + self.validate_arg_num_vals(opt, ma, matcher)?; + self.validate_values(opt, ma, matcher)?; + self.validate_arg_requires(opt, ma, matcher)?; + self.validate_arg_num_occurs(opt, ma, matcher)?; + } else if let Some(flag) = find_by_name!(self.0, *name, flags, iter) { + self.validate_arg_requires(flag, ma, matcher)?; + self.validate_arg_num_occurs(flag, ma, matcher)?; + } else if let Some(pos) = find_by_name!(self.0, *name, positionals, values) { + self.validate_arg_num_vals(pos, ma, matcher)?; + self.validate_arg_num_occurs(pos, ma, matcher)?; + self.validate_values(pos, ma, matcher)?; + self.validate_arg_requires(pos, ma, matcher)?; + } else { + let grp = self.0 + .groups + .iter() + .find(|g| &g.name == name) + .expect(INTERNAL_ERROR_MSG); + if let Some(ref g_reqs) = grp.requires { + if g_reqs.iter().any(|&n| !matcher.contains(n)) { + return self.missing_required_error(matcher, None); + } + } + } + } + Ok(()) + } + + fn validate_arg_num_occurs(&self, + a: &A, + ma: &MatchedArg, + matcher: &ArgMatcher) + -> ClapResult<()> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Validator::validate_arg_num_occurs: a={};", a.name()); + if ma.occurs > 1 && !a.is_set(ArgSettings::Multiple) { + // Not the first time, and we don't allow multiples + return Err(Error::unexpected_multiple_usage(a, + &*usage::create_error_usage(self.0, + matcher, + None), + self.0.color())); + } + Ok(()) + } + + fn validate_arg_num_vals(&self, + a: &A, + ma: &MatchedArg, + matcher: &ArgMatcher) + -> ClapResult<()> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Validator::validate_arg_num_vals;"); + if let Some(num) = a.num_vals() { + debugln!("Validator::validate_arg_num_vals: num_vals set...{}", num); + let should_err = if a.is_set(ArgSettings::Multiple) { + ((ma.vals.len() as u64) % num) != 0 + } else { + num != (ma.vals.len() as u64) + }; + if should_err { + debugln!("Validator::validate_arg_num_vals: Sending error WrongNumberOfValues"); + return Err(Error::wrong_number_of_values(a, + num, + if a.is_set(ArgSettings::Multiple) { + (ma.vals.len() % num as usize) + } else { + ma.vals.len() + }, + if ma.vals.len() == 1 || + (a.is_set(ArgSettings::Multiple) && + (ma.vals.len() % num as usize) == + 1) { + "as" + } else { + "ere" + }, + &*usage::create_error_usage(self.0, + matcher, + None), + self.0.color())); + } + } + if let Some(num) = a.max_vals() { + debugln!("Validator::validate_arg_num_vals: max_vals set...{}", num); + if (ma.vals.len() as u64) > num { + debugln!("Validator::validate_arg_num_vals: Sending error TooManyValues"); + return Err(Error::too_many_values(ma.vals + .iter() + .last() + .expect(INTERNAL_ERROR_MSG) + .to_str() + .expect(INVALID_UTF8), + a, + &*usage::create_error_usage(self.0, + matcher, + None), + self.0.color())); + } + } + let min_vals_zero = if let Some(num) = a.min_vals() { + debugln!("Validator::validate_arg_num_vals: min_vals set: {}", num); + if (ma.vals.len() as u64) < num && num != 0 { + debugln!("Validator::validate_arg_num_vals: Sending error TooFewValues"); + return Err(Error::too_few_values(a, + num, + ma.vals.len(), + &*usage::create_error_usage(self.0, + matcher, + None), + self.0.color())); + } + num == 0 + } else { false }; + // Issue 665 (https://github.com/kbknapp/clap-rs/issues/665) + if a.takes_value() && !(a.is_set(ArgSettings::EmptyValues) || min_vals_zero) && ma.vals.is_empty() { + return Err(Error::empty_value(a, + &*usage::create_error_usage(self.0, matcher, None), + self.0.color())); + } + Ok(()) + } + + fn validate_arg_requires(&self, + a: &A, + ma: &MatchedArg, + matcher: &ArgMatcher) + -> ClapResult<()> + where A: AnyArg<'a, 'b> + Display + { + debugln!("Validator::validate_arg_requires;"); + if let Some(a_reqs) = a.requires() { + for &(val, name) in a_reqs.iter().filter(|&&(val, _)| val.is_some()) { + let missing_req = + |v| v == val.expect(INTERNAL_ERROR_MSG) && !matcher.contains(name); + if ma.vals.iter().any(missing_req) { + return self.missing_required_error(matcher, None); + } + } + } + Ok(()) + } + + fn validate_required(&self, matcher: &ArgMatcher) -> ClapResult<()> { + debugln!("Validator::validate_required: required={:?};", + self.0.required); + 'outer: for name in &self.0.required { + debugln!("Validator::validate_required:iter:{}:", name); + if matcher.contains(name) { + continue 'outer; + } + if let Some(a) = find_by_name!(self.0, *name, flags, iter) { + if self.is_missing_required_ok(a, matcher) { + continue 'outer; + } + } else if let Some(a) = find_by_name!(self.0, *name, opts, iter) { + if self.is_missing_required_ok(a, matcher) { + continue 'outer; + } + } else if let Some(a) = find_by_name!(self.0, *name, positionals, values) { + if self.is_missing_required_ok(a, matcher) { + continue 'outer; + } + } + return self.missing_required_error(matcher, None); + } + + // Validate the conditionally required args + for &(a, v, r) in &self.0.r_ifs { + if let Some(ma) = matcher.get(a) { + if matcher.get(r).is_none() && ma.vals.iter().any(|val| val == v) { + return self.missing_required_error(matcher, Some(r)); + } + } + } + Ok(()) + } + + fn validate_conflicts(&self, a: &A, matcher: &ArgMatcher) -> Option + where A: AnyArg<'a, 'b> + { + debugln!("Validator::validate_conflicts: a={:?};", a.name()); + a.blacklist() + .map(|bl| { + bl.iter() + .any(|conf| { + matcher.contains(conf) || + self.0 + .groups + .iter() + .find(|g| &g.name == conf) + .map_or(false, |g| g.args.iter().any(|arg| matcher.contains(arg))) + }) + }) + } + + fn validate_required_unless(&self, a: &A, matcher: &ArgMatcher) -> Option + where A: AnyArg<'a, 'b> + { + debugln!("Validator::validate_required_unless: a={:?};", a.name()); + macro_rules! check { + ($how:ident, $_self:expr, $a:ident, $m:ident) => {{ + $a.required_unless().map(|ru| { + ru.iter().$how(|n| { + $m.contains(n) || { + if let Some(grp) = $_self.groups.iter().find(|g| &g.name == n) { + grp.args.iter().any(|arg| $m.contains(arg)) + } else { + false + } + } + }) + }) + }}; + } + if a.is_set(ArgSettings::RequiredUnlessAll) { + check!(all, self.0, a, matcher) + } else { + check!(any, self.0, a, matcher) + } + } + + fn missing_required_error(&self, matcher: &ArgMatcher, extra: Option<&str>) -> ClapResult<()> { + debugln!("Validator::missing_required_error: extra={:?}", extra); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: self.0.color(), + }); + let mut reqs = self.0 + .required + .iter() + .map(|&r| &*r) + .collect::>(); + if let Some(r) = extra { + reqs.push(r); + } + reqs.retain(|n| !matcher.contains(n)); + reqs.dedup(); + debugln!("Validator::missing_required_error: reqs={:#?}", reqs); + let req_args = + usage::get_required_usage_from(self.0, &reqs[..], Some(matcher), extra, true) + .iter() + .fold(String::new(), + |acc, s| acc + &format!("\n {}", c.error(s))[..]); + debugln!("Validator::missing_required_error: req_args={:#?}", + req_args); + Err(Error::missing_required_argument(&*req_args, + &*usage::create_error_usage(self.0, matcher, extra), + self.0.color())) + } + + #[inline] + fn is_missing_required_ok(&self, a: &A, matcher: &ArgMatcher) -> bool + where A: AnyArg<'a, 'b> + { + debugln!("Validator::is_missing_required_ok: a={}", a.name()); + self.validate_conflicts(a, matcher).unwrap_or(false) || + self.validate_required_unless(a, matcher) + .unwrap_or(false) + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/any_arg.rs b/vendor/registry-40351f815f426200/clap/src/args/any_arg.rs new file mode 100644 index 000000000..9fa34c7fa --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/any_arg.rs @@ -0,0 +1,43 @@ +// Std +use std::rc::Rc; +use std::fmt as std_fmt; +use std::ffi::{OsStr, OsString}; + +// Internal +use args::settings::ArgSettings; +use map::{self, VecMap}; + +#[doc(hidden)] +pub trait AnyArg<'n, 'e>: std_fmt::Display { + fn name(&self) -> &'n str; + fn overrides(&self) -> Option<&[&'e str]>; + fn aliases(&self) -> Option>; + fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]>; + fn blacklist(&self) -> Option<&[&'e str]>; + fn required_unless(&self) -> Option<&[&'e str]>; + fn is_set(&self, ArgSettings) -> bool; + fn set(&mut self, ArgSettings); + fn has_switch(&self) -> bool; + fn max_vals(&self) -> Option; + fn min_vals(&self) -> Option; + fn num_vals(&self) -> Option; + fn possible_vals(&self) -> Option<&[&'e str]>; + fn validator(&self) -> Option<&Rc Result<(), String>>>; + fn validator_os(&self) -> Option<&Rc Result<(), OsString>>>; + fn short(&self) -> Option; + fn long(&self) -> Option<&'e str>; + fn val_delim(&self) -> Option; + fn takes_value(&self) -> bool; + fn val_names(&self) -> Option<&VecMap<&'e str>>; + fn help(&self) -> Option<&'e str>; + fn long_help(&self) -> Option<&'e str>; + fn default_val(&self) -> Option<&'e OsStr>; + fn default_vals_ifs(&self) -> Option, &'e OsStr)>>; + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)>; + fn longest_filter(&self) -> bool; + fn val_terminator(&self) -> Option<&'e str>; +} + +pub trait DispOrder { + fn disp_ord(&self) -> usize; +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg.rs b/vendor/registry-40351f815f426200/clap/src/args/arg.rs new file mode 100644 index 000000000..5d8e07742 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg.rs @@ -0,0 +1,3612 @@ +#[cfg(feature = "yaml")] +use std::collections::BTreeMap; +use std::rc::Rc; +use std::ffi::{OsString, OsStr}; +#[cfg(target_os="windows")] +use osstringext::OsStrExt3; +#[cfg(not(target_os="windows"))] +use std::os::unix::ffi::OsStrExt; +use std::env; + +#[cfg(feature = "yaml")] +use yaml_rust::Yaml; +use map::VecMap; + +use usage_parser::UsageParser; +use args::settings::ArgSettings; +use args::arg_builder::{Base, Valued, Switched}; + +/// The abstract representation of a command line argument. Used to set all the options and +/// relationships that define a valid argument for the program. +/// +/// There are two methods for constructing [`Arg`]s, using the builder pattern and setting options +/// manually, or using a usage string which is far less verbose but has fewer options. You can also +/// use a combination of the two methods to achieve the best of both worlds. +/// +/// # Examples +/// +/// ```rust +/// # use clap::Arg; +/// // Using the traditional builder pattern and setting each option manually +/// let cfg = Arg::with_name("config") +/// .short("c") +/// .long("config") +/// .takes_value(true) +/// .value_name("FILE") +/// .help("Provides a config file to myprog"); +/// // Using a usage string (setting a similar argument to the one above) +/// let input = Arg::from_usage("-i, --input=[FILE] 'Provides an input file to the program'"); +/// ``` +/// [`Arg`]: ./struct.Arg.html +#[allow(missing_debug_implementations)] +#[derive(Default, Clone)] +pub struct Arg<'a, 'b> + where 'a: 'b +{ + #[doc(hidden)] + pub b: Base<'a, 'b>, + #[doc(hidden)] + pub s: Switched<'b>, + #[doc(hidden)] + pub v: Valued<'a, 'b>, + #[doc(hidden)] + pub index: Option, + #[doc(hidden)] + pub r_ifs: Option>, +} + +impl<'a, 'b> Arg<'a, 'b> { + /// Creates a new instance of [`Arg`] using a unique string name. The name will be used to get + /// information about whether or not the argument was used at runtime, get values, set + /// relationships with other args, etc.. + /// + /// **NOTE:** In the case of arguments that take values (i.e. [`Arg::takes_value(true)`]) + /// and positional arguments (i.e. those without a preceding `-` or `--`) the name will also + /// be displayed when the user prints the usage/help information of the program. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// # ; + /// ``` + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + /// [`Arg`]: ./struct.Arg.html + pub fn with_name(n: &'a str) -> Self { Arg { b: Base::new(n), ..Default::default() } } + + /// Creates a new instance of [`Arg`] from a .yml (YAML) file. + /// + /// # Examples + /// + /// ```ignore + /// # #[macro_use] + /// # extern crate clap; + /// # use clap::Arg; + /// # fn main() { + /// let yml = load_yaml!("arg.yml"); + /// let arg = Arg::from_yaml(yml); + /// # } + /// ``` + /// [`Arg`]: ./struct.Arg.html + #[cfg(feature = "yaml")] + pub fn from_yaml(y: &BTreeMap) -> Arg { + // We WANT this to panic on error...so expect() is good. + let name_yml = y.keys().nth(0).unwrap(); + let name_str = name_yml.as_str().unwrap(); + let mut a = Arg::with_name(name_str); + let arg_settings = y.get(name_yml).unwrap().as_hash().unwrap(); + + for (k, v) in arg_settings.iter() { + a = match k.as_str().unwrap() { + "short" => yaml_to_str!(a, v, short), + "long" => yaml_to_str!(a, v, long), + "aliases" => yaml_vec_or_str!(v, a, alias), + "help" => yaml_to_str!(a, v, help), + "long_help" => yaml_to_str!(a, v, long_help), + "required" => yaml_to_bool!(a, v, required), + "required_if" => yaml_tuple2!(a, v, required_if), + "required_ifs" => yaml_tuple2!(a, v, required_if), + "takes_value" => yaml_to_bool!(a, v, takes_value), + "index" => yaml_to_u64!(a, v, index), + "global" => yaml_to_bool!(a, v, global), + "multiple" => yaml_to_bool!(a, v, multiple), + "hidden" => yaml_to_bool!(a, v, hidden), + "next_line_help" => yaml_to_bool!(a, v, next_line_help), + "empty_values" => yaml_to_bool!(a, v, empty_values), + "group" => yaml_to_str!(a, v, group), + "number_of_values" => yaml_to_u64!(a, v, number_of_values), + "max_values" => yaml_to_u64!(a, v, max_values), + "min_values" => yaml_to_u64!(a, v, min_values), + "value_name" => yaml_to_str!(a, v, value_name), + "use_delimiter" => yaml_to_bool!(a, v, use_delimiter), + "allow_hyphen_values" => yaml_to_bool!(a, v, allow_hyphen_values), + "require_delimiter" => yaml_to_bool!(a, v, require_delimiter), + "value_delimiter" => yaml_to_str!(a, v, value_delimiter), + "required_unless" => yaml_to_str!(a, v, required_unless), + "display_order" => yaml_to_usize!(a, v, display_order), + "default_value" => yaml_to_str!(a, v, default_value), + "default_value_if" => yaml_tuple3!(a, v, default_value_if), + "default_value_ifs" => yaml_tuple3!(a, v, default_value_if), + "env" => yaml_to_str!(a, v, env), + "value_names" => yaml_vec_or_str!(v, a, value_name), + "groups" => yaml_vec_or_str!(v, a, group), + "requires" => yaml_vec_or_str!(v, a, requires), + "requires_if" => yaml_tuple2!(a, v, requires_if), + "requires_ifs" => yaml_tuple2!(a, v, requires_if), + "conflicts_with" => yaml_vec_or_str!(v, a, conflicts_with), + "overrides_with" => yaml_vec_or_str!(v, a, overrides_with), + "possible_values" => yaml_vec_or_str!(v, a, possible_value), + "required_unless_one" => yaml_vec_or_str!(v, a, required_unless), + "required_unless_all" => { + a = yaml_vec_or_str!(v, a, required_unless); + a.setb(ArgSettings::RequiredUnlessAll); + a + } + s => { + panic!("Unknown Arg setting '{}' in YAML file for arg '{}'", + s, + name_str) + } + } + } + + a + } + + /// Creates a new instance of [`Arg`] from a usage string. Allows creation of basic settings + /// for the [`Arg`]. The syntax is flexible, but there are some rules to follow. + /// + /// **NOTE**: Not all settings may be set using the usage string method. Some properties are + /// only available via the builder pattern. + /// + /// **NOTE**: Only ASCII values are officially supported in [`Arg::from_usage`] strings. Some + /// UTF-8 codepoints may work just fine, but this is not guaranteed. + /// + /// # Syntax + /// + /// Usage strings typically following the form: + /// + /// ```notrust + /// [explicit name] [short] [long] [value names] [help string] + /// ``` + /// + /// This is not a hard rule as the attributes can appear in other orders. There are also + /// several additional sigils which denote additional settings. Below are the details of each + /// portion of the string. + /// + /// ### Explicit Name + /// + /// This is an optional field, if it's omitted the argument will use one of the additional + /// fields as the name using the following priority order: + /// + /// * Explicit Name (This always takes precedence when present) + /// * Long + /// * Short + /// * Value Name + /// + /// `clap` determines explicit names as the first string of characters between either `[]` or + /// `<>` where `[]` has the dual notation of meaning the argument is optional, and `<>` meaning + /// the argument is required. + /// + /// Explicit names may be followed by: + /// * The multiple denotation `...` + /// + /// Example explicit names as follows (`ename` for an optional argument, and `rname` for a + /// required argument): + /// + /// ```notrust + /// [ename] -s, --long 'some flag' + /// -r, --longer 'some other flag' + /// ``` + /// + /// ### Short + /// + /// This is set by placing a single character after a leading `-`. + /// + /// Shorts may be followed by + /// * The multiple denotation `...` + /// * An optional comma `,` which is cosmetic only + /// * Value notation + /// + /// Example shorts are as follows (`-s`, and `-r`): + /// + /// ```notrust + /// -s, --long 'some flag' + /// -r [val], --longer 'some option' + /// ``` + /// + /// ### Long + /// + /// This is set by placing a word (no spaces) after a leading `--`. + /// + /// Shorts may be followed by + /// * The multiple denotation `...` + /// * Value notation + /// + /// Example longs are as follows (`--some`, and `--rapid`): + /// + /// ```notrust + /// -s, --some 'some flag' + /// --rapid=[FILE] 'some option' + /// ``` + /// + /// ### Values (Value Notation) + /// + /// This is set by placing a word(s) between `[]` or `<>` optionally after `=` (although this + /// is cosmetic only and does not affect functionality). If an explicit name has **not** been + /// set, using `<>` will denote a required argument, and `[]` will denote an optional argument + /// + /// Values may be followed by + /// * The multiple denotation `...` + /// * More Value notation + /// + /// More than one value will also implicitly set the arguments number of values, i.e. having + /// two values, `--option [val1] [val2]` specifies that in order for option to be satisified it + /// must receive exactly two values + /// + /// Example values are as follows (`FILE`, and `SPEED`): + /// + /// ```notrust + /// -s, --some [FILE] 'some option' + /// --rapid=... 'some required multiple option' + /// ``` + /// + /// ### Help String + /// + /// The help string is denoted between a pair of single quotes `''` and may contain any + /// characters. + /// + /// Example help strings are as follows: + /// + /// ```notrust + /// -s, --some [FILE] 'some option' + /// --rapid=... 'some required multiple option' + /// ``` + /// + /// ### Additional Sigils + /// + /// Multiple notation `...` (three consecutive dots/periods) specifies that this argument may + /// be used multiple times. Do not confuse multiple occurrences (`...`) with multiple values. + /// `--option val1 val2` is a single occurrence with multiple values. `--flag --flag` is + /// multiple occurrences (and then you can obviously have instances of both as well) + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// App::new("prog") + /// .args(&[ + /// Arg::from_usage("--config 'a required file for the configuration and no short'"), + /// Arg::from_usage("-d, --debug... 'turns on debugging information and allows multiples'"), + /// Arg::from_usage("[input] 'an optional input file to use'") + /// ]) + /// # ; + /// ``` + /// [`Arg`]: ./struct.Arg.html + /// [`Arg::from_usage`]: ./struct.Arg.html#method.from_usage + pub fn from_usage(u: &'a str) -> Self { + let parser = UsageParser::from_usage(u); + parser.parse() + } + + /// Sets the short version of the argument without the preceding `-`. + /// + /// By default `clap` automatically assigns `V` and `h` to the auto-generated `version` and + /// `help` arguments respectively. You may use the uppercase `V` or lowercase `h` for your own + /// arguments, in which case `clap` simply will not assign those to the auto-generated + /// `version` or `help` arguments. + /// + /// **NOTE:** Any leading `-` characters will be stripped, and only the first + /// non `-` character will be used as the [`short`] version + /// + /// # Examples + /// + /// To set [`short`] use a single valid UTF-8 code point. If you supply a leading `-` such as + /// `-c`, the `-` will be stripped. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .short("c") + /// # ; + /// ``` + /// + /// Setting [`short`] allows using the argument via a single hyphen (`-`) such as `-c` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("config") + /// .short("c")) + /// .get_matches_from(vec![ + /// "prog", "-c" + /// ]); + /// + /// assert!(m.is_present("config")); + /// ``` + /// [`short`]: ./struct.Arg.html#method.short + pub fn short>(mut self, s: S) -> Self { + self.s.short = s.as_ref().trim_left_matches(|c| c == '-').chars().nth(0); + self + } + + /// Sets the long version of the argument without the preceding `--`. + /// + /// By default `clap` automatically assigns `version` and `help` to the auto-generated + /// `version` and `help` arguments respectively. You may use the word `version` or `help` for + /// the long form of your own arguments, in which case `clap` simply will not assign those to + /// the auto-generated `version` or `help` arguments. + /// + /// **NOTE:** Any leading `-` characters will be stripped + /// + /// # Examples + /// + /// To set `long` use a word containing valid UTF-8 codepoints. If you supply a double leading + /// `--` such as `--config` they will be stripped. Hyphens in the middle of the word, however, + /// will *not* be stripped (i.e. `config-file` is allowed) + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("cfg") + /// .long("config") + /// # ; + /// ``` + /// + /// Setting `long` allows using the argument via a double hyphen (`--`) such as `--config` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .long("config")) + /// .get_matches_from(vec![ + /// "prog", "--config" + /// ]); + /// + /// assert!(m.is_present("cfg")); + /// ``` + pub fn long(mut self, l: &'b str) -> Self { + self.s.long = Some(l.trim_left_matches(|c| c == '-')); + self + } + + /// Allows adding a [`Arg`] alias, which function as "hidden" arguments that + /// automatically dispatch as if this argument was used. This is more efficient, and easier + /// than creating multiple hidden arguments as one only needs to check for the existence of + /// this command, and not all variants. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("test") + /// .long("test") + /// .alias("alias") + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "prog", "--alias", "cool" + /// ]); + /// assert!(m.is_present("test")); + /// assert_eq!(m.value_of("test"), Some("cool")); + /// ``` + /// [`Arg`]: ./struct.Arg.html + pub fn alias>(mut self, name: S) -> Self { + if let Some(ref mut als) = self.s.aliases { + als.push((name.into(), false)); + } else { + self.s.aliases = Some(vec![(name.into(), false)]); + } + self + } + + /// Allows adding [`Arg`] aliases, which function as "hidden" arguments that + /// automatically dispatch as if this argument was used. This is more efficient, and easier + /// than creating multiple hidden subcommands as one only needs to check for the existence of + /// this command, and not all variants. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("test") + /// .long("test") + /// .aliases(&["do-stuff", "do-tests", "tests"]) + /// .help("the file to add") + /// .required(false)) + /// .get_matches_from(vec![ + /// "prog", "--do-tests" + /// ]); + /// assert!(m.is_present("test")); + /// ``` + /// [`Arg`]: ./struct.Arg.html + pub fn aliases(mut self, names: &[&'b str]) -> Self { + if let Some(ref mut als) = self.s.aliases { + for n in names { + als.push((n, false)); + } + } else { + self.s.aliases = Some(names.iter().map(|n| (*n, false)).collect::>()); + } + self + } + + /// Allows adding a [`Arg`] alias that functions exactly like those defined with + /// [`Arg::alias`], except that they are visible inside the help message. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("test") + /// .visible_alias("something-awesome") + /// .long("test") + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "prog", "--something-awesome", "coffee" + /// ]); + /// assert!(m.is_present("test")); + /// assert_eq!(m.value_of("test"), Some("coffee")); + /// ``` + /// [`Arg`]: ./struct.Arg.html + /// [`App::alias`]: ./struct.Arg.html#method.alias + pub fn visible_alias>(mut self, name: S) -> Self { + if let Some(ref mut als) = self.s.aliases { + als.push((name.into(), true)); + } else { + self.s.aliases = Some(vec![(name.into(), true)]); + } + self + } + + /// Allows adding multiple [`Arg`] aliases that functions exactly like those defined + /// with [`Arg::aliases`], except that they are visible inside the help message. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("test") + /// .long("test") + /// .visible_aliases(&["something", "awesome", "cool"])) + /// .get_matches_from(vec![ + /// "prog", "--awesome" + /// ]); + /// assert!(m.is_present("test")); + /// ``` + /// [`Arg`]: ./struct.Arg.html + /// [`App::aliases`]: ./struct.Arg.html#method.aliases + pub fn visible_aliases(mut self, names: &[&'b str]) -> Self { + if let Some(ref mut als) = self.s.aliases { + for n in names { + als.push((n, true)); + } + } else { + self.s.aliases = Some(names.iter().map(|n| (*n, true)).collect::>()); + } + self + } + + /// Sets the short help text of the argument that will be displayed to the user when they print + /// the help information with `-h`. Typically, this is a short (one line) description of the + /// arg. + /// + /// **NOTE:** If only `Arg::help` is provided, and not [`Arg::long_help`] but the user requests + /// `--help` clap will still display the contents of `help` appropriately + /// + /// **NOTE:** Only `Arg::help` is used in completion script generation in order to be concise + /// + /// # Examples + /// + /// Any valid UTF-8 is allowed in the help text. The one exception is when one wishes to + /// include a newline in the help text and have the following text be properly aligned with all + /// the other help text. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .help("The config file used by the myprog") + /// # ; + /// ``` + /// + /// Setting `help` displays a short message to the side of the argument when the user passes + /// `-h` or `--help` (by default). + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .long("config") + /// .help("Some help text describing the --config arg")) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// + /// The above example displays + /// + /// ```notrust + /// helptest + /// + /// USAGE: + /// helptest [FLAGS] + /// + /// FLAGS: + /// --config Some help text describing the --config arg + /// -h, --help Prints help information + /// -V, --version Prints version information + /// ``` + /// [`Arg::long_help`]: ./struct.Arg.html#method.long_help + pub fn help(mut self, h: &'b str) -> Self { + self.b.help = Some(h); + self + } + + /// Sets the long help text of the argument that will be displayed to the user when they print + /// the help information with `--help`. Typically this a more detailed (multi-line) message + /// that describes the arg. + /// + /// **NOTE:** If only `long_help` is provided, and not [`Arg::help`] but the user requests `-h` + /// clap will still display the contents of `long_help` appropriately + /// + /// **NOTE:** Only [`Arg::help`] is used in completion script generation in order to be concise + /// + /// # Examples + /// + /// Any valid UTF-8 is allowed in the help text. The one exception is when one wishes to + /// include a newline in the help text and have the following text be properly aligned with all + /// the other help text. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .long_help( + /// "The config file used by the myprog must be in JSON format + /// with only valid keys and may not contain other nonsense + /// that cannot be read by this program. Obviously I'm going on + /// and on, so I'll stop now.") + /// # ; + /// ``` + /// + /// Setting `help` displays a short message to the side of the argument when the user passes + /// `-h` or `--help` (by default). + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .long("config") + /// .long_help( + /// "The config file used by the myprog must be in JSON format + /// with only valid keys and may not contain other nonsense + /// that cannot be read by this program. Obviously I'm going on + /// and on, so I'll stop now.")) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// + /// The above example displays + /// + /// ```notrust + /// helptest + /// + /// USAGE: + /// helptest [FLAGS] + /// + /// FLAGS: + /// --config + /// The config file used by the myprog must be in JSON format + /// with only valid keys and may not contain other nonsense + /// that cannot be read by this program. Obviously I'm going on + /// and on, so I'll stop now. + /// + /// -h, --help + /// Prints help information + /// + /// -V, --version + /// Prints version information + /// ``` + /// [`Arg::help`]: ./struct.Arg.html#method.help + pub fn long_help(mut self, h: &'b str) -> Self { + self.b.long_help = Some(h); + self + } + + /// Specifies that this arg is the last, or final, positional argument (i.e. has the highest + /// index) and is *only* able to be accessed via the `--` syntax (i.e. `$ prog args -- + /// last_arg`). Even, if no other arguments are left to parse, if the user omits the `--` syntax + /// they will receive an [`UnknownArgument`] error. Setting an argument to `.last(true)` also + /// allows one to access this arg early using the `--` syntax. Accessing an arg early, even with + /// the `--` syntax is otherwise not possible. + /// + /// **NOTE:** This will change the usage string to look like `$ prog [FLAGS] [-- ]` if + /// `ARG` is marked as `.last(true)`. + /// + /// **NOTE:** This setting will imply [`AppSettings::DontCollapseArgsInUsage`] because failing + /// to set this can make the usage string very confusing. + /// + /// **NOTE**: This setting only applies to positional arguments, and has no affect on FLAGS / + /// OPTIONS + /// + /// **CAUTION:** Setting an argument to `.last(true)` *and* having child subcommands is not + /// recommended with the exception of *also* using [`AppSettings::ArgsNegateSubcommands`] + /// (or [`AppSettings::SubcommandsNegateReqs`] if the argument marked `.last(true)` is also + /// marked [`.required(true)`]) + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("args") + /// .last(true) + /// # ; + /// ``` + /// + /// Setting [`Arg::last(true)`] ensures the arg has the highest [index] of all positional args + /// and requires that the `--` syntax be used to access it early. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("first")) + /// .arg(Arg::with_name("second")) + /// .arg(Arg::with_name("third").last(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "one", "--", "three" + /// ]); + /// + /// assert!(res.is_ok()); + /// let m = res.unwrap(); + /// assert_eq!(m.value_of("third"), Some("three")); + /// assert!(m.value_of("second").is_none()); + /// ``` + /// + /// Even if the positional argument marked `.last(true)` is the only argument left to parse, + /// failing to use the `--` syntax results in an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("first")) + /// .arg(Arg::with_name("second")) + /// .arg(Arg::with_name("third").last(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "one", "two", "three" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// [`Arg::last(true)`]: ./struct.Arg.html#method.last + /// [index]: ./struct.Arg.html#method.index + /// [`AppSettings::DontCollapseArgsInUsage`]: ./enum.AppSettings.html#variant.DontCollapseArgsInUsage + /// [`AppSettings::ArgsNegateSubcommands`]: ./enum.AppSettings.html#variant.ArgsNegateSubcommands + /// [`AppSettings::SubcommandsNegateReqs`]: ./enum.AppSettings.html#variant.SubcommandsNegateReqs + /// [`.required(true)`]: ./struct.Arg.html#method.required + /// [`UnknownArgument`]: ./enum.ErrorKind.html#variant.UnknownArgument + pub fn last(self, l: bool) -> Self { + if l { + self.set(ArgSettings::Last) + } else { + self.unset(ArgSettings::Last) + } + } + + /// Sets whether or not the argument is required by default. Required by default means it is + /// required, when no other conflicting rules have been evaluated. Conflicting rules take + /// precedence over being required. **Default:** `false` + /// + /// **NOTE:** Flags (i.e. not positional, or arguments that take values) cannot be required by + /// default. This is simply because if a flag should be required, it should simply be implied + /// as no additional information is required from user. Flags by their very nature are simply + /// yes/no, or true/false. + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required(true) + /// # ; + /// ``` + /// + /// Setting [`Arg::required(true)`] requires that the argument be used at runtime. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required(true) + /// .takes_value(true) + /// .long("config")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "file.conf" + /// ]); + /// + /// assert!(res.is_ok()); + /// ``` + /// + /// Setting [`Arg::required(true)`] and *not* supplying that argument is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required(true) + /// .takes_value(true) + /// .long("config")) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::required(true)`]: ./struct.Arg.html#method.required + pub fn required(self, r: bool) -> Self { + if r { + self.set(ArgSettings::Required) + } else { + self.unset(ArgSettings::Required) + } + } + + /// Requires that options use the `--option=val` syntax (i.e. an equals between the option and + /// associated value) **Default:** `false` + /// + /// **NOTE:** This setting also removes the default of allowing empty values and implies + /// [`Arg::empty_values(false)`]. + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .long("config") + /// .takes_value(true) + /// .require_equals(true) + /// # ; + /// ``` + /// + /// Setting [`Arg::require_equals(true)`] requires that the option have an equals sign between + /// it and the associated value. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .require_equals(true) + /// .takes_value(true) + /// .long("config")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config=file.conf" + /// ]); + /// + /// assert!(res.is_ok()); + /// ``` + /// + /// Setting [`Arg::require_equals(true)`] and *not* supplying the equals will cause an error + /// unless [`Arg::empty_values(true)`] is set. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .require_equals(true) + /// .takes_value(true) + /// .long("config")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "file.conf" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::EmptyValue); + /// ``` + /// [`Arg::require_equals(true)`]: ./struct.Arg.html#method.require_equals + /// [`Arg::empty_values(true)`]: ./struct.Arg.html#method.empty_values + /// [`Arg::empty_values(false)`]: ./struct.Arg.html#method.empty_values + pub fn require_equals(mut self, r: bool) -> Self { + if r { + self.unsetb(ArgSettings::EmptyValues); + self.set(ArgSettings::RequireEquals) + } else { + self.unset(ArgSettings::RequireEquals) + } + } + + /// Allows values which start with a leading hyphen (`-`) + /// + /// **WARNING**: Take caution when using this setting, combined with [`Arg::multiple(true)`] as + /// it this becomes ambigous `$ prog --arg -- -- val`. All three `--, --, val` will be values + /// when the user may have thought the second `--` would constitute the normal, "Only + /// positional args follow" idiom. To fix this, consider using [`Arg::number_of_values(1)`] + /// + /// **WARNING**: When building your CLIs, consider the effects of allowing leading hyphens and + /// the user passing in a value that matches a valid short. For example `prog -opt -F` where + /// `-F` is supposed to be a value, yet `-F` is *also* a valid short for anther arg. Care should + /// should be taken when designing these args. This is compounded by the ability to "stack" + /// short args. I.e. if `-val` is supposed to be a value, but `-v`, `-a`, and `-l` are all valid + /// shorts. + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("pattern") + /// .allow_hyphen_values(true) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("pat") + /// .allow_hyphen_values(true) + /// .takes_value(true) + /// .long("pattern")) + /// .get_matches_from(vec![ + /// "prog", "--pattern", "-file" + /// ]); + /// + /// assert_eq!(m.value_of("pat"), Some("-file")); + /// ``` + /// + /// Not setting [`Arg::allow_hyphen_values(true)`] and supplying a value which starts with a + /// hyphen is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("pat") + /// .takes_value(true) + /// .long("pattern")) + /// .get_matches_from_safe(vec![ + /// "prog", "--pattern", "-file" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// [`Arg::allow_hyphen_values(true)`]: ./struct.Arg.html#method.allow_hyphen_values + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + /// [`Arg::number_of_values(1)`]: ./struct.Arg.html#method.number_of_values + pub fn allow_hyphen_values(self, a: bool) -> Self { + if a { + self.set(ArgSettings::AllowLeadingHyphen) + } else { + self.unset(ArgSettings::AllowLeadingHyphen) + } + } + /// Sets an arg that override this arg's required setting. (i.e. this arg will be required + /// unless this other argument is present). + /// + /// **Pro Tip:** Using [`Arg::required_unless`] implies [`Arg::required`] and is therefore not + /// mandatory to also set. + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required_unless("debug") + /// # ; + /// ``` + /// + /// Setting [`Arg::required_unless(name)`] requires that the argument be used at runtime + /// *unless* `name` is present. In the following example, the required argument is *not* + /// provided, but it's not an error because the `unless` arg has been supplied. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless("dbg") + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .get_matches_from_safe(vec![ + /// "prog", "--debug" + /// ]); + /// + /// assert!(res.is_ok()); + /// ``` + /// + /// Setting [`Arg::required_unless(name)`] and *not* supplying `name` or this arg is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless("dbg") + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::required_unless`]: ./struct.Arg.html#method.required_unless + /// [`Arg::required`]: ./struct.Arg.html#method.required + /// [`Arg::required_unless(name)`]: ./struct.Arg.html#method.required_unless + pub fn required_unless(mut self, name: &'a str) -> Self { + if let Some(ref mut vec) = self.b.r_unless { + vec.push(name); + } else { + self.b.r_unless = Some(vec![name]); + } + self.required(true) + } + + /// Sets args that override this arg's required setting. (i.e. this arg will be required unless + /// all these other arguments are present). + /// + /// **NOTE:** If you wish for this argument to only be required if *one of* these args are + /// present see [`Arg::required_unless_one`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required_unless_all(&["cfg", "dbg"]) + /// # ; + /// ``` + /// + /// Setting [`Arg::required_unless_all(names)`] requires that the argument be used at runtime + /// *unless* *all* the args in `names` are present. In the following example, the required + /// argument is *not* provided, but it's not an error because all the `unless` args have been + /// supplied. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless_all(&["dbg", "infile"]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .arg(Arg::with_name("infile") + /// .short("i") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "--debug", "-i", "file" + /// ]); + /// + /// assert!(res.is_ok()); + /// ``` + /// + /// Setting [`Arg::required_unless_all(names)`] and *not* supplying *all* of `names` or this + /// arg is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless_all(&["dbg", "infile"]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .arg(Arg::with_name("infile") + /// .short("i") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::required_unless_one`]: ./struct.Arg.html#method.required_unless_one + /// [`Arg::required_unless_all(names)`]: ./struct.Arg.html#method.required_unless_all + pub fn required_unless_all(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.r_unless { + for s in names { + vec.push(s); + } + } else { + self.b.r_unless = Some(names.iter().map(|s| *s).collect::>()); + } + self.setb(ArgSettings::RequiredUnlessAll); + self.required(true) + } + + /// Sets args that override this arg's [required] setting. (i.e. this arg will be required + /// unless *at least one of* these other arguments are present). + /// + /// **NOTE:** If you wish for this argument to only be required if *all of* these args are + /// present see [`Arg::required_unless_all`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required_unless_all(&["cfg", "dbg"]) + /// # ; + /// ``` + /// + /// Setting [`Arg::required_unless_one(names)`] requires that the argument be used at runtime + /// *unless* *at least one of* the args in `names` are present. In the following example, the + /// required argument is *not* provided, but it's not an error because one the `unless` args + /// have been supplied. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless_one(&["dbg", "infile"]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .arg(Arg::with_name("infile") + /// .short("i") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "--debug" + /// ]); + /// + /// assert!(res.is_ok()); + /// ``` + /// + /// Setting [`Arg::required_unless_one(names)`] and *not* supplying *at least one of* `names` + /// or this arg is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_unless_one(&["dbg", "infile"]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("dbg") + /// .long("debug")) + /// .arg(Arg::with_name("infile") + /// .short("i") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [required]: ./struct.Arg.html#method.required + /// [`Arg::required_unless_one(names)`]: ./struct.Arg.html#method.required_unless_one + /// [`Arg::required_unless_all`]: ./struct.Arg.html#method.required_unless_all + pub fn required_unless_one(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.r_unless { + for s in names { + vec.push(s); + } + } else { + self.b.r_unless = Some(names.iter().map(|s| *s).collect::>()); + } + self.required(true) + } + + /// Sets a conflicting argument by name. I.e. when using this argument, + /// the following argument can't be present and vice versa. + /// + /// **NOTE:** Conflicting rules take precedence over being required by default. Conflict rules + /// only need to be set for one of the two arguments, they do not need to be set for each. + /// + /// **NOTE:** Defining a conflict is two-way, but does *not* need to defined for both arguments + /// (i.e. if A conflicts with B, defining A.conflicts_with(B) is sufficient. You do not need + /// need to also do B.conflicts_with(A)) + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .conflicts_with("debug") + /// # ; + /// ``` + /// + /// Setting conflicting argument, and having both arguments present at runtime is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .conflicts_with("debug") + /// .long("config")) + /// .arg(Arg::with_name("debug") + /// .long("debug")) + /// .get_matches_from_safe(vec![ + /// "prog", "--debug", "--config", "file.conf" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::ArgumentConflict); + /// ``` + pub fn conflicts_with(mut self, name: &'a str) -> Self { + if let Some(ref mut vec) = self.b.blacklist { + vec.push(name); + } else { + self.b.blacklist = Some(vec![name]); + } + self + } + + /// The same as [`Arg::conflicts_with`] but allows specifying multiple two-way conlicts per + /// argument. + /// + /// **NOTE:** Conflicting rules take precedence over being required by default. Conflict rules + /// only need to be set for one of the two arguments, they do not need to be set for each. + /// + /// **NOTE:** Defining a conflict is two-way, but does *not* need to defined for both arguments + /// (i.e. if A conflicts with B, defining A.conflicts_with(B) is sufficient. You do not need + /// need to also do B.conflicts_with(A)) + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .conflicts_with_all(&["debug", "input"]) + /// # ; + /// ``` + /// + /// Setting conflicting argument, and having any of the arguments present at runtime with a + /// conflicting argument is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .conflicts_with_all(&["debug", "input"]) + /// .long("config")) + /// .arg(Arg::with_name("debug") + /// .long("debug")) + /// .arg(Arg::with_name("input") + /// .index(1)) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "file.conf", "file.txt" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::ArgumentConflict); + /// ``` + /// [`Arg::conflicts_with`]: ./struct.Arg.html#method.conflicts_with + pub fn conflicts_with_all(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.blacklist { + for s in names { + vec.push(s); + } + } else { + self.b.blacklist = Some(names.iter().map(|s| *s).collect::>()); + } + self + } + + /// Sets a overridable argument by name. I.e. this argument and the following argument + /// will override each other in POSIX style (whichever argument was specified at runtime + /// **last** "wins") + /// + /// **NOTE:** When an argument is overridden it is essentially as if it never was used, any + /// conflicts, requirements, etc. are evaluated **after** all "overrides" have been removed + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::from_usage("-f, --flag 'some flag'") + /// .conflicts_with("debug")) + /// .arg(Arg::from_usage("-d, --debug 'other flag'")) + /// .arg(Arg::from_usage("-c, --color 'third flag'") + /// .overrides_with("flag")) + /// .get_matches_from(vec![ + /// "prog", "-f", "-d", "-c"]); + /// // ^~~~~~~~~~~~^~~~~ flag is overridden by color + /// + /// assert!(m.is_present("color")); + /// assert!(m.is_present("debug")); // even though flag conflicts with debug, it's as if flag + /// // was never used because it was overridden with color + /// assert!(!m.is_present("flag")); + /// ``` + pub fn overrides_with(mut self, name: &'a str) -> Self { + if let Some(ref mut vec) = self.b.overrides { + vec.push(name.as_ref()); + } else { + self.b.overrides = Some(vec![name.as_ref()]); + } + self + } + + /// Sets multiple mutually overridable arguments by name. I.e. this argument and the following + /// argument will override each other in POSIX style (whichever argument was specified at + /// runtime **last** "wins") + /// + /// **NOTE:** When an argument is overridden it is essentially as if it never was used, any + /// conflicts, requirements, etc. are evaluated **after** all "overrides" have been removed + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::from_usage("-f, --flag 'some flag'") + /// .conflicts_with("color")) + /// .arg(Arg::from_usage("-d, --debug 'other flag'")) + /// .arg(Arg::from_usage("-c, --color 'third flag'") + /// .overrides_with_all(&["flag", "debug"])) + /// .get_matches_from(vec![ + /// "prog", "-f", "-d", "-c"]); + /// // ^~~~~~^~~~~~~~~ flag and debug are overridden by color + /// + /// assert!(m.is_present("color")); // even though flag conflicts with color, it's as if flag + /// // and debug were never used because they were overridden + /// // with color + /// assert!(!m.is_present("debug")); + /// assert!(!m.is_present("flag")); + /// ``` + pub fn overrides_with_all(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.overrides { + for s in names { + vec.push(s); + } + } else { + self.b.overrides = Some(names.iter().map(|s| *s).collect::>()); + } + self + } + + /// Sets an argument by name that is required when this one is present I.e. when + /// using this argument, the following argument *must* be present. + /// + /// **NOTE:** [Conflicting] rules and [override] rules take precedence over being required + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .requires("input") + /// # ; + /// ``` + /// + /// Setting [`Arg::requires(name)`] requires that the argument be used at runtime if the + /// defining argument is used. If the defining argument isn't used, the other argument isn't + /// required + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires("input") + /// .long("config")) + /// .arg(Arg::with_name("input") + /// .index(1)) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_ok()); // We didn't use cfg, so input wasn't required + /// ``` + /// + /// Setting [`Arg::requires(name)`] and *not* supplying that argument is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires("input") + /// .long("config")) + /// .arg(Arg::with_name("input") + /// .index(1)) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "file.conf" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::requires(name)`]: ./struct.Arg.html#method.requires + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [override]: ./struct.Arg.html#method.overrides_with + pub fn requires(mut self, name: &'a str) -> Self { + if let Some(ref mut vec) = self.b.requires { + vec.push((None, name)); + } else { + let mut vec = vec![]; + vec.push((None, name)); + self.b.requires = Some(vec); + } + self + } + + /// Allows a conditional requirement. The requirement will only become valid if this arg's value + /// equals `val`. + /// + /// **NOTE:** If using YAML the values should be laid out as follows + /// + /// ```yaml + /// requires_if: + /// - [val, arg] + /// ``` + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .requires_if("val", "arg") + /// # ; + /// ``` + /// + /// Setting [`Arg::requires_if(val, arg)`] requires that the `arg` be used at runtime if the + /// defining argument's value is equal to `val`. If the defining argument is anything other than + /// `val`, the other argument isn't required. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires_if("my.cfg", "other") + /// .long("config")) + /// .arg(Arg::with_name("other")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "some.cfg" + /// ]); + /// + /// assert!(res.is_ok()); // We didn't use --config=my.cfg, so other wasn't required + /// ``` + /// + /// Setting [`Arg::requires_if(val, arg)`] and setting the value to `val` but *not* supplying + /// `arg` is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires_if("my.cfg", "input") + /// .long("config")) + /// .arg(Arg::with_name("input")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "my.cfg" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::requires(name)`]: ./struct.Arg.html#method.requires + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [override]: ./struct.Arg.html#method.overrides_with + pub fn requires_if(mut self, val: &'b str, arg: &'a str) -> Self { + if let Some(ref mut vec) = self.b.requires { + vec.push((Some(val), arg)); + } else { + self.b.requires = Some(vec![(Some(val), arg)]); + } + self + } + + /// Allows multiple conditional requirements. The requirement will only become valid if this arg's value + /// equals `val`. + /// + /// **NOTE:** If using YAML the values should be laid out as follows + /// + /// ```yaml + /// requires_if: + /// - [val, arg] + /// - [val2, arg2] + /// ``` + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .requires_ifs(&[ + /// ("val", "arg"), + /// ("other_val", "arg2"), + /// ]) + /// # ; + /// ``` + /// + /// Setting [`Arg::requires_ifs(&["val", "arg"])`] requires that the `arg` be used at runtime if the + /// defining argument's value is equal to `val`. If the defining argument's value is anything other + /// than `val`, `arg` isn't required. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires_ifs(&[ + /// ("special.conf", "opt"), + /// ("other.conf", "other"), + /// ]) + /// .long("config")) + /// .arg(Arg::with_name("opt") + /// .long("option") + /// .takes_value(true)) + /// .arg(Arg::with_name("other")) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "special.conf" + /// ]); + /// + /// assert!(res.is_err()); // We used --config=special.conf so --option is required + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::requires(name)`]: ./struct.Arg.html#method.requires + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [override]: ./struct.Arg.html#method.overrides_with + pub fn requires_ifs(mut self, ifs: &[(&'b str, &'a str)]) -> Self { + if let Some(ref mut vec) = self.b.requires { + for &(val, arg) in ifs { + vec.push((Some(val), arg)); + } + } else { + let mut vec = vec![]; + for &(val, arg) in ifs { + vec.push((Some(val), arg)); + } + self.b.requires = Some(vec); + } + self + } + + /// Allows specifying that an argument is [required] conditionally. The requirement will only + /// become valid if the specified `arg`'s value equals `val`. + /// + /// **NOTE:** If using YAML the values should be laid out as follows + /// + /// ```yaml + /// required_if: + /// - [arg, val] + /// ``` + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required_if("other_arg", "value") + /// # ; + /// ``` + /// + /// Setting [`Arg::required_if(arg, val)`] makes this arg required if the `arg` is used at + /// runtime and it's value is equal to `val`. If the `arg`'s value is anything other than `val`, + /// this argument isn't required. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .required_if("other", "special") + /// .long("config")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "--other", "not-special" + /// ]); + /// + /// assert!(res.is_ok()); // We didn't use --other=special, so "cfg" wasn't required + /// ``` + /// + /// Setting [`Arg::required_if(arg, val)`] and having `arg` used with a value of `val` but *not* + /// using this arg is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .required_if("other", "special") + /// .long("config")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "--other", "special" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::requires(name)`]: ./struct.Arg.html#method.requires + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [required]: ./struct.Arg.html#method.required + pub fn required_if(mut self, arg: &'a str, val: &'b str) -> Self { + if let Some(ref mut vec) = self.r_ifs { + vec.push((arg, val)); + } else { + self.r_ifs = Some(vec![(arg, val)]); + } + self + } + + /// Allows specifying that an argument is [required] based on multiple conditions. The + /// conditions are set up in a `(arg, val)` style tuple. The requirement will only become valid + /// if one of the specified `arg`'s value equals it's corresponding `val`. + /// + /// **NOTE:** If using YAML the values should be laid out as follows + /// + /// ```yaml + /// required_if: + /// - [arg, val] + /// - [arg2, val2] + /// ``` + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .required_ifs(&[ + /// ("extra", "val"), + /// ("option", "spec") + /// ]) + /// # ; + /// ``` + /// + /// Setting [`Arg::required_ifs(&[(arg, val)])`] makes this arg required if any of the `arg`s + /// are used at runtime and it's corresponding value is equal to `val`. If the `arg`'s value is + /// anything other than `val`, this argument isn't required. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_ifs(&[ + /// ("extra", "val"), + /// ("option", "spec") + /// ]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("extra") + /// .takes_value(true) + /// .long("extra")) + /// .arg(Arg::with_name("option") + /// .takes_value(true) + /// .long("option")) + /// .get_matches_from_safe(vec![ + /// "prog", "--option", "other" + /// ]); + /// + /// assert!(res.is_ok()); // We didn't use --option=spec, or --extra=val so "cfg" isn't required + /// ``` + /// + /// Setting [`Arg::required_ifs(&[(arg, val)])`] and having any of the `arg`s used with it's + /// value of `val` but *not* using this arg is an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .required_ifs(&[ + /// ("extra", "val"), + /// ("option", "spec") + /// ]) + /// .takes_value(true) + /// .long("config")) + /// .arg(Arg::with_name("extra") + /// .takes_value(true) + /// .long("extra")) + /// .arg(Arg::with_name("option") + /// .takes_value(true) + /// .long("option")) + /// .get_matches_from_safe(vec![ + /// "prog", "--option", "spec" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`Arg::requires(name)`]: ./struct.Arg.html#method.requires + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [required]: ./struct.Arg.html#method.required + pub fn required_ifs(mut self, ifs: &[(&'a str, &'b str)]) -> Self { + if let Some(ref mut vec) = self.r_ifs { + for r_if in ifs { + vec.push((r_if.0, r_if.1)); + } + } else { + let mut vec = vec![]; + for r_if in ifs { + vec.push((r_if.0, r_if.1)); + } + self.r_ifs = Some(vec); + } + self + } + + /// Sets multiple arguments by names that are required when this one is present I.e. when + /// using this argument, the following arguments *must* be present. + /// + /// **NOTE:** [Conflicting] rules and [override] rules take precedence over being required + /// by default. + /// + /// # Examples + /// + /// ```rust + /// # use clap::Arg; + /// Arg::with_name("config") + /// .requires_all(&["input", "output"]) + /// # ; + /// ``` + /// + /// Setting [`Arg::requires_all(&[arg, arg2])`] requires that all the arguments be used at + /// runtime if the defining argument is used. If the defining argument isn't used, the other + /// argument isn't required + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires("input") + /// .long("config")) + /// .arg(Arg::with_name("input") + /// .index(1)) + /// .arg(Arg::with_name("output") + /// .index(2)) + /// .get_matches_from_safe(vec![ + /// "prog" + /// ]); + /// + /// assert!(res.is_ok()); // We didn't use cfg, so input and output weren't required + /// ``` + /// + /// Setting [`Arg::requires_all(&[arg, arg2])`] and *not* supplying all the arguments is an + /// error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .takes_value(true) + /// .requires_all(&["input", "output"]) + /// .long("config")) + /// .arg(Arg::with_name("input") + /// .index(1)) + /// .arg(Arg::with_name("output") + /// .index(2)) + /// .get_matches_from_safe(vec![ + /// "prog", "--config", "file.conf", "in.txt" + /// ]); + /// + /// assert!(res.is_err()); + /// // We didn't use output + /// assert_eq!(res.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [Conflicting]: ./struct.Arg.html#method.conflicts_with + /// [override]: ./struct.Arg.html#method.overrides_with + /// [`Arg::requires_all(&[arg, arg2])`]: ./struct.Arg.html#method.requires_all + pub fn requires_all(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.requires { + for s in names { + vec.push((None, s)); + } + } else { + let mut vec = vec![]; + for s in names { + vec.push((None, *s)); + } + self.b.requires = Some(vec); + } + self + } + + /// Specifies that the argument takes a value at run time. + /// + /// **NOTE:** values for arguments may be specified in any of the following methods + /// + /// * Using a space such as `-o value` or `--option value` + /// * Using an equals and no space such as `-o=value` or `--option=value` + /// * Use a short and no space such as `-ovalue` + /// + /// **NOTE:** By default, args which allow [multiple values] are delimited by commas, meaning + /// `--option=val1,val2,val3` is three values for the `--option` argument. If you wish to + /// change the delimiter to another character you can use [`Arg::value_delimiter(char)`], + /// alternatively you can turn delimiting values **OFF** by using [`Arg::use_delimiter(false)`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .takes_value(true) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "prog", "--mode", "fast" + /// ]); + /// + /// assert!(m.is_present("mode")); + /// assert_eq!(m.value_of("mode"), Some("fast")); + /// ``` + /// [`Arg::value_delimiter(char)`]: ./struct.Arg.html#method.value_delimiter + /// [`Arg::use_delimiter(false)`]: ./struct.Arg.html#method.use_delimiter + /// [multiple values]: ./struct.Arg.html#method.multiple + pub fn takes_value(self, tv: bool) -> Self { + if tv { + self.set(ArgSettings::TakesValue) + } else { + self.unset(ArgSettings::TakesValue) + } + } + + /// Specifies if the possible values of an argument should be displayed in the help text or + /// not. Defaults to `false` (i.e. show possible values) + /// + /// This is useful for args with many values, or ones which are explained elsewhere in the + /// help text. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .hide_possible_values(true) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .possible_values(&["fast", "slow"]) + /// .takes_value(true) + /// .hide_possible_values(true)); + /// + /// ``` + /// + /// If we were to run the above program with `--help` the `[values: fast, slow]` portion of + /// the help text would be omitted. + pub fn hide_possible_values(self, hide: bool) -> Self { + if hide { + self.set(ArgSettings::HidePossibleValues) + } else { + self.unset(ArgSettings::HidePossibleValues) + } + } + + /// Specifies if the default value of an argument should be displayed in the help text or + /// not. Defaults to `false` (i.e. show default value) + /// + /// This is useful when default behavior of an arg is explained elsewhere in the help text. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .hide_default_value(true) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("connect") + /// .arg(Arg::with_name("host") + /// .long("host") + /// .default_value("localhost") + /// .hide_default_value(true)); + /// + /// ``` + /// + /// If we were to run the above program with `--help` the `[default: localhost]` portion of + /// the help text would be omitted. + pub fn hide_default_value(self, hide: bool) -> Self { + if hide { + self.set(ArgSettings::HideDefaultValue) + } else { + self.unset(ArgSettings::HideDefaultValue) + } + } + + /// Specifies the index of a positional argument **starting at** 1. + /// + /// **NOTE:** The index refers to position according to **other positional argument**. It does + /// not define position in the argument list as a whole. + /// + /// **NOTE:** If no [`Arg::short`], or [`Arg::long`] have been defined, you can optionally + /// leave off the `index` method, and the index will be assigned in order of evaluation. + /// Utilizing the `index` method allows for setting indexes out of order + /// + /// **NOTE:** When utilized with [`Arg::multiple(true)`], only the **last** positional argument + /// may be defined as multiple (i.e. with the highest index) + /// + /// # Panics + /// + /// Although not in this method directly, [`App`] will [`panic!`] if indexes are skipped (such + /// as defining `index(1)` and `index(3)` but not `index(2)`, or a positional argument is + /// defined as multiple and is not the highest index + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("config") + /// .index(1) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .index(1)) + /// .arg(Arg::with_name("debug") + /// .long("debug")) + /// .get_matches_from(vec![ + /// "prog", "--debug", "fast" + /// ]); + /// + /// assert!(m.is_present("mode")); + /// assert_eq!(m.value_of("mode"), Some("fast")); // notice index(1) means "first positional" + /// // *not* first argument + /// ``` + /// [`Arg::short`]: ./struct.Arg.html#method.short + /// [`Arg::long`]: ./struct.Arg.html#method.long + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + /// [`App`]: ./struct.App.html + /// [`panic!`]: https://doc.rust-lang.org/std/macro.panic!.html + pub fn index(mut self, idx: u64) -> Self { + self.index = Some(idx); + self + } + + /// Specifies that the argument may appear more than once. For flags, this results + /// in the number of occurrences of the flag being recorded. For example `-ddd` or `-d -d -d` + /// would count as three occurrences. For options there is a distinct difference in multiple + /// occurrences vs multiple values. + /// + /// For example, `--opt val1 val2` is one occurrence, but two values. Whereas + /// `--opt val1 --opt val2` is two occurrences. + /// + /// **WARNING:** + /// + /// Setting `multiple(true)` for an [option] with no other details, allows multiple values + /// **and** multiple occurrences because it isn't possible to have more occurrences than values + /// for options. Because multiple values are allowed, `--option val1 val2 val3` is perfectly + /// valid, be careful when designing a CLI where positional arguments are expected after a + /// option which accepts multiple values, as `clap` will continue parsing *values* until it + /// reaches the max or specific number of values defined, or another flag or option. + /// + /// **Pro Tip**: + /// + /// It's possible to define an option which allows multiple occurrences, but only one value per + /// occurrence. To do this use [`Arg::number_of_values(1)`] in coordination with + /// [`Arg::multiple(true)`]. + /// + /// **WARNING:** + /// + /// When using args with `multiple(true)` on [options] or [positionals] (i.e. those args that + /// accept values) and [subcommands], one needs to consider the posibility of an argument value + /// being the same as a valid subcommand. By default `clap` will parse the argument in question + /// as a value *only if* a value is possible at that moment. Otherwise it will be parsed as a + /// subcommand. In effect, this means using `multiple(true)` with no additional parameters and + /// a possible value that coincides with a subcommand name, the subcommand cannot be called + /// unless another argument is passed first. + /// + /// As an example, consider a CLI with an option `--ui-paths=...` and subcommand `signer` + /// + /// The following would be parsed as values to `--ui-paths`. + /// + /// ```notrust + /// $ program --ui-paths path1 path2 signer + /// ``` + /// + /// This is because `--ui-paths` accepts multiple values. `clap` will continue parsing values + /// until another argument is reached and it knows `--ui-paths` is done. + /// + /// By adding additional parameters to `--ui-paths` we can solve this issue. Consider adding + /// [`Arg::number_of_values(1)`] as discussed above. The following are all valid, and `signer` + /// is parsed as both a subcommand and a value in the second case. + /// + /// ```notrust + /// $ program --ui-paths path1 signer + /// $ program --ui-paths path1 --ui-paths signer signer + /// ``` + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("debug") + /// .short("d") + /// .multiple(true) + /// # ; + /// ``` + /// An example with flags + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("verbose") + /// .multiple(true) + /// .short("v")) + /// .get_matches_from(vec![ + /// "prog", "-v", "-v", "-v" // note, -vvv would have same result + /// ]); + /// + /// assert!(m.is_present("verbose")); + /// assert_eq!(m.occurrences_of("verbose"), 3); + /// ``` + /// + /// An example with options + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("file") + /// .multiple(true) + /// .takes_value(true) + /// .short("F")) + /// .get_matches_from(vec![ + /// "prog", "-F", "file1", "file2", "file3" + /// ]); + /// + /// assert!(m.is_present("file")); + /// assert_eq!(m.occurrences_of("file"), 1); // notice only one occurrence + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3"]); + /// ``` + /// This is functionally equivilant to the example above + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("file") + /// .multiple(true) + /// .takes_value(true) + /// .short("F")) + /// .get_matches_from(vec![ + /// "prog", "-F", "file1", "-F", "file2", "-F", "file3" + /// ]); + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3"]); + /// + /// assert!(m.is_present("file")); + /// assert_eq!(m.occurrences_of("file"), 3); // Notice 3 occurrences + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3"]); + /// ``` + /// + /// A common mistake is to define an option which allows multiples, and a positional argument + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("file") + /// .multiple(true) + /// .takes_value(true) + /// .short("F")) + /// .arg(Arg::with_name("word") + /// .index(1)) + /// .get_matches_from(vec![ + /// "prog", "-F", "file1", "file2", "file3", "word" + /// ]); + /// + /// assert!(m.is_present("file")); + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3", "word"]); // wait...what?! + /// assert!(!m.is_present("word")); // but we clearly used word! + /// ``` + /// The problem is clap doesn't know when to stop parsing values for "files". This is further + /// compounded by if we'd said `word -F file1 file2` it would have worked fine, so it would + /// appear to only fail sometimes...not good! + /// + /// A solution for the example above is to specify that `-F` only accepts one value, but is + /// allowed to appear multiple times + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("file") + /// .multiple(true) + /// .takes_value(true) + /// .number_of_values(1) + /// .short("F")) + /// .arg(Arg::with_name("word") + /// .index(1)) + /// .get_matches_from(vec![ + /// "prog", "-F", "file1", "-F", "file2", "-F", "file3", "word" + /// ]); + /// + /// assert!(m.is_present("file")); + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3"]); + /// assert!(m.is_present("word")); + /// assert_eq!(m.value_of("word"), Some("word")); + /// ``` + /// As a final example, notice if we define [`Arg::number_of_values(1)`] and try to run the + /// problem example above, it would have been a runtime error with a pretty message to the + /// user :) + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .multiple(true) + /// .takes_value(true) + /// .number_of_values(1) + /// .short("F")) + /// .arg(Arg::with_name("word") + /// .index(1)) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1", "file2", "file3", "word" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + /// [option]: ./struct.Arg.html#method.takes_value + /// [options]: ./struct.Arg.html#method.takes_value + /// [subcommands]: ./struct.SubCommand.html + /// [positionals]: ./struct.Arg.html#method.index + /// [`Arg::number_of_values(1)`]: ./struct.Arg.html#method.number_of_values + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + pub fn multiple(self, multi: bool) -> Self { + if multi { + self.set(ArgSettings::Multiple) + } else { + self.unset(ArgSettings::Multiple) + } + } + + /// Specifies a value that *stops* parsing multiple values of a give argument. By default when + /// one sets [`multiple(true)`] on an argument, clap will continue parsing values for that + /// argument until it reaches another valid argument, or one of the other more specific settings + /// for multiple values is used (such as [`min_values`], [`max_values`] or + /// [`number_of_values`]). + /// + /// **NOTE:** This setting only applies to [options] and [positional arguments] + /// + /// **NOTE:** When the terminator is passed in on the command line, it is **not** stored as one + /// of the values + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("vals") + /// .takes_value(true) + /// .multiple(true) + /// .value_terminator(";") + /// # ; + /// ``` + /// The following example uses two arguments, a sequence of commands, and the location in which + /// to perform them + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("cmds") + /// .multiple(true) + /// .allow_hyphen_values(true) + /// .value_terminator(";")) + /// .arg(Arg::with_name("location")) + /// .get_matches_from(vec![ + /// "prog", "find", "-type", "f", "-name", "special", ";", "/home/clap" + /// ]); + /// let cmds: Vec<_> = m.values_of("cmds").unwrap().collect(); + /// assert_eq!(&cmds, &["find", "-type", "f", "-name", "special"]); + /// assert_eq!(m.value_of("location"), Some("/home/clap")); + /// ``` + /// [options]: ./struct.Arg.html#method.takes_value + /// [positional arguments]: ./struct.Arg.html#method.index + /// [`multiple(true)`]: ./struct.Arg.html#method.multiple + /// [`min_values`]: ./struct.Arg.html#method.min_values + /// [`number_of_values`]: ./struct.Arg.html#method.number_of_values + /// [`max_values`]: ./struct.Arg.html#method.max_values + pub fn value_terminator(mut self, term: &'b str) -> Self { + self.setb(ArgSettings::TakesValue); + self.v.terminator = Some(term); + self + } + + /// Specifies that an argument can be matched to all child [`SubCommand`]s. + /// + /// **NOTE:** Global arguments *only* propagate down, **not** up (to parent commands), however + /// their values once a user uses them will be propagated back up to parents. In effect, this + /// means one should *define* all global arguments at the top level, however it doesn't matter + /// where the user *uses* the global argument. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("debug") + /// .short("d") + /// .global(true) + /// # ; + /// ``` + /// + /// For example, assume an appliction with two subcommands, and you'd like to define a + /// `--verbose` flag that can be called on any of the subcommands and parent, but you don't + /// want to clutter the source with three duplicate [`Arg`] definitions. + /// + /// ```rust + /// # use clap::{App, Arg, SubCommand}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("verb") + /// .long("verbose") + /// .short("v") + /// .global(true)) + /// .subcommand(SubCommand::with_name("test")) + /// .subcommand(SubCommand::with_name("do-stuff")) + /// .get_matches_from(vec![ + /// "prog", "do-stuff", "--verbose" + /// ]); + /// + /// assert_eq!(m.subcommand_name(), Some("do-stuff")); + /// let sub_m = m.subcommand_matches("do-stuff").unwrap(); + /// assert!(sub_m.is_present("verb")); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [required]: ./struct.Arg.html#method.required + /// [`ArgMatches`]: ./struct.ArgMatches.html + /// [`ArgMatches::is_present("flag")`]: ./struct.ArgMatches.html#method.is_present + /// [`Arg`]: ./struct.Arg.html + pub fn global(self, g: bool) -> Self { + if g { + self.set(ArgSettings::Global) + } else { + self.unset(ArgSettings::Global) + } + } + + /// Allows an argument to accept explicitly empty values. An empty value must be specified at + /// the command line with an explicit `""`, or `''` + /// + /// **NOTE:** Defaults to `true` (Explicitly empty values are allowed) + /// + /// **NOTE:** Implicitly sets [`Arg::takes_value(true)`] when set to `false` + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("file") + /// .long("file") + /// .empty_values(false) + /// # ; + /// ``` + /// The default is to allow empty values, such as `--option ""` would be an empty value. But + /// we can change to make empty values become an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .long("config") + /// .short("v") + /// .empty_values(false)) + /// .get_matches_from_safe(vec![ + /// "prog", "--config=" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::EmptyValue); + /// ``` + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + pub fn empty_values(mut self, ev: bool) -> Self { + if ev { + self.set(ArgSettings::EmptyValues) + } else { + self = self.set(ArgSettings::TakesValue); + self.unset(ArgSettings::EmptyValues) + } + } + + /// Hides an argument from help message output. + /// + /// **NOTE:** This does **not** hide the argument from usage strings on error + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("debug") + /// .hidden(true) + /// # ; + /// ``` + /// Setting `hidden(true)` will hide the argument when displaying help text + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("cfg") + /// .long("config") + /// .hidden(true) + /// .help("Some help text describing the --config arg")) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// + /// The above example displays + /// + /// ```notrust + /// helptest + /// + /// USAGE: + /// helptest [FLAGS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// ``` + pub fn hidden(self, h: bool) -> Self { + if h { + self.set(ArgSettings::Hidden) + } else { + self.unset(ArgSettings::Hidden) + } + } + + /// Specifies a list of possible values for this argument. At runtime, `clap` verifies that + /// only one of the specified values was used, or fails with an error message. + /// + /// **NOTE:** This setting only applies to [options] and [positional arguments] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("mode") + /// .takes_value(true) + /// .possible_values(&["fast", "slow", "medium"]) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .takes_value(true) + /// .possible_values(&["fast", "slow", "medium"])) + /// .get_matches_from(vec![ + /// "prog", "--mode", "fast" + /// ]); + /// assert!(m.is_present("mode")); + /// assert_eq!(m.value_of("mode"), Some("fast")); + /// ``` + /// + /// The next example shows a failed parse from using a value which wasn't defined as one of the + /// possible values. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .takes_value(true) + /// .possible_values(&["fast", "slow", "medium"])) + /// .get_matches_from_safe(vec![ + /// "prog", "--mode", "wrong" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::InvalidValue); + /// ``` + /// [options]: ./struct.Arg.html#method.takes_value + /// [positional arguments]: ./struct.Arg.html#method.index + pub fn possible_values(mut self, names: &[&'b str]) -> Self { + if let Some(ref mut vec) = self.v.possible_vals { + for s in names { + vec.push(s); + } + } else { + self.v.possible_vals = Some(names.iter().map(|s| *s).collect::>()); + } + self + } + + /// Specifies a possible value for this argument, one at a time. At runtime, `clap` verifies + /// that only one of the specified values was used, or fails with error message. + /// + /// **NOTE:** This setting only applies to [options] and [positional arguments] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("mode") + /// .takes_value(true) + /// .possible_value("fast") + /// .possible_value("slow") + /// .possible_value("medium") + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .takes_value(true) + /// .possible_value("fast") + /// .possible_value("slow") + /// .possible_value("medium")) + /// .get_matches_from(vec![ + /// "prog", "--mode", "fast" + /// ]); + /// assert!(m.is_present("mode")); + /// assert_eq!(m.value_of("mode"), Some("fast")); + /// ``` + /// + /// The next example shows a failed parse from using a value which wasn't defined as one of the + /// possible values. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("mode") + /// .long("mode") + /// .takes_value(true) + /// .possible_value("fast") + /// .possible_value("slow") + /// .possible_value("medium")) + /// .get_matches_from_safe(vec![ + /// "prog", "--mode", "wrong" + /// ]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::InvalidValue); + /// ``` + /// [options]: ./struct.Arg.html#method.takes_value + /// [positional arguments]: ./struct.Arg.html#method.index + pub fn possible_value(mut self, name: &'b str) -> Self { + if let Some(ref mut vec) = self.v.possible_vals { + vec.push(name); + } else { + self.v.possible_vals = Some(vec![name]); + } + self + } + + /// Specifies the name of the [`ArgGroup`] the argument belongs to. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("debug") + /// .long("debug") + /// .group("mode") + /// # ; + /// ``` + /// + /// Multiple arguments can be a member of a single group and then the group checked as if it + /// was one of said arguments. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("debug") + /// .long("debug") + /// .group("mode")) + /// .arg(Arg::with_name("verbose") + /// .long("verbose") + /// .group("mode")) + /// .get_matches_from(vec![ + /// "prog", "--debug" + /// ]); + /// assert!(m.is_present("mode")); + /// ``` + /// [`ArgGroup`]: ./struct.ArgGroup.html + pub fn group(mut self, name: &'a str) -> Self { + if let Some(ref mut vec) = self.b.groups { + vec.push(name); + } else { + self.b.groups = Some(vec![name]); + } + self + } + + /// Specifies the names of multiple [`ArgGroup`]'s the argument belongs to. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("debug") + /// .long("debug") + /// .groups(&["mode", "verbosity"]) + /// # ; + /// ``` + /// + /// Arguments can be members of multiple groups and then the group checked as if it + /// was one of said arguments. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("debug") + /// .long("debug") + /// .groups(&["mode", "verbosity"])) + /// .arg(Arg::with_name("verbose") + /// .long("verbose") + /// .groups(&["mode", "verbosity"])) + /// .get_matches_from(vec![ + /// "prog", "--debug" + /// ]); + /// assert!(m.is_present("mode")); + /// assert!(m.is_present("verbosity")); + /// ``` + /// [`ArgGroup`]: ./struct.ArgGroup.html + pub fn groups(mut self, names: &[&'a str]) -> Self { + if let Some(ref mut vec) = self.b.groups { + for s in names { + vec.push(s); + } + } else { + self.b.groups = Some(names.into_iter().map(|s| *s).collect::>()); + } + self + } + + /// Specifies how many values are required to satisfy this argument. For example, if you had a + /// `-f ` argument where you wanted exactly 3 'files' you would set + /// `.number_of_values(3)`, and this argument wouldn't be satisfied unless the user provided + /// 3 and only 3 values. + /// + /// **NOTE:** Does *not* require [`Arg::multiple(true)`] to be set. Setting + /// [`Arg::multiple(true)`] would allow `-f -f ` where + /// as *not* setting [`Arg::multiple(true)`] would only allow one occurrence of this argument. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("file") + /// .short("f") + /// .number_of_values(3) + /// # ; + /// ``` + /// + /// Not supplying the correct number of values is an error + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .takes_value(true) + /// .number_of_values(2) + /// .short("F")) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::WrongNumberOfValues); + /// ``` + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + pub fn number_of_values(mut self, qty: u64) -> Self { + self.setb(ArgSettings::TakesValue); + self.v.num_vals = Some(qty); + self + } + + /// Allows one to perform a custom validation on the argument value. You provide a closure + /// which accepts a [`String`] value, and return a [`Result`] where the [`Err(String)`] is a + /// message displayed to the user. + /// + /// **NOTE:** The error message does *not* need to contain the `error:` portion, only the + /// message as all errors will appear as + /// `error: Invalid value for '': ` where `` is replaced by the actual + /// arg, and `` is the `String` you return as the error. + /// + /// **NOTE:** There is a small performance hit for using validators, as they are implemented + /// with [`Rc`] pointers. And the value to be checked will be allocated an extra time in order + /// to to be passed to the closure. This performance hit is extremely minimal in the grand + /// scheme of things. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// fn has_at(v: String) -> Result<(), String> { + /// if v.contains("@") { return Ok(()); } + /// Err(String::from("The value did not contain the required @ sigil")) + /// } + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .index(1) + /// .validator(has_at)) + /// .get_matches_from_safe(vec![ + /// "prog", "some@file" + /// ]); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap().value_of("file"), Some("some@file")); + /// ``` + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html + /// [`Err(String)`]: https://doc.rust-lang.org/std/result/enum.Result.html#variant.Err + /// [`Rc`]: https://doc.rust-lang.org/std/rc/struct.Rc.html + pub fn validator(mut self, f: F) -> Self + where F: Fn(String) -> Result<(), String> + 'static + { + self.v.validator = Some(Rc::new(f)); + self + } + + /// Works identically to Validator but is intended to be used with values that could + /// contain non UTF-8 formatted strings. + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```rust")] + /// # use clap::{App, Arg}; + /// # use std::ffi::{OsStr, OsString}; + /// # use std::os::unix::ffi::OsStrExt; + /// fn has_ampersand(v: &OsStr) -> Result<(), OsString> { + /// if v.as_bytes().iter().any(|b| *b == b'&') { return Ok(()); } + /// Err(OsString::from("The value did not contain the required & sigil")) + /// } + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .index(1) + /// .validator_os(has_ampersand)) + /// .get_matches_from_safe(vec![ + /// "prog", "Fish & chips" + /// ]); + /// assert!(res.is_ok()); + /// assert_eq!(res.unwrap().value_of("file"), Some("Fish & chips")); + /// ``` + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`OsStr`]: https://doc.rust-lang.org/std/ffi/struct.OsStr.html + /// [`OsString`]: https://doc.rust-lang.org/std/ffi/struct.OsString.html + /// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html + /// [`Err(String)`]: https://doc.rust-lang.org/std/result/enum.Result.html#variant.Err + /// [`Rc`]: https://doc.rust-lang.org/std/rc/struct.Rc.html + pub fn validator_os(mut self, f: F) -> Self + where F: Fn(&OsStr) -> Result<(), OsString> + 'static + { + self.v.validator_os = Some(Rc::new(f)); + self + } + + /// Specifies the *maximum* number of values are for this argument. For example, if you had a + /// `-f ` argument where you wanted up to 3 'files' you would set `.max_values(3)`, and + /// this argument would be satisfied if the user provided, 1, 2, or 3 values. + /// + /// **NOTE:** This does *not* implicitly set [`Arg::multiple(true)`]. This is because + /// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single + /// occurence with multiple values. For positional arguments this **does** set + /// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple + /// occurences and multiple values. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("file") + /// .short("f") + /// .max_values(3) + /// # ; + /// ``` + /// + /// Supplying less than the maximum number of values is allowed + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .takes_value(true) + /// .max_values(3) + /// .short("F")) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1", "file2" + /// ]); + /// + /// assert!(res.is_ok()); + /// let m = res.unwrap(); + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2"]); + /// ``` + /// + /// Supplying more than the maximum number of values is an error + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .takes_value(true) + /// .max_values(2) + /// .short("F")) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1", "file2", "file3" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::TooManyValues); + /// ``` + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + pub fn max_values(mut self, qty: u64) -> Self { + self.setb(ArgSettings::TakesValue); + self.v.max_vals = Some(qty); + self + } + + /// Specifies the *minimum* number of values for this argument. For example, if you had a + /// `-f ` argument where you wanted at least 2 'files' you would set + /// `.min_values(2)`, and this argument would be satisfied if the user provided, 2 or more + /// values. + /// + /// **NOTE:** This does not implicitly set [`Arg::multiple(true)`]. This is because + /// `-o val -o val` is multiple occurrences but a single value and `-o val1 val2` is a single + /// occurence with multiple values. For positional arguments this **does** set + /// [`Arg::multiple(true)`] because there is no way to determine the difference between multiple + /// occurences and multiple values. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("file") + /// .short("f") + /// .min_values(3) + /// # ; + /// ``` + /// + /// Supplying more than the minimum number of values is allowed + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .takes_value(true) + /// .min_values(2) + /// .short("F")) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1", "file2", "file3" + /// ]); + /// + /// assert!(res.is_ok()); + /// let m = res.unwrap(); + /// let files: Vec<_> = m.values_of("file").unwrap().collect(); + /// assert_eq!(files, ["file1", "file2", "file3"]); + /// ``` + /// + /// Supplying less than the minimum number of values is an error + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("file") + /// .takes_value(true) + /// .min_values(2) + /// .short("F")) + /// .get_matches_from_safe(vec![ + /// "prog", "-F", "file1" + /// ]); + /// + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::TooFewValues); + /// ``` + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + pub fn min_values(mut self, qty: u64) -> Self { + self.v.min_vals = Some(qty); + self.set(ArgSettings::TakesValue) + } + + /// Specifies whether or not an argument should allow grouping of multiple values via a + /// delimiter. I.e. should `--option=val1,val2,val3` be parsed as three values (`val1`, `val2`, + /// and `val3`) or as a single value (`val1,val2,val3`). Defaults to using `,` (comma) as the + /// value delimiter for all arguments that accept values (options and positional arguments) + /// + /// **NOTE:** The default is `false`. When set to `true` the default [`Arg::value_delimiter`] + /// is the comma `,`. + /// + /// # Examples + /// + /// The following example shows the default behavior. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let delims = App::new("prog") + /// .arg(Arg::with_name("option") + /// .long("option") + /// .use_delimiter(true) + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "prog", "--option=val1,val2,val3", + /// ]); + /// + /// assert!(delims.is_present("option")); + /// assert_eq!(delims.occurrences_of("option"), 1); + /// assert_eq!(delims.values_of("option").unwrap().collect::>(), ["val1", "val2", "val3"]); + /// ``` + /// The next example shows the difference when turning delimiters off. This is the default + /// behavior + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let nodelims = App::new("prog") + /// .arg(Arg::with_name("option") + /// .long("option") + /// .use_delimiter(false) + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "prog", "--option=val1,val2,val3", + /// ]); + /// + /// assert!(nodelims.is_present("option")); + /// assert_eq!(nodelims.occurrences_of("option"), 1); + /// assert_eq!(nodelims.value_of("option").unwrap(), "val1,val2,val3"); + /// ``` + /// [`Arg::value_delimiter`]: ./struct.Arg.html#method.value_delimiter + pub fn use_delimiter(mut self, d: bool) -> Self { + if d { + if self.v.val_delim.is_none() { + self.v.val_delim = Some(','); + } + self.setb(ArgSettings::TakesValue); + self.setb(ArgSettings::UseValueDelimiter); + self.unset(ArgSettings::ValueDelimiterNotSet) + } else { + self.v.val_delim = None; + self.unsetb(ArgSettings::UseValueDelimiter); + self.unset(ArgSettings::ValueDelimiterNotSet) + } + } + + /// Specifies that *multiple values* may only be set using the delimiter. This means if an + /// if an option is encountered, and no delimiter is found, it automatically assumed that no + /// additional values for that option follow. This is unlike the default, where it is generally + /// assumed that more values will follow regardless of whether or not a delimiter is used. + /// + /// **NOTE:** The default is `false`. + /// + /// **NOTE:** Setting this to true implies [`Arg::use_delimiter(true)`] + /// + /// **NOTE:** It's a good idea to inform the user that use of a delimiter is required, either + /// through help text or other means. + /// + /// # Examples + /// + /// These examples demonstrate what happens when `require_delimiter(true)` is used. Notice + /// everything works in this first example, as we use a delimiter, as expected. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let delims = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .short("o") + /// .takes_value(true) + /// .multiple(true) + /// .require_delimiter(true)) + /// .get_matches_from(vec![ + /// "prog", "-o", "val1,val2,val3", + /// ]); + /// + /// assert!(delims.is_present("opt")); + /// assert_eq!(delims.values_of("opt").unwrap().collect::>(), ["val1", "val2", "val3"]); + /// ``` + /// In this next example, we will *not* use a delimiter. Notice it's now an error. + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .short("o") + /// .takes_value(true) + /// .multiple(true) + /// .require_delimiter(true)) + /// .get_matches_from_safe(vec![ + /// "prog", "-o", "val1", "val2", "val3", + /// ]); + /// + /// assert!(res.is_err()); + /// let err = res.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::UnknownArgument); + /// ``` + /// What's happening is `-o` is getting `val1`, and because delimiters are required yet none + /// were present, it stops parsing `-o`. At this point it reaches `val2` and because no + /// positional arguments have been defined, it's an error of an unexpected argument. + /// + /// In this final example, we contrast the above with `clap`'s default behavior where the above + /// is *not* an error. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let delims = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .short("o") + /// .takes_value(true) + /// .multiple(true)) + /// .get_matches_from(vec![ + /// "prog", "-o", "val1", "val2", "val3", + /// ]); + /// + /// assert!(delims.is_present("opt")); + /// assert_eq!(delims.values_of("opt").unwrap().collect::>(), ["val1", "val2", "val3"]); + /// ``` + /// [`Arg::use_delimiter(true)`]: ./struct.Arg.html#method.use_delimiter + pub fn require_delimiter(mut self, d: bool) -> Self { + if d { + self = self.use_delimiter(true); + self.unsetb(ArgSettings::ValueDelimiterNotSet); + self.setb(ArgSettings::UseValueDelimiter); + self.set(ArgSettings::RequireDelimiter) + } else { + self = self.use_delimiter(false); + self.unsetb(ArgSettings::UseValueDelimiter); + self.unset(ArgSettings::RequireDelimiter) + } + } + + /// Specifies the separator to use when values are clumped together, defaults to `,` (comma). + /// + /// **NOTE:** implicitly sets [`Arg::use_delimiter(true)`] + /// + /// **NOTE:** implicitly sets [`Arg::takes_value(true)`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("config") + /// .short("c") + /// .long("config") + /// .value_delimiter(";")) + /// .get_matches_from(vec![ + /// "prog", "--config=val1;val2;val3" + /// ]); + /// + /// assert_eq!(m.values_of("config").unwrap().collect::>(), ["val1", "val2", "val3"]) + /// ``` + /// [`Arg::use_delimiter(true)`]: ./struct.Arg.html#method.use_delimiter + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + pub fn value_delimiter(mut self, d: &str) -> Self { + self.unsetb(ArgSettings::ValueDelimiterNotSet); + self.setb(ArgSettings::TakesValue); + self.setb(ArgSettings::UseValueDelimiter); + self.v.val_delim = Some(d.chars() + .nth(0) + .expect("Failed to get value_delimiter from arg")); + self + } + + /// Specify multiple names for values of option arguments. These names are cosmetic only, used + /// for help and usage strings only. The names are **not** used to access arguments. The values + /// of the arguments are accessed in numeric order (i.e. if you specify two names `one` and + /// `two` `one` will be the first matched value, `two` will be the second). + /// + /// This setting can be very helpful when describing the type of input the user should be + /// using, such as `FILE`, `INTERFACE`, etc. Although not required, it's somewhat convention to + /// use all capital letters for the value name. + /// + /// **Pro Tip:** It may help to use [`Arg::next_line_help(true)`] if there are long, or + /// multiple value names in order to not throw off the help text alignment of all options. + /// + /// **NOTE:** This implicitly sets [`Arg::number_of_values`] if the number of value names is + /// greater than one. I.e. be aware that the number of "names" you set for the values, will be + /// the *exact* number of values required to satisfy this argument + /// + /// **NOTE:** implicitly sets [`Arg::takes_value(true)`] + /// + /// **NOTE:** Does *not* require or imply [`Arg::multiple(true)`]. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("speed") + /// .short("s") + /// .value_names(&["fast", "slow"]) + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("io") + /// .long("io-files") + /// .value_names(&["INFILE", "OUTFILE"])) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// Running the above program produces the following output + /// + /// ```notrust + /// valnames + /// + /// USAGE: + /// valnames [FLAGS] [OPTIONS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// + /// OPTIONS: + /// --io-files Some help text + /// ``` + /// [`Arg::next_line_help(true)`]: ./struct.Arg.html#method.next_line_help + /// [`Arg::number_of_values`]: ./struct.Arg.html#method.number_of_values + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + /// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple + pub fn value_names(mut self, names: &[&'b str]) -> Self { + self.setb(ArgSettings::TakesValue); + if self.is_set(ArgSettings::ValueDelimiterNotSet) { + self.unsetb(ArgSettings::ValueDelimiterNotSet); + self.setb(ArgSettings::UseValueDelimiter); + } + if let Some(ref mut vals) = self.v.val_names { + let mut l = vals.len(); + for s in names { + vals.insert(l, s); + l += 1; + } + } else { + let mut vm = VecMap::new(); + for (i, n) in names.iter().enumerate() { + vm.insert(i, *n); + } + self.v.val_names = Some(vm); + } + self + } + + /// Specifies the name for value of [option] or [positional] arguments inside of help + /// documentation. This name is cosmetic only, the name is **not** used to access arguments. + /// This setting can be very helpful when describing the type of input the user should be + /// using, such as `FILE`, `INTERFACE`, etc. Although not required, it's somewhat convention to + /// use all capital letters for the value name. + /// + /// **NOTE:** implicitly sets [`Arg::takes_value(true)`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// Arg::with_name("cfg") + /// .long("config") + /// .value_name("FILE") + /// # ; + /// ``` + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("config") + /// .long("config") + /// .value_name("FILE")) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// Running the above program produces the following output + /// + /// ```notrust + /// valnames + /// + /// USAGE: + /// valnames [FLAGS] [OPTIONS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// + /// OPTIONS: + /// --config Some help text + /// ``` + /// [option]: ./struct.Arg.html#method.takes_value + /// [positional]: ./struct.Arg.html#method.index + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + pub fn value_name(mut self, name: &'b str) -> Self { + self.setb(ArgSettings::TakesValue); + if let Some(ref mut vals) = self.v.val_names { + let l = vals.len(); + vals.insert(l, name); + } else { + let mut vm = VecMap::new(); + vm.insert(0, name); + self.v.val_names = Some(vm); + } + self + } + + /// Specifies the value of the argument when *not* specified at runtime. + /// + /// **NOTE:** If the user *does not* use this argument at runtime, [`ArgMatches::occurrences_of`] + /// will return `0` even though the [`ArgMatches::value_of`] will return the default specified. + /// + /// **NOTE:** If the user *does not* use this argument at runtime [`ArgMatches::is_present`] will + /// still return `true`. If you wish to determine whether the argument was used at runtime or + /// not, consider [`ArgMatches::occurrences_of`] which will return `0` if the argument was *not* + /// used at runtime. + /// + /// **NOTE:** This setting is perfectly compatible with [`Arg::default_value_if`] but slightly + /// different. `Arg::default_value` *only* takes affect when the user has not provided this arg + /// at runtime. `Arg::default_value_if` however only takes affect when the user has not provided + /// a value at runtime **and** these other conditions are met as well. If you have set + /// `Arg::default_value` and `Arg::default_value_if`, and the user **did not** provide a this + /// arg at runtime, nor did were the conditions met for `Arg::default_value_if`, the + /// `Arg::default_value` will be applied. + /// + /// **NOTE:** This implicitly sets [`Arg::takes_value(true)`]. + /// + /// **NOTE:** This setting effectively disables `AppSettings::ArgRequiredElseHelp` if used in + /// conjuction as it ensures that some argument will always be present. + /// + /// # Examples + /// + /// First we use the default value without providing any value at runtime. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .long("myopt") + /// .default_value("myval")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("opt"), Some("myval")); + /// assert!(m.is_present("opt")); + /// assert_eq!(m.occurrences_of("opt"), 0); + /// ``` + /// + /// Next we provide a value at runtime to override the default. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .long("myopt") + /// .default_value("myval")) + /// .get_matches_from(vec![ + /// "prog", "--myopt=non_default" + /// ]); + /// + /// assert_eq!(m.value_of("opt"), Some("non_default")); + /// assert!(m.is_present("opt")); + /// assert_eq!(m.occurrences_of("opt"), 1); + /// ``` + /// [`ArgMatches::occurrences_of`]: ./struct.ArgMatches.html#method.occurrences_of + /// [`ArgMatches::value_of`]: ./struct.ArgMatches.html#method.value_of + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + /// [`ArgMatches::is_present`]: ./struct.ArgMatches.html#method.is_present + /// [`Arg::default_value_if`]: ./struct.Arg.html#method.default_value_if + pub fn default_value(self, val: &'a str) -> Self { + self.default_value_os(OsStr::from_bytes(val.as_bytes())) + } + + /// Provides a default value in the exact same manner as [`Arg::default_value`] + /// only using [`OsStr`]s instead. + /// [`Arg::default_value`]: ./struct.Arg.html#method.default_value + /// [`OsStr`]: https://doc.rust-lang.org/std/ffi/struct.OsStr.html + pub fn default_value_os(mut self, val: &'a OsStr) -> Self { + self.setb(ArgSettings::TakesValue); + self.v.default_val = Some(val); + self + } + + /// Specifies the value of the argument if `arg` has been used at runtime. If `val` is set to + /// `None`, `arg` only needs to be present. If `val` is set to `"some-val"` then `arg` must be + /// present at runtime **and** have the value `val`. + /// + /// **NOTE:** This setting is perfectly compatible with [`Arg::default_value`] but slightly + /// different. `Arg::default_value` *only* takes affect when the user has not provided this arg + /// at runtime. This setting however only takes affect when the user has not provided a value at + /// runtime **and** these other conditions are met as well. If you have set `Arg::default_value` + /// and `Arg::default_value_if`, and the user **did not** provide a this arg at runtime, nor did + /// were the conditions met for `Arg::default_value_if`, the `Arg::default_value` will be + /// applied. + /// + /// **NOTE:** This implicitly sets [`Arg::takes_value(true)`]. + /// + /// **NOTE:** If using YAML the values should be laid out as follows (`None` can be represented + /// as `null` in YAML) + /// + /// ```yaml + /// default_value_if: + /// - [arg, val, default] + /// ``` + /// + /// # Examples + /// + /// First we use the default value only if another arg is present at runtime. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_if("flag", None, "default")) + /// .get_matches_from(vec![ + /// "prog", "--flag" + /// ]); + /// + /// assert_eq!(m.value_of("other"), Some("default")); + /// ``` + /// + /// Next we run the same test, but without providing `--flag`. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_if("flag", None, "default")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("other"), None); + /// ``` + /// + /// Now lets only use the default value if `--opt` contains the value `special`. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .takes_value(true) + /// .long("opt")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_if("opt", Some("special"), "default")) + /// .get_matches_from(vec![ + /// "prog", "--opt", "special" + /// ]); + /// + /// assert_eq!(m.value_of("other"), Some("default")); + /// ``` + /// + /// We can run the same test and provide any value *other than* `special` and we won't get a + /// default value. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .takes_value(true) + /// .long("opt")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_if("opt", Some("special"), "default")) + /// .get_matches_from(vec![ + /// "prog", "--opt", "hahaha" + /// ]); + /// + /// assert_eq!(m.value_of("other"), None); + /// ``` + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + /// [`Arg::default_value`]: ./struct.Arg.html#method.default_value + pub fn default_value_if(self, arg: &'a str, val: Option<&'b str>, default: &'b str) -> Self { + self.default_value_if_os(arg, + val.map(str::as_bytes).map(OsStr::from_bytes), + OsStr::from_bytes(default.as_bytes())) + } + + /// Provides a conditional default value in the exact same manner as [`Arg::default_value_if`] + /// only using [`OsStr`]s instead. + /// [`Arg::default_value_if`]: ./struct.Arg.html#method.default_value_if + /// [`OsStr`]: https://doc.rust-lang.org/std/ffi/struct.OsStr.html + pub fn default_value_if_os(mut self, + arg: &'a str, + val: Option<&'b OsStr>, + default: &'b OsStr) + -> Self { + self.setb(ArgSettings::TakesValue); + if let Some(ref mut vm) = self.v.default_vals_ifs { + let l = vm.len(); + vm.insert(l, (arg, val, default)); + } else { + let mut vm = VecMap::new(); + vm.insert(0, (arg, val, default)); + self.v.default_vals_ifs = Some(vm); + } + self + } + + /// Specifies multiple values and conditions in the same manner as [`Arg::default_value_if`]. + /// The method takes a slice of tuples in the `(arg, Option, default)` format. + /// + /// **NOTE**: The conditions are stored in order and evaluated in the same order. I.e. the first + /// if multiple conditions are true, the first one found will be applied and the ultimate value. + /// + /// **NOTE:** If using YAML the values should be laid out as follows + /// + /// ```yaml + /// default_value_if: + /// - [arg, val, default] + /// - [arg2, null, default2] + /// ``` + /// + /// # Examples + /// + /// First we use the default value only if another arg is present at runtime. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag")) + /// .arg(Arg::with_name("opt") + /// .long("opt") + /// .takes_value(true)) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_ifs(&[ + /// ("flag", None, "default"), + /// ("opt", Some("channal"), "chan"), + /// ])) + /// .get_matches_from(vec![ + /// "prog", "--opt", "channal" + /// ]); + /// + /// assert_eq!(m.value_of("other"), Some("chan")); + /// ``` + /// + /// Next we run the same test, but without providing `--flag`. + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag")) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_ifs(&[ + /// ("flag", None, "default"), + /// ("opt", Some("channal"), "chan"), + /// ])) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("other"), None); + /// ``` + /// + /// We can also see that these values are applied in order, and if more than one condition is + /// true, only the first evaluatd "wins" + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag")) + /// .arg(Arg::with_name("opt") + /// .long("opt") + /// .takes_value(true)) + /// .arg(Arg::with_name("other") + /// .long("other") + /// .default_value_ifs(&[ + /// ("flag", None, "default"), + /// ("opt", Some("channal"), "chan"), + /// ])) + /// .get_matches_from(vec![ + /// "prog", "--opt", "channal", "--flag" + /// ]); + /// + /// assert_eq!(m.value_of("other"), Some("default")); + /// ``` + /// [`Arg::takes_value(true)`]: ./struct.Arg.html#method.takes_value + /// [`Arg::default_value`]: ./struct.Arg.html#method.default_value + pub fn default_value_ifs(mut self, ifs: &[(&'a str, Option<&'b str>, &'b str)]) -> Self { + for &(arg, val, default) in ifs { + self = self.default_value_if_os(arg, + val.map(str::as_bytes).map(OsStr::from_bytes), + OsStr::from_bytes(default.as_bytes())); + } + self + } + + /// Provides multiple conditional default values in the exact same manner as + /// [`Arg::default_value_ifs`] only using [`OsStr`]s instead. + /// [`Arg::default_value_ifs`]: ./struct.Arg.html#method.default_value_ifs + /// [`OsStr`]: https://doc.rust-lang.org/std/ffi/struct.OsStr.html + #[cfg_attr(feature = "lints", allow(explicit_counter_loop))] + pub fn default_value_ifs_os(mut self, ifs: &[(&'a str, Option<&'b OsStr>, &'b OsStr)]) -> Self { + for &(arg, val, default) in ifs { + self = self.default_value_if_os(arg, val, default); + } + self + } + + /// Specifies that if the value is not passed in as an argument, that it should be retrieved + /// from the environment, if available. If it is not present in the environment, then default + /// rules will apply. + /// + /// **NOTE:** If the user *does not* use this argument at runtime, [`ArgMatches::occurrences_of`] + /// will return `0` even though the [`ArgMatches::value_of`] will return the default specified. + /// + /// **NOTE:** If the user *does not* use this argument at runtime [`ArgMatches::is_present`] will + /// return `true` if the variable is present in the environemnt . If you wish to determine whether + /// the argument was used at runtime or not, consider [`ArgMatches::occurrences_of`] which will + /// return `0` if the argument was *not* used at runtime. + /// + /// **NOTE:** This implicitly sets [`Arg::takes_value(true)`]. + /// + /// **NOTE:** If [`Arg::multiple(true)`] is set then [`Arg::use_delimiter(true)`] should also be + /// set. Otherwise, only a single argument will be returned from the environment variable. The + /// default delimiter is `,` and follows all the other delimiter rules. + /// + /// # Examples + /// + /// In this example, we show the variable coming from the environment: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("env")); + /// ``` + /// + /// In this example, we show the variable coming from an option on the CLI: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG")) + /// .get_matches_from(vec![ + /// "prog", "--flag", "opt" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("opt")); + /// ``` + /// + /// In this example, we show the variable coming from the environment even with the + /// presence of a default: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG", "env"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG") + /// .default_value("default")) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.value_of("flag"), Some("env")); + /// ``` + /// + /// In this example, we show the use of multiple values in a single environment variable: + /// + /// ```rust + /// # use std::env; + /// # use clap::{App, Arg}; + /// + /// env::set_var("MY_FLAG_MULTI", "env1,env2"); + /// + /// let m = App::new("prog") + /// .arg(Arg::with_name("flag") + /// .long("flag") + /// .env("MY_FLAG_MULTI") + /// .multiple(true) + /// .use_delimiter(true)) + /// .get_matches_from(vec![ + /// "prog" + /// ]); + /// + /// assert_eq!(m.values_of("flag").unwrap().collect::>(), vec!["env1", "env2"]); + /// ``` + pub fn env(self, name: &'a str) -> Self { + self.env_os(OsStr::new(name)) + } + + /// Specifies that if the value is not passed in as an argument, that it should be retrieved + /// from the environment if available in the exact same manner as [`Arg::env`] only using + /// [`OsStr`]s instead. + pub fn env_os(mut self, name: &'a OsStr) -> Self { + self.setb(ArgSettings::TakesValue); + + self.v.env = Some((name, env::var_os(name))); + self + } + + /// When set to `true` the help string will be displayed on the line after the argument and + /// indented once. This can be helpful for arguments with very long or complex help messages. + /// This can also be helpful for arguments with very long flag names, or many/long value names. + /// + /// **NOTE:** To apply this setting to all arguments consider using + /// [`AppSettings::NextLineHelp`] + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("opt") + /// .long("long-option-flag") + /// .short("o") + /// .takes_value(true) + /// .value_names(&["value1", "value2"]) + /// .help("Some really long help and complex\n\ + /// help that makes more sense to be\n\ + /// on a line after the option") + /// .next_line_help(true)) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// + /// The above example displays the following help message + /// + /// ```notrust + /// nlh + /// + /// USAGE: + /// nlh [FLAGS] [OPTIONS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// + /// OPTIONS: + /// -o, --long-option-flag + /// Some really long help and complex + /// help that makes more sense to be + /// on a line after the option + /// ``` + /// [`AppSettings::NextLineHelp`]: ./enum.AppSettings.html#variant.NextLineHelp + pub fn next_line_help(mut self, nlh: bool) -> Self { + if nlh { + self.setb(ArgSettings::NextLineHelp); + } else { + self.unsetb(ArgSettings::NextLineHelp); + } + self + } + + /// Allows custom ordering of args within the help message. Args with a lower value will be + /// displayed first in the help message. This is helpful when one would like to emphasise + /// frequently used args, or prioritize those towards the top of the list. Duplicate values + /// **are** allowed. Args with duplicate display orders will be displayed in alphabetical + /// order. + /// + /// **NOTE:** The default is 999 for all arguments. + /// + /// **NOTE:** This setting is ignored for [positional arguments] which are always displayed in + /// [index] order. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("prog") + /// .arg(Arg::with_name("a") // Typically args are grouped alphabetically by name. + /// // Args without a display_order have a value of 999 and are + /// // displayed alphabetically with all other 999 valued args. + /// .long("long-option") + /// .short("o") + /// .takes_value(true) + /// .help("Some help and text")) + /// .arg(Arg::with_name("b") + /// .long("other-option") + /// .short("O") + /// .takes_value(true) + /// .display_order(1) // In order to force this arg to appear *first* + /// // all we have to do is give it a value lower than 999. + /// // Any other args with a value of 1 will be displayed + /// // alphabetically with this one...then 2 values, then 3, etc. + /// .help("I should be first!")) + /// .get_matches_from(vec![ + /// "prog", "--help" + /// ]); + /// ``` + /// + /// The above example displays the following help message + /// + /// ```notrust + /// cust-ord + /// + /// USAGE: + /// cust-ord [FLAGS] [OPTIONS] + /// + /// FLAGS: + /// -h, --help Prints help information + /// -V, --version Prints version information + /// + /// OPTIONS: + /// -O, --other-option I should be first! + /// -o, --long-option Some help and text + /// ``` + /// [positional arguments]: ./struct.Arg.html#method.index + /// [index]: ./struct.Arg.html#method.index + pub fn display_order(mut self, ord: usize) -> Self { + self.s.disp_ord = ord; + self + } + + /// Checks if one of the [`ArgSettings`] settings is set for the argument + /// [`ArgSettings`]: ./enum.ArgSettings.html + pub fn is_set(&self, s: ArgSettings) -> bool { self.b.is_set(s) } + + /// Sets one of the [`ArgSettings`] settings for the argument + /// [`ArgSettings`]: ./enum.ArgSettings.html + pub fn set(mut self, s: ArgSettings) -> Self { + self.setb(s); + self + } + + /// Unsets one of the [`ArgSettings`] settings for the argument + /// [`ArgSettings`]: ./enum.ArgSettings.html + pub fn unset(mut self, s: ArgSettings) -> Self { + self.unsetb(s); + self + } + + #[doc(hidden)] + pub fn setb(&mut self, s: ArgSettings) { self.b.set(s); } + + #[doc(hidden)] + pub fn unsetb(&mut self, s: ArgSettings) { self.b.unset(s); } +} + +impl<'a, 'b, 'z> From<&'z Arg<'a, 'b>> for Arg<'a, 'b> { + fn from(a: &'z Arg<'a, 'b>) -> Self { + Arg { + b: a.b.clone(), + v: a.v.clone(), + s: a.s.clone(), + index: a.index, + r_ifs: a.r_ifs.clone(), + } + } +} + +impl<'n, 'e> PartialEq for Arg<'n, 'e> { + fn eq(&self, other: &Arg<'n, 'e>) -> bool { + self.b == other.b + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/base.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/base.rs new file mode 100644 index 000000000..5990bc082 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/base.rs @@ -0,0 +1,35 @@ + +use args::{ArgSettings, Arg, ArgFlags}; + +#[derive(Debug, Clone, Default)] +pub struct Base<'a, 'b> + where 'a: 'b +{ + pub name: &'a str, + pub help: Option<&'b str>, + pub long_help: Option<&'b str>, + pub blacklist: Option>, + pub settings: ArgFlags, + pub r_unless: Option>, + pub overrides: Option>, + pub groups: Option>, + pub requires: Option, &'a str)>>, +} + +impl<'n, 'e> Base<'n, 'e> { + pub fn new(name: &'n str) -> Self { Base { name: name, ..Default::default() } } + + pub fn set(&mut self, s: ArgSettings) { self.settings.set(s); } + pub fn unset(&mut self, s: ArgSettings) { self.settings.unset(s); } + pub fn is_set(&self, s: ArgSettings) -> bool { self.settings.is_set(s) } +} + +impl<'n, 'e, 'z> From<&'z Arg<'n, 'e>> for Base<'n, 'e> { + fn from(a: &'z Arg<'n, 'e>) -> Self { a.b.clone() } +} + +impl<'n, 'e> PartialEq for Base<'n, 'e> { + fn eq(&self, other: &Base<'n, 'e>) -> bool { + self.name == other.name + } +} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/flag.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/flag.rs new file mode 100644 index 000000000..4e3782104 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/flag.rs @@ -0,0 +1,159 @@ +// Std +use std::convert::From; +use std::fmt::{Display, Formatter, Result}; +use std::rc::Rc; +use std::result::Result as StdResult; +use std::ffi::{OsStr, OsString}; +use std::mem; + +// Internal +use Arg; +use args::{AnyArg, ArgSettings, Base, DispOrder, Switched}; +use map::{self, VecMap}; + +#[derive(Default, Clone, Debug)] +#[doc(hidden)] +pub struct FlagBuilder<'n, 'e> +where + 'n: 'e, +{ + pub b: Base<'n, 'e>, + pub s: Switched<'e>, +} + +impl<'n, 'e> FlagBuilder<'n, 'e> { + pub fn new(name: &'n str) -> Self { + FlagBuilder { + b: Base::new(name), + ..Default::default() + } + } +} + +impl<'a, 'b, 'z> From<&'z Arg<'a, 'b>> for FlagBuilder<'a, 'b> { + fn from(a: &'z Arg<'a, 'b>) -> Self { + FlagBuilder { + b: Base::from(a), + s: Switched::from(a), + } + } +} + +impl<'a, 'b> From> for FlagBuilder<'a, 'b> { + fn from(mut a: Arg<'a, 'b>) -> Self { + FlagBuilder { + b: mem::replace(&mut a.b, Base::default()), + s: mem::replace(&mut a.s, Switched::default()), + } + } +} + +impl<'n, 'e> Display for FlagBuilder<'n, 'e> { + fn fmt(&self, f: &mut Formatter) -> Result { + if let Some(l) = self.s.long { + write!(f, "--{}", l)?; + } else { + write!(f, "-{}", self.s.short.unwrap())?; + } + + Ok(()) + } +} + +impl<'n, 'e> AnyArg<'n, 'e> for FlagBuilder<'n, 'e> { + fn name(&self) -> &'n str { self.b.name } + fn overrides(&self) -> Option<&[&'e str]> { self.b.overrides.as_ref().map(|o| &o[..]) } + fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]> { + self.b.requires.as_ref().map(|o| &o[..]) + } + fn blacklist(&self) -> Option<&[&'e str]> { self.b.blacklist.as_ref().map(|o| &o[..]) } + fn required_unless(&self) -> Option<&[&'e str]> { None } + fn is_set(&self, s: ArgSettings) -> bool { self.b.settings.is_set(s) } + fn has_switch(&self) -> bool { true } + fn takes_value(&self) -> bool { false } + fn set(&mut self, s: ArgSettings) { self.b.settings.set(s) } + fn max_vals(&self) -> Option { None } + fn val_names(&self) -> Option<&VecMap<&'e str>> { None } + fn num_vals(&self) -> Option { None } + fn possible_vals(&self) -> Option<&[&'e str]> { None } + fn validator(&self) -> Option<&Rc StdResult<(), String>>> { None } + fn validator_os(&self) -> Option<&Rc StdResult<(), OsString>>> { None } + fn min_vals(&self) -> Option { None } + fn short(&self) -> Option { self.s.short } + fn long(&self) -> Option<&'e str> { self.s.long } + fn val_delim(&self) -> Option { None } + fn help(&self) -> Option<&'e str> { self.b.help } + fn long_help(&self) -> Option<&'e str> { self.b.long_help } + fn val_terminator(&self) -> Option<&'e str> { None } + fn default_val(&self) -> Option<&'e OsStr> { None } + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + None + } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { None } + fn longest_filter(&self) -> bool { self.s.long.is_some() } + fn aliases(&self) -> Option> { + if let Some(ref aliases) = self.s.aliases { + let vis_aliases: Vec<_> = aliases + .iter() + .filter_map(|&(n, v)| if v { Some(n) } else { None }) + .collect(); + if vis_aliases.is_empty() { + None + } else { + Some(vis_aliases) + } + } else { + None + } + } +} + +impl<'n, 'e> DispOrder for FlagBuilder<'n, 'e> { + fn disp_ord(&self) -> usize { self.s.disp_ord } +} + +impl<'n, 'e> PartialEq for FlagBuilder<'n, 'e> { + fn eq(&self, other: &FlagBuilder<'n, 'e>) -> bool { self.b == other.b } +} + +#[cfg(test)] +mod test { + use args::settings::ArgSettings; + use super::FlagBuilder; + + #[test] + fn flagbuilder_display() { + let mut f = FlagBuilder::new("flg"); + f.b.settings.set(ArgSettings::Multiple); + f.s.long = Some("flag"); + + assert_eq!(&*format!("{}", f), "--flag"); + + let mut f2 = FlagBuilder::new("flg"); + f2.s.short = Some('f'); + + assert_eq!(&*format!("{}", f2), "-f"); + } + + #[test] + fn flagbuilder_display_single_alias() { + let mut f = FlagBuilder::new("flg"); + f.s.long = Some("flag"); + f.s.aliases = Some(vec![("als", true)]); + + assert_eq!(&*format!("{}", f), "--flag"); + } + + #[test] + fn flagbuilder_display_multiple_aliases() { + let mut f = FlagBuilder::new("flg"); + f.s.short = Some('f'); + f.s.aliases = Some(vec![ + ("alias_not_visible", false), + ("f2", true), + ("f3", true), + ("f4", true), + ]); + assert_eq!(&*format!("{}", f), "-f"); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/mod.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/mod.rs new file mode 100644 index 000000000..d1a7a6608 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/mod.rs @@ -0,0 +1,13 @@ +pub use self::flag::FlagBuilder; +pub use self::option::OptBuilder; +pub use self::positional::PosBuilder; +pub use self::base::Base; +pub use self::switched::Switched; +pub use self::valued::Valued; + +mod flag; +mod positional; +mod option; +mod base; +mod valued; +mod switched; diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/option.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/option.rs new file mode 100644 index 000000000..4bb147a7d --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/option.rs @@ -0,0 +1,244 @@ +// Std +use std::fmt::{Display, Formatter, Result}; +use std::rc::Rc; +use std::result::Result as StdResult; +use std::ffi::{OsStr, OsString}; +use std::mem; + +// Internal +use args::{AnyArg, Arg, ArgSettings, Base, DispOrder, Switched, Valued}; +use map::{self, VecMap}; +use INTERNAL_ERROR_MSG; + +#[allow(missing_debug_implementations)] +#[doc(hidden)] +#[derive(Default, Clone)] +pub struct OptBuilder<'n, 'e> +where + 'n: 'e, +{ + pub b: Base<'n, 'e>, + pub s: Switched<'e>, + pub v: Valued<'n, 'e>, +} + +impl<'n, 'e> OptBuilder<'n, 'e> { + pub fn new(name: &'n str) -> Self { + OptBuilder { + b: Base::new(name), + ..Default::default() + } + } +} + +impl<'n, 'e, 'z> From<&'z Arg<'n, 'e>> for OptBuilder<'n, 'e> { + fn from(a: &'z Arg<'n, 'e>) -> Self { + OptBuilder { + b: Base::from(a), + s: Switched::from(a), + v: Valued::from(a), + } + } +} + +impl<'n, 'e> From> for OptBuilder<'n, 'e> { + fn from(mut a: Arg<'n, 'e>) -> Self { + a.v.fill_in(); + OptBuilder { + b: mem::replace(&mut a.b, Base::default()), + s: mem::replace(&mut a.s, Switched::default()), + v: mem::replace(&mut a.v, Valued::default()), + } + } +} + +impl<'n, 'e> Display for OptBuilder<'n, 'e> { + fn fmt(&self, f: &mut Formatter) -> Result { + debugln!("OptBuilder::fmt:{}", self.b.name); + let sep = if self.b.is_set(ArgSettings::RequireEquals) { + "=" + } else { + " " + }; + // Write the name such --long or -l + if let Some(l) = self.s.long { + write!(f, "--{}{}", l, sep)?; + } else { + write!(f, "-{}{}", self.s.short.unwrap(), sep)?; + } + let delim = if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }; + + // Write the values such as + if let Some(ref vec) = self.v.val_names { + let mut it = vec.iter().peekable(); + while let Some((_, val)) = it.next() { + write!(f, "<{}>", val)?; + if it.peek().is_some() { + write!(f, "{}", delim)?; + } + } + let num = vec.len(); + if self.is_set(ArgSettings::Multiple) && num == 1 { + write!(f, "...")?; + } + } else if let Some(num) = self.v.num_vals { + let mut it = (0..num).peekable(); + while let Some(_) = it.next() { + write!(f, "<{}>", self.b.name)?; + if it.peek().is_some() { + write!(f, "{}", delim)?; + } + } + if self.is_set(ArgSettings::Multiple) && num == 1 { + write!(f, "...")?; + } + } else { + write!( + f, + "<{}>{}", + self.b.name, + if self.is_set(ArgSettings::Multiple) { + "..." + } else { + "" + } + )?; + } + + Ok(()) + } +} + +impl<'n, 'e> AnyArg<'n, 'e> for OptBuilder<'n, 'e> { + fn name(&self) -> &'n str { self.b.name } + fn overrides(&self) -> Option<&[&'e str]> { self.b.overrides.as_ref().map(|o| &o[..]) } + fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]> { + self.b.requires.as_ref().map(|o| &o[..]) + } + fn blacklist(&self) -> Option<&[&'e str]> { self.b.blacklist.as_ref().map(|o| &o[..]) } + fn required_unless(&self) -> Option<&[&'e str]> { self.b.r_unless.as_ref().map(|o| &o[..]) } + fn val_names(&self) -> Option<&VecMap<&'e str>> { self.v.val_names.as_ref() } + fn is_set(&self, s: ArgSettings) -> bool { self.b.settings.is_set(s) } + fn has_switch(&self) -> bool { true } + fn set(&mut self, s: ArgSettings) { self.b.settings.set(s) } + fn max_vals(&self) -> Option { self.v.max_vals } + fn val_terminator(&self) -> Option<&'e str> { self.v.terminator } + fn num_vals(&self) -> Option { self.v.num_vals } + fn possible_vals(&self) -> Option<&[&'e str]> { self.v.possible_vals.as_ref().map(|o| &o[..]) } + fn validator(&self) -> Option<&Rc StdResult<(), String>>> { + self.v.validator.as_ref() + } + fn validator_os(&self) -> Option<&Rc StdResult<(), OsString>>> { + self.v.validator_os.as_ref() + } + fn min_vals(&self) -> Option { self.v.min_vals } + fn short(&self) -> Option { self.s.short } + fn long(&self) -> Option<&'e str> { self.s.long } + fn val_delim(&self) -> Option { self.v.val_delim } + fn takes_value(&self) -> bool { true } + fn help(&self) -> Option<&'e str> { self.b.help } + fn long_help(&self) -> Option<&'e str> { self.b.long_help } + fn default_val(&self) -> Option<&'e OsStr> { self.v.default_val } + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + self.v.default_vals_ifs.as_ref().map(|vm| vm.values()) + } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { + self.v + .env + .as_ref() + .map(|&(key, ref value)| (key, value.as_ref())) + } + fn longest_filter(&self) -> bool { true } + fn aliases(&self) -> Option> { + if let Some(ref aliases) = self.s.aliases { + let vis_aliases: Vec<_> = aliases + .iter() + .filter_map(|&(n, v)| if v { Some(n) } else { None }) + .collect(); + if vis_aliases.is_empty() { + None + } else { + Some(vis_aliases) + } + } else { + None + } + } +} + +impl<'n, 'e> DispOrder for OptBuilder<'n, 'e> { + fn disp_ord(&self) -> usize { self.s.disp_ord } +} + +impl<'n, 'e> PartialEq for OptBuilder<'n, 'e> { + fn eq(&self, other: &OptBuilder<'n, 'e>) -> bool { self.b == other.b } +} + +#[cfg(test)] +mod test { + use args::settings::ArgSettings; + use super::OptBuilder; + use map::VecMap; + + #[test] + fn optbuilder_display1() { + let mut o = OptBuilder::new("opt"); + o.s.long = Some("option"); + o.b.settings.set(ArgSettings::Multiple); + + assert_eq!(&*format!("{}", o), "--option ..."); + } + + #[test] + fn optbuilder_display2() { + let mut v_names = VecMap::new(); + v_names.insert(0, "file"); + v_names.insert(1, "name"); + + let mut o2 = OptBuilder::new("opt"); + o2.s.short = Some('o'); + o2.v.val_names = Some(v_names); + + assert_eq!(&*format!("{}", o2), "-o "); + } + + #[test] + fn optbuilder_display3() { + let mut v_names = VecMap::new(); + v_names.insert(0, "file"); + v_names.insert(1, "name"); + + let mut o2 = OptBuilder::new("opt"); + o2.s.short = Some('o'); + o2.v.val_names = Some(v_names); + o2.b.settings.set(ArgSettings::Multiple); + + assert_eq!(&*format!("{}", o2), "-o "); + } + + #[test] + fn optbuilder_display_single_alias() { + let mut o = OptBuilder::new("opt"); + o.s.long = Some("option"); + o.s.aliases = Some(vec![("als", true)]); + + assert_eq!(&*format!("{}", o), "--option "); + } + + #[test] + fn optbuilder_display_multiple_aliases() { + let mut o = OptBuilder::new("opt"); + o.s.long = Some("option"); + o.s.aliases = Some(vec![ + ("als_not_visible", false), + ("als2", true), + ("als3", true), + ("als4", true), + ]); + assert_eq!(&*format!("{}", o), "--option "); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/positional.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/positional.rs new file mode 100644 index 000000000..43fdca4c5 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/positional.rs @@ -0,0 +1,229 @@ +// Std +use std::borrow::Cow; +use std::fmt::{Display, Formatter, Result}; +use std::rc::Rc; +use std::result::Result as StdResult; +use std::ffi::{OsStr, OsString}; +use std::mem; + +// Internal +use Arg; +use args::{AnyArg, ArgSettings, Base, DispOrder, Valued}; +use INTERNAL_ERROR_MSG; +use map::{self, VecMap}; + +#[allow(missing_debug_implementations)] +#[doc(hidden)] +#[derive(Clone, Default)] +pub struct PosBuilder<'n, 'e> +where + 'n: 'e, +{ + pub b: Base<'n, 'e>, + pub v: Valued<'n, 'e>, + pub index: u64, +} + +impl<'n, 'e> PosBuilder<'n, 'e> { + pub fn new(name: &'n str, idx: u64) -> Self { + PosBuilder { + b: Base::new(name), + index: idx, + ..Default::default() + } + } + + pub fn from_arg_ref(a: &Arg<'n, 'e>, idx: u64) -> Self { + let mut pb = PosBuilder { + b: Base::from(a), + v: Valued::from(a), + index: idx, + }; + if a.v.max_vals.is_some() || a.v.min_vals.is_some() + || (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) + { + pb.b.settings.set(ArgSettings::Multiple); + } + pb + } + + pub fn from_arg(mut a: Arg<'n, 'e>, idx: u64) -> Self { + if a.v.max_vals.is_some() || a.v.min_vals.is_some() + || (a.v.num_vals.is_some() && a.v.num_vals.unwrap() > 1) + { + a.b.settings.set(ArgSettings::Multiple); + } + PosBuilder { + b: mem::replace(&mut a.b, Base::default()), + v: mem::replace(&mut a.v, Valued::default()), + index: idx, + } + } + + pub fn multiple_str(&self) -> &str { + let mult_vals = self.v + .val_names + .as_ref() + .map_or(true, |names| names.len() < 2); + if self.is_set(ArgSettings::Multiple) && mult_vals { + "..." + } else { + "" + } + } + + pub fn name_no_brackets(&self) -> Cow { + debugln!("PosBuilder::name_no_brackets;"); + let mut delim = String::new(); + delim.push(if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }); + if let Some(ref names) = self.v.val_names { + debugln!("PosBuilder:name_no_brackets: val_names={:#?}", names); + if names.len() > 1 { + Cow::Owned( + names + .values() + .map(|n| format!("<{}>", n)) + .collect::>() + .join(&*delim), + ) + } else { + Cow::Borrowed(names.values().next().expect(INTERNAL_ERROR_MSG)) + } + } else { + debugln!("PosBuilder:name_no_brackets: just name"); + Cow::Borrowed(self.b.name) + } + } +} + +impl<'n, 'e> Display for PosBuilder<'n, 'e> { + fn fmt(&self, f: &mut Formatter) -> Result { + let mut delim = String::new(); + delim.push(if self.is_set(ArgSettings::RequireDelimiter) { + self.v.val_delim.expect(INTERNAL_ERROR_MSG) + } else { + ' ' + }); + if let Some(ref names) = self.v.val_names { + write!( + f, + "{}", + names + .values() + .map(|n| format!("<{}>", n)) + .collect::>() + .join(&*delim) + )?; + } else { + write!(f, "<{}>", self.b.name)?; + } + if self.b.settings.is_set(ArgSettings::Multiple) + && (self.v.val_names.is_none() || self.v.val_names.as_ref().unwrap().len() == 1) + { + write!(f, "...")?; + } + + Ok(()) + } +} + +impl<'n, 'e> AnyArg<'n, 'e> for PosBuilder<'n, 'e> { + fn name(&self) -> &'n str { self.b.name } + fn overrides(&self) -> Option<&[&'e str]> { self.b.overrides.as_ref().map(|o| &o[..]) } + fn requires(&self) -> Option<&[(Option<&'e str>, &'n str)]> { + self.b.requires.as_ref().map(|o| &o[..]) + } + fn blacklist(&self) -> Option<&[&'e str]> { self.b.blacklist.as_ref().map(|o| &o[..]) } + fn required_unless(&self) -> Option<&[&'e str]> { self.b.r_unless.as_ref().map(|o| &o[..]) } + fn val_names(&self) -> Option<&VecMap<&'e str>> { self.v.val_names.as_ref() } + fn is_set(&self, s: ArgSettings) -> bool { self.b.settings.is_set(s) } + fn set(&mut self, s: ArgSettings) { self.b.settings.set(s) } + fn has_switch(&self) -> bool { false } + fn max_vals(&self) -> Option { self.v.max_vals } + fn val_terminator(&self) -> Option<&'e str> { self.v.terminator } + fn num_vals(&self) -> Option { self.v.num_vals } + fn possible_vals(&self) -> Option<&[&'e str]> { self.v.possible_vals.as_ref().map(|o| &o[..]) } + fn validator(&self) -> Option<&Rc StdResult<(), String>>> { + self.v.validator.as_ref() + } + fn validator_os(&self) -> Option<&Rc StdResult<(), OsString>>> { + self.v.validator_os.as_ref() + } + fn min_vals(&self) -> Option { self.v.min_vals } + fn short(&self) -> Option { None } + fn long(&self) -> Option<&'e str> { None } + fn val_delim(&self) -> Option { self.v.val_delim } + fn takes_value(&self) -> bool { true } + fn help(&self) -> Option<&'e str> { self.b.help } + fn long_help(&self) -> Option<&'e str> { self.b.long_help } + fn default_vals_ifs(&self) -> Option, &'e OsStr)>> { + self.v.default_vals_ifs.as_ref().map(|vm| vm.values()) + } + fn default_val(&self) -> Option<&'e OsStr> { self.v.default_val } + fn env<'s>(&'s self) -> Option<(&'n OsStr, Option<&'s OsString>)> { + self.v + .env + .as_ref() + .map(|&(key, ref value)| (key, value.as_ref())) + } + fn longest_filter(&self) -> bool { true } + fn aliases(&self) -> Option> { None } +} + +impl<'n, 'e> DispOrder for PosBuilder<'n, 'e> { + fn disp_ord(&self) -> usize { self.index as usize } +} + +impl<'n, 'e> PartialEq for PosBuilder<'n, 'e> { + fn eq(&self, other: &PosBuilder<'n, 'e>) -> bool { self.b == other.b } +} + +#[cfg(test)] +mod test { + use args::settings::ArgSettings; + use super::PosBuilder; + use map::VecMap; + + #[test] + fn display_mult() { + let mut p = PosBuilder::new("pos", 1); + p.b.settings.set(ArgSettings::Multiple); + + assert_eq!(&*format!("{}", p), "..."); + } + + #[test] + fn display_required() { + let mut p2 = PosBuilder::new("pos", 1); + p2.b.settings.set(ArgSettings::Required); + + assert_eq!(&*format!("{}", p2), ""); + } + + #[test] + fn display_val_names() { + let mut p2 = PosBuilder::new("pos", 1); + let mut vm = VecMap::new(); + vm.insert(0, "file1"); + vm.insert(1, "file2"); + p2.v.val_names = Some(vm); + + assert_eq!(&*format!("{}", p2), " "); + } + + #[test] + fn display_val_names_req() { + let mut p2 = PosBuilder::new("pos", 1); + p2.b.settings.set(ArgSettings::Required); + let mut vm = VecMap::new(); + vm.insert(0, "file1"); + vm.insert(1, "file2"); + p2.v.val_names = Some(vm); + + assert_eq!(&*format!("{}", p2), " "); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/switched.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/switched.rs new file mode 100644 index 000000000..e42586c26 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/switched.rs @@ -0,0 +1,39 @@ + +use Arg; + +#[derive(Debug)] +pub struct Switched<'b> { + pub short: Option, + pub long: Option<&'b str>, + pub aliases: Option>, // (name, visible) + pub disp_ord: usize, + pub unified_ord: usize, +} + +impl<'e> Default for Switched<'e> { + fn default() -> Self { + Switched { + short: None, + long: None, + aliases: None, + disp_ord: 999, + unified_ord: 999, + } + } +} + +impl<'n, 'e, 'z> From<&'z Arg<'n, 'e>> for Switched<'e> { + fn from(a: &'z Arg<'n, 'e>) -> Self { a.s.clone() } +} + +impl<'e> Clone for Switched<'e> { + fn clone(&self) -> Self { + Switched { + short: self.short, + long: self.long, + aliases: self.aliases.clone(), + disp_ord: self.disp_ord, + unified_ord: self.unified_ord, + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_builder/valued.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/valued.rs new file mode 100644 index 000000000..d70854dc8 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_builder/valued.rs @@ -0,0 +1,67 @@ +use std::rc::Rc; +use std::ffi::{OsStr, OsString}; + +use map::VecMap; + +use Arg; + +#[allow(missing_debug_implementations)] +#[derive(Clone)] +pub struct Valued<'a, 'b> +where + 'a: 'b, +{ + pub possible_vals: Option>, + pub val_names: Option>, + pub num_vals: Option, + pub max_vals: Option, + pub min_vals: Option, + pub validator: Option Result<(), String>>>, + pub validator_os: Option Result<(), OsString>>>, + pub val_delim: Option, + pub default_val: Option<&'b OsStr>, + pub default_vals_ifs: Option, &'b OsStr)>>, + pub env: Option<(&'a OsStr, Option)>, + pub terminator: Option<&'b str>, +} + +impl<'n, 'e> Default for Valued<'n, 'e> { + fn default() -> Self { + Valued { + possible_vals: None, + num_vals: None, + min_vals: None, + max_vals: None, + val_names: None, + validator: None, + validator_os: None, + val_delim: None, + default_val: None, + default_vals_ifs: None, + env: None, + terminator: None, + } + } +} + +impl<'n, 'e> Valued<'n, 'e> { + pub fn fill_in(&mut self) { + if let Some(ref vec) = self.val_names { + if vec.len() > 1 { + self.num_vals = Some(vec.len() as u64); + } + } + } +} + +impl<'n, 'e, 'z> From<&'z Arg<'n, 'e>> for Valued<'n, 'e> { + fn from(a: &'z Arg<'n, 'e>) -> Self { + let mut v = a.v.clone(); + if let Some(ref vec) = a.v.val_names { + if vec.len() > 1 { + v.num_vals = Some(vec.len() as u64); + } + } + v + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_matcher.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_matcher.rs new file mode 100644 index 000000000..967516c50 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_matcher.rs @@ -0,0 +1,149 @@ +// Std +use std::collections::hash_map::{Entry, Iter}; +use std::collections::HashMap; +use std::ffi::OsStr; +use std::ops::Deref; +use std::mem; + +// Internal +use args::{ArgMatches, MatchedArg, SubCommand}; +use args::AnyArg; +use args::settings::ArgSettings; + +#[doc(hidden)] +#[allow(missing_debug_implementations)] +pub struct ArgMatcher<'a>(pub ArgMatches<'a>); + +impl<'a> Default for ArgMatcher<'a> { + fn default() -> Self { ArgMatcher(ArgMatches::default()) } +} + +impl<'a> ArgMatcher<'a> { + pub fn new() -> Self { ArgMatcher::default() } + + pub fn propagate_globals(&mut self, global_arg_vec : &[&'a str]) { + debugln!("ArgMatcher::get_global_values: global_arg_vec={:?}", global_arg_vec); + let mut vals_map = HashMap::new(); + self.fill_in_global_values(global_arg_vec, &mut vals_map); + } + + fn fill_in_global_values( + &mut self, + global_arg_vec: &[&'a str], + vals_map: &mut HashMap<&'a str, MatchedArg> + ) { + for global_arg in global_arg_vec { + if let Some(ma) = self.get(global_arg) { + // We have to check if the parent's global arg wasn't used but still exists + // such as from a default value. + // + // For example, `myprog subcommand --global-arg=value` where --global-arg defines + // a default value of `other` myprog would have an existing MatchedArg for + // --global-arg where the value is `other`, however the occurs will be 0. + let to_update = if let Some(parent_ma) = vals_map.get(global_arg) { + if parent_ma.occurs > 0 && ma.occurs == 0 { + parent_ma.clone() + } else { + ma.clone() + } + } else { + ma.clone() + }; + vals_map.insert(global_arg, to_update); + } + } + if let Some(ref mut sc) = self.0.subcommand { + let mut am = ArgMatcher(mem::replace(&mut sc.matches, ArgMatches::new())); + am.fill_in_global_values(global_arg_vec, vals_map); + mem::swap(&mut am.0, &mut sc.matches); + } + + for (name, matched_arg) in vals_map.into_iter() { + self.0.args.insert(name, matched_arg.clone()); + } + } + + pub fn get_mut(&mut self, arg: &str) -> Option<&mut MatchedArg> { self.0.args.get_mut(arg) } + + pub fn get(&self, arg: &str) -> Option<&MatchedArg> { self.0.args.get(arg) } + + pub fn remove(&mut self, arg: &str) { self.0.args.remove(arg); } + + pub fn remove_all(&mut self, args: &[&str]) { + for &arg in args { + self.0.args.remove(arg); + } + } + + pub fn insert(&mut self, name: &'a str) { self.0.args.insert(name, MatchedArg::new()); } + + pub fn contains(&self, arg: &str) -> bool { self.0.args.contains_key(arg) } + + pub fn is_empty(&self) -> bool { self.0.args.is_empty() } + + pub fn usage(&mut self, usage: String) { self.0.usage = Some(usage); } + + pub fn arg_names(&'a self) -> Vec<&'a str> { self.0.args.keys().map(Deref::deref).collect() } + + pub fn entry(&mut self, arg: &'a str) -> Entry<&'a str, MatchedArg> { self.0.args.entry(arg) } + + pub fn subcommand(&mut self, sc: SubCommand<'a>) { self.0.subcommand = Some(Box::new(sc)); } + + pub fn subcommand_name(&self) -> Option<&str> { self.0.subcommand_name() } + + pub fn iter(&self) -> Iter<&str, MatchedArg> { self.0.args.iter() } + + pub fn inc_occurrence_of(&mut self, arg: &'a str) { + debugln!("ArgMatcher::inc_occurrence_of: arg={}", arg); + if let Some(a) = self.get_mut(arg) { + a.occurs += 1; + return; + } + debugln!("ArgMatcher::inc_occurrence_of: first instance"); + self.insert(arg); + } + + pub fn inc_occurrences_of(&mut self, args: &[&'a str]) { + debugln!("ArgMatcher::inc_occurrences_of: args={:?}", args); + for arg in args { + self.inc_occurrence_of(arg); + } + } + + pub fn add_val_to(&mut self, arg: &'a str, val: &OsStr) { + let ma = self.entry(arg).or_insert(MatchedArg { + occurs: 0, + vals: Vec::with_capacity(1), + }); + // let len = ma.vals.len() + 1; + ma.vals.push(val.to_owned()); + } + + pub fn needs_more_vals<'b, A>(&self, o: &A) -> bool + where A: AnyArg<'a, 'b> + { + debugln!("ArgMatcher::needs_more_vals: o={}", o.name()); + if let Some(ma) = self.get(o.name()) { + if let Some(num) = o.num_vals() { + debugln!("ArgMatcher::needs_more_vals: num_vals...{}", num); + return if o.is_set(ArgSettings::Multiple) { + ((ma.vals.len() as u64) % num) != 0 + } else { + num != (ma.vals.len() as u64) + }; + } else if let Some(num) = o.max_vals() { + debugln!("ArgMatcher::needs_more_vals: max_vals...{}", num); + return !((ma.vals.len() as u64) > num); + } else if o.min_vals().is_some() { + debugln!("ArgMatcher::needs_more_vals: min_vals...true"); + return true; + } + return o.is_set(ArgSettings::Multiple); + } + true + } +} + +impl<'a> Into> for ArgMatcher<'a> { + fn into(self) -> ArgMatches<'a> { self.0 } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/arg_matches.rs b/vendor/registry-40351f815f426200/clap/src/args/arg_matches.rs new file mode 100644 index 000000000..14a190451 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/arg_matches.rs @@ -0,0 +1,652 @@ +// Std +use std::borrow::Cow; +use std::collections::HashMap; +use std::ffi::{OsStr, OsString}; +use std::iter::Map; +use std::slice::Iter; + +// Internal +use INVALID_UTF8; +use args::MatchedArg; +use args::SubCommand; + +/// Used to get information about the arguments that where supplied to the program at runtime by +/// the user. New instances of this struct are obtained by using the [`App::get_matches`] family of +/// methods. +/// +/// # Examples +/// +/// ```no_run +/// # use clap::{App, Arg}; +/// let matches = App::new("MyApp") +/// .arg(Arg::with_name("out") +/// .long("output") +/// .required(true) +/// .takes_value(true)) +/// .arg(Arg::with_name("debug") +/// .short("d") +/// .multiple(true)) +/// .arg(Arg::with_name("cfg") +/// .short("c") +/// .takes_value(true)) +/// .get_matches(); // builds the instance of ArgMatches +/// +/// // to get information about the "cfg" argument we created, such as the value supplied we use +/// // various ArgMatches methods, such as ArgMatches::value_of +/// if let Some(c) = matches.value_of("cfg") { +/// println!("Value for -c: {}", c); +/// } +/// +/// // The ArgMatches::value_of method returns an Option because the user may not have supplied +/// // that argument at runtime. But if we specified that the argument was "required" as we did +/// // with the "out" argument, we can safely unwrap because `clap` verifies that was actually +/// // used at runtime. +/// println!("Value for --output: {}", matches.value_of("out").unwrap()); +/// +/// // You can check the presence of an argument +/// if matches.is_present("out") { +/// // Another way to check if an argument was present, or if it occurred multiple times is to +/// // use occurrences_of() which returns 0 if an argument isn't found at runtime, or the +/// // number of times that it occurred, if it was. To allow an argument to appear more than +/// // once, you must use the .multiple(true) method, otherwise it will only return 1 or 0. +/// if matches.occurrences_of("debug") > 2 { +/// println!("Debug mode is REALLY on, don't be crazy"); +/// } else { +/// println!("Debug mode kind of on"); +/// } +/// } +/// ``` +/// [`App::get_matches`]: ./struct.App.html#method.get_matches +#[derive(Debug, Clone)] +pub struct ArgMatches<'a> { + #[doc(hidden)] + pub args: HashMap<&'a str, MatchedArg>, + #[doc(hidden)] + pub subcommand: Option>>, + #[doc(hidden)] + pub usage: Option, +} + +impl<'a> Default for ArgMatches<'a> { + fn default() -> Self { + ArgMatches { + args: HashMap::new(), + subcommand: None, + usage: None, + } + } +} + +impl<'a> ArgMatches<'a> { + #[doc(hidden)] + pub fn new() -> Self { ArgMatches { ..Default::default() } } + + /// Gets the value of a specific [option] or [positional] argument (i.e. an argument that takes + /// an additional value at runtime). If the option wasn't present at runtime + /// it returns `None`. + /// + /// *NOTE:* If getting a value for an option or positional argument that allows multiples, + /// prefer [`ArgMatches::values_of`] as `ArgMatches::value_of` will only return the *first* + /// value. + /// + /// # Panics + /// + /// This method will [`panic!`] if the value contains invalid UTF-8 code points. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("myapp") + /// .arg(Arg::with_name("output") + /// .takes_value(true)) + /// .get_matches_from(vec!["myapp", "something"]); + /// + /// assert_eq!(m.value_of("output"), Some("something")); + /// ``` + /// [option]: ./struct.Arg.html#method.takes_value + /// [positional]: ./struct.Arg.html#method.index + /// [`ArgMatches::values_of`]: ./struct.ArgMatches.html#method.values_of + /// [`panic!`]: https://doc.rust-lang.org/std/macro.panic!.html + pub fn value_of>(&self, name: S) -> Option<&str> { + if let Some(arg) = self.args.get(name.as_ref()) { + if let Some(v) = arg.vals.get(0) { + return Some(v.to_str().expect(INVALID_UTF8)); + } + } + None + } + + /// Gets the lossy value of a specific argument. If the argument wasn't present at runtime + /// it returns `None`. A lossy value is one which contains invalid UTF-8 code points, those + /// invalid points will be replaced with `\u{FFFD}` + /// + /// *NOTE:* If getting a value for an option or positional argument that allows multiples, + /// prefer [`Arg::values_of_lossy`] as `value_of_lossy()` will only return the *first* value. + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, Arg}; + /// use std::ffi::OsString; + /// use std::os::unix::ffi::{OsStrExt,OsStringExt}; + /// + /// let m = App::new("utf8") + /// .arg(Arg::from_usage(" 'some arg'")) + /// .get_matches_from(vec![OsString::from("myprog"), + /// // "Hi {0xe9}!" + /// OsString::from_vec(vec![b'H', b'i', b' ', 0xe9, b'!'])]); + /// assert_eq!(&*m.value_of_lossy("arg").unwrap(), "Hi \u{FFFD}!"); + /// ``` + /// [`Arg::values_of_lossy`]: ./struct.ArgMatches.html#method.values_of_lossy + pub fn value_of_lossy>(&'a self, name: S) -> Option> { + if let Some(arg) = self.args.get(name.as_ref()) { + if let Some(v) = arg.vals.get(0) { + return Some(v.to_string_lossy()); + } + } + None + } + + /// Gets the OS version of a string value of a specific argument. If the option wasn't present + /// at runtime it returns `None`. An OS value on Unix-like systems is any series of bytes, + /// regardless of whether or not they contain valid UTF-8 code points. Since [`String`]s in + /// Rust are guaranteed to be valid UTF-8, a valid filename on a Unix system as an argument + /// value may contain invalid UTF-8 code points. + /// + /// *NOTE:* If getting a value for an option or positional argument that allows multiples, + /// prefer [`ArgMatches::values_of_os`] as `Arg::value_of_os` will only return the *first* + /// value. + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, Arg}; + /// use std::ffi::OsString; + /// use std::os::unix::ffi::{OsStrExt,OsStringExt}; + /// + /// let m = App::new("utf8") + /// .arg(Arg::from_usage(" 'some arg'")) + /// .get_matches_from(vec![OsString::from("myprog"), + /// // "Hi {0xe9}!" + /// OsString::from_vec(vec![b'H', b'i', b' ', 0xe9, b'!'])]); + /// assert_eq!(&*m.value_of_os("arg").unwrap().as_bytes(), [b'H', b'i', b' ', 0xe9, b'!']); + /// ``` + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`ArgMatches::values_of_os`]: ./struct.ArgMatches.html#method.values_of_os + pub fn value_of_os>(&self, name: S) -> Option<&OsStr> { + self.args + .get(name.as_ref()) + .and_then(|arg| arg.vals.get(0).map(|v| v.as_os_str())) + } + + /// Gets a [`Values`] struct which implements [`Iterator`] for values of a specific argument + /// (i.e. an argument that takes multiple values at runtime). If the option wasn't present at + /// runtime it returns `None` + /// + /// # Panics + /// + /// This method will panic if any of the values contain invalid UTF-8 code points. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("output") + /// .multiple(true) + /// .short("o") + /// .takes_value(true)) + /// .get_matches_from(vec![ + /// "myprog", "-o", "val1", "val2", "val3" + /// ]); + /// let vals: Vec<&str> = m.values_of("output").unwrap().collect(); + /// assert_eq!(vals, ["val1", "val2", "val3"]); + /// ``` + /// [`Values`]: ./struct.Values.html + /// [`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html + pub fn values_of>(&'a self, name: S) -> Option> { + if let Some(arg) = self.args.get(name.as_ref()) { + fn to_str_slice(o: &OsString) -> &str { o.to_str().expect(INVALID_UTF8) } + let to_str_slice: fn(&OsString) -> &str = to_str_slice; // coerce to fn pointer + return Some(Values { iter: arg.vals.iter().map(to_str_slice) }); + } + None + } + + /// Gets the lossy values of a specific argument. If the option wasn't present at runtime + /// it returns `None`. A lossy value is one where if it contains invalid UTF-8 code points, + /// those invalid points will be replaced with `\u{FFFD}` + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, Arg}; + /// use std::ffi::OsString; + /// use std::os::unix::ffi::OsStringExt; + /// + /// let m = App::new("utf8") + /// .arg(Arg::from_usage("... 'some arg'")) + /// .get_matches_from(vec![OsString::from("myprog"), + /// // "Hi" + /// OsString::from_vec(vec![b'H', b'i']), + /// // "{0xe9}!" + /// OsString::from_vec(vec![0xe9, b'!'])]); + /// let mut itr = m.values_of_lossy("arg").unwrap().into_iter(); + /// assert_eq!(&itr.next().unwrap()[..], "Hi"); + /// assert_eq!(&itr.next().unwrap()[..], "\u{FFFD}!"); + /// assert_eq!(itr.next(), None); + /// ``` + pub fn values_of_lossy>(&'a self, name: S) -> Option> { + if let Some(arg) = self.args.get(name.as_ref()) { + return Some(arg.vals + .iter() + .map(|v| v.to_string_lossy().into_owned()) + .collect()); + } + None + } + + /// Gets a [`OsValues`] struct which is implements [`Iterator`] for [`OsString`] values of a + /// specific argument. If the option wasn't present at runtime it returns `None`. An OS value + /// on Unix-like systems is any series of bytes, regardless of whether or not they contain + /// valid UTF-8 code points. Since [`String`]s in Rust are guaranteed to be valid UTF-8, a valid + /// filename as an argument value on Linux (for example) may contain invalid UTF-8 code points. + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, Arg}; + /// use std::ffi::{OsStr,OsString}; + /// use std::os::unix::ffi::{OsStrExt,OsStringExt}; + /// + /// let m = App::new("utf8") + /// .arg(Arg::from_usage("... 'some arg'")) + /// .get_matches_from(vec![OsString::from("myprog"), + /// // "Hi" + /// OsString::from_vec(vec![b'H', b'i']), + /// // "{0xe9}!" + /// OsString::from_vec(vec![0xe9, b'!'])]); + /// + /// let mut itr = m.values_of_os("arg").unwrap().into_iter(); + /// assert_eq!(itr.next(), Some(OsStr::new("Hi"))); + /// assert_eq!(itr.next(), Some(OsStr::from_bytes(&[0xe9, b'!']))); + /// assert_eq!(itr.next(), None); + /// ``` + /// [`OsValues`]: ./struct.OsValues.html + /// [`Iterator`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html + /// [`OsString`]: https://doc.rust-lang.org/std/ffi/struct.OsString.html + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + pub fn values_of_os>(&'a self, name: S) -> Option> { + fn to_str_slice(o: &OsString) -> &OsStr { &*o } + let to_str_slice: fn(&'a OsString) -> &'a OsStr = to_str_slice; // coerce to fn pointer + if let Some(arg) = self.args.get(name.as_ref()) { + return Some(OsValues { iter: arg.vals.iter().map(to_str_slice) }); + } + None + } + + /// Returns `true` if an argument was present at runtime, otherwise `false`. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .get_matches_from(vec![ + /// "myprog", "-d" + /// ]); + /// + /// assert!(m.is_present("debug")); + /// ``` + pub fn is_present>(&self, name: S) -> bool { + if let Some(ref sc) = self.subcommand { + if sc.name == name.as_ref() { + return true; + } + } + self.args.contains_key(name.as_ref()) + } + + /// Returns the number of times an argument was used at runtime. If an argument isn't present + /// it will return `0`. + /// + /// **NOTE:** This returns the number of times the argument was used, *not* the number of + /// values. For example, `-o val1 val2 val3 -o val4` would return `2` (2 occurrences, but 4 + /// values). + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("debug") + /// .short("d") + /// .multiple(true)) + /// .get_matches_from(vec![ + /// "myprog", "-d", "-d", "-d" + /// ]); + /// + /// assert_eq!(m.occurrences_of("debug"), 3); + /// ``` + /// + /// This next example shows that counts actual uses of the argument, not just `-`'s + /// + /// ```rust + /// # use clap::{App, Arg}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("debug") + /// .short("d") + /// .multiple(true)) + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .get_matches_from(vec![ + /// "myprog", "-ddfd" + /// ]); + /// + /// assert_eq!(m.occurrences_of("debug"), 3); + /// assert_eq!(m.occurrences_of("flag"), 1); + /// ``` + pub fn occurrences_of>(&self, name: S) -> u64 { + self.args.get(name.as_ref()).map_or(0, |a| a.occurs) + } + + /// Because [`Subcommand`]s are essentially "sub-[`App`]s" they have their own [`ArgMatches`] + /// as well. This method returns the [`ArgMatches`] for a particular subcommand or `None` if + /// the subcommand wasn't present at runtime. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, SubCommand}; + /// let app_m = App::new("myprog") + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .subcommand(SubCommand::with_name("test") + /// .arg(Arg::with_name("opt") + /// .long("option") + /// .takes_value(true))) + /// .get_matches_from(vec![ + /// "myprog", "-d", "test", "--option", "val" + /// ]); + /// + /// // Both parent commands, and child subcommands can have arguments present at the same times + /// assert!(app_m.is_present("debug")); + /// + /// // Get the subcommand's ArgMatches instance + /// if let Some(sub_m) = app_m.subcommand_matches("test") { + /// // Use the struct like normal + /// assert_eq!(sub_m.value_of("opt"), Some("val")); + /// } + /// ``` + /// [`Subcommand`]: ./struct.SubCommand.html + /// [`App`]: ./struct.App.html + /// [`ArgMatches`]: ./struct.ArgMatches.html + pub fn subcommand_matches>(&self, name: S) -> Option<&ArgMatches<'a>> { + if let Some(ref s) = self.subcommand { + if s.name == name.as_ref() { + return Some(&s.matches); + } + } + None + } + + /// Because [`Subcommand`]s are essentially "sub-[`App`]s" they have their own [`ArgMatches`] + /// as well.But simply getting the sub-[`ArgMatches`] doesn't help much if we don't also know + /// which subcommand was actually used. This method returns the name of the subcommand that was + /// used at runtime, or `None` if one wasn't. + /// + /// *NOTE*: Subcommands form a hierarchy, where multiple subcommands can be used at runtime, + /// but only a single subcommand from any group of sibling commands may used at once. + /// + /// An ASCII art depiction may help explain this better...Using a fictional version of `git` as + /// the demo subject. Imagine the following are all subcommands of `git` (note, the author is + /// aware these aren't actually all subcommands in the real `git` interface, but it makes + /// explanation easier) + /// + /// ```notrust + /// Top Level App (git) TOP + /// | + /// ----------------------------------------- + /// / | \ \ + /// clone push add commit LEVEL 1 + /// | / \ / \ | + /// url origin remote ref name message LEVEL 2 + /// / /\ + /// path remote local LEVEL 3 + /// ``` + /// + /// Given the above fictional subcommand hierarchy, valid runtime uses would be (not an all + /// inclusive list, and not including argument options per command for brevity and clarity): + /// + /// ```sh + /// $ git clone url + /// $ git push origin path + /// $ git add ref local + /// $ git commit message + /// ``` + /// + /// Notice only one command per "level" may be used. You could not, for example, do `$ git + /// clone url push origin path` + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let app_m = App::new("git") + /// .subcommand(SubCommand::with_name("clone")) + /// .subcommand(SubCommand::with_name("push")) + /// .subcommand(SubCommand::with_name("commit")) + /// .get_matches(); + /// + /// match app_m.subcommand_name() { + /// Some("clone") => {}, // clone was used + /// Some("push") => {}, // push was used + /// Some("commit") => {}, // commit was used + /// _ => {}, // Either no subcommand or one not tested for... + /// } + /// ``` + /// [`Subcommand`]: ./struct.SubCommand.html + /// [`App`]: ./struct.App.html + /// [`ArgMatches`]: ./struct.ArgMatches.html + pub fn subcommand_name(&self) -> Option<&str> { + self.subcommand.as_ref().map(|sc| &sc.name[..]) + } + + /// This brings together [`ArgMatches::subcommand_matches`] and [`ArgMatches::subcommand_name`] + /// by returning a tuple with both pieces of information. + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let app_m = App::new("git") + /// .subcommand(SubCommand::with_name("clone")) + /// .subcommand(SubCommand::with_name("push")) + /// .subcommand(SubCommand::with_name("commit")) + /// .get_matches(); + /// + /// match app_m.subcommand() { + /// ("clone", Some(sub_m)) => {}, // clone was used + /// ("push", Some(sub_m)) => {}, // push was used + /// ("commit", Some(sub_m)) => {}, // commit was used + /// _ => {}, // Either no subcommand or one not tested for... + /// } + /// ``` + /// + /// Another useful scenario is when you want to support third party, or external, subcommands. + /// In these cases you can't know the subcommand name ahead of time, so use a variable instead + /// with pattern matching! + /// + /// ```rust + /// # use clap::{App, AppSettings}; + /// // Assume there is an external subcommand named "subcmd" + /// let app_m = App::new("myprog") + /// .setting(AppSettings::AllowExternalSubcommands) + /// .get_matches_from(vec![ + /// "myprog", "subcmd", "--option", "value", "-fff", "--flag" + /// ]); + /// + /// // All trailing arguments will be stored under the subcommand's sub-matches using an empty + /// // string argument name + /// match app_m.subcommand() { + /// (external, Some(sub_m)) => { + /// let ext_args: Vec<&str> = sub_m.values_of("").unwrap().collect(); + /// assert_eq!(external, "subcmd"); + /// assert_eq!(ext_args, ["--option", "value", "-fff", "--flag"]); + /// }, + /// _ => {}, + /// } + /// ``` + /// [`ArgMatches::subcommand_matches`]: ./struct.ArgMatches.html#method.subcommand_matches + /// [`ArgMatches::subcommand_name`]: ./struct.ArgMatches.html#method.subcommand_name + pub fn subcommand(&self) -> (&str, Option<&ArgMatches<'a>>) { + self.subcommand.as_ref().map_or(("", None), |sc| (&sc.name[..], Some(&sc.matches))) + } + + /// Returns a string slice of the usage statement for the [`App`] or [`SubCommand`] + /// + /// # Examples + /// + /// ```no_run + /// # use clap::{App, Arg, SubCommand}; + /// let app_m = App::new("myprog") + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches(); + /// + /// println!("{}", app_m.usage()); + /// ``` + /// [`Subcommand`]: ./struct.SubCommand.html + /// [`App`]: ./struct.App.html + pub fn usage(&self) -> &str { self.usage.as_ref().map_or("", |u| &u[..]) } +} + + +// The following were taken and adapated from vec_map source +// repo: https://github.com/contain-rs/vec-map +// commit: be5e1fa3c26e351761b33010ddbdaf5f05dbcc33 +// license: MIT - Copyright (c) 2015 The Rust Project Developers + +/// An iterator for getting multiple values out of an argument via the [`ArgMatches::values_of`] +/// method. +/// +/// # Examples +/// +/// ```rust +/// # use clap::{App, Arg}; +/// let m = App::new("myapp") +/// .arg(Arg::with_name("output") +/// .takes_value(true)) +/// .get_matches_from(vec!["myapp", "something"]); +/// +/// assert_eq!(m.value_of("output"), Some("something")); +/// ``` +/// [`ArgMatches::values_of`]: ./struct.ArgMatches.html#method.values_of +#[derive(Clone)] +#[allow(missing_debug_implementations)] +pub struct Values<'a> { + iter: Map, fn(&'a OsString) -> &'a str>, +} + +impl<'a> Iterator for Values<'a> { + type Item = &'a str; + + fn next(&mut self) -> Option<&'a str> { self.iter.next() } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } +} + +impl<'a> DoubleEndedIterator for Values<'a> { + fn next_back(&mut self) -> Option<&'a str> { self.iter.next_back() } +} + +impl<'a> ExactSizeIterator for Values<'a> {} + +/// Creates an empty iterator. +impl<'a> Default for Values<'a> { + fn default() -> Self { + static EMPTY: [OsString; 0] = []; + // This is never called because the iterator is empty: + fn to_str_slice(_: &OsString) -> &str { unreachable!() }; + Values { iter: EMPTY[..].iter().map(to_str_slice) } + } +} + +#[test] +fn test_default_values() { + let mut values: Values = Values::default(); + assert_eq!(values.next(), None); +} + +#[test] +fn test_default_values_with_shorter_lifetime() { + let matches = ArgMatches::new(); + let mut values = matches.values_of("").unwrap_or_default(); + assert_eq!(values.next(), None); +} + +/// An iterator for getting multiple values out of an argument via the [`ArgMatches::values_of_os`] +/// method. Usage of this iterator allows values which contain invalid UTF-8 code points unlike +/// [`Values`]. +/// +/// # Examples +/// +#[cfg_attr(not(unix), doc=" ```ignore")] +#[cfg_attr( unix , doc=" ```")] +/// # use clap::{App, Arg}; +/// use std::ffi::OsString; +/// use std::os::unix::ffi::{OsStrExt,OsStringExt}; +/// +/// let m = App::new("utf8") +/// .arg(Arg::from_usage(" 'some arg'")) +/// .get_matches_from(vec![OsString::from("myprog"), +/// // "Hi {0xe9}!" +/// OsString::from_vec(vec![b'H', b'i', b' ', 0xe9, b'!'])]); +/// assert_eq!(&*m.value_of_os("arg").unwrap().as_bytes(), [b'H', b'i', b' ', 0xe9, b'!']); +/// ``` +/// [`ArgMatches::values_of_os`]: ./struct.ArgMatches.html#method.values_of_os +/// [`Values`]: ./struct.Values.html +#[derive(Clone)] +#[allow(missing_debug_implementations)] +pub struct OsValues<'a> { + iter: Map, fn(&'a OsString) -> &'a OsStr>, +} + +impl<'a> Iterator for OsValues<'a> { + type Item = &'a OsStr; + + fn next(&mut self) -> Option<&'a OsStr> { self.iter.next() } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } +} + +impl<'a> DoubleEndedIterator for OsValues<'a> { + fn next_back(&mut self) -> Option<&'a OsStr> { self.iter.next_back() } +} + +/// Creates an empty iterator. +impl<'a> Default for OsValues<'a> { + fn default() -> Self { + static EMPTY: [OsString; 0] = []; + // This is never called because the iterator is empty: + fn to_str_slice(_: &OsString) -> &OsStr { unreachable!() }; + OsValues { iter: EMPTY[..].iter().map(to_str_slice) } + } +} + +#[test] +fn test_default_osvalues() { + let mut values: OsValues = OsValues::default(); + assert_eq!(values.next(), None); +} + +#[test] +fn test_default_osvalues_with_shorter_lifetime() { + let matches = ArgMatches::new(); + let mut values = matches.values_of_os("").unwrap_or_default(); + assert_eq!(values.next(), None); +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/group.rs b/vendor/registry-40351f815f426200/clap/src/args/group.rs new file mode 100644 index 000000000..1d555aba4 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/group.rs @@ -0,0 +1,634 @@ +#[cfg(feature = "yaml")] +use std::collections::BTreeMap; +use std::fmt::{Debug, Formatter, Result}; + +#[cfg(feature = "yaml")] +use yaml_rust::Yaml; + +/// `ArgGroup`s are a family of related [arguments] and way for you to express, "Any of these +/// arguments". By placing arguments in a logical group, you can create easier requirement and +/// exclusion rules instead of having to list each argument individually, or when you want a rule +/// to apply "any but not all" arguments. +/// +/// For instance, you can make an entire `ArgGroup` required. If [`ArgGroup::multiple(true)`] is +/// set, this means that at least one argument from that group must be present. If +/// [`ArgGroup::multiple(false)`] is set (the default), one and *only* one must be present. +/// +/// You can also do things such as name an entire `ArgGroup` as a [conflict] or [requirement] for +/// another argument, meaning any of the arguments that belong to that group will cause a failure +/// if present, or must present respectively. +/// +/// Perhaps the most common use of `ArgGroup`s is to require one and *only* one argument to be +/// present out of a given set. Imagine that you had multiple arguments, and you want one of them +/// to be required, but making all of them required isn't feasible because perhaps they conflict +/// with each other. For example, lets say that you were building an application where one could +/// set a given version number by supplying a string with an option argument, i.e. +/// `--set-ver v1.2.3`, you also wanted to support automatically using a previous version number +/// and simply incrementing one of the three numbers. So you create three flags `--major`, +/// `--minor`, and `--patch`. All of these arguments shouldn't be used at one time but you want to +/// specify that *at least one* of them is used. For this, you can create a group. +/// +/// Finally, you may use `ArgGroup`s to pull a value from a group of arguments when you don't care +/// exactly which argument was actually used at runtime. +/// +/// # Examples +/// +/// The following example demonstrates using an `ArgGroup` to ensure that one, and only one, of +/// the arguments from the specified group is present at runtime. +/// +/// ```rust +/// # use clap::{App, ArgGroup, ErrorKind}; +/// let result = App::new("app") +/// .args_from_usage( +/// "--set-ver [ver] 'set the version manually' +/// --major 'auto increase major' +/// --minor 'auto increase minor' +/// --patch 'auto increase patch'") +/// .group(ArgGroup::with_name("vers") +/// .args(&["set-ver", "major", "minor","patch"]) +/// .required(true)) +/// .get_matches_from_safe(vec!["app", "--major", "--patch"]); +/// // Because we used two args in the group it's an error +/// assert!(result.is_err()); +/// let err = result.unwrap_err(); +/// assert_eq!(err.kind, ErrorKind::ArgumentConflict); +/// ``` +/// This next example shows a passing parse of the same scenario +/// +/// ```rust +/// # use clap::{App, ArgGroup}; +/// let result = App::new("app") +/// .args_from_usage( +/// "--set-ver [ver] 'set the version manually' +/// --major 'auto increase major' +/// --minor 'auto increase minor' +/// --patch 'auto increase patch'") +/// .group(ArgGroup::with_name("vers") +/// .args(&["set-ver", "major", "minor","patch"]) +/// .required(true)) +/// .get_matches_from_safe(vec!["app", "--major"]); +/// assert!(result.is_ok()); +/// let matches = result.unwrap(); +/// // We may not know which of the args was used, so we can test for the group... +/// assert!(matches.is_present("vers")); +/// // we could also alternatively check each arg individually (not shown here) +/// ``` +/// [`ArgGroup::multiple(true)`]: ./struct.ArgGroup.html#method.multiple +/// [arguments]: ./struct.Arg.html +/// [conflict]: ./struct.Arg.html#method.conflicts_with +/// [requirement]: ./struct.Arg.html#method.requires +#[derive(Default)] +pub struct ArgGroup<'a> { + #[doc(hidden)] + pub name: &'a str, + #[doc(hidden)] + pub args: Vec<&'a str>, + #[doc(hidden)] + pub required: bool, + #[doc(hidden)] + pub requires: Option>, + #[doc(hidden)] + pub conflicts: Option>, + #[doc(hidden)] + pub multiple: bool, +} + +impl<'a> ArgGroup<'a> { + /// Creates a new instance of `ArgGroup` using a unique string name. The name will be used to + /// get values from the group or refer to the group inside of conflict and requirement rules. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, ArgGroup}; + /// ArgGroup::with_name("config") + /// # ; + /// ``` + pub fn with_name(n: &'a str) -> Self { + ArgGroup { + name: n, + required: false, + args: vec![], + requires: None, + conflicts: None, + multiple: false, + } + } + + /// Creates a new instance of `ArgGroup` from a .yml (YAML) file. + /// + /// # Examples + /// + /// ```ignore + /// # #[macro_use] + /// # extern crate clap; + /// # use clap::ArgGroup; + /// # fn main() { + /// let yml = load_yaml!("group.yml"); + /// let ag = ArgGroup::from_yaml(yml); + /// # } + /// ``` + #[cfg(feature = "yaml")] + pub fn from_yaml(y: &'a Yaml) -> ArgGroup<'a> { ArgGroup::from(y.as_hash().unwrap()) } + + /// Adds an [argument] to this group by name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .group(ArgGroup::with_name("req_flags") + /// .arg("flag") + /// .arg("color")) + /// .get_matches_from(vec!["myprog", "-f"]); + /// // maybe we don't know which of the two flags was used... + /// assert!(m.is_present("req_flags")); + /// // but we can also check individually if needed + /// assert!(m.is_present("flag")); + /// ``` + /// [argument]: ./struct.Arg.html + #[cfg_attr(feature = "lints", allow(should_assert_eq))] + pub fn arg(mut self, n: &'a str) -> Self { + assert!(self.name != n, + "ArgGroup '{}' can not have same name as arg inside it", + &*self.name); + self.args.push(n); + self + } + + /// Adds multiple [arguments] to this group by name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"])) + /// .get_matches_from(vec!["myprog", "-f"]); + /// // maybe we don't know which of the two flags was used... + /// assert!(m.is_present("req_flags")); + /// // but we can also check individually if needed + /// assert!(m.is_present("flag")); + /// ``` + /// [arguments]: ./struct.Arg.html + pub fn args(mut self, ns: &[&'a str]) -> Self { + for n in ns { + self = self.arg(n); + } + self + } + + /// Allows more than one of the ['Arg']s in this group to be used. (Default: `false`) + /// + /// # Examples + /// + /// Notice in this example we use *both* the `-f` and `-c` flags which are both part of the + /// group + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup}; + /// let m = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .multiple(true)) + /// .get_matches_from(vec!["myprog", "-f", "-c"]); + /// // maybe we don't know which of the two flags was used... + /// assert!(m.is_present("req_flags")); + /// ``` + /// In this next example, we show the default behavior (i.e. `multiple(false)) which will throw + /// an error if more than one of the args in the group was used. + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"])) + /// .get_matches_from_safe(vec!["myprog", "-f", "-c"]); + /// // Because we used both args in the group it's an error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::ArgumentConflict); + /// ``` + /// ['Arg']: ./struct.Arg.html + pub fn multiple(mut self, m: bool) -> Self { + self.multiple = m; + self + } + + /// Sets the group as required or not. A required group will be displayed in the usage string + /// of the application in the format ``. A required `ArgGroup` simply states + /// that one argument from this group *must* be present at runtime (unless + /// conflicting with another argument). + /// + /// **NOTE:** This setting only applies to the current [`App`] / [`SubCommand`], and not + /// globally. + /// + /// **NOTE:** By default, [`ArgGroup::multiple`] is set to `false` which when combined with + /// `ArgGroup::required(true)` states, "One and *only one* arg must be used from this group. + /// Use of more than one arg is an error." Vice setting `ArgGroup::multiple(true)` which + /// states, '*At least* one arg from this group must be used. Using multiple is OK." + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .required(true)) + /// .get_matches_from_safe(vec!["myprog"]); + /// // Because we didn't use any of the args in the group, it's an error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [`App`]: ./struct.App.html + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`ArgGroup::multiple`]: ./struct.ArgGroup.html#method.multiple + pub fn required(mut self, r: bool) -> Self { + self.required = r; + self + } + + /// Sets the requirement rules of this group. This is not to be confused with a + /// [required group]. Requirement rules function just like [argument requirement rules], you + /// can name other arguments or groups that must be present when any one of the arguments from + /// this group is used. + /// + /// **NOTE:** The name provided may be an argument, or group name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .requires("debug")) + /// .get_matches_from_safe(vec!["myprog", "-c"]); + /// // because we used an arg from the group, and the group requires "-d" to be used, it's an + /// // error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [required group]: ./struct.ArgGroup.html#method.required + /// [argument requirement rules]: ./struct.Arg.html#method.requires + pub fn requires(mut self, n: &'a str) -> Self { + if let Some(ref mut reqs) = self.requires { + reqs.push(n); + } else { + self.requires = Some(vec![n]); + } + self + } + + /// Sets the requirement rules of this group. This is not to be confused with a + /// [required group]. Requirement rules function just like [argument requirement rules], you + /// can name other arguments or groups that must be present when one of the arguments from this + /// group is used. + /// + /// **NOTE:** The names provided may be an argument, or group name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .arg(Arg::with_name("verb") + /// .short("v")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .requires_all(&["debug", "verb"])) + /// .get_matches_from_safe(vec!["myprog", "-c", "-d"]); + /// // because we used an arg from the group, and the group requires "-d" and "-v" to be used, + /// // yet we only used "-d" it's an error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::MissingRequiredArgument); + /// ``` + /// [required group]: ./struct.ArgGroup.html#method.required + /// [argument requirement rules]: ./struct.Arg.html#method.requires_all + pub fn requires_all(mut self, ns: &[&'a str]) -> Self { + for n in ns { + self = self.requires(n); + } + self + } + + /// Sets the exclusion rules of this group. Exclusion (aka conflict) rules function just like + /// [argument exclusion rules], you can name other arguments or groups that must *not* be + /// present when one of the arguments from this group are used. + /// + /// **NOTE:** The name provided may be an argument, or group name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .conflicts_with("debug")) + /// .get_matches_from_safe(vec!["myprog", "-c", "-d"]); + /// // because we used an arg from the group, and the group conflicts with "-d", it's an error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::ArgumentConflict); + /// ``` + /// [argument exclusion rules]: ./struct.Arg.html#method.conflicts_with + pub fn conflicts_with(mut self, n: &'a str) -> Self { + if let Some(ref mut confs) = self.conflicts { + confs.push(n); + } else { + self.conflicts = Some(vec![n]); + } + self + } + + /// Sets the exclusion rules of this group. Exclusion rules function just like + /// [argument exclusion rules], you can name other arguments or groups that must *not* be + /// present when one of the arguments from this group are used. + /// + /// **NOTE:** The names provided may be an argument, or group name + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ArgGroup, ErrorKind}; + /// let result = App::new("myprog") + /// .arg(Arg::with_name("flag") + /// .short("f")) + /// .arg(Arg::with_name("color") + /// .short("c")) + /// .arg(Arg::with_name("debug") + /// .short("d")) + /// .arg(Arg::with_name("verb") + /// .short("v")) + /// .group(ArgGroup::with_name("req_flags") + /// .args(&["flag", "color"]) + /// .conflicts_with_all(&["debug", "verb"])) + /// .get_matches_from_safe(vec!["myprog", "-c", "-v"]); + /// // because we used an arg from the group, and the group conflicts with either "-v" or "-d" + /// // it's an error + /// assert!(result.is_err()); + /// let err = result.unwrap_err(); + /// assert_eq!(err.kind, ErrorKind::ArgumentConflict); + /// ``` + /// [argument exclusion rules]: ./struct.Arg.html#method.conflicts_with_all + pub fn conflicts_with_all(mut self, ns: &[&'a str]) -> Self { + for n in ns { + self = self.conflicts_with(n); + } + self + } +} + +impl<'a> Debug for ArgGroup<'a> { + fn fmt(&self, f: &mut Formatter) -> Result { + write!(f, + "{{\n\ + \tname: {:?},\n\ + \targs: {:?},\n\ + \trequired: {:?},\n\ + \trequires: {:?},\n\ + \tconflicts: {:?},\n\ + }}", + self.name, + self.args, + self.required, + self.requires, + self.conflicts) + } +} + +impl<'a, 'z> From<&'z ArgGroup<'a>> for ArgGroup<'a> { + fn from(g: &'z ArgGroup<'a>) -> Self { + ArgGroup { + name: g.name, + required: g.required, + args: g.args.clone(), + requires: g.requires.clone(), + conflicts: g.conflicts.clone(), + multiple: g.multiple, + } + } +} + +#[cfg(feature = "yaml")] +impl<'a> From<&'a BTreeMap> for ArgGroup<'a> { + fn from(b: &'a BTreeMap) -> Self { + // We WANT this to panic on error...so expect() is good. + let mut a = ArgGroup::default(); + let group_settings = if b.len() == 1 { + let name_yml = b.keys().nth(0).expect("failed to get name"); + let name_str = name_yml.as_str().expect("failed to convert arg YAML name to str"); + a.name = name_str; + b.get(name_yml) + .expect("failed to get name_str") + .as_hash() + .expect("failed to convert to a hash") + } else { + b + }; + + for (k, v) in group_settings { + a = match k.as_str().unwrap() { + "required" => a.required(v.as_bool().unwrap()), + "multiple" => a.multiple(v.as_bool().unwrap()), + "args" => yaml_vec_or_str!(v, a, arg), + "arg" => { + if let Some(ys) = v.as_str() { + a = a.arg(ys); + } + a + } + "requires" => yaml_vec_or_str!(v, a, requires), + "conflicts_with" => yaml_vec_or_str!(v, a, conflicts_with), + "name" => { + if let Some(ys) = v.as_str() { + a.name = ys; + } + a + } + s => { + panic!("Unknown ArgGroup setting '{}' in YAML file for \ + ArgGroup '{}'", + s, + a.name) + } + } + } + + a + } +} + +#[cfg(test)] +mod test { + use super::ArgGroup; + #[cfg(feature = "yaml")] + use yaml_rust::YamlLoader; + + #[test] + fn groups() { + let g = ArgGroup::with_name("test") + .arg("a1") + .arg("a4") + .args(&["a2", "a3"]) + .required(true) + .conflicts_with("c1") + .conflicts_with_all(&["c2", "c3"]) + .conflicts_with("c4") + .requires("r1") + .requires_all(&["r2", "r3"]) + .requires("r4"); + + let args = vec!["a1", "a4", "a2", "a3"]; + let reqs = vec!["r1", "r2", "r3", "r4"]; + let confs = vec!["c1", "c2", "c3", "c4"]; + + assert_eq!(g.args, args); + assert_eq!(g.requires, Some(reqs)); + assert_eq!(g.conflicts, Some(confs)); + } + + #[test] + fn test_debug() { + let g = ArgGroup::with_name("test") + .arg("a1") + .arg("a4") + .args(&["a2", "a3"]) + .required(true) + .conflicts_with("c1") + .conflicts_with_all(&["c2", "c3"]) + .conflicts_with("c4") + .requires("r1") + .requires_all(&["r2", "r3"]) + .requires("r4"); + + let args = vec!["a1", "a4", "a2", "a3"]; + let reqs = vec!["r1", "r2", "r3", "r4"]; + let confs = vec!["c1", "c2", "c3", "c4"]; + + let debug_str = format!("{{\n\ + \tname: \"test\",\n\ + \targs: {:?},\n\ + \trequired: {:?},\n\ + \trequires: {:?},\n\ + \tconflicts: {:?},\n\ + }}", + args, + true, + Some(reqs), + Some(confs)); + assert_eq!(&*format!("{:?}", g), &*debug_str); + } + + #[test] + fn test_from() { + let g = ArgGroup::with_name("test") + .arg("a1") + .arg("a4") + .args(&["a2", "a3"]) + .required(true) + .conflicts_with("c1") + .conflicts_with_all(&["c2", "c3"]) + .conflicts_with("c4") + .requires("r1") + .requires_all(&["r2", "r3"]) + .requires("r4"); + + let args = vec!["a1", "a4", "a2", "a3"]; + let reqs = vec!["r1", "r2", "r3", "r4"]; + let confs = vec!["c1", "c2", "c3", "c4"]; + + let g2 = ArgGroup::from(&g); + assert_eq!(g2.args, args); + assert_eq!(g2.requires, Some(reqs)); + assert_eq!(g2.conflicts, Some(confs)); + } + + #[cfg(feature="yaml")] + #[cfg_attr(feature = "yaml", test)] + fn test_yaml() { + + let g_yaml = "name: test +args: +- a1 +- a4 +- a2 +- a3 +conflicts_with: +- c1 +- c2 +- c3 +- c4 +requires: +- r1 +- r2 +- r3 +- r4"; + let yml = &YamlLoader::load_from_str(g_yaml).expect("failed to load YAML file")[0]; + let g = ArgGroup::from_yaml(yml); + let args = vec!["a1", "a4", "a2", "a3"]; + let reqs = vec!["r1", "r2", "r3", "r4"]; + let confs = vec!["c1", "c2", "c3", "c4"]; + assert_eq!(g.args, args); + assert_eq!(g.requires, Some(reqs)); + assert_eq!(g.conflicts, Some(confs)); + } +} + +impl<'a> Clone for ArgGroup<'a> { + fn clone(&self) -> Self { + ArgGroup { + name: self.name, + required: self.required, + args: self.args.clone(), + requires: self.requires.clone(), + conflicts: self.conflicts.clone(), + multiple: self.multiple, + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/macros.rs b/vendor/registry-40351f815f426200/clap/src/args/macros.rs new file mode 100644 index 000000000..1de12f4ec --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/macros.rs @@ -0,0 +1,109 @@ +#[cfg(feature = "yaml")] +macro_rules! yaml_tuple2 { + ($a:ident, $v:ident, $c:ident) => {{ + if let Some(vec) = $v.as_vec() { + for ys in vec { + if let Some(tup) = ys.as_vec() { + debug_assert_eq!(2, tup.len()); + $a = $a.$c(yaml_str!(tup[0]), yaml_str!(tup[1])); + } else { + panic!("Failed to convert YAML value to vec"); + } + } + } else { + panic!("Failed to convert YAML value to vec"); + } + $a + } + }; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_tuple3 { + ($a:ident, $v:ident, $c:ident) => {{ + if let Some(vec) = $v.as_vec() { + for ys in vec { + if let Some(tup) = ys.as_vec() { + debug_assert_eq!(3, tup.len()); + $a = $a.$c(yaml_str!(tup[0]), yaml_opt_str!(tup[1]), yaml_str!(tup[2])); + } else { + panic!("Failed to convert YAML value to vec"); + } + } + } else { + panic!("Failed to convert YAML value to vec"); + } + $a + } + }; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_vec_or_str { + ($v:ident, $a:ident, $c:ident) => {{ + let maybe_vec = $v.as_vec(); + if let Some(vec) = maybe_vec { + for ys in vec { + if let Some(s) = ys.as_str() { + $a = $a.$c(s); + } else { + panic!("Failed to convert YAML value {:?} to a string", ys); + } + } + } else { + if let Some(s) = $v.as_str() { + $a = $a.$c(s); + } else { + panic!("Failed to convert YAML value {:?} to either a vec or string", $v); + } + } + $a + } + }; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_opt_str { + ($v:expr) => {{ + if $v.is_null() { + Some($v.as_str().unwrap_or_else(|| panic!("failed to convert YAML {:?} value to a string", $v))) + } else { + None + } + }}; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_str { + ($v:expr) => {{ + $v.as_str().unwrap_or_else(|| panic!("failed to convert YAML {:?} value to a string", $v)) + }}; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_to_str { + ($a:ident, $v:ident, $c:ident) => {{ + $a.$c(yaml_str!($v)) + }}; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_to_bool { + ($a:ident, $v:ident, $c:ident) => {{ + $a.$c($v.as_bool().unwrap_or_else(|| panic!("failed to convert YAML {:?} value to a string", $v))) + }}; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_to_u64 { + ($a:ident, $v:ident, $c:ident) => {{ + $a.$c($v.as_i64().unwrap_or_else(|| panic!("failed to convert YAML {:?} value to a string", $v)) as u64) + }}; +} + +#[cfg(feature = "yaml")] +macro_rules! yaml_to_usize { + ($a:ident, $v:ident, $c:ident) => {{ + $a.$c($v.as_i64().unwrap_or_else(|| panic!("failed to convert YAML {:?} value to a string", $v)) as usize) + }}; +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/matched_arg.rs b/vendor/registry-40351f815f426200/clap/src/args/matched_arg.rs new file mode 100644 index 000000000..9a73af9d5 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/matched_arg.rs @@ -0,0 +1,24 @@ +// Std +use std::ffi::OsString; + +#[doc(hidden)] +#[derive(Debug, Clone)] +pub struct MatchedArg { + #[doc(hidden)] + pub occurs: u64, + #[doc(hidden)] + pub vals: Vec, +} + +impl Default for MatchedArg { + fn default() -> Self { + MatchedArg { + occurs: 1, + vals: Vec::with_capacity(1), + } + } +} + +impl MatchedArg { + pub fn new() -> Self { MatchedArg::default() } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/mod.rs b/vendor/registry-40351f815f426200/clap/src/args/mod.rs new file mode 100644 index 000000000..5c87e1be9 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/mod.rs @@ -0,0 +1,21 @@ +pub use self::any_arg::{AnyArg, DispOrder}; +pub use self::arg::Arg; +pub use self::arg_builder::{Base, Switched, Valued, FlagBuilder, OptBuilder, PosBuilder}; +pub use self::arg_matcher::ArgMatcher; +pub use self::arg_matches::{Values, OsValues, ArgMatches}; +pub use self::group::ArgGroup; +pub use self::matched_arg::MatchedArg; +pub use self::settings::{ArgFlags, ArgSettings}; +pub use self::subcommand::SubCommand; + +#[macro_use] +mod macros; +mod arg; +pub mod any_arg; +mod arg_matches; +mod arg_matcher; +mod subcommand; +mod arg_builder; +mod matched_arg; +mod group; +pub mod settings; diff --git a/vendor/registry-40351f815f426200/clap/src/args/settings.rs b/vendor/registry-40351f815f426200/clap/src/args/settings.rs new file mode 100644 index 000000000..c453e4a2e --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/settings.rs @@ -0,0 +1,165 @@ +// Std +use std::ascii::AsciiExt; +use std::str::FromStr; + +bitflags! { + struct Flags: u16 { + const REQUIRED = 1; + const MULTIPLE = 1 << 1; + const EMPTY_VALS = 1 << 2; + const GLOBAL = 1 << 3; + const HIDDEN = 1 << 4; + const TAKES_VAL = 1 << 5; + const USE_DELIM = 1 << 6; + const NEXT_LINE_HELP = 1 << 7; + const R_UNLESS_ALL = 1 << 8; + const REQ_DELIM = 1 << 9; + const DELIM_NOT_SET = 1 << 10; + const HIDE_POS_VALS = 1 << 11; + const ALLOW_TAC_VALS = 1 << 12; + const REQUIRE_EQUALS = 1 << 13; + const LAST = 1 << 14; + const HIDE_DEFAULT_VAL = 1 << 15; + } +} + +#[doc(hidden)] +#[derive(Debug, Clone, Copy)] +pub struct ArgFlags(Flags); + +impl ArgFlags { + pub fn new() -> Self { ArgFlags::default() } + + impl_settings!{ArgSettings, + Required => REQUIRED, + Multiple => MULTIPLE, + EmptyValues => EMPTY_VALS, + Global => GLOBAL, + Hidden => HIDDEN, + TakesValue => TAKES_VAL, + UseValueDelimiter => USE_DELIM, + NextLineHelp => NEXT_LINE_HELP, + RequiredUnlessAll => R_UNLESS_ALL, + RequireDelimiter => REQ_DELIM, + ValueDelimiterNotSet => DELIM_NOT_SET, + HidePossibleValues => HIDE_POS_VALS, + AllowLeadingHyphen => ALLOW_TAC_VALS, + RequireEquals => REQUIRE_EQUALS, + Last => LAST, + HideDefaultValue => HIDE_DEFAULT_VAL + } +} + +impl Default for ArgFlags { + fn default() -> Self { ArgFlags(EMPTY_VALS | DELIM_NOT_SET) } +} + +/// Various settings that apply to arguments and may be set, unset, and checked via getter/setter +/// methods [`Arg::set`], [`Arg::unset`], and [`Arg::is_set`] +/// [`Arg::set`]: ./struct.Arg.html#method.set +/// [`Arg::unset`]: ./struct.Arg.html#method.unset +/// [`Arg::is_set`]: ./struct.Arg.html#method.is_set +#[derive(Debug, PartialEq, Copy, Clone)] +pub enum ArgSettings { + /// The argument must be used + Required, + /// The argument may be used multiple times such as `--flag --flag` + Multiple, + /// The argument allows empty values such as `--option ""` + EmptyValues, + /// The argument should be propagated down through all child [`SubCommands`] + /// [`SubCommand`]: ./struct.SubCommand.html + Global, + /// The argument should **not** be shown in help text + Hidden, + /// The argument accepts a value, such as `--option ` + TakesValue, + /// Determines if the argument allows values to be grouped via a delimter + UseValueDelimiter, + /// Prints the help text on the line after the argument + NextLineHelp, + /// Requires the use of a value delimiter for all multiple values + RequireDelimiter, + /// Hides the possible values from the help string + HidePossibleValues, + /// Allows vals that start with a '-' + AllowLeadingHyphen, + /// Require options use `--option=val` syntax + RequireEquals, + /// Specifies that the arg is the last positional argument and may be accessed early via `--` + /// syntax + Last, + /// Hides the default value from the help string + HideDefaultValue, + #[doc(hidden)] + RequiredUnlessAll, + #[doc(hidden)] + ValueDelimiterNotSet, +} + +impl FromStr for ArgSettings { + type Err = String; + fn from_str(s: &str) -> Result::Err> { + match &*s.to_ascii_lowercase() { + "required" => Ok(ArgSettings::Required), + "multiple" => Ok(ArgSettings::Multiple), + "global" => Ok(ArgSettings::Global), + "emptyvalues" => Ok(ArgSettings::EmptyValues), + "hidden" => Ok(ArgSettings::Hidden), + "takesvalue" => Ok(ArgSettings::TakesValue), + "usevaluedelimiter" => Ok(ArgSettings::UseValueDelimiter), + "nextlinehelp" => Ok(ArgSettings::NextLineHelp), + "requiredunlessall" => Ok(ArgSettings::RequiredUnlessAll), + "requiredelimiter" => Ok(ArgSettings::RequireDelimiter), + "valuedelimiternotset" => Ok(ArgSettings::ValueDelimiterNotSet), + "hidepossiblevalues" => Ok(ArgSettings::HidePossibleValues), + "allowleadinghyphen" => Ok(ArgSettings::AllowLeadingHyphen), + "requireequals" => Ok(ArgSettings::RequireEquals), + "last" => Ok(ArgSettings::Last), + "hidedefaultvalue" => Ok(ArgSettings::HideDefaultValue), + _ => Err("unknown ArgSetting, cannot convert from str".to_owned()), + } + } +} + +#[cfg(test)] +mod test { + use super::ArgSettings; + + #[test] + fn arg_settings_fromstr() { + assert_eq!("allowleadinghyphen".parse::().unwrap(), + ArgSettings::AllowLeadingHyphen); + assert_eq!("emptyvalues".parse::().unwrap(), + ArgSettings::EmptyValues); + assert_eq!("global".parse::().unwrap(), + ArgSettings::Global); + assert_eq!("hidepossiblevalues".parse::().unwrap(), + ArgSettings::HidePossibleValues); + assert_eq!("hidden".parse::().unwrap(), + ArgSettings::Hidden); + assert_eq!("multiple".parse::().unwrap(), + ArgSettings::Multiple); + assert_eq!("nextlinehelp".parse::().unwrap(), + ArgSettings::NextLineHelp); + assert_eq!("requiredunlessall".parse::().unwrap(), + ArgSettings::RequiredUnlessAll); + assert_eq!("requiredelimiter".parse::().unwrap(), + ArgSettings::RequireDelimiter); + assert_eq!("required".parse::().unwrap(), + ArgSettings::Required); + assert_eq!("takesvalue".parse::().unwrap(), + ArgSettings::TakesValue); + assert_eq!("usevaluedelimiter".parse::().unwrap(), + ArgSettings::UseValueDelimiter); + assert_eq!("valuedelimiternotset".parse::().unwrap(), + ArgSettings::ValueDelimiterNotSet); + assert_eq!("requireequals".parse::().unwrap(), + ArgSettings::RequireEquals); + assert_eq!("last".parse::().unwrap(), + ArgSettings::Last); + assert_eq!("hidedefaultvalue".parse::().unwrap(), + ArgSettings::HideDefaultValue); + assert!("hahahaha".parse::().is_err()); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/args/subcommand.rs b/vendor/registry-40351f815f426200/clap/src/args/subcommand.rs new file mode 100644 index 000000000..5154c4114 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/args/subcommand.rs @@ -0,0 +1,68 @@ +// Third Party +#[cfg(feature = "yaml")] +use yaml_rust::Yaml; + +// Internal +use App; +use ArgMatches; + +/// The abstract representation of a command line subcommand. +/// +/// This struct describes all the valid options of the subcommand for the program. Subcommands are +/// essentially "sub-[`App`]s" and contain all the same possibilities (such as their own +/// [arguments], subcommands, and settings). +/// +/// # Examples +/// +/// ```rust +/// # use clap::{App, Arg, SubCommand}; +/// App::new("myprog") +/// .subcommand( +/// SubCommand::with_name("config") +/// .about("Used for configuration") +/// .arg(Arg::with_name("config_file") +/// .help("The configuration file to use") +/// .index(1))) +/// # ; +/// ``` +/// [`App`]: ./struct.App.html +/// [arguments]: ./struct.Arg.html +#[derive(Debug, Clone)] +pub struct SubCommand<'a> { + #[doc(hidden)] + pub name: String, + #[doc(hidden)] + pub matches: ArgMatches<'a>, +} + +impl<'a> SubCommand<'a> { + /// Creates a new instance of a subcommand requiring a name. The name will be displayed + /// to the user when they print version or help and usage information. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, SubCommand}; + /// App::new("myprog") + /// .subcommand( + /// SubCommand::with_name("config")) + /// # ; + /// ``` + pub fn with_name<'b>(name: &str) -> App<'a, 'b> { App::new(name) } + + /// Creates a new instance of a subcommand from a YAML (.yml) document + /// + /// # Examples + /// + /// ```ignore + /// # #[macro_use] + /// # extern crate clap; + /// # use clap::Subcommand; + /// # fn main() { + /// let sc_yaml = load_yaml!("test_subcommand.yml"); + /// let sc = SubCommand::from_yaml(sc_yaml); + /// # } + /// ``` + #[cfg(feature = "yaml")] + pub fn from_yaml(yaml: &Yaml) -> App { App::from_yaml(yaml) } +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/bash.rs b/vendor/registry-40351f815f426200/clap/src/completions/bash.rs new file mode 100644 index 000000000..a5333828a --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/bash.rs @@ -0,0 +1,230 @@ +// Std +use std::io::Write; + +// Internal +use app::parser::Parser; +use args::{ArgSettings, OptBuilder}; +use completions; + +pub struct BashGen<'a, 'b> + where 'a: 'b +{ + p: &'b Parser<'a, 'b>, +} + +impl<'a, 'b> BashGen<'a, 'b> { + pub fn new(p: &'b Parser<'a, 'b>) -> Self { BashGen { p: p } } + + pub fn generate_to(&self, buf: &mut W) { + + w!(buf, + format!("_{name}() {{ + local i cur prev opts cmds + COMPREPLY=() + cur=\"${{COMP_WORDS[COMP_CWORD]}}\" + prev=\"${{COMP_WORDS[COMP_CWORD-1]}}\" + cmd=\"\" + opts=\"\" + + for i in ${{COMP_WORDS[@]}} + do + case \"${{i}}\" in + {name}) + cmd=\"{name}\" + ;; + {subcmds} + *) + ;; + esac + done + + case \"${{cmd}}\" in + {name}) + opts=\"{name_opts}\" + if [[ ${{cur}} == -* || ${{COMP_CWORD}} -eq 1 ]] ; then + COMPREPLY=( $(compgen -W \"${{opts}}\" -- ${{cur}}) ) + return 0 + fi + case \"${{prev}}\" in + {name_opts_details} + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W \"${{opts}}\" -- ${{cur}}) ) + return 0 + ;; + {subcmd_details} + esac +}} + +complete -F _{name} -o bashdefault -o default {name} +", + name = self.p.meta.bin_name.as_ref().unwrap(), + name_opts = self.all_options_for_path(self.p.meta.bin_name.as_ref().unwrap()), + name_opts_details = + self.option_details_for_path(self.p.meta.bin_name.as_ref().unwrap()), + subcmds = self.all_subcommands(), + subcmd_details = self.subcommand_details()) + .as_bytes()); + } + + fn all_subcommands(&self) -> String { + debugln!("BashGen::all_subcommands;"); + let mut subcmds = String::new(); + let scs = completions::all_subcommand_names(self.p); + + for sc in &scs { + subcmds = format!("{} + {name}) + cmd+=\"__{name}\" + ;;", + subcmds, + name = sc.replace("-", "__")); + } + + subcmds + } + + fn subcommand_details(&self) -> String { + debugln!("BashGen::subcommand_details;"); + let mut subcmd_dets = String::new(); + let mut scs = completions::get_all_subcommand_paths(self.p, true); + scs.sort(); + scs.dedup(); + + for sc in &scs { + subcmd_dets = format!("{} + {subcmd}) + opts=\"{sc_opts}\" + if [[ ${{cur}} == -* || ${{COMP_CWORD}} -eq {level} ]] ; then + COMPREPLY=( $(compgen -W \"${{opts}}\" -- ${{cur}}) ) + return 0 + fi + case \"${{prev}}\" in + {opts_details} + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W \"${{opts}}\" -- ${{cur}}) ) + return 0 + ;;", + subcmd_dets, + subcmd = sc.replace("-", "__"), + sc_opts = self.all_options_for_path(&*sc), + level = sc.split("__").map(|_| 1).fold(0, |acc, n| acc + n), + opts_details = self.option_details_for_path(&*sc)); + } + + subcmd_dets + } + + fn option_details_for_path(&self, path: &str) -> String { + debugln!("BashGen::option_details_for_path: path={}", path); + let mut p = self.p; + for sc in path.split("__").skip(1) { + debugln!("BashGen::option_details_for_path:iter: sc={}", sc); + p = &find_subcmd!(p, sc).unwrap().p; + } + let mut opts = String::new(); + for o in p.opts() { + if let Some(l) = o.s.long { + opts = format!("{} + --{}) + COMPREPLY=({}) + return 0 + ;;", + opts, + l, + self.vals_for(o)); + } + if let Some(s) = o.s.short { + opts = format!("{} + -{}) + COMPREPLY=({}) + return 0 + ;;", + opts, + s, + self.vals_for(o)); + } + } + opts + } + + fn vals_for(&self, o: &OptBuilder) -> String { + debugln!("BashGen::vals_for: o={}", o.b.name); + use args::AnyArg; + let mut ret = String::new(); + let mut needs_quotes = true; + if let Some(vals) = o.possible_vals() { + needs_quotes = false; + ret = format!("$(compgen -W \"{}\" -- ${{cur}})", vals.join(" ")); + } else if let Some(vec) = o.val_names() { + let mut it = vec.iter().peekable(); + while let Some((_, val)) = it.next() { + ret = format!("{}<{}>{}", + ret, + val, + if it.peek().is_some() { " " } else { "" }); + } + let num = vec.len(); + if o.is_set(ArgSettings::Multiple) && num == 1 { + ret = format!("{}...", ret); + } + } else if let Some(num) = o.num_vals() { + let mut it = (0..num).peekable(); + while let Some(_) = it.next() { + ret = format!("{}<{}>{}", + ret, + o.name(), + if it.peek().is_some() { " " } else { "" }); + } + if o.is_set(ArgSettings::Multiple) && num == 1 { + ret = format!("{}...", ret); + } + } else { + ret = format!("<{}>", o.name()); + if o.is_set(ArgSettings::Multiple) { + ret = format!("{}...", ret); + } + } + if needs_quotes { + ret = format!("\"{}\"", ret); + } + ret + } + fn all_options_for_path(&self, path: &str) -> String { + debugln!("BashGen::all_options_for_path: path={}", path); + let mut p = self.p; + for sc in path.split("__").skip(1) { + debugln!("BashGen::all_options_for_path:iter: sc={}", sc); + p = &find_subcmd!(p, sc).unwrap().p; + } + let mut opts = shorts!(p).fold(String::new(), |acc, s| format!("{} -{}", acc, s)); + opts = format!("{} {}", + opts, + longs!(p).fold(String::new(), |acc, l| format!("{} --{}", acc, l))); + opts = format!("{} {}", + opts, + p.positionals + .values() + .fold(String::new(), |acc, p| format!("{} {}", acc, p))); + opts = format!("{} {}", + opts, + p.subcommands + .iter() + .fold(String::new(), |acc, s| format!("{} {}", acc, s.p.meta.name))); + for sc in &p.subcommands { + if let Some(ref aliases) = sc.p.meta.aliases { + opts = format!("{} {}", + opts, + aliases.iter() + .map(|&(n, _)| n) + .fold(String::new(), |acc, a| format!("{} {}", acc, a))); + } + } + opts + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/fish.rs b/vendor/registry-40351f815f426200/clap/src/completions/fish.rs new file mode 100644 index 000000000..96e8cc246 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/fish.rs @@ -0,0 +1,121 @@ + +// Std +use std::io::Write; + +// Internal +use app::parser::Parser; + +pub struct FishGen<'a, 'b> + where 'a: 'b +{ + p: &'b Parser<'a, 'b>, +} + +impl<'a, 'b> FishGen<'a, 'b> { + pub fn new(p: &'b Parser<'a, 'b>) -> Self { FishGen { p: p } } + + pub fn generate_to(&self, buf: &mut W) { + let command = self.p.meta.bin_name.as_ref().unwrap(); + + // function to detect subcommand + let detect_subcommand_function = r#"function __fish_using_command + set cmd (commandline -opc) + if [ (count $cmd) -eq (count $argv) ] + for i in (seq (count $argv)) + if [ $cmd[$i] != $argv[$i] ] + return 1 + end + end + return 0 + end + return 1 +end + +"# + .to_string(); + + let mut buffer = detect_subcommand_function; + gen_fish_inner(command, self, &command.to_string(), &mut buffer); + w!(buf, buffer.as_bytes()); + } +} + +// Escape string inside single quotes +fn escape_string(string: &str) -> String { + string.replace("\\", "\\\\").replace("'", "\\'") +} + +fn gen_fish_inner(root_command: &str, comp_gen: &FishGen, parent_cmds: &str, buffer: &mut String) { + debugln!("FishGen::gen_fish_inner;"); + // example : + // + // complete + // -c {command} + // -d "{description}" + // -s {short} + // -l {long} + // -a "{possible_arguments}" + // -r # if require parameter + // -f # don't use file completion + // -n "__fish_using_command myprog subcmd1" # complete for command "myprog subcmd1" + + let basic_template = format!("complete -c {} -n \"__fish_using_command {}\"", + root_command, + parent_cmds); + + for option in comp_gen.p.opts() { + let mut template = basic_template.clone(); + if let Some(data) = option.s.short { + template.push_str(format!(" -s {}", data).as_str()); + } + if let Some(data) = option.s.long { + template.push_str(format!(" -l {}", data).as_str()); + } + if let Some(data) = option.b.help { + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()); + } + if let Some(ref data) = option.v.possible_vals { + template.push_str(format!(" -r -f -a \"{}\"", data.join(" ")).as_str()); + } + buffer.push_str(template.as_str()); + buffer.push_str("\n"); + } + + for flag in comp_gen.p.flags() { + let mut template = basic_template.clone(); + if let Some(data) = flag.s.short { + template.push_str(format!(" -s {}", data).as_str()); + } + if let Some(data) = flag.s.long { + template.push_str(format!(" -l {}", data).as_str()); + } + if let Some(data) = flag.b.help { + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()); + } + buffer.push_str(template.as_str()); + buffer.push_str("\n"); + } + + for subcommand in &comp_gen.p.subcommands { + let mut template = basic_template.clone(); + template.push_str(" -f"); + template.push_str(format!(" -a \"{}\"", &subcommand.p.meta.name).as_str()); + if let Some(data) = subcommand.p.meta.about { + template.push_str(format!(" -d '{}'", escape_string(data)).as_str()) + } + buffer.push_str(template.as_str()); + buffer.push_str("\n"); + } + + // generate options of subcommands + for subcommand in &comp_gen.p.subcommands { + let sub_comp_gen = FishGen::new(&subcommand.p); + // make new "parent_cmds" for different subcommands + let mut sub_parent_cmds = parent_cmds.to_string(); + if !sub_parent_cmds.is_empty() { + sub_parent_cmds.push_str(" "); + } + sub_parent_cmds.push_str(&subcommand.p.meta.name); + gen_fish_inner(root_command, &sub_comp_gen, &sub_parent_cmds, buffer); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/macros.rs b/vendor/registry-40351f815f426200/clap/src/completions/macros.rs new file mode 100644 index 000000000..a4ffce4bd --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/macros.rs @@ -0,0 +1,29 @@ + +macro_rules! w { + ($buf:expr, $to_w:expr) => { + match $buf.write_all($to_w) { + Ok(..) => (), + Err(..) => panic!("Failed to write to completions file"), + } + }; +} + +macro_rules! get_zsh_arg_conflicts { + ($p:ident, $arg:ident, $msg:ident) => { + if let Some(conf_vec) = $arg.blacklist() { + let mut v = vec![]; + for arg_name in conf_vec { + let arg = $p.find_any_arg(arg_name).expect($msg); + if let Some(s) = arg.short() { + v.push(format!("-{}", s)); + } + if let Some(l) = arg.long() { + v.push(format!("--{}", l)); + } + } + v.join(" ") + } else { + String::new() + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/mod.rs b/vendor/registry-40351f815f426200/clap/src/completions/mod.rs new file mode 100644 index 000000000..6d067882b --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/mod.rs @@ -0,0 +1,153 @@ +#[macro_use] +mod macros; +mod bash; +mod fish; +mod zsh; +mod powershell; +mod shell; + +// Std +use std::io::Write; + +// Internal +use app::parser::Parser; +use self::bash::BashGen; +use self::fish::FishGen; +use self::zsh::ZshGen; +use self::powershell::PowerShellGen; +pub use self::shell::Shell; + +pub struct ComplGen<'a, 'b> + where 'a: 'b +{ + p: &'b Parser<'a, 'b>, +} + +impl<'a, 'b> ComplGen<'a, 'b> { + pub fn new(p: &'b Parser<'a, 'b>) -> Self { ComplGen { p: p } } + + pub fn generate(&self, for_shell: Shell, buf: &mut W) { + match for_shell { + Shell::Bash => BashGen::new(self.p).generate_to(buf), + Shell::Fish => FishGen::new(self.p).generate_to(buf), + Shell::Zsh => ZshGen::new(self.p).generate_to(buf), + Shell::PowerShell => PowerShellGen::new(self.p).generate_to(buf), + } + } +} + +// Gets all subcommands including child subcommands in the form of 'name' where the name +// is a single word (i.e. "install") of the path to said subcommand (i.e. +// "rustup toolchain install") +// +// Also note, aliases are treated as their own subcommands but duplicates of whatever they're +// aliasing. +pub fn all_subcommand_names(p: &Parser) -> Vec { + debugln!("all_subcommand_names;"); + let mut subcmds: Vec<_> = subcommands_of(p).iter().map(|&(ref n, _)| n.clone()).collect(); + for sc_v in p.subcommands.iter().map(|s| all_subcommand_names(&s.p)) { + subcmds.extend(sc_v); + } + subcmds.sort(); + subcmds.dedup(); + subcmds +} + +// Gets all subcommands including child subcommands in the form of ('name', 'bin_name') where the name +// is a single word (i.e. "install") of the path and full bin_name of said subcommand (i.e. +// "rustup toolchain install") +// +// Also note, aliases are treated as their own subcommands but duplicates of whatever they're +// aliasing. +pub fn all_subcommands(p: &Parser) -> Vec<(String, String)> { + debugln!("all_subcommands;"); + let mut subcmds: Vec<_> = subcommands_of(p); + for sc_v in p.subcommands.iter().map(|s| all_subcommands(&s.p)) { + subcmds.extend(sc_v); + } + subcmds +} + +// Gets all subcommands exlcuding child subcommands in the form of (name, bin_name) where the name +// is a single word (i.e. "install") and the bin_name is a space deliniated list of the path to said +// subcommand (i.e. "rustup toolchain install") +// +// Also note, aliases are treated as their own subcommands but duplicates of whatever they're +// aliasing. +pub fn subcommands_of(p: &Parser) -> Vec<(String, String)> { + debugln!("subcommands_of: name={}, bin_name={}", + p.meta.name, + p.meta.bin_name.as_ref().unwrap()); + let mut subcmds = vec![]; + + debugln!("subcommands_of: Has subcommands...{:?}", p.has_subcommands()); + if !p.has_subcommands() { + let mut ret = vec![(p.meta.name.clone(), p.meta.bin_name.as_ref().unwrap().clone())]; + debugln!("subcommands_of: Looking for aliases..."); + if let Some(ref aliases) = p.meta.aliases { + for &(n, _) in aliases { + debugln!("subcommands_of:iter:iter: Found alias...{}", n); + let mut als_bin_name: Vec<_> = + p.meta.bin_name.as_ref().unwrap().split(' ').collect(); + als_bin_name.push(n); + let old = als_bin_name.len() - 2; + als_bin_name.swap_remove(old); + ret.push((n.to_owned(), als_bin_name.join(" "))); + } + } + return ret; + } + for sc in &p.subcommands { + debugln!("subcommands_of:iter: name={}, bin_name={}", + sc.p.meta.name, + sc.p.meta.bin_name.as_ref().unwrap()); + + debugln!("subcommands_of:iter: Looking for aliases..."); + if let Some(ref aliases) = sc.p.meta.aliases { + for &(n, _) in aliases { + debugln!("subcommands_of:iter:iter: Found alias...{}", n); + let mut als_bin_name: Vec<_> = + p.meta.bin_name.as_ref().unwrap().split(' ').collect(); + als_bin_name.push(n); + let old = als_bin_name.len() - 2; + als_bin_name.swap_remove(old); + subcmds.push((n.to_owned(), als_bin_name.join(" "))); + } + } + subcmds.push((sc.p.meta.name.clone(), sc.p.meta.bin_name.as_ref().unwrap().clone())); + } + subcmds +} + +pub fn get_all_subcommand_paths(p: &Parser, first: bool) -> Vec { + debugln!("get_all_subcommand_paths;"); + let mut subcmds = vec![]; + if !p.has_subcommands() { + if !first { + let name = &*p.meta.name; + let path = p.meta.bin_name.as_ref().unwrap().clone().replace(" ", "__"); + let mut ret = vec![path.clone()]; + if let Some(ref aliases) = p.meta.aliases { + for &(n, _) in aliases { + ret.push(path.replace(name, n)); + } + } + return ret; + } + return vec![]; + } + for sc in &p.subcommands { + let name = &*sc.p.meta.name; + let path = sc.p.meta.bin_name.as_ref().unwrap().clone().replace(" ", "__"); + subcmds.push(path.clone()); + if let Some(ref aliases) = sc.p.meta.aliases { + for &(n, _) in aliases { + subcmds.push(path.replace(name, n)); + } + } + } + for sc_v in p.subcommands.iter().map(|s| get_all_subcommand_paths(&s.p, false)) { + subcmds.extend(sc_v); + } + subcmds +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/powershell.rs b/vendor/registry-40351f815f426200/clap/src/completions/powershell.rs new file mode 100644 index 000000000..423dd450b --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/powershell.rs @@ -0,0 +1,125 @@ + +// Std +use std::io::Write; + +// Internal +use app::parser::Parser; +use INTERNAL_ERROR_MSG; + +pub struct PowerShellGen<'a, 'b> + where 'a: 'b +{ + p: &'b Parser<'a, 'b>, +} + +impl<'a, 'b> PowerShellGen<'a, 'b> { + pub fn new(p: &'b Parser<'a, 'b>) -> Self { PowerShellGen { p: p } } + + pub fn generate_to(&self, buf: &mut W) { + let bin_name = self.p.meta.bin_name.as_ref().unwrap(); + + let mut names = vec![]; + let (subcommands_detection_cases, subcommands_cases) = generate_inner(self.p, "", &mut names); + + let mut bin_names = vec![bin_name.to_string(), format!("./{0}", bin_name)]; + if cfg!(windows) { + bin_names.push(format!("{0}.exe", bin_name)); + bin_names.push(format!(r".\{0}", bin_name)); + bin_names.push(format!(r".\{0}.exe", bin_name)); + bin_names.push(format!(r"./{0}.exe", bin_name)); + } + + let bin_names = bin_names.iter().fold(String::new(), |previous, current| { + format!("{0}, '{1}'", previous, current) + }); + let bin_names = bin_names.trim_left_matches(", "); + + let result = format!(r#" +@({bin_names}) | %{{ + Register-ArgumentCompleter -Native -CommandName $_ -ScriptBlock {{ + param($wordToComplete, $commandAst, $cursorPosition) + + $command = '_{bin_name}' + $commandAst.CommandElements | + Select-Object -Skip 1 | + %{{ + switch ($_.ToString()) {{ +{subcommands_detection_cases} + default {{ + break + }} + }} + }} + + $completions = @() + + switch ($command) {{ +{subcommands_cases} + }} + + $completions | + ?{{ $_ -like "$wordToComplete*" }} | + Sort-Object | + %{{ New-Object System.Management.Automation.CompletionResult $_, $_, 'ParameterValue', $_ }} + }} +}} +"#, + bin_names = bin_names, + bin_name = bin_name, + subcommands_detection_cases = subcommands_detection_cases, + subcommands_cases = subcommands_cases + ); + + w!(buf, result.as_bytes()); + } +} + +fn generate_inner<'a, 'b, 'p>(p: &'p Parser<'a, 'b>, previous_command_name: &str, names: &mut Vec<&'p str>) -> (String, String) { + debugln!("PowerShellGen::generate_inner;"); + let command_name = if previous_command_name.is_empty() { + format!("{}_{}", previous_command_name, &p.meta.bin_name.as_ref().expect(INTERNAL_ERROR_MSG)) + } else { + format!("{}_{}", previous_command_name, &p.meta.name) + }; + + let mut subcommands_detection_cases = if !names.contains(&&*p.meta.name) { + names.push(&*p.meta.name); + format!(r" + '{0}' {{ + $command += '_{0}' + break + }} +", + &p.meta.name) + } else { + String::new() + }; + + let mut completions = String::new(); + for subcommand in &p.subcommands { + completions.push_str(&format!("'{}', ", &subcommand.p.meta.name)); + } + for short in shorts!(p) { + completions.push_str(&format!("'-{}', ", short)); + } + for long in longs!(p) { + completions.push_str(&format!("'--{}', ", long)); + } + + let mut subcommands_cases = format!(r" + '{}' {{ + $completions = @({}) + }} +", + &command_name, + completions.trim_right_matches(", ")); + + for subcommand in &p.subcommands { + let (subcommand_subcommands_detection_cases, subcommand_subcommands_cases) = + generate_inner(&subcommand.p, &command_name, names); + subcommands_detection_cases.push_str(&subcommand_subcommands_detection_cases); + subcommands_cases.push_str(&subcommand_subcommands_cases); + } + + (subcommands_detection_cases, subcommands_cases) +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/shell.rs b/vendor/registry-40351f815f426200/clap/src/completions/shell.rs new file mode 100644 index 000000000..60513ede1 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/shell.rs @@ -0,0 +1,48 @@ +use std::ascii::AsciiExt; +use std::str::FromStr; +use std::fmt; + +/// Describes which shell to produce a completions file for +#[cfg_attr(feature = "lints", allow(enum_variant_names))] +#[derive(Debug, Copy, Clone)] +pub enum Shell { + /// Generates a .bash-completion completion file for the Bourne Again SHell (BASH) + Bash, + /// Generates a .fish completion file for the Friendly Interactive SHell (fish) + Fish, + /// Generates a completion file for the Z SHell (ZSH) + Zsh, + /// Generates a completion file for PowerShell + PowerShell, +} + +impl Shell { + /// A list of possible variants in `&'static str` form + pub fn variants() -> [&'static str; 4] { ["zsh", "bash", "fish", "powershell"] } +} + +impl FromStr for Shell { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + + "ZSH" | _ if s.eq_ignore_ascii_case("zsh") => Ok(Shell::Zsh), + "FISH" | _ if s.eq_ignore_ascii_case("fish") => Ok(Shell::Fish), + "BASH" | _ if s.eq_ignore_ascii_case("bash") => Ok(Shell::Bash), + "POWERSHELL" | _ if s.eq_ignore_ascii_case("powershell") => Ok(Shell::PowerShell), + _ => Err(String::from("[valid values: bash, fish, zsh, powershell]")), + } + } +} + +impl fmt::Display for Shell { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + Shell::Bash => write!(f, "BASH"), + Shell::Fish => write!(f, "FISH"), + Shell::Zsh => write!(f, "ZSH"), + Shell::PowerShell => write!(f, "POWERSHELL"), + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/completions/zsh.rs b/vendor/registry-40351f815f426200/clap/src/completions/zsh.rs new file mode 100644 index 000000000..298b5cadd --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/completions/zsh.rs @@ -0,0 +1,395 @@ + +// Std +use std::io::Write; +use std::ascii::AsciiExt; + +// Internal +use app::App; +use app::parser::Parser; +use args::{ArgSettings, AnyArg}; +use completions; +use INTERNAL_ERROR_MSG; + +pub struct ZshGen<'a, 'b> + where 'a: 'b +{ + p: &'b Parser<'a, 'b>, +} + +impl<'a, 'b> ZshGen<'a, 'b> { + pub fn new(p: &'b Parser<'a, 'b>) -> Self { + debugln!("ZshGen::new;"); + ZshGen { p: p } + } + + pub fn generate_to(&self, buf: &mut W) { + debugln!("ZshGen::generate_to;"); + w!(buf, + format!("\ +#compdef {name} + +_{name}() {{ + typeset -A opt_args + local ret=1 + + local context curcontext=\"$curcontext\" state line + {initial_args} + {subcommands} +}} + +{subcommand_details} + +_{name} \"$@\"", + name = self.p.meta.bin_name.as_ref().unwrap(), + initial_args = get_args_of(self.p), + subcommands = get_subcommands_of(self.p), + subcommand_details = subcommand_details(self.p)).as_bytes()); + + } +} + +// Displays the positional args and commands of a subcommand +// (( $+functions[_[bin_name_underscore]_commands] )) || +// _[bin_name_underscore]_commands() { +// local commands; commands=( +// '[arg_name]:[arg_help]' +// ) +// _describe -t commands '[bin_name] commands' commands "$@" +// +// Where the following variables are present: +// [bin_name_underscore]: The full space deliniated bin_name, where spaces have been replaced by +// underscore characters +// [arg_name]: The name of the positional arg or subcommand +// [arg_help]: The help message of the arg or subcommand +// [bin_name]: The full space deliniated bin_name +// +// Here's a snippet from rustup: +// +// (( $+functions[_rustup_commands] )) || +// _rustup_commands() { +// local commands; commands=( +// 'show:Show the active and installed toolchains' +// 'update:Update Rust toolchains' +// # ... snip for brevity +// 'help:Prints this message or the help of the given subcommand(s)' +// ) +// _describe -t commands 'rustup commands' commands "$@" +// +fn subcommand_details(p: &Parser) -> String { + debugln!("ZshGen::subcommand_details;"); + // First we do ourself + let mut ret = vec![format!("\ +(( $+functions[_{bin_name_underscore}_commands] )) || +_{bin_name_underscore}_commands() {{ + local commands; commands=( + {subcommands_and_args} + ) + _describe -t commands '{bin_name} commands' commands \"$@\" +}}", + bin_name_underscore = p.meta.bin_name.as_ref().unwrap().replace(" ", "__"), + bin_name = p.meta.bin_name.as_ref().unwrap(), + subcommands_and_args = subcommands_and_args_of(p))]; + + // Next we start looping through all the children, grandchildren, etc. + let mut all_subcommands = completions::all_subcommands(p); + all_subcommands.sort(); + all_subcommands.dedup(); + for &(_, ref bin_name) in &all_subcommands { + debugln!("ZshGen::subcommand_details:iter: bin_name={}", bin_name); + ret.push(format!("\ +(( $+functions[_{bin_name_underscore}_commands] )) || +_{bin_name_underscore}_commands() {{ + local commands; commands=( + {subcommands_and_args} + ) + _describe -t commands '{bin_name} commands' commands \"$@\" +}}", + bin_name_underscore = bin_name.replace(" ", "__"), + bin_name = bin_name, + subcommands_and_args = subcommands_and_args_of(parser_of(p, bin_name)))); + } + + ret.join("\n") +} + +// Generates subcommand and positional argument completions in form of +// +// '[arg_name]:[arg_help]' +// +// Where: +// [arg_name]: the argument or subcommand's name +// [arg_help]: the help message of the argument or subcommand +// +// A snippet from rustup: +// 'show:Show the active and installed toolchains' +// 'update:Update Rust toolchains' +fn subcommands_and_args_of(p: &Parser) -> String { + debugln!("ZshGen::subcommands_and_args_of;"); + let mut ret = vec![]; + fn add_sc(sc: &App, n: &str, ret: &mut Vec) { + debugln!("ZshGen::add_sc;"); + let s = format!("\"{name}:{help}\" \\", + name = n, + help = sc.p.meta.about.unwrap_or("").replace("[", "\\[").replace("]", "\\]")); + if !s.is_empty() { + ret.push(s); + } + } + + // First the subcommands + for sc in p.subcommands() { + debugln!("ZshGen::subcommands_and_args_of:iter: subcommand={}", sc.p.meta.name); + add_sc(sc, &sc.p.meta.name, &mut ret); + if let Some(ref v) = sc.p.meta.aliases { + for alias in v.iter().filter(|&&(_, vis)| vis).map(|&(n, _)| n) { + add_sc(sc, alias, &mut ret); + } + } + } + + // Then the positional args + for arg in p.positionals() { + debugln!("ZshGen::subcommands_and_args_of:iter: arg={}", arg.b.name); + let a = format!("\"{name}:{help}\" \\", + name = arg.b.name.to_ascii_uppercase(), + help = arg.b.help.unwrap_or("").replace("[", "\\[").replace("]", "\\]")); + + if !a.is_empty() { + ret.push(a); + } + } + + ret.join("\n") +} + +// Get's the subcommand section of a completion file +// This looks roughly like: +// +// case $state in +// ([bin_name]_args) +// curcontext=\"${curcontext%:*:*}:[name_hyphen]-command-$words[1]:\" +// case $line[1] in +// +// ([name]) +// _arguments -C -s -S \ +// [subcommand_args] +// && ret=0 +// +// [RECURSIVE_CALLS] +// +// ;;", +// +// [repeat] +// +// esac +// ;; +// esac", +// +// Where the following variables are present: +// [name] = The subcommand name in the form of "install" for "rustup toolchain install" +// [bin_name] = The full space deliniated bin_name such as "rustup toolchain install" +// [name_hyphen] = The full space deliniated bin_name, but replace spaces with hyphens +// [repeat] = From the same recursive calls, but for all subcommands +// [subcommand_args] = The same as zsh::get_args_of +fn get_subcommands_of(p: &Parser) -> String { + debugln!("get_subcommands_of;"); + + debugln!("get_subcommands_of: Has subcommands...{:?}", p.has_subcommands()); + if !p.has_subcommands() { + return String::new(); + } + + let sc_names = completions::subcommands_of(p); + + let mut subcmds = vec![]; + for &(ref name, ref bin_name) in &sc_names { + let mut v = vec![format!("({})", name)]; + let subcommand_args = get_args_of(parser_of(p, &*bin_name)); + if !subcommand_args.is_empty() { + v.push(subcommand_args); + } + let subcommands = get_subcommands_of(parser_of(p, &*bin_name)); + if !subcommands.is_empty() { + v.push(subcommands); + } + v.push(String::from(";;")); + subcmds.push(v.join("\n")); + } + + format!( +"case $state in + ({name}) + curcontext=\"${{curcontext%:*:*}}:{name_hyphen}-command-$words[1]:\" + case $line[1] in + {subcommands} + esac + ;; +esac", + name = p.meta.name, + name_hyphen = p.meta.bin_name.as_ref().unwrap().replace(" ", "-"), + subcommands = subcmds.join("\n")) +} + +fn parser_of<'a, 'b>(p: &'b Parser<'a, 'b>, sc: &str) -> &'b Parser<'a, 'b> { + debugln!("parser_of: sc={}", sc); + if sc == p.meta.bin_name.as_ref().unwrap_or(&String::new()) { + return p; + } + &p.find_subcommand(sc).expect(INTERNAL_ERROR_MSG).p +} + +// Writes out the args section, which ends up being the flags and opts, and a jump to +// another ZSH function if there are positional args or subcommands. +// The structer works like this: +// ([conflicting_args]) [multiple] arg [takes_value] [[help]] [: :(possible_values)] +// ^-- list '-v -h' ^--'*' ^--'+' ^-- list 'one two three' +// +// An example from the rustup command: +// +// _arguments -C -s -S \ +// '(-h --help --verbose)-v[Enable verbose output]' \ +// '(-V -v --version --verbose --help)-h[Prints help information]' \ +// # ... snip for brevity +// '1:: :_rustup_commands' \ # <-- displays positional args and subcommands +// '*:: :->rustup' \ # <-- displays subcommand args and child subcommands +// && ret=0 +// +// The args used for _arguments are as follows: +// -C: modify the $context internal variable +// -s: Allow stacking of short args (i.e. -a -b -c => -abc) +// -S: Do not complete anything after '--' and treat those as argument values +fn get_args_of(p: &Parser) -> String { + debugln!("get_args_of;"); + let mut ret = vec![String::from("_arguments -s -S -C \\")]; + let opts = write_opts_of(p); + let flags = write_flags_of(p); + let sc_or_a = if p.has_subcommands() || p.has_positionals() { + format!("\"1:: :_{name}_commands\" \\", + name = p.meta.bin_name.as_ref().unwrap().replace(" ", "__")) + } else { + String::new() + }; + let sc = if p.has_subcommands() { + format!("\"*:: :->{name}\" \\", name = p.meta.name) + } else { + String::new() + }; + + if !opts.is_empty() { + ret.push(opts); + } + if !flags.is_empty() { + ret.push(flags); + } + if !sc_or_a.is_empty() { + ret.push(sc_or_a); + } + if !sc.is_empty() { + ret.push(sc); + } + ret.push(String::from("&& ret=0")); + + ret.join("\n") +} + +// Escape string inside single quotes and brackets +fn escape_string(string: &str) -> String { + string.replace("\\", "\\\\") + .replace("'", "'\\''") + .replace("[", "\\[") + .replace("]", "\\]") +} + +fn write_opts_of(p: &Parser) -> String { + debugln!("write_opts_of;"); + let mut ret = vec![]; + for o in p.opts() { + debugln!("write_opts_of:iter: o={}", o.name()); + let help = o.help().map_or(String::new(), escape_string); + let mut conflicts = get_zsh_arg_conflicts!(p, o, INTERNAL_ERROR_MSG); + conflicts = if conflicts.is_empty() { + String::new() + } else { + format!("({})", conflicts) + }; + + let multiple = if o.is_set(ArgSettings::Multiple) { + "*" + } else { + "" + }; + let pv = if let Some(pv_vec) = o.possible_vals() { + format!(": :({})", pv_vec.join(" ")) + } else { + String::new() + }; + if let Some(short) = o.short() { + let s = format!("'{conflicts}{multiple}-{arg}+[{help}]{possible_values}' \\", + conflicts = conflicts, + multiple = multiple, + arg = short, + possible_values = pv, + help = help); + + debugln!("write_opts_of:iter: Wrote...{}", &*s); + ret.push(s); + } + if let Some(long) = o.long() { + let l = format!("'{conflicts}{multiple}--{arg}+[{help}]{possible_values}' \\", + conflicts = conflicts, + multiple = multiple, + arg = long, + possible_values = pv, + help = help); + + debugln!("write_opts_of:iter: Wrote...{}", &*l); + ret.push(l); + } + } + + ret.join("\n") +} + +fn write_flags_of(p: &Parser) -> String { + debugln!("write_flags_of;"); + let mut ret = vec![]; + for f in p.flags() { + debugln!("write_flags_of:iter: f={}", f.name()); + let help = f.help().map_or(String::new(), escape_string); + let mut conflicts = get_zsh_arg_conflicts!(p, f, INTERNAL_ERROR_MSG); + conflicts = if conflicts.is_empty() { + String::new() + } else { + format!("({})", conflicts) + }; + + let multiple = if f.is_set(ArgSettings::Multiple) { + "*" + } else { + "" + }; + if let Some(short) = f.short() { + let s = format!("'{conflicts}{multiple}-{arg}[{help}]' \\", + multiple = multiple, + conflicts = conflicts, + arg = short, + help = help); + + debugln!("write_flags_of:iter: Wrote...{}", &*s); + ret.push(s); + } + + if let Some(long) = f.long() { + let l = format!("'{conflicts}{multiple}--{arg}[{help}]' \\", + conflicts = conflicts, + multiple = multiple, + arg = long, + help = help); + + debugln!("write_flags_of:iter: Wrote...{}", &*l); + ret.push(l); + } + } + + ret.join("\n") +} diff --git a/vendor/registry-40351f815f426200/clap/src/errors.rs b/vendor/registry-40351f815f426200/clap/src/errors.rs new file mode 100644 index 000000000..bd1e7d55f --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/errors.rs @@ -0,0 +1,884 @@ +// Std +use std::convert::From; +use std::error::Error as StdError; +use std::fmt as std_fmt; +use std::fmt::Display; +use std::io::{self, Write}; +use std::process; +use std::result::Result as StdResult; + +// Internal +use args::{FlagBuilder, AnyArg}; +use fmt::{Colorizer, ColorizerOption, ColorWhen}; +use suggestions; + +/// Short hand for [`Result`] type +/// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html +pub type Result = StdResult; + +/// Command line argument parser kind of error +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ErrorKind { + /// Occurs when an [`Arg`] has a set of possible values, + /// and the user provides a value which isn't in that set. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("speed") + /// .possible_value("fast") + /// .possible_value("slow")) + /// .get_matches_from_safe(vec!["prog", "other"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::InvalidValue); + /// ``` + /// [`Arg`]: ./struct.Arg.html + InvalidValue, + + /// Occurs when a user provides a flag, option, argument or subcommand which isn't defined. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::from_usage("--flag 'some flag'")) + /// .get_matches_from_safe(vec!["prog", "--other"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::UnknownArgument); + /// ``` + UnknownArgument, + + /// Occurs when the user provides an unrecognized [`SubCommand`] which meets the threshold for + /// being similar enough to an existing subcommand. + /// If it doesn't meet the threshold, or the 'suggestions' feature is disabled, + /// the more general [`UnknownArgument`] error is returned. + /// + /// # Examples + /// + #[cfg_attr(not(feature="suggestions"), doc=" ```no_run")] + #[cfg_attr( feature="suggestions" , doc=" ```")] + /// # use clap::{App, Arg, ErrorKind, SubCommand}; + /// let result = App::new("prog") + /// .subcommand(SubCommand::with_name("config") + /// .about("Used for configuration") + /// .arg(Arg::with_name("config_file") + /// .help("The configuration file to use") + /// .index(1))) + /// .get_matches_from_safe(vec!["prog", "confi"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::InvalidSubcommand); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`UnknownArgument`]: ./enum.ErrorKind.html#variant.UnknownArgument + InvalidSubcommand, + + /// Occurs when the user provides an unrecognized [`SubCommand`] which either + /// doesn't meet the threshold for being similar enough to an existing subcommand, + /// or the 'sggestions' feature is disabled. + /// Otherwise the more detailed [`InvalidSubcommand`] error is returned. + /// + /// This error typically happens when passing additional subcommand names to the `help` + /// subcommand. Otherwise, the more general [`UnknownArgument`] error is used. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind, SubCommand}; + /// let result = App::new("prog") + /// .subcommand(SubCommand::with_name("config") + /// .about("Used for configuration") + /// .arg(Arg::with_name("config_file") + /// .help("The configuration file to use") + /// .index(1))) + /// .get_matches_from_safe(vec!["prog", "help", "nothing"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::UnrecognizedSubcommand); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`InvalidSubcommand`]: ./enum.ErrorKind.html#variant.InvalidSubcommand + /// [`UnknownArgument`]: ./enum.ErrorKind.html#variant.UnknownArgument + UnrecognizedSubcommand, + + /// Occurs when the user provides an empty value for an option that does not allow empty + /// values. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let res = App::new("prog") + /// .arg(Arg::with_name("color") + /// .long("color") + /// .empty_values(false)) + /// .get_matches_from_safe(vec!["prog", "--color="]); + /// assert!(res.is_err()); + /// assert_eq!(res.unwrap_err().kind, ErrorKind::EmptyValue); + /// ``` + EmptyValue, + + /// Occurs when the user provides a value for an argument with a custom validation and the + /// value fails that validation. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// fn is_numeric(val: String) -> Result<(), String> { + /// match val.parse::() { + /// Ok(..) => Ok(()), + /// Err(..) => Err(String::from("Value wasn't a number!")), + /// } + /// } + /// + /// let result = App::new("prog") + /// .arg(Arg::with_name("num") + /// .validator(is_numeric)) + /// .get_matches_from_safe(vec!["prog", "NotANumber"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::ValueValidation); + /// ``` + ValueValidation, + + /// Occurs when a user provides more values for an argument than were defined by setting + /// [`Arg::max_values`]. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("arg") + /// .multiple(true) + /// .max_values(2)) + /// .get_matches_from_safe(vec!["prog", "too", "many", "values"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::TooManyValues); + /// ``` + /// [`Arg::max_values`]: ./struct.Arg.html#method.max_values + TooManyValues, + + /// Occurs when the user provides fewer values for an argument than were defined by setting + /// [`Arg::min_values`]. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("some_opt") + /// .long("opt") + /// .min_values(3)) + /// .get_matches_from_safe(vec!["prog", "--opt", "too", "few"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::TooFewValues); + /// ``` + /// [`Arg::min_values`]: ./struct.Arg.html#method.min_values + TooFewValues, + + /// Occurs when the user provides a different number of values for an argument than what's + /// been defined by setting [`Arg::number_of_values`] or than was implicitly set by + /// [`Arg::value_names`]. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("some_opt") + /// .long("opt") + /// .takes_value(true) + /// .number_of_values(2)) + /// .get_matches_from_safe(vec!["prog", "--opt", "wrong"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::WrongNumberOfValues); + /// ``` + /// [`Arg::number_of_values`] + /// [`Arg::number_of_values`]: ./struct.Arg.html#method.number_of_values + /// [`Arg::value_names`]: ./struct.Arg.html#method.value_names + WrongNumberOfValues, + + /// Occurs when the user provides two values which conflict with each other and can't be used + /// together. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("debug") + /// .long("debug") + /// .conflicts_with("color")) + /// .arg(Arg::with_name("color") + /// .long("color")) + /// .get_matches_from_safe(vec!["prog", "--debug", "--color"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::ArgumentConflict); + /// ``` + ArgumentConflict, + + /// Occurs when the user does not provide one or more required arguments. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("debug") + /// .required(true)) + /// .get_matches_from_safe(vec!["prog"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::MissingRequiredArgument); + /// ``` + MissingRequiredArgument, + + /// Occurs when a subcommand is required (as defined by [`AppSettings::SubcommandRequired`]), + /// but the user does not provide one. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, AppSettings, SubCommand, ErrorKind}; + /// let err = App::new("prog") + /// .setting(AppSettings::SubcommandRequired) + /// .subcommand(SubCommand::with_name("test")) + /// .get_matches_from_safe(vec![ + /// "myprog", + /// ]); + /// assert!(err.is_err()); + /// assert_eq!(err.unwrap_err().kind, ErrorKind::MissingSubcommand); + /// # ; + /// ``` + /// [`AppSettings::SubcommandRequired`]: ./enum.AppSettings.html#variant.SubcommandRequired + MissingSubcommand, + + /// Occurs when either an argument or [`SubCommand`] is required, as defined by + /// [`AppSettings::ArgRequiredElseHelp`], but the user did not provide one. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, AppSettings, ErrorKind, SubCommand}; + /// let result = App::new("prog") + /// .setting(AppSettings::ArgRequiredElseHelp) + /// .subcommand(SubCommand::with_name("config") + /// .about("Used for configuration") + /// .arg(Arg::with_name("config_file") + /// .help("The configuration file to use"))) + /// .get_matches_from_safe(vec!["prog"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::MissingArgumentOrSubcommand); + /// ``` + /// [`SubCommand`]: ./struct.SubCommand.html + /// [`AppSettings::ArgRequiredElseHelp`]: ./enum.AppSettings.html#variant.ArgRequiredElseHelp + MissingArgumentOrSubcommand, + + /// Occurs when the user provides multiple values to an argument which doesn't allow that. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .arg(Arg::with_name("debug") + /// .long("debug") + /// .multiple(false)) + /// .get_matches_from_safe(vec!["prog", "--debug", "--debug"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::UnexpectedMultipleUsage); + /// ``` + UnexpectedMultipleUsage, + + /// Occurs when the user provides a value containing invalid UTF-8 for an argument and + /// [`AppSettings::StrictUtf8`] is set. + /// + /// # Platform Speicific + /// + /// Non-Windows platforms only (such as Linux, Unix, OSX, etc.) + /// + /// # Examples + /// + #[cfg_attr(not(unix), doc=" ```ignore")] + #[cfg_attr( unix , doc=" ```")] + /// # use clap::{App, Arg, ErrorKind, AppSettings}; + /// # use std::os::unix::ffi::OsStringExt; + /// # use std::ffi::OsString; + /// let result = App::new("prog") + /// .setting(AppSettings::StrictUtf8) + /// .arg(Arg::with_name("utf8") + /// .short("u") + /// .takes_value(true)) + /// .get_matches_from_safe(vec![OsString::from("myprog"), + /// OsString::from("-u"), + /// OsString::from_vec(vec![0xE9])]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::InvalidUtf8); + /// ``` + /// [`AppSettings::StrictUtf8`]: ./enum.AppSettings.html#variant.StrictUtf8 + InvalidUtf8, + + /// Not a true "error" as it means `--help` or similar was used. + /// The help message will be sent to `stdout`. + /// + /// **Note**: If the help is displayed due to an error (such as missing subcommands) it will + /// be sent to `stderr` instead of `stdout`. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .get_matches_from_safe(vec!["prog", "--help"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::HelpDisplayed); + /// ``` + HelpDisplayed, + + /// Not a true "error" as it means `--version` or similar was used. + /// The message will be sent to `stdout`. + /// + /// # Examples + /// + /// ```rust + /// # use clap::{App, Arg, ErrorKind}; + /// let result = App::new("prog") + /// .get_matches_from_safe(vec!["prog", "--version"]); + /// assert!(result.is_err()); + /// assert_eq!(result.unwrap_err().kind, ErrorKind::VersionDisplayed); + /// ``` + VersionDisplayed, + + /// Occurs when using the [`value_t!`] and [`values_t!`] macros to convert an argument value + /// into type `T`, but the argument you requested wasn't used. I.e. you asked for an argument + /// with name `config` to be converted, but `config` wasn't used by the user. + /// [`value_t!`]: ./macro.value_t!.html + /// [`values_t!`]: ./macro.values_t!.html + ArgumentNotFound, + + /// Represents an [I/O error]. + /// Can occur when writing to `stderr` or `stdout` or reading a configuration file. + /// [I/O error]: https://doc.rust-lang.org/std/io/struct.Error.html + Io, + + /// Represents a [Format error] (which is a part of [`Display`]). + /// Typically caused by writing to `stderr` or `stdout`. + /// [`Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html + /// [Format error]: https://doc.rust-lang.org/std/fmt/struct.Error.html + Format, +} + +/// Command Line Argument Parser Error +#[derive(Debug)] +pub struct Error { + /// Formated error message + pub message: String, + /// The type of error + pub kind: ErrorKind, + /// Any additional information passed along, such as the argument name that caused the error + pub info: Option>, +} + +impl Error { + /// Should the message be written to `stdout` or not + pub fn use_stderr(&self) -> bool { + match self.kind { + ErrorKind::HelpDisplayed | + ErrorKind::VersionDisplayed => false, + _ => true, + } + } + + /// Prints the error to `stderr` and exits with a status of `1` + pub fn exit(&self) -> ! { + if self.use_stderr() { + wlnerr!("{}", self.message); + process::exit(1); + } + let out = io::stdout(); + writeln!(&mut out.lock(), "{}", self.message).expect("Error writing Error to stdout"); + process::exit(0); + } + + #[doc(hidden)] + pub fn write_to(&self, w: &mut W) -> io::Result<()> { write!(w, "{}", self.message) } + + #[doc(hidden)] + pub fn argument_conflict<'a, 'b, A, O, U>(arg: &A, + other: Option, + usage: U, + color: ColorWhen) + -> Self + where A: AnyArg<'a, 'b> + Display, + O: Into, + U: Display + { + let mut v = vec![arg.name().to_owned()]; + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The argument '{}' cannot be used with {}\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(&*arg.to_string()), + match other { + Some(name) => { + let n = name.into(); + v.push(n.clone()); + c.warning(format!("'{}'", n)) + } + None => { + c.none("one or more of the other specified arguments" + .to_owned()) + } + }, + usage, + c.good("--help")), + kind: ErrorKind::ArgumentConflict, + info: Some(v), + } + } + + #[doc(hidden)] + pub fn empty_value<'a, 'b, A, U>(arg: &A, usage: U, color: ColorWhen) -> Self + where A: AnyArg<'a, 'b> + Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The argument '{}' requires a value but none was supplied\ + \n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(arg.to_string()), + usage, + c.good("--help")), + kind: ErrorKind::EmptyValue, + info: Some(vec![arg.name().to_owned()]), + } + } + + #[doc(hidden)] + pub fn invalid_value<'a, 'b, B, G, A, U>(bad_val: B, + good_vals: &[G], + arg: &A, + usage: U, + color: ColorWhen) + -> Self + where B: AsRef, + G: AsRef + Display, + A: AnyArg<'a, 'b> + Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + let suffix = + suggestions::did_you_mean_value_suffix( + bad_val.as_ref(), + good_vals.iter()); + + let mut sorted = vec![]; + for v in good_vals { + let val = format!("{}", c.good(v)); + sorted.push(val); + } + sorted.sort(); + let valid_values = sorted.join(", "); + Error { + message: format!("{} '{}' isn't a valid value for '{}'\n\t\ + [values: {}]\n\ + {}\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(bad_val.as_ref()), + c.warning(arg.to_string()), + valid_values, + suffix.0, + usage, + c.good("--help")), + kind: ErrorKind::InvalidValue, + info: Some(vec![arg.name().to_owned(), bad_val.as_ref().to_owned()]), + } + } + + #[doc(hidden)] + pub fn invalid_subcommand(subcmd: S, + did_you_mean: D, + name: N, + usage: U, + color: ColorWhen) + -> Self + where S: Into, + D: AsRef + Display, + N: Display, + U: Display + { + let s = subcmd.into(); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The subcommand '{}' wasn't recognized\n\t\ + Did you mean '{}'?\n\n\ + If you believe you received this message in error, try \ + re-running with '{} {} {}'\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(&*s), + c.good(did_you_mean.as_ref()), + name, + c.good("--"), + &*s, + usage, + c.good("--help")), + kind: ErrorKind::InvalidSubcommand, + info: Some(vec![s]), + } + } + + #[doc(hidden)] + pub fn unrecognized_subcommand(subcmd: S, name: N, color: ColorWhen) -> Self + where S: Into, + N: Display + { + let s = subcmd.into(); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The subcommand '{}' wasn't recognized\n\n\ + {}\n\t\ + {} help ...\n\n\ + For more information try {}", + c.error("error:"), + c.warning(&*s), + c.warning("USAGE:"), + name, + c.good("--help")), + kind: ErrorKind::UnrecognizedSubcommand, + info: Some(vec![s]), + } + } + + #[doc(hidden)] + pub fn missing_required_argument(required: R, usage: U, color: ColorWhen) -> Self + where R: Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The following required arguments were not provided:{}\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + required, + usage, + c.good("--help")), + kind: ErrorKind::MissingRequiredArgument, + info: None, + } + } + + #[doc(hidden)] + pub fn missing_subcommand(name: N, usage: U, color: ColorWhen) -> Self + where N: AsRef + Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} '{}' requires a subcommand, but one was not provided\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(name), + usage, + c.good("--help")), + kind: ErrorKind::MissingSubcommand, + info: None, + } + } + + + #[doc(hidden)] + pub fn invalid_utf8(usage: U, color: ColorWhen) -> Self + where U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} Invalid UTF-8 was detected in one or more arguments\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + usage, + c.good("--help")), + kind: ErrorKind::InvalidUtf8, + info: None, + } + } + + #[doc(hidden)] + pub fn too_many_values<'a, 'b, V, A, U>(val: V, + arg: &A, + usage: U, + color: ColorWhen) + -> Self + where V: AsRef + Display + ToOwned, + A: AnyArg<'a, 'b> + Display, + U: Display + { + let v = val.as_ref(); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The value '{}' was provided to '{}', but it wasn't expecting \ + any more values\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(v), + c.warning(arg.to_string()), + usage, + c.good("--help")), + kind: ErrorKind::TooManyValues, + info: Some(vec![arg.name().to_owned(), v.to_owned()]), + } + } + + #[doc(hidden)] + pub fn too_few_values<'a, 'b, A, U>(arg: &A, + min_vals: u64, + curr_vals: usize, + usage: U, + color: ColorWhen) + -> Self + where A: AnyArg<'a, 'b> + Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The argument '{}' requires at least {} values, but only {} w{} \ + provided\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(arg.to_string()), + c.warning(min_vals.to_string()), + c.warning(curr_vals.to_string()), + if curr_vals > 1 { "ere" } else { "as" }, + usage, + c.good("--help")), + kind: ErrorKind::TooFewValues, + info: Some(vec![arg.name().to_owned()]), + } + } + + #[doc(hidden)] + pub fn value_validation<'a, 'b, A>(arg: Option<&A>, err: String, color: ColorWhen) -> Self + where A: AnyArg<'a, 'b> + Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} Invalid value{}: {}", + c.error("error:"), + if let Some(a) = arg { + format!(" for '{}'", c.warning(a.to_string())) + } else { + "".to_string() + }, + err), + kind: ErrorKind::ValueValidation, + info: None, + } + } + + #[doc(hidden)] + pub fn value_validation_auto(err: String) -> Self { + let n: Option<&FlagBuilder> = None; + Error::value_validation(n, err, ColorWhen::Auto) + } + + #[doc(hidden)] + pub fn wrong_number_of_values<'a, 'b, A, S, U>(arg: &A, + num_vals: u64, + curr_vals: usize, + suffix: S, + usage: U, + color: ColorWhen) + -> Self + where A: AnyArg<'a, 'b> + Display, + S: Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The argument '{}' requires {} values, but {} w{} \ + provided\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(arg.to_string()), + c.warning(num_vals.to_string()), + c.warning(curr_vals.to_string()), + suffix, + usage, + c.good("--help")), + kind: ErrorKind::WrongNumberOfValues, + info: Some(vec![arg.name().to_owned()]), + } + } + + #[doc(hidden)] + pub fn unexpected_multiple_usage<'a, 'b, A, U>(arg: &A, usage: U, color: ColorWhen) -> Self + where A: AnyArg<'a, 'b> + Display, + U: Display + { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} The argument '{}' was provided more than once, but cannot \ + be used multiple times\n\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(arg.to_string()), + usage, + c.good("--help")), + kind: ErrorKind::UnexpectedMultipleUsage, + info: Some(vec![arg.name().to_owned()]), + } + } + + #[doc(hidden)] + pub fn unknown_argument(arg: A, + did_you_mean: &str, + usage: U, + color: ColorWhen) + -> Self + where A: Into, + U: Display + { + let a = arg.into(); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} Found argument '{}' which wasn't expected, or isn't valid in \ + this context{}\n\ + {}\n\n\ + For more information try {}", + c.error("error:"), + c.warning(&*a), + if did_you_mean.is_empty() { + "\n".to_owned() + } else { + format!("{}\n", did_you_mean) + }, + usage, + c.good("--help")), + kind: ErrorKind::UnknownArgument, + info: Some(vec![a]), + } + } + + #[doc(hidden)] + pub fn io_error(e: &Error, color: ColorWhen) -> Self { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: color, + }); + Error { + message: format!("{} {}", c.error("error:"), e.description()), + kind: ErrorKind::Io, + info: None, + } + } + + #[doc(hidden)] + pub fn argument_not_found_auto(arg: A) -> Self + where A: Into + { + let a = arg.into(); + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: ColorWhen::Auto, + }); + Error { + message: format!("{} The argument '{}' wasn't found", + c.error("error:"), + a.clone()), + kind: ErrorKind::ArgumentNotFound, + info: Some(vec![a]), + } + } + + /// Create an error with a custom description. + /// + /// This can be used in combination with `Error::exit` to exit your program + /// with a custom error message. + pub fn with_description(description: &str, kind: ErrorKind) -> Self { + let c = Colorizer::new(ColorizerOption { + use_stderr: true, + when: ColorWhen::Auto, + }); + Error { + message: format!("{} {}", c.error("error:"), description), + kind: kind, + info: None, + } + } +} + +impl StdError for Error { + fn description(&self) -> &str { &*self.message } +} + +impl Display for Error { + fn fmt(&self, f: &mut std_fmt::Formatter) -> std_fmt::Result { writeln!(f, "{}", self.message) } +} + +impl From for Error { + fn from(e: io::Error) -> Self { Error::with_description(e.description(), ErrorKind::Io) } +} + +impl From for Error { + fn from(e: std_fmt::Error) -> Self { + Error::with_description(e.description(), ErrorKind::Format) + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/fmt.rs b/vendor/registry-40351f815f426200/clap/src/fmt.rs new file mode 100644 index 000000000..9fccd3f53 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/fmt.rs @@ -0,0 +1,181 @@ +#[cfg(all(feature = "color", not(target_os = "windows")))] +use ansi_term::ANSIString; + +#[cfg(all(feature = "color", not(target_os = "windows")))] +use ansi_term::Colour::{Green, Red, Yellow}; + +#[cfg(feature = "color")] +use atty; +use std::fmt; +use std::env; + +#[doc(hidden)] +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum ColorWhen { + Auto, + Always, + Never, +} + +#[cfg(feature = "color")] +pub fn is_a_tty(stderr: bool) -> bool { + debugln!("is_a_tty: stderr={:?}", stderr); + let stream = if stderr { + atty::Stream::Stderr + } else { + atty::Stream::Stdout + }; + atty::is(stream) +} + +#[cfg(not(feature = "color"))] +pub fn is_a_tty(_: bool) -> bool { + debugln!("is_a_tty;"); + false +} + +pub fn is_term_dumb() -> bool { env::var("TERM").ok() == Some(String::from("dumb")) } + +#[doc(hidden)] +pub struct ColorizerOption { + pub use_stderr: bool, + pub when: ColorWhen, +} + +#[doc(hidden)] +pub struct Colorizer { + when: ColorWhen, +} + +macro_rules! color { + ($_self:ident, $c:ident, $m:expr) => { + match $_self.when { + ColorWhen::Auto => Format::$c($m), + ColorWhen::Always => Format::$c($m), + ColorWhen::Never => Format::None($m), + } + }; +} + +impl Colorizer { + pub fn new(option: ColorizerOption) -> Colorizer { + let is_a_tty = is_a_tty(option.use_stderr); + let is_term_dumb = is_term_dumb(); + Colorizer { + when: if is_a_tty && !is_term_dumb { + option.when + } else { + ColorWhen::Never + }, + } + } + + pub fn good(&self, msg: T) -> Format + where T: fmt::Display + AsRef + { + debugln!("Colorizer::good;"); + color!(self, Good, msg) + } + + pub fn warning(&self, msg: T) -> Format + where T: fmt::Display + AsRef + { + debugln!("Colorizer::warning;"); + color!(self, Warning, msg) + } + + pub fn error(&self, msg: T) -> Format + where T: fmt::Display + AsRef + { + debugln!("Colorizer::error;"); + color!(self, Error, msg) + } + + pub fn none(&self, msg: T) -> Format + where T: fmt::Display + AsRef + { + debugln!("Colorizer::none;"); + Format::None(msg) + } +} + +impl Default for Colorizer { + fn default() -> Self { + Colorizer::new(ColorizerOption { + use_stderr: true, + when: ColorWhen::Auto, + }) + } +} + +/// Defines styles for different types of error messages. Defaults to Error=Red, Warning=Yellow, +/// and Good=Green +#[derive(Debug)] +#[doc(hidden)] +pub enum Format { + /// Defines the style used for errors, defaults to Red + Error(T), + /// Defines the style used for warnings, defaults to Yellow + Warning(T), + /// Defines the style used for good values, defaults to Green + Good(T), + /// Defines no formatting style + None(T), +} + +#[cfg(all(feature = "color", not(target_os = "windows")))] +impl> Format { + fn format(&self) -> ANSIString { + match *self { + Format::Error(ref e) => Red.bold().paint(e.as_ref()), + Format::Warning(ref e) => Yellow.paint(e.as_ref()), + Format::Good(ref e) => Green.paint(e.as_ref()), + Format::None(ref e) => ANSIString::from(e.as_ref()), + } + } +} + +#[cfg(any(not(feature = "color"), target_os = "windows"))] +#[cfg_attr(feature="lints", allow(match_same_arms))] +impl Format { + fn format(&self) -> &T { + match *self { + Format::Error(ref e) => e, + Format::Warning(ref e) => e, + Format::Good(ref e) => e, + Format::None(ref e) => e, + } + } +} + + +#[cfg(all(feature = "color", not(target_os = "windows")))] +impl> fmt::Display for Format { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", &self.format()) } +} + +#[cfg(any(not(feature = "color"), target_os = "windows"))] +impl fmt::Display for Format { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", &self.format()) } +} + +#[cfg(all(test, feature = "color", not(target_os = "windows")))] +mod test { + use ansi_term::ANSIString; + use ansi_term::Colour::{Green, Red, Yellow}; + use super::Format; + + #[test] + fn colored_output() { + let err = Format::Error("error"); + assert_eq!(&*format!("{}", err), + &*format!("{}", Red.bold().paint("error"))); + let good = Format::Good("good"); + assert_eq!(&*format!("{}", good), &*format!("{}", Green.paint("good"))); + let warn = Format::Warning("warn"); + assert_eq!(&*format!("{}", warn), &*format!("{}", Yellow.paint("warn"))); + let none = Format::None("none"); + assert_eq!(&*format!("{}", none), + &*format!("{}", ANSIString::from("none"))); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/lib.rs b/vendor/registry-40351f815f426200/clap/src/lib.rs new file mode 100644 index 000000000..b9446e33a --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/lib.rs @@ -0,0 +1,576 @@ +// Copyright ⓒ 2015-2016 Kevin B. Knapp and [`clap-rs` contributors](https://github.com/kbknapp/clap-rs/blob/master/CONTRIBUTORS.md). +// Licensed under the MIT license +// (see LICENSE or ) All files in the project carrying such +// notice may not be copied, modified, or distributed except according to those terms. + +//! `clap` is a simple-to-use, efficient, and full-featured library for parsing command line +//! arguments and subcommands when writing console/terminal applications. +//! +//! ## About +//! +//! `clap` is used to parse *and validate* the string of command line arguments provided by the user +//! at runtime. You provide the list of valid possibilities, and `clap` handles the rest. This means +//! you focus on your *applications* functionality, and less on the parsing and validating of +//! arguments. +//! +//! `clap` also provides the traditional version and help switches (or flags) 'for free' meaning +//! automatically with no configuration. It does this by checking list of valid possibilities you +//! supplied and adding only the ones you haven't already defined. If you are using subcommands, +//! `clap` will also auto-generate a `help` subcommand for you in addition to the traditional flags. +//! +//! Once `clap` parses the user provided string of arguments, it returns the matches along with any +//! applicable values. If the user made an error or typo, `clap` informs them of the mistake and +//! exits gracefully (or returns a `Result` type and allows you to perform any clean up prior to +//! exit). Because of this, you can make reasonable assumptions in your code about the validity of +//! the arguments. +//! +//! +//! ## Quick Example +//! +//! The following examples show a quick example of some of the very basic functionality of `clap`. +//! For more advanced usage, such as requirements, conflicts, groups, multiple values and +//! occurrences see the [documentation](https://docs.rs/clap/), [examples/](examples) directory of +//! this repository or the [video tutorials](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U). +//! +//! **NOTE:** All of these examples are functionally the same, but show different styles in which to +//! use `clap` +//! +//! The first example shows a method that allows more advanced configuration options (not shown in +//! this small example), or even dynamically generating arguments when desired. The downside is it's +//! more verbose. +//! +//! ```no_run +//! // (Full example with detailed comments in examples/01b_quick_example.rs) +//! // +//! // This example demonstrates clap's full 'builder pattern' style of creating arguments which is +//! // more verbose, but allows easier editing, and at times more advanced options, or the possibility +//! // to generate arguments dynamically. +//! extern crate clap; +//! use clap::{Arg, App, SubCommand}; +//! +//! fn main() { +//! let matches = App::new("My Super Program") +//! .version("1.0") +//! .author("Kevin K. ") +//! .about("Does awesome things") +//! .arg(Arg::with_name("config") +//! .short("c") +//! .long("config") +//! .value_name("FILE") +//! .help("Sets a custom config file") +//! .takes_value(true)) +//! .arg(Arg::with_name("INPUT") +//! .help("Sets the input file to use") +//! .required(true) +//! .index(1)) +//! .arg(Arg::with_name("v") +//! .short("v") +//! .multiple(true) +//! .help("Sets the level of verbosity")) +//! .subcommand(SubCommand::with_name("test") +//! .about("controls testing features") +//! .version("1.3") +//! .author("Someone E. ") +//! .arg(Arg::with_name("debug") +//! .short("d") +//! .help("print debug information verbosely"))) +//! .get_matches(); +//! +//! // Gets a value for config if supplied by user, or defaults to "default.conf" +//! let config = matches.value_of("config").unwrap_or("default.conf"); +//! println!("Value for config: {}", config); +//! +//! // Calling .unwrap() is safe here because "INPUT" is required (if "INPUT" wasn't +//! // required we could have used an 'if let' to conditionally get the value) +//! println!("Using input file: {}", matches.value_of("INPUT").unwrap()); +//! +//! // Vary the output based on how many times the user used the "verbose" flag +//! // (i.e. 'myprog -v -v -v' or 'myprog -vvv' vs 'myprog -v' +//! match matches.occurrences_of("v") { +//! 0 => println!("No verbose info"), +//! 1 => println!("Some verbose info"), +//! 2 => println!("Tons of verbose info"), +//! 3 | _ => println!("Don't be crazy"), +//! } +//! +//! // You can handle information about subcommands by requesting their matches by name +//! // (as below), requesting just the name used, or both at the same time +//! if let Some(matches) = matches.subcommand_matches("test") { +//! if matches.is_present("debug") { +//! println!("Printing debug info..."); +//! } else { +//! println!("Printing normally..."); +//! } +//! } +//! +//! // more program logic goes here... +//! } +//! ``` +//! +//! The next example shows a far less verbose method, but sacrifices some of the advanced +//! configuration options (not shown in this small example). This method also takes a *very* minor +//! runtime penalty. +//! +//! ```no_run +//! // (Full example with detailed comments in examples/01a_quick_example.rs) +//! // +//! // This example demonstrates clap's "usage strings" method of creating arguments +//! // which is less verbose +//! extern crate clap; +//! use clap::{Arg, App, SubCommand}; +//! +//! fn main() { +//! let matches = App::new("myapp") +//! .version("1.0") +//! .author("Kevin K. ") +//! .about("Does awesome things") +//! .args_from_usage( +//! "-c, --config=[FILE] 'Sets a custom config file' +//! 'Sets the input file to use' +//! -v... 'Sets the level of verbosity'") +//! .subcommand(SubCommand::with_name("test") +//! .about("controls testing features") +//! .version("1.3") +//! .author("Someone E. ") +//! .arg_from_usage("-d, --debug 'Print debug information'")) +//! .get_matches(); +//! +//! // Same as previous example... +//! } +//! ``` +//! +//! This third method shows how you can use a YAML file to build your CLI and keep your Rust source +//! tidy or support multiple localized translations by having different YAML files for each +//! localization. +//! +//! First, create the `cli.yml` file to hold your CLI options, but it could be called anything we +//! like: +//! +//! ```yaml +//! name: myapp +//! version: "1.0" +//! author: Kevin K. +//! about: Does awesome things +//! args: +//! - config: +//! short: c +//! long: config +//! value_name: FILE +//! help: Sets a custom config file +//! takes_value: true +//! - INPUT: +//! help: Sets the input file to use +//! required: true +//! index: 1 +//! - verbose: +//! short: v +//! multiple: true +//! help: Sets the level of verbosity +//! subcommands: +//! - test: +//! about: controls testing features +//! version: "1.3" +//! author: Someone E. +//! args: +//! - debug: +//! short: d +//! help: print debug information +//! ``` +//! +//! Since this feature requires additional dependencies that not everyone may want, it is *not* +//! compiled in by default and we need to enable a feature flag in Cargo.toml: +//! +//! Simply change your `clap = "~2.27.0"` to `clap = {version = "~2.27.0", features = ["yaml"]}`. +//! +//! At last we create our `main.rs` file just like we would have with the previous two examples: +//! +//! ```ignore +//! // (Full example with detailed comments in examples/17_yaml.rs) +//! // +//! // This example demonstrates clap's building from YAML style of creating arguments which is far +//! // more clean, but takes a very small performance hit compared to the other two methods. +//! #[macro_use] +//! extern crate clap; +//! use clap::App; +//! +//! fn main() { +//! // The YAML file is found relative to the current file, similar to how modules are found +//! let yaml = load_yaml!("cli.yml"); +//! let matches = App::from_yaml(yaml).get_matches(); +//! +//! // Same as previous examples... +//! } +//! ``` +//! +//! Finally there is a macro version, which is like a hybrid approach offering the speed of the +//! builder pattern (the first example), but without all the verbosity. +//! +//! ```no_run +//! #[macro_use] +//! extern crate clap; +//! +//! fn main() { +//! let matches = clap_app!(myapp => +//! (version: "1.0") +//! (author: "Kevin K. ") +//! (about: "Does awesome things") +//! (@arg CONFIG: -c --config +takes_value "Sets a custom config file") +//! (@arg INPUT: +required "Sets the input file to use") +//! (@arg debug: -d ... "Sets the level of debugging information") +//! (@subcommand test => +//! (about: "controls testing features") +//! (version: "1.3") +//! (author: "Someone E. ") +//! (@arg verbose: -v --verbose "Print test information verbosely") +//! ) +//! ).get_matches(); +//! +//! // Same as before... +//! } +//! ``` +//! +//! If you were to compile any of the above programs and run them with the flag `--help` or `-h` (or +//! `help` subcommand, since we defined `test` as a subcommand) the following would be output +//! +//! ```text +//! $ myprog --help +//! My Super Program 1.0 +//! Kevin K. +//! Does awesome things +//! +//! USAGE: +//! MyApp [FLAGS] [OPTIONS] [SUBCOMMAND] +//! +//! FLAGS: +//! -h, --help Prints this message +//! -v Sets the level of verbosity +//! -V, --version Prints version information +//! +//! OPTIONS: +//! -c, --config Sets a custom config file +//! +//! ARGS: +//! INPUT The input file to use +//! +//! SUBCOMMANDS: +//! help Prints this message +//! test Controls testing features +//! ``` +//! +//! **NOTE:** You could also run `myapp test --help` to see similar output and options for the +//! `test` subcommand. +//! +//! ## Try it! +//! +//! ### Pre-Built Test +//! +//! To try out the pre-built example, use the following steps: +//! +//! * Clone the repository `$ git clone https://github.com/kbknapp/clap-rs && cd clap-rs/tests` +//! * Compile the example `$ cargo build --release` +//! * Run the help info `$ ./target/release/claptests --help` +//! * Play with the arguments! +//! +//! ### BYOB (Build Your Own Binary) +//! +//! To test out `clap`'s default auto-generated help/version follow these steps: +//! +//! * Create a new cargo project `$ cargo new fake --bin && cd fake` +//! * Add `clap` to your `Cargo.toml` +//! +//! ```toml +//! [dependencies] +//! clap = "2" +//! ``` +//! +//! * Add the following to your `src/main.rs` +//! +//! ```no_run +//! extern crate clap; +//! use clap::App; +//! +//! fn main() { +//! App::new("fake").version("v1.0-beta").get_matches(); +//! } +//! ``` +//! +//! * Build your program `$ cargo build --release` +//! * Run with help or version `$ ./target/release/fake --help` or `$ ./target/release/fake +//! --version` +//! +//! ## Usage +//! +//! For full usage, add `clap` as a dependency in your `Cargo.toml` (it is **highly** recommended to +//! use the `~major.minor.patch` style versions in your `Cargo.toml`, for more information see +//! [Compatibility Policy](#compatibility-policy)) to use from crates.io: +//! +//! ```toml +//! [dependencies] +//! clap = "~2.27.0" +//! ``` +//! +//! Or get the latest changes from the master branch at github: +//! +//! ```toml +//! [dependencies.clap] +//! git = "https://github.com/kbknapp/clap-rs.git" +//! ``` +//! +//! Add `extern crate clap;` to your crate root. +//! +//! Define a list of valid arguments for your program (see the +//! [documentation](https://docs.rs/clap/) or [examples/](examples) directory of this repo) +//! +//! Then run `cargo build` or `cargo update && cargo build` for your project. +//! +//! ### Optional Dependencies / Features +//! +//! #### Features enabled by default +//! +//! * `suggestions`: Turns on the `Did you mean '--myoption'?` feature for when users make typos. (builds dependency `strsim`) +//! * `color`: Turns on colored error messages. This feature only works on non-Windows OSs. (builds dependency `ansi-term` and `atty`) +//! * `wrap_help`: Wraps the help at the actual terminal width when +//! available, instead of 120 chracters. (builds dependency `textwrap` +//! with feature `term_size`) +//! +//! To disable these, add this to your `Cargo.toml`: +//! +//! ```toml +//! [dependencies.clap] +//! version = "~2.27.0" +//! default-features = false +//! ``` +//! +//! You can also selectively enable only the features you'd like to include, by adding: +//! +//! ```toml +//! [dependencies.clap] +//! version = "~2.27.0" +//! default-features = false +//! +//! # Cherry-pick the features you'd like to use +//! features = [ "suggestions", "color" ] +//! ``` +//! +//! #### Opt-in features +//! +//! * **"yaml"**: Enables building CLIs from YAML documents. (builds dependency `yaml-rust`) +//! * **"unstable"**: Enables unstable `clap` features that may change from release to release +//! +//! ### Dependencies Tree +//! +//! The following graphic depicts `clap`s dependency graph (generated using +//! [cargo-graph](https://github.com/kbknapp/cargo-graph)). +//! +//! * **Dashed** Line: Optional dependency +//! * **Red** Color: **NOT** included by default (must use cargo `features` to enable) +//! * **Blue** Color: Dev dependency, only used while developing. +//! +//! ![clap dependencies](clap_dep_graph.png) +//! +//! ### More Information +//! +//! You can find complete documentation on the [docs.rs](https://docs.rs/clap/) for this project. +//! +//! You can also find usage examples in the [examples/](examples) directory of this repo. +//! +//! #### Video Tutorials +//! +//! There's also the video tutorial series [Argument Parsing with Rust v2](https://www.youtube.com/playlist?list=PLza5oFLQGTl2Z5T8g1pRkIynR3E0_pc7U). +//! +//! These videos slowly trickle out as I finish them and currently a work in progress. +//! +//! ## How to Contribute +//! +//! Contributions are always welcome! And there is a multitude of ways in which you can help +//! depending on what you like to do, or are good at. Anything from documentation, code cleanup, +//! issue completion, new features, you name it, even filing issues is contributing and greatly +//! appreciated! +//! +//! Another really great way to help is if you find an interesting, or helpful way in which to use +//! `clap`. You can either add it to the [examples/](examples) directory, or file an issue and tell +//! me. I'm all about giving credit where credit is due :) +//! +//! Please read [CONTRIBUTING.md](.github/CONTRIBUTING.md) before you start contributing. +//! +//! +//! ### Testing Code +//! +//! To test with all features both enabled and disabled, you can run theese commands: +//! +//! ```text +//! $ cargo test --no-default-features +//! $ cargo test --features "yaml unstable" +//! ``` +//! +//! Alternatively, if you have [`just`](https://github.com/casey/just) installed you can run the +//! prebuilt recipies. *Not* using `just` is prfeclty fine as well, it simply bundles commands +//! automatically. +//! +//! For example, to test the code, as above simply run: +//! +//! ```text +//! $ just run-tests` +//! ``` +//! +//! From here on, I will lis the appropriate `cargo` command as well as the `just` command. +//! +//! Sometimes it's helpful to only run a subset of the tests, which can be done via: +//! +//! ```text +//! $ cargo test --test +//! +//! # Or +//! +//! $ just run-test +//! ``` +//! +//! ### Linting Code +//! +//! During the CI process `clap` runs against many different lints using +//! [`clippy`](https://github.com/Manishearth/rust-clippy). In order to check if these lints pass on +//! your own computer prior to submitting a PR you'll need a nightly compiler. +//! +//! In order to check the code for lints run either: +//! +//! ```text +//! $ rustup override add nightly +//! $ cargo build --features lints +//! $ rustup override remove +//! +//! # Or +//! +//! $ just lint +//! ``` +//! +//! ### Debugging Code +//! +//! Another helpful technique is to see the `clap` debug output while developing features. In order +//! to see the debug output while running the full test suite or individual tests, run: +//! +//! ```text +//! $ cargo test --features debug +//! +//! # Or for individual tests +//! $ cargo test --test --features debug +//! +//! # The corresponding just command for individual debugging tests is: +//! $ just debug +//! ``` +//! +//! ### Goals +//! +//! There are a few goals of `clap` that I'd like to maintain throughout contributions. If your +//! proposed changes break, or go against any of these goals we'll discuss the changes further +//! before merging (but will *not* be ignored, all contributes are welcome!). These are by no means +//! hard-and-fast rules, as I'm no expert and break them myself from time to time (even if by +//! mistake or ignorance). +//! +//! * Remain backwards compatible when possible +//! - If backwards compatibility *must* be broken, use deprecation warnings if at all possible before +//! removing legacy code - This does not apply for security concerns +//! * Parse arguments quickly +//! - Parsing of arguments shouldn't slow down usage of the main program - This is also true of +//! generating help and usage information (although *slightly* less stringent, as the program is about +//! to exit) +//! * Try to be cognizant of memory usage +//! - Once parsing is complete, the memory footprint of `clap` should be low since the main program +//! is the star of the show +//! * `panic!` on *developer* error, exit gracefully on *end-user* error +//! +//! ### Compatibility Policy +//! +//! Because `clap` takes `SemVer` and compatibility seriously, this is the official policy regarding +//! breaking changes and previous versions of Rust. +//! +//! `clap` will pin the minimum required version of Rust to the CI builds. Bumping the minimum +//! version of Rust is considered a minor breaking change, meaning *at a minimum* the minor version +//! of `clap` will be bumped. +//! +//! In order to keep from being suprised of breaking changes, it is **highly** recommended to use +//! the `~major.minor.patch` style in your `Cargo.toml`: +//! +//! ```toml +//! [dependencies] clap = "~2.27.0" +//! ``` +//! +//! This will cause *only* the patch version to be updated upon a `cargo update` call, and therefore +//! cannot break due to new features, or bumped minimum versions of Rust. +//! +//! #### Minimum Version of Rust +//! +//! `clap` will officially support current stable Rust, minus two releases, but may work with prior +//! releases as well. For example, current stable Rust at the time of this writing is 1.21.0, +//! meaning `clap` is guaranteed to compile with 1.19.0 and beyond. At the 1.22.0 release, `clap` +//! will be guaranteed to compile with 1.20.0 and beyond, etc. +//! +//! Upon bumping the minimum version of Rust (assuming it's within the stable-2 range), it *must* be +//! clearly annotated in the `CHANGELOG.md` +//! +//! ## License +//! +//! `clap` is licensed under the MIT license. Please read the [LICENSE-MIT](LICENSE-MIT) file in +//! this repository for more information. + +#![crate_type= "lib"] +#![doc(html_root_url = "https://docs.rs/clap/2.27.1")] +#![deny( + missing_docs, + missing_debug_implementations, + missing_copy_implementations, + trivial_casts, + unused_import_braces, + unused_allocation)] +// Lints we'd like to deny but are currently failing for upstream crates +// unused_qualifications (bitflags, clippy) +// trivial_numeric_casts (bitflags) +#![cfg_attr(not(any(feature = "lints", feature = "nightly")), forbid(unstable_features))] +#![cfg_attr(feature = "lints", feature(plugin))] +#![cfg_attr(feature = "lints", plugin(clippy))] +// Need to disable deny(warnings) while deprecations are active +// #![cfg_attr(feature = "lints", deny(warnings))] +#![cfg_attr(feature = "lints", allow(cyclomatic_complexity))] +#![cfg_attr(feature = "lints", allow(doc_markdown))] +#![cfg_attr(feature = "lints", allow(explicit_iter_loop))] + +#[cfg(feature = "suggestions")] +extern crate strsim; +#[cfg(feature = "color")] +extern crate ansi_term; +#[cfg(feature = "yaml")] +extern crate yaml_rust; +extern crate unicode_width; +#[macro_use] +extern crate bitflags; +#[cfg(feature = "vec_map")] +extern crate vec_map; +#[cfg(feature = "wrap_help")] +extern crate term_size; +extern crate textwrap; +#[cfg(feature = "color")] +extern crate atty; + +#[cfg(feature = "yaml")] +pub use yaml_rust::YamlLoader; +pub use args::{Arg, ArgGroup, ArgMatches, ArgSettings, SubCommand, Values, OsValues}; +pub use app::{App, AppSettings}; +pub use fmt::Format; +pub use errors::{Error, ErrorKind, Result}; +pub use completions::Shell; + +#[macro_use] +mod macros; +mod app; +mod args; +mod usage_parser; +mod fmt; +mod suggestions; +mod errors; +mod osstringext; +mod strext; +mod completions; +mod map; + +const INTERNAL_ERROR_MSG: &'static str = "Fatal internal error. Please consider filing a bug \ + report at https://github.com/kbknapp/clap-rs/issues"; +const INVALID_UTF8: &'static str = "unexpected invalid UTF-8 code point"; diff --git a/vendor/registry-40351f815f426200/clap/src/macros.rs b/vendor/registry-40351f815f426200/clap/src/macros.rs new file mode 100644 index 000000000..db8ea2f0a --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/macros.rs @@ -0,0 +1,1033 @@ +/// A convenience macro for loading the YAML file at compile time (relative to the current file, +/// like modules work). That YAML object can then be passed to this function. +/// +/// # Panics +/// +/// The YAML file must be properly formatted or this function will panic!(). A good way to +/// ensure this doesn't happen is to run your program with the `--help` switch. If this passes +/// without error, you needn't worry because the YAML is properly formatted. +/// +/// # Examples +/// +/// The following example shows how to load a properly formatted YAML file to build an instnace +/// of an `App` struct. +/// +/// ```ignore +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let yml = load_yaml!("app.yml"); +/// let app = App::from_yaml(yml); +/// +/// // continued logic goes here, such as `app.get_matches()` etc. +/// # } +/// ``` +#[cfg(feature = "yaml")] +#[macro_export] +macro_rules! load_yaml { + ($yml:expr) => ( + &::clap::YamlLoader::load_from_str(include_str!($yml)).expect("failed to load YAML file")[0] + ); +} + +/// Convenience macro getting a typed value `T` where `T` implements [`std::str::FromStr`] from an +/// argument value. This macro returns a `Result` which allows you as the developer to +/// decide what you'd like to do on a failed parse. There are two types of errors, parse failures +/// and those where the argument wasn't present (such as a non-required argument). You can use +/// it to get a single value, or a iterator as with the [`ArgMatches::values_of`] +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let matches = App::new("myapp") +/// .arg_from_usage("[length] 'Set the length to use as a pos whole num, i.e. 20'") +/// .get_matches(); +/// +/// let len = value_t!(matches.value_of("length"), u32).unwrap_or_else(|e| e.exit()); +/// let also_len = value_t!(matches, "length", u32).unwrap_or_else(|e| e.exit()); +/// +/// println!("{} + 2: {}", len, len + 2); +/// # } +/// ``` +/// [`std::str::FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`ArgMatches::values_of`]: ./struct.ArgMatches.html#method.values_of +/// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html +#[macro_export] +macro_rules! value_t { + ($m:ident, $v:expr, $t:ty) => { + value_t!($m.value_of($v), $t) + }; + ($m:ident.value_of($v:expr), $t:ty) => { + if let Some(v) = $m.value_of($v) { + match v.parse::<$t>() { + Ok(val) => Ok(val), + Err(_) => + Err(::clap::Error::value_validation_auto( + format!("The argument '{}' isn't a valid value", v))), + } + } else { + Err(::clap::Error::argument_not_found_auto($v)) + } + }; +} + +/// Convenience macro getting a typed value `T` where `T` implements [`std::str::FromStr`] or +/// exiting upon error, instead of returning a [`Result`] type. +/// +/// **NOTE:** This macro is for backwards compatibility sake. Prefer +/// [`value_t!(/* ... */).unwrap_or_else(|e| e.exit())`] +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let matches = App::new("myapp") +/// .arg_from_usage("[length] 'Set the length to use as a pos whole num, i.e. 20'") +/// .get_matches(); +/// +/// let len = value_t_or_exit!(matches.value_of("length"), u32); +/// let also_len = value_t_or_exit!(matches, "length", u32); +/// +/// println!("{} + 2: {}", len, len + 2); +/// # } +/// ``` +/// [`std::str::FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`Result`]: https://doc.rust-lang.org/std/result/enum.Result.html +/// [`value_t!(/* ... */).unwrap_or_else(|e| e.exit())`]: ./macro.value_t!.html +#[macro_export] +macro_rules! value_t_or_exit { + ($m:ident, $v:expr, $t:ty) => { + value_t_or_exit!($m.value_of($v), $t) + }; + ($m:ident.value_of($v:expr), $t:ty) => { + if let Some(v) = $m.value_of($v) { + match v.parse::<$t>() { + Ok(val) => val, + Err(_) => + ::clap::Error::value_validation_auto( + format!("The argument '{}' isn't a valid value", v)).exit(), + } + } else { + ::clap::Error::argument_not_found_auto($v).exit() + } + }; +} + +/// Convenience macro getting a typed value [`Vec`] where `T` implements [`std::str::FromStr`] +/// This macro returns a [`clap::Result>`] which allows you as the developer to decide +/// what you'd like to do on a failed parse. +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let matches = App::new("myapp") +/// .arg_from_usage("[seq]... 'A sequence of pos whole nums, i.e. 20 45'") +/// .get_matches(); +/// +/// let vals = values_t!(matches.values_of("seq"), u32).unwrap_or_else(|e| e.exit()); +/// for v in &vals { +/// println!("{} + 2: {}", v, v + 2); +/// } +/// +/// let vals = values_t!(matches, "seq", u32).unwrap_or_else(|e| e.exit()); +/// for v in &vals { +/// println!("{} + 2: {}", v, v + 2); +/// } +/// # } +/// ``` +/// [`std::str::FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`Vec`]: https://doc.rust-lang.org/std/vec/struct.Vec.html +/// [`clap::Result>`]: ./type.Result.html +#[macro_export] +macro_rules! values_t { + ($m:ident, $v:expr, $t:ty) => { + values_t!($m.values_of($v), $t) + }; + ($m:ident.values_of($v:expr), $t:ty) => { + if let Some(vals) = $m.values_of($v) { + let mut tmp = vec![]; + let mut err = None; + for pv in vals { + match pv.parse::<$t>() { + Ok(rv) => tmp.push(rv), + Err(..) => { + err = Some(::clap::Error::value_validation_auto( + format!("The argument '{}' isn't a valid value", pv))); + break + } + } + } + match err { + Some(e) => Err(e), + None => Ok(tmp), + } + } else { + Err(::clap::Error::argument_not_found_auto($v)) + } + }; +} + +/// Convenience macro getting a typed value [`Vec`] where `T` implements [`std::str::FromStr`] +/// or exiting upon error. +/// +/// **NOTE:** This macro is for backwards compatibility sake. Prefer +/// [`values_t!(/* ... */).unwrap_or_else(|e| e.exit())`] +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let matches = App::new("myapp") +/// .arg_from_usage("[seq]... 'A sequence of pos whole nums, i.e. 20 45'") +/// .get_matches(); +/// +/// let vals = values_t_or_exit!(matches.values_of("seq"), u32); +/// for v in &vals { +/// println!("{} + 2: {}", v, v + 2); +/// } +/// +/// // type for example only +/// let vals: Vec = values_t_or_exit!(matches, "seq", u32); +/// for v in &vals { +/// println!("{} + 2: {}", v, v + 2); +/// } +/// # } +/// ``` +/// [`values_t!(/* ... */).unwrap_or_else(|e| e.exit())`]: ./macro.values_t!.html +/// [`std::str::FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`Vec`]: https://doc.rust-lang.org/std/vec/struct.Vec.html +#[macro_export] +macro_rules! values_t_or_exit { + ($m:ident, $v:expr, $t:ty) => { + values_t_or_exit!($m.values_of($v), $t) + }; + ($m:ident.values_of($v:expr), $t:ty) => { + if let Some(vals) = $m.values_of($v) { + vals.map(|v| v.parse::<$t>().unwrap_or_else(|_|{ + ::clap::Error::value_validation_auto( + format!("One or more arguments aren't valid values")).exit() + })).collect::>() + } else { + ::clap::Error::argument_not_found_auto($v).exit() + } + }; +} + +// _clap_count_exprs! is derived from https://github.com/DanielKeep/rust-grabbag +// commit: 82a35ca5d9a04c3b920622d542104e3310ee5b07 +// License: MIT +// Copyright ⓒ 2015 grabbag contributors. +// Licensed under the MIT license (see LICENSE or ) or the Apache License, Version 2.0 (see LICENSE of +// ), at your option. All +// files in the project carrying such notice may not be copied, modified, +// or distributed except according to those terms. +// +/// Counts the number of comma-delimited expressions passed to it. The result is a compile-time +/// evaluable expression, suitable for use as a static array size, or the value of a `const`. +/// +/// # Examples +/// +/// ``` +/// # #[macro_use] extern crate clap; +/// # fn main() { +/// const COUNT: usize = _clap_count_exprs!(a, 5+1, "hi there!".into_string()); +/// assert_eq!(COUNT, 3); +/// # } +/// ``` +#[macro_export] +macro_rules! _clap_count_exprs { + () => { 0 }; + ($e:expr) => { 1 }; + ($e:expr, $($es:expr),+) => { 1 + _clap_count_exprs!($($es),*) }; +} + +/// Convenience macro to generate more complete enums with variants to be used as a type when +/// parsing arguments. This enum also provides a `variants()` function which can be used to +/// retrieve a `Vec<&'static str>` of the variant names, as well as implementing [`FromStr`] and +/// [`Display`] automatically. +/// +/// **NOTE:** Case insensitivity is supported for ASCII characters only +/// +/// **NOTE:** This macro automatically implements [`std::str::FromStr`] and [`std::fmt::Display`] +/// +/// **NOTE:** These enums support pub (or not) and uses of the #[derive()] traits +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::{App, Arg}; +/// arg_enum!{ +/// #[derive(Debug)] +/// pub enum Foo { +/// Bar, +/// Baz, +/// Qux +/// } +/// } +/// // Foo enum can now be used via Foo::Bar, or Foo::Baz, etc +/// // and implements std::str::FromStr to use with the value_t! macros +/// fn main() { +/// let m = App::new("app") +/// .arg_from_usage(" 'the foo'") +/// .get_matches(); +/// let f = value_t!(m, "foo", Foo).unwrap_or_else(|e| e.exit()); +/// +/// // Use f like any other Foo variant... +/// } +/// ``` +/// [`FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`std::str::FromStr`]: https://doc.rust-lang.org/std/str/trait.FromStr.html +/// [`Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html +/// [`std::fmt::Display`]: https://doc.rust-lang.org/std/fmt/trait.Display.html +#[macro_export] +macro_rules! arg_enum { + (@as_item $($i:item)*) => ($($i)*); + (@impls ( $($tts:tt)* ) -> ($e:ident, $($v:ident),+)) => { + arg_enum!(@as_item + $($tts)* + + impl ::std::str::FromStr for $e { + type Err = String; + + fn from_str(s: &str) -> ::std::result::Result { + use ::std::ascii::AsciiExt; + match s { + $(stringify!($v) | + _ if s.eq_ignore_ascii_case(stringify!($v)) => Ok($e::$v)),+, + _ => Err({ + let v = vec![ + $(stringify!($v),)+ + ]; + format!("valid values: {}", + v.join(" ,")) + }), + } + } + } + impl ::std::fmt::Display for $e { + fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { + match *self { + $($e::$v => write!(f, stringify!($v)),)+ + } + } + } + impl $e { + #[allow(dead_code)] + pub fn variants() -> [&'static str; _clap_count_exprs!($(stringify!($v)),+)] { + [ + $(stringify!($v),)+ + ] + } + }); + }; + ($(#[$($m:meta),+])+ pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => { + arg_enum!(@impls + ($(#[$($m),+])+ + pub enum $e { + $($v$(=$val)*),+ + }) -> ($e, $($v),+) + ); + }; + ($(#[$($m:meta),+])+ enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => { + arg_enum!(@impls + ($(#[$($m),+])+ + enum $e { + $($v$(=$val)*),+ + }) -> ($e, $($v),+) + ); + }; + (pub enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => { + arg_enum!(@impls + (pub enum $e { + $($v$(=$val)*),+ + }) -> ($e, $($v),+) + ); + }; + (enum $e:ident { $($v:ident $(=$val:expr)*),+ } ) => { + arg_enum!(@impls + (enum $e { + $($v$(=$val)*),+ + }) -> ($e, $($v),+) + ); + }; +} + +/// Allows you to pull the version from your Cargo.toml at compile time as +/// `MAJOR.MINOR.PATCH_PKGVERSION_PRE` +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let m = App::new("app") +/// .version(crate_version!()) +/// .get_matches(); +/// # } +/// ``` +#[cfg(not(feature="no_cargo"))] +#[macro_export] +macro_rules! crate_version { + () => { + env!("CARGO_PKG_VERSION") + }; +} + +/// Allows you to pull the authors for the app from your Cargo.toml at +/// compile time in the form: +/// `"author1 lastname :author2 lastname "` +/// +/// You can replace the colons with a custom separator by supplying a +/// replacement string, so, for example, +/// `crate_authors!(",\n")` would become +/// `"author1 lastname ,\nauthor2 lastname ,\nauthor3 lastname "` +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let m = App::new("app") +/// .author(crate_authors!("\n")) +/// .get_matches(); +/// # } +/// ``` +#[cfg(not(feature="no_cargo"))] +#[macro_export] +macro_rules! crate_authors { + ($sep:expr) => {{ + use std::ops::Deref; + use std::sync::{ONCE_INIT, Once}; + + #[allow(missing_copy_implementations)] + #[allow(dead_code)] + struct CargoAuthors { __private_field: () }; + + impl Deref for CargoAuthors { + type Target = str; + + #[allow(unsafe_code)] + fn deref(&self) -> &'static str { + static ONCE: Once = ONCE_INIT; + static mut VALUE: *const String = 0 as *const String; + + unsafe { + ONCE.call_once(|| { + let s = env!("CARGO_PKG_AUTHORS").replace(':', $sep); + VALUE = Box::into_raw(Box::new(s)); + }); + + &(*VALUE)[..] + } + } + } + + &*CargoAuthors { __private_field: () } + }}; + () => { + env!("CARGO_PKG_AUTHORS") + }; +} + +/// Allows you to pull the description from your Cargo.toml at compile time. +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let m = App::new("app") +/// .about(crate_description!()) +/// .get_matches(); +/// # } +/// ``` +#[cfg(not(feature="no_cargo"))] +#[macro_export] +macro_rules! crate_description { + () => { + env!("CARGO_PKG_DESCRIPTION") + }; +} + +/// Allows you to pull the name from your Cargo.toml at compile time. +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # use clap::App; +/// # fn main() { +/// let m = App::new(crate_name!()) +/// .get_matches(); +/// # } +/// ``` +#[cfg(not(feature="no_cargo"))] +#[macro_export] +macro_rules! crate_name { + () => { + env!("CARGO_PKG_NAME") + }; +} + +/// Allows you to build the `App` instance from your Cargo.toml at compile time. +/// +/// Equivalent to using the `crate_*!` macros with their respective fields. +/// +/// Provided separator is for the [`crate_authors!`](macro.crate_authors.html) macro, +/// refer to the documentation therefor. +/// +/// **NOTE:** Changing the values in your `Cargo.toml` does not trigger a re-build automatically, +/// and therefore won't change the generated output until you recompile. +/// +/// **Pro Tip:** In some cases you can "trick" the compiler into triggering a rebuild when your +/// `Cargo.toml` is changed by including this in your `src/main.rs` file +/// `include_str!("../Cargo.toml");` +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # fn main() { +/// let m = app_from_crate!().get_matches(); +/// # } +/// ``` +#[cfg(not(feature="no_cargo"))] +#[macro_export] +macro_rules! app_from_crate { + () => { + $crate::App::new(crate_name!()) + .version(crate_version!()) + .author(crate_authors!()) + .about(crate_description!()) + }; + ($sep:expr) => { + $crate::App::new(crate_name!()) + .version(crate_version!()) + .author(crate_authors!($sep)) + .about(crate_description!()) + }; +} + +/// Build `App`, `Arg`s, `SubCommand`s and `Group`s with Usage-string like input +/// but without the associated parsing runtime cost. +/// +/// `clap_app!` also supports several shorthand syntaxes. +/// +/// # Examples +/// +/// ```no_run +/// # #[macro_use] +/// # extern crate clap; +/// # fn main() { +/// let matches = clap_app!(myapp => +/// (version: "1.0") +/// (author: "Kevin K. ") +/// (about: "Does awesome things") +/// (@arg CONFIG: -c --config +takes_value "Sets a custom config file") +/// (@arg INPUT: +required "Sets the input file to use") +/// (@arg debug: -d ... "Sets the level of debugging information") +/// (@group difficulty => +/// (@arg hard: -h --hard "Sets hard mode") +/// (@arg normal: -n --normal "Sets normal mode") +/// (@arg easy: -e --easy "Sets easy mode") +/// ) +/// (@subcommand test => +/// (about: "controls testing features") +/// (version: "1.3") +/// (author: "Someone E. ") +/// (@arg verbose: -v --verbose "Print test information verbosely") +/// ) +/// ); +/// # } +/// ``` +/// # Shorthand Syntax for Args +/// +/// * A single hyphen followed by a character (such as `-c`) sets the [`Arg::short`] +/// * A double hyphen followed by a character or word (such as `--config`) sets [`Arg::long`] +/// * If one wishes to use a [`Arg::long`] with a hyphen inside (i.e. `--config-file`), you +/// must use `--("config-file")` due to limitations of the Rust macro system. +/// * Three dots (`...`) sets [`Arg::multiple(true)`] +/// * Angled brackets after either a short or long will set [`Arg::value_name`] and +/// `Arg::required(true)` such as `--config ` = `Arg::value_name("FILE")` and +/// `Arg::required(true) +/// * Square brackets after either a short or long will set [`Arg::value_name`] and +/// `Arg::required(false)` such as `--config [FILE]` = `Arg::value_name("FILE")` and +/// `Arg::required(false) +/// * There are short hand syntaxes for Arg methods that accept booleans +/// * A plus sign will set that method to `true` such as `+required` = `Arg::required(true)` +/// * An exclamation will set that method to `false` such as `!required` = `Arg::required(false)` +/// * A `#{min, max}` will set [`Arg::min_values(min)`] and [`Arg::max_values(max)`] +/// * An asterisk (`*`) will set `Arg::required(true)` +/// * Curly brackets around a `fn` will set [`Arg::validator`] as in `{fn}` = `Arg::validator(fn)` +/// * An Arg method that accepts a string followed by square brackets will set that method such as +/// `conflicts_with[FOO]` will set `Arg::conflicts_with("FOO")` (note the lack of quotes around +/// `FOO` in the macro) +/// * An Arg method that takes a string and can be set multiple times (such as +/// [`Arg::conflicts_with`]) followed by square brackets and a list of values separated by spaces +/// will set that method such as `conflicts_with[FOO BAR BAZ]` will set +/// `Arg::conflicts_with("FOO")`, `Arg::conflicts_with("BAR")`, and `Arg::conflicts_with("BAZ")` +/// (note the lack of quotes around the values in the macro) +/// +/// [`Arg::short`]: ./struct.Arg.html#method.short +/// [`Arg::long`]: ./struct.Arg.html#method.long +/// [`Arg::multiple(true)`]: ./struct.Arg.html#method.multiple +/// [`Arg::value_name`]: ./struct.Arg.html#method.value_name +/// [`Arg::min_values(min)`]: ./struct.Arg.html#method.min_values +/// [`Arg::max_values(max)`]: ./struct.Arg.html#method.max_values +/// [`Arg::validator`]: ./struct.Arg.html#method.validator +/// [`Arg::conflicts_with`]: ./struct.Arg.html#method.conflicts_with +#[macro_export] +macro_rules! clap_app { + (@app ($builder:expr)) => { $builder }; + (@app ($builder:expr) (@arg ($name:expr): $($tail:tt)*) $($tt:tt)*) => { + clap_app!{ @app + ($builder.arg( + clap_app!{ @arg ($crate::Arg::with_name($name)) (-) $($tail)* })) + $($tt)* + } + }; + (@app ($builder:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => { + clap_app!{ @app + ($builder.arg( + clap_app!{ @arg ($crate::Arg::with_name(stringify!($name))) (-) $($tail)* })) + $($tt)* + } + }; + (@app ($builder:expr) (@setting $setting:ident) $($tt:tt)*) => { + clap_app!{ @app + ($builder.setting($crate::AppSettings::$setting)) + $($tt)* + } + }; +// Treat the application builder as an argument to set it's attributes + (@app ($builder:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => { + clap_app!{ @app (clap_app!{ @arg ($builder) $($attr)* }) $($tt)* } + }; + (@app ($builder:expr) (@group $name:ident => $($tail:tt)*) $($tt:tt)*) => { + clap_app!{ @app + (clap_app!{ @group ($builder, $crate::ArgGroup::with_name(stringify!($name))) $($tail)* }) + $($tt)* + } + }; +// Handle subcommand creation + (@app ($builder:expr) (@subcommand $name:ident => $($tail:tt)*) $($tt:tt)*) => { + clap_app!{ @app + ($builder.subcommand( + clap_app!{ @app ($crate::SubCommand::with_name(stringify!($name))) $($tail)* } + )) + $($tt)* + } + }; +// Yaml like function calls - used for setting various meta directly against the app + (@app ($builder:expr) ($ident:ident: $($v:expr),*) $($tt:tt)*) => { +// clap_app!{ @app ($builder.$ident($($v),*)) $($tt)* } + clap_app!{ @app + ($builder.$ident($($v),*)) + $($tt)* + } + }; + +// Add members to group and continue argument handling with the parent builder + (@group ($builder:expr, $group:expr)) => { $builder.group($group) }; + (@group ($builder:expr, $group:expr) (@attributes $($attr:tt)*) $($tt:tt)*) => { + clap_app!{ @group ($builder, clap_app!{ @arg ($group) (-) $($attr)* }) $($tt)* } + }; + (@group ($builder:expr, $group:expr) (@arg $name:ident: $($tail:tt)*) $($tt:tt)*) => { + clap_app!{ @group + (clap_app!{ @app ($builder) (@arg $name: $($tail)*) }, + $group.arg(stringify!($name))) + $($tt)* + } + }; + +// No more tokens to munch + (@arg ($arg:expr) $modes:tt) => { $arg }; +// Shorthand tokens influenced by the usage_string + (@arg ($arg:expr) $modes:tt --($long:expr) $($tail:tt)*) => { + clap_app!{ @arg ($arg.long($long)) $modes $($tail)* } + }; + (@arg ($arg:expr) $modes:tt --$long:ident $($tail:tt)*) => { + clap_app!{ @arg ($arg.long(stringify!($long))) $modes $($tail)* } + }; + (@arg ($arg:expr) $modes:tt -$short:ident $($tail:tt)*) => { + clap_app!{ @arg ($arg.short(stringify!($short))) $modes $($tail)* } + }; + (@arg ($arg:expr) (-) <$var:ident> $($tail:tt)*) => { + clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value +required $($tail)* } + }; + (@arg ($arg:expr) (+) <$var:ident> $($tail:tt)*) => { + clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* } + }; + (@arg ($arg:expr) (-) [$var:ident] $($tail:tt)*) => { + clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) +takes_value $($tail)* } + }; + (@arg ($arg:expr) (+) [$var:ident] $($tail:tt)*) => { + clap_app!{ @arg ($arg.value_name(stringify!($var))) (+) $($tail)* } + }; + (@arg ($arg:expr) $modes:tt ... $($tail:tt)*) => { + clap_app!{ @arg ($arg) $modes +multiple $($tail)* } + }; +// Shorthand magic + (@arg ($arg:expr) $modes:tt #{$n:expr, $m:expr} $($tail:tt)*) => { + clap_app!{ @arg ($arg) $modes min_values($n) max_values($m) $($tail)* } + }; + (@arg ($arg:expr) $modes:tt * $($tail:tt)*) => { + clap_app!{ @arg ($arg) $modes +required $($tail)* } + }; +// !foo -> .foo(false) + (@arg ($arg:expr) $modes:tt !$ident:ident $($tail:tt)*) => { + clap_app!{ @arg ($arg.$ident(false)) $modes $($tail)* } + }; +// +foo -> .foo(true) + (@arg ($arg:expr) $modes:tt +$ident:ident $($tail:tt)*) => { + clap_app!{ @arg ($arg.$ident(true)) $modes $($tail)* } + }; +// Validator + (@arg ($arg:expr) $modes:tt {$fn_:expr} $($tail:tt)*) => { + clap_app!{ @arg ($arg.validator($fn_)) $modes $($tail)* } + }; + (@as_expr $expr:expr) => { $expr }; +// Help + (@arg ($arg:expr) $modes:tt $desc:tt) => { $arg.help(clap_app!{ @as_expr $desc }) }; +// Handle functions that need to be called multiple times for each argument + (@arg ($arg:expr) $modes:tt $ident:ident[$($target:ident)*] $($tail:tt)*) => { + clap_app!{ @arg ($arg $( .$ident(stringify!($target)) )*) $modes $($tail)* } + }; +// Inherit builder's functions + (@arg ($arg:expr) $modes:tt $ident:ident($($expr:expr)*) $($tail:tt)*) => { + clap_app!{ @arg ($arg.$ident($($expr)*)) $modes $($tail)* } + }; + +// Build a subcommand outside of an app. + (@subcommand $name:ident => $($tail:tt)*) => { + clap_app!{ @app ($crate::SubCommand::with_name(stringify!($name))) $($tail)* } + }; +// Start the magic + (($name:expr) => $($tail:tt)*) => {{ + clap_app!{ @app ($crate::App::new($name)) $($tail)*} + }}; + + ($name:ident => $($tail:tt)*) => {{ + clap_app!{ @app ($crate::App::new(stringify!($name))) $($tail)*} + }}; +} + +macro_rules! impl_settings { + ($n:ident, $($v:ident => $c:ident),+) => { + pub fn set(&mut self, s: $n) { + match s { + $($n::$v => self.0.insert($c)),+ + } + } + + pub fn unset(&mut self, s: $n) { + match s { + $($n::$v => self.0.remove($c)),+ + } + } + + pub fn is_set(&self, s: $n) -> bool { + match s { + $($n::$v => self.0.contains($c)),+ + } + } + }; +} + +// Convenience for writing to stderr thanks to https://github.com/BurntSushi +macro_rules! wlnerr( + ($($arg:tt)*) => ({ + use std::io::{Write, stderr}; + writeln!(&mut stderr(), $($arg)*).ok(); + }) +); + +#[cfg(feature = "debug")] +#[cfg_attr(feature = "debug", macro_use)] +mod debug_macros { + macro_rules! debugln { + ($fmt:expr) => (println!(concat!("DEBUG:clap:", $fmt))); + ($fmt:expr, $($arg:tt)*) => (println!(concat!("DEBUG:clap:",$fmt), $($arg)*)); + } + macro_rules! sdebugln { + ($fmt:expr) => (println!($fmt)); + ($fmt:expr, $($arg:tt)*) => (println!($fmt, $($arg)*)); + } + macro_rules! debug { + ($fmt:expr) => (print!(concat!("DEBUG:clap:", $fmt))); + ($fmt:expr, $($arg:tt)*) => (print!(concat!("DEBUG:clap:",$fmt), $($arg)*)); + } + macro_rules! sdebug { + ($fmt:expr) => (print!($fmt)); + ($fmt:expr, $($arg:tt)*) => (print!($fmt, $($arg)*)); + } +} + +#[cfg(not(feature = "debug"))] +#[cfg_attr(not(feature = "debug"), macro_use)] +mod debug_macros { + macro_rules! debugln { + ($fmt:expr) => (); + ($fmt:expr, $($arg:tt)*) => (); + } + macro_rules! sdebugln { + ($fmt:expr) => (); + ($fmt:expr, $($arg:tt)*) => (); + } + macro_rules! debug { + ($fmt:expr) => (); + ($fmt:expr, $($arg:tt)*) => (); + } +} + +// Helper/deduplication macro for printing the correct number of spaces in help messages +// used in: +// src/args/arg_builder/*.rs +// src/app/mod.rs +macro_rules! write_nspaces { + ($dst:expr, $num:expr) => ({ + debugln!("write_spaces!: num={}", $num); + for _ in 0..$num { + $dst.write_all(b" ")?; + } + }) +} + +// convenience macro for remove an item from a vec +macro_rules! vec_remove_all { + ($vec:expr, $to_rem:expr) => { + debugln!("vec_remove_all! to_rem={:?}", $to_rem); + for i in (0 .. $vec.len()).rev() { + let should_remove = $to_rem.any(|name| name == &$vec[i]); + if should_remove { $vec.swap_remove(i); } + } + }; +} +macro_rules! find_from { + ($_self:expr, $arg_name:expr, $from:ident, $matcher:expr) => {{ + let mut ret = None; + for k in $matcher.arg_names() { + if let Some(f) = find_by_name!($_self, k, flags, iter) { + if let Some(ref v) = f.$from() { + if v.contains($arg_name) { + ret = Some(f.to_string()); + } + } + } + if let Some(o) = find_by_name!($_self, k, opts, iter) { + if let Some(ref v) = o.$from() { + if v.contains(&$arg_name) { + ret = Some(o.to_string()); + } + } + } + if let Some(pos) = find_by_name!($_self, k, positionals, values) { + if let Some(ref v) = pos.$from() { + if v.contains($arg_name) { + ret = Some(pos.b.name.to_owned()); + } + } + } + } + ret + }}; +} + +macro_rules! find_name_from { + ($_self:expr, $arg_name:expr, $from:ident, $matcher:expr) => {{ + let mut ret = None; + for k in $matcher.arg_names() { + if let Some(f) = find_by_name!($_self, k, flags, iter) { + if let Some(ref v) = f.$from() { + if v.contains($arg_name) { + ret = Some(f.b.name); + } + } + } + if let Some(o) = find_by_name!($_self, k, opts, iter) { + if let Some(ref v) = o.$from() { + if v.contains(&$arg_name) { + ret = Some(o.b.name); + } + } + } + if let Some(pos) = find_by_name!($_self, k, positionals, values) { + if let Some(ref v) = pos.$from() { + if v.contains($arg_name) { + ret = Some(pos.b.name); + } + } + } + } + ret + }}; +} + +// Finds an arg by name +macro_rules! find_by_name { + ($p:expr, $name:expr, $what:ident, $how:ident) => { + $p.$what.$how().find(|o| o.b.name == $name) + } +} + +// Finds an option including if it's aliasesed +macro_rules! find_opt_by_long { + (@os $_self:ident, $long:expr) => {{ + _find_by_long!($_self, $long, opts) + }}; + ($_self:ident, $long:expr) => {{ + _find_by_long!($_self, $long, opts) + }}; +} + +macro_rules! find_flag_by_long { + (@os $_self:ident, $long:expr) => {{ + _find_by_long!($_self, $long, flags) + }}; + ($_self:ident, $long:expr) => {{ + _find_by_long!($_self, $long, flags) + }}; +} + +macro_rules! _find_by_long { + ($_self:ident, $long:expr, $what:ident) => {{ + $_self.$what + .iter() + .filter(|a| a.s.long.is_some()) + .find(|a| { + a.s.long.unwrap() == $long || + (a.s.aliases.is_some() && + a.s + .aliases + .as_ref() + .unwrap() + .iter() + .any(|&(alias, _)| alias == $long)) + }) + }} +} + +// Finds an option +macro_rules! find_opt_by_short { + ($_self:ident, $short:expr) => {{ + _find_by_short!($_self, $short, opts) + }} +} + +macro_rules! find_flag_by_short { + ($_self:ident, $short:expr) => {{ + _find_by_short!($_self, $short, flags) + }} +} + +macro_rules! _find_by_short { + ($_self:ident, $short:expr, $what:ident) => {{ + $_self.$what + .iter() + .filter(|a| a.s.short.is_some()) + .find(|a| a.s.short.unwrap() == $short) + }} +} + +macro_rules! find_subcmd { + ($_self:expr, $sc:expr) => {{ + $_self.subcommands + .iter() + .find(|s| { + &*s.p.meta.name == $sc || + (s.p.meta.aliases.is_some() && + s.p + .meta + .aliases + .as_ref() + .unwrap() + .iter() + .any(|&(n, _)| n == $sc)) + }) + }}; +} + +macro_rules! shorts { + ($_self:ident) => {{ + _shorts_longs!($_self, short) + }}; +} + + +macro_rules! longs { + ($_self:ident) => {{ + _shorts_longs!($_self, long) + }}; +} + +macro_rules! _shorts_longs { + ($_self:ident, $what:ident) => {{ + $_self.flags + .iter() + .filter(|f| f.s.$what.is_some()) + .map(|f| f.s.$what.as_ref().unwrap()) + .chain($_self.opts.iter() + .filter(|o| o.s.$what.is_some()) + .map(|o| o.s.$what.as_ref().unwrap())) + }}; +} + +macro_rules! arg_names { + ($_self:ident) => {{ + _names!(@args $_self) + }}; +} + +macro_rules! sc_names { + ($_self:ident) => {{ + _names!(@sc $_self) + }}; +} + +macro_rules! _names { + (@args $_self:ident) => {{ + $_self.flags + .iter() + .map(|f| &*f.b.name) + .chain($_self.opts.iter() + .map(|o| &*o.b.name) + .chain($_self.positionals.values() + .map(|p| &*p.b.name))) + }}; + (@sc $_self:ident) => {{ + $_self.subcommands + .iter() + .map(|s| &*s.p.meta.name) + .chain($_self.subcommands + .iter() + .filter(|s| s.p.meta.aliases.is_some()) + .flat_map(|s| s.p.meta.aliases.as_ref().unwrap().iter().map(|&(n, _)| n))) + + }} +} diff --git a/vendor/registry-40351f815f426200/clap/src/map.rs b/vendor/registry-40351f815f426200/clap/src/map.rs new file mode 100644 index 000000000..12385db4c --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/map.rs @@ -0,0 +1,84 @@ +#[cfg(feature = "vec_map")] +pub use vec_map::{VecMap, Values}; + +#[cfg(not(feature = "vec_map"))] +pub use self::vec_map::{VecMap, Values}; + +#[cfg(not(feature = "vec_map"))] +mod vec_map { + use std::collections::BTreeMap; + use std::collections::btree_map; + use std::fmt::{self, Debug, Formatter}; + + #[derive(Clone, Default, Debug)] + pub struct VecMap { + inner: BTreeMap, + } + + impl VecMap { + pub fn new() -> Self { + VecMap { inner: Default::default() } + } + + pub fn len(&self) -> usize { + self.inner.len() + } + + pub fn is_empty(&self) -> bool { + self.inner.is_empty() + } + + pub fn insert(&mut self, key: usize, value: V) -> Option { + self.inner.insert(key, value) + } + + pub fn values(&self) -> Values { + self.inner.values() + } + + pub fn iter(&self) -> Iter { + Iter { inner: self.inner.iter() } + } + + pub fn contains_key(&self, key: usize) -> bool { + self.inner.contains_key(&key) + } + + pub fn entry(&mut self, key: usize) -> Entry { + self.inner.entry(key) + } + + pub fn get(&self, key: usize) -> Option<&V> { + self.inner.get(&key) + } + } + + pub type Values<'a, V> = btree_map::Values<'a, usize, V>; + + pub type Entry<'a, V> = btree_map::Entry<'a, usize, V>; + + #[derive(Clone)] + pub struct Iter<'a, V: 'a> { + inner: btree_map::Iter<'a, usize, V>, + } + + impl<'a, V: 'a + Debug> Debug for Iter<'a, V> { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + f.debug_list().entries(self.inner.clone()).finish() + } + } + + impl<'a, V: 'a> Iterator for Iter<'a, V> { + type Item = (usize, &'a V); + + fn next(&mut self) -> Option { + self.inner.next().map(|(k, v)| (*k, v)) + } + } + + impl<'a, V: 'a> DoubleEndedIterator for Iter<'a, V> { + fn next_back(&mut self) -> Option { + self.inner.next_back().map(|(k, v)| (*k, v)) + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/osstringext.rs b/vendor/registry-40351f815f426200/clap/src/osstringext.rs new file mode 100644 index 000000000..303cbcbef --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/osstringext.rs @@ -0,0 +1,135 @@ +#[cfg(target_os = "windows")] +use INVALID_UTF8; +use std::ffi::OsStr; +#[cfg(not(target_os = "windows"))] +use std::os::unix::ffi::OsStrExt; + +#[cfg(target_os = "windows")] +pub trait OsStrExt3 { + fn from_bytes(b: &[u8]) -> &Self; + fn as_bytes(&self) -> &[u8]; +} + +#[doc(hidden)] +pub trait OsStrExt2 { + fn starts_with(&self, s: &[u8]) -> bool; + fn split_at_byte(&self, b: u8) -> (&OsStr, &OsStr); + fn split_at(&self, i: usize) -> (&OsStr, &OsStr); + fn trim_left_matches(&self, b: u8) -> &OsStr; + fn len_(&self) -> usize; + fn contains_byte(&self, b: u8) -> bool; + fn is_empty_(&self) -> bool; + fn split(&self, b: u8) -> OsSplit; +} + +#[cfg(target_os = "windows")] +impl OsStrExt3 for OsStr { + fn from_bytes(b: &[u8]) -> &Self { + use std::mem; + unsafe { mem::transmute(b) } + } + fn as_bytes(&self) -> &[u8] { self.to_str().map(|s| s.as_bytes()).expect(INVALID_UTF8) } +} + +impl OsStrExt2 for OsStr { + fn starts_with(&self, s: &[u8]) -> bool { self.as_bytes().starts_with(s) } + + fn is_empty_(&self) -> bool { self.as_bytes().is_empty() } + + fn contains_byte(&self, byte: u8) -> bool { + for b in self.as_bytes() { + if b == &byte { + return true; + } + } + false + } + + fn split_at_byte(&self, byte: u8) -> (&OsStr, &OsStr) { + for (i, b) in self.as_bytes().iter().enumerate() { + if b == &byte { + return (OsStr::from_bytes(&self.as_bytes()[..i]), + OsStr::from_bytes(&self.as_bytes()[i + 1..])); + } + } + (&*self, OsStr::from_bytes(&self.as_bytes()[self.len_()..self.len_()])) + } + + fn trim_left_matches(&self, byte: u8) -> &OsStr { + for (i, b) in self.as_bytes().iter().enumerate() { + if b != &byte { + return OsStr::from_bytes(&self.as_bytes()[i..]); + } + } + &*self + } + + fn split_at(&self, i: usize) -> (&OsStr, &OsStr) { + (OsStr::from_bytes(&self.as_bytes()[..i]), OsStr::from_bytes(&self.as_bytes()[i..])) + } + + fn len_(&self) -> usize { self.as_bytes().len() } + + fn split(&self, b: u8) -> OsSplit { + OsSplit { + sep: b, + val: self.as_bytes(), + pos: 0, + } + } +} + +#[doc(hidden)] +#[derive(Clone, Debug)] +pub struct OsSplit<'a> { + sep: u8, + val: &'a [u8], + pos: usize, +} + +impl<'a> Iterator for OsSplit<'a> { + type Item = &'a OsStr; + + fn next(&mut self) -> Option<&'a OsStr> { + debugln!("OsSplit::next: self={:?}", self); + if self.pos == self.val.len() { + return None; + } + let start = self.pos; + for b in &self.val[start..] { + self.pos += 1; + if *b == self.sep { + return Some(OsStr::from_bytes(&self.val[start..self.pos - 1])); + } + } + Some(OsStr::from_bytes(&self.val[start..])) + } + fn size_hint(&self) -> (usize, Option) { + let mut count = 0; + for b in &self.val[self.pos..] { + if *b == self.sep { + count += 1; + } + } + if count > 0 { + return (count, Some(count)); + } + (0, None) + } +} + +impl<'a> DoubleEndedIterator for OsSplit<'a> { + fn next_back(&mut self) -> Option<&'a OsStr> { + if self.pos == 0 { + return None; + } + let start = self.pos; + for b in self.val[..self.pos].iter().rev() { + self.pos -= 1; + if *b == self.sep { + return Some(OsStr::from_bytes(&self.val[self.pos + 1..start])); + } + } + Some(OsStr::from_bytes(&self.val[..start])) + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/strext.rs b/vendor/registry-40351f815f426200/clap/src/strext.rs new file mode 100644 index 000000000..6f81367ab --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/strext.rs @@ -0,0 +1,16 @@ +pub trait _StrExt { + fn _is_char_boundary(&self, index: usize) -> bool; +} + +impl _StrExt for str { + #[inline] + fn _is_char_boundary(&self, index: usize) -> bool { + if index == self.len() { + return true; + } + match self.as_bytes().get(index) { + None => false, + Some(&b) => b < 128 || b >= 192, + } + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/suggestions.rs b/vendor/registry-40351f815f426200/clap/src/suggestions.rs new file mode 100644 index 000000000..7143c0b34 --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/suggestions.rs @@ -0,0 +1,116 @@ +use app::App; +// Third Party +#[cfg(feature = "suggestions")] +use strsim; + +// Internal +use fmt::Format; + +/// Produces a string from a given list of possible values which is similar to +/// the passed in value `v` with a certain confidence. +/// Thus in a list of possible values like ["foo", "bar"], the value "fop" will yield +/// `Some("foo")`, whereas "blark" would yield `None`. +#[cfg(feature = "suggestions")] +#[cfg_attr(feature = "lints", allow(needless_lifetimes))] +pub fn did_you_mean<'a, T: ?Sized, I>(v: &str, possible_values: I) -> Option<&'a str> + where T: AsRef + 'a, + I: IntoIterator +{ + + let mut candidate: Option<(f64, &str)> = None; + for pv in possible_values { + let confidence = strsim::jaro_winkler(v, pv.as_ref()); + if confidence > 0.8 && + (candidate.is_none() || (candidate.as_ref().unwrap().0 < confidence)) { + candidate = Some((confidence, pv.as_ref())); + } + } + match candidate { + None => None, + Some((_, candidate)) => Some(candidate), + } +} + +#[cfg(not(feature = "suggestions"))] +pub fn did_you_mean<'a, T: ?Sized, I>(_: &str, _: I) -> Option<&'a str> + where T: AsRef + 'a, + I: IntoIterator +{ + None +} + +/// Returns a suffix that can be empty, or is the standard 'did you mean' phrase +#[cfg_attr(feature = "lints", allow(needless_lifetimes))] +pub fn did_you_mean_flag_suffix<'z, T, I>(arg: &str, longs: I, subcommands: &'z [App]) + -> (String, Option<&'z str>) + where T: AsRef + 'z, + I: IntoIterator +{ + match did_you_mean(arg, longs) { + Some(candidate) => { + let suffix = format!("\n\tDid you mean {}{}?", Format::Good("--"), Format::Good(candidate)); + return (suffix, Some(candidate)) + } + None => { + for subcommand in subcommands { + let opts = subcommand.p.flags.iter().filter_map(|f| f.s.long).chain( + subcommand.p.opts.iter().filter_map(|o| o.s.long)); + + if let Some(candidate) = did_you_mean(arg, opts) { + let suffix = format!( + "\n\tDid you mean to put '{}{}' after the subcommand '{}'?", + Format::Good("--"), + Format::Good(candidate), + Format::Good(subcommand.get_name())); + return (suffix, Some(candidate)); + } + } + } + } + (String::new(), None) +} + +/// Returns a suffix that can be empty, or is the standard 'did you mean' phrase +pub fn did_you_mean_value_suffix<'z, T, I>(arg: &str, values: I) -> (String, Option<&'z str>) + where T: AsRef + 'z, + I: IntoIterator +{ + match did_you_mean(arg, values) { + Some(candidate) => { + let suffix = format!("\n\tDid you mean '{}'?", Format::Good(candidate)); + (suffix, Some(candidate)) + } + None => (String::new(), None), + } +} + +#[cfg(all(test, features = "suggestions"))] +mod test { + use super::*; + + #[test] + fn possible_values_match() { + let p_vals = ["test", "possible", "values"]; + assert_eq!(did_you_mean("tst", p_vals.iter()), Some("test")); + } + + #[test] + fn possible_values_nomatch() { + let p_vals = ["test", "possible", "values"]; + assert!(did_you_mean("hahaahahah", p_vals.iter()).is_none()); + } + + #[test] + fn suffix_long() { + let p_vals = ["test", "possible", "values"]; + let suffix = "\n\tDid you mean \'--test\'?"; + assert_eq!(did_you_mean_flag_suffix("tst", p_vals.iter(), []), (suffix, Some("test"))); + } + + #[test] + fn suffix_enum() { + let p_vals = ["test", "possible", "values"]; + let suffix = "\n\tDid you mean \'test\'?"; + assert_eq!(did_you_mean_value_suffix("tst", p_vals.iter()), (suffix, Some("test"))); + } +} diff --git a/vendor/registry-40351f815f426200/clap/src/usage_parser.rs b/vendor/registry-40351f815f426200/clap/src/usage_parser.rs new file mode 100644 index 000000000..2593ae7fa --- /dev/null +++ b/vendor/registry-40351f815f426200/clap/src/usage_parser.rs @@ -0,0 +1,1198 @@ + +// Internal +use INTERNAL_ERROR_MSG; +use args::Arg; +use args::settings::ArgSettings; +use map::VecMap; + +#[derive(PartialEq, Debug)] +enum UsageToken { + Name, + ValName, + Short, + Long, + Help, + Multiple, + Unknown, +} + +#[doc(hidden)] +#[derive(Debug)] +pub struct UsageParser<'a> { + usage: &'a str, + pos: usize, + start: usize, + prev: UsageToken, + explicit_name_set: bool, +} + +impl<'a> UsageParser<'a> { + fn new(usage: &'a str) -> Self { + debugln!("UsageParser::new: usage={:?}", usage); + UsageParser { + usage: usage, + pos: 0, + start: 0, + prev: UsageToken::Unknown, + explicit_name_set: false, + } + } + + pub fn from_usage(usage: &'a str) -> Self { + debugln!("UsageParser::from_usage;"); + UsageParser::new(usage) + } + + pub fn parse(mut self) -> Arg<'a, 'a> { + debugln!("UsageParser::parse;"); + let mut arg = Arg::default(); + loop { + debugln!("UsageParser::parse:iter: pos={};", self.pos); + self.stop_at(token); + if let Some(&c) = self.usage.as_bytes().get(self.pos) { + match c { + b'-' => self.short_or_long(&mut arg), + b'.' => self.multiple(&mut arg), + b'\'' => self.help(&mut arg), + _ => self.name(&mut arg), + } + } else { + break; + } + } + debug_assert!(!arg.b.name.is_empty(), + format!("No name found for Arg when parsing usage string: {}", + self.usage)); + arg.v.num_vals = match arg.v.val_names { + Some(ref v) if v.len() >= 2 => Some(v.len() as u64), + _ => None, + }; + debugln!("UsageParser::parse: vals...{:?}", arg.v.val_names); + arg + } + + fn name(&mut self, arg: &mut Arg<'a, 'a>) { + debugln!("UsageParser::name;"); + if *self.usage.as_bytes().get(self.pos).expect(INTERNAL_ERROR_MSG) == b'<' && + !self.explicit_name_set { + arg.setb(ArgSettings::Required); + } + self.pos += 1; + self.stop_at(name_end); + let name = &self.usage[self.start..self.pos]; + if self.prev == UsageToken::Unknown { + debugln!("UsageParser::name: setting name...{}", name); + arg.b.name = name; + if arg.s.long.is_none() && arg.s.short.is_none() { + debugln!("UsageParser::name: explicit name set..."); + self.explicit_name_set = true; + self.prev = UsageToken::Name; + } + } else { + debugln!("UsageParser::name: setting val name...{}", name); + if let Some(ref mut v) = arg.v.val_names { + let len = v.len(); + v.insert(len, name); + } else { + let mut v = VecMap::new(); + v.insert(0, name); + arg.v.val_names = Some(v); + arg.setb(ArgSettings::TakesValue); + } + self.prev = UsageToken::ValName; + } + } + + fn stop_at(&mut self, f: F) + where F: Fn(u8) -> bool + { + debugln!("UsageParser::stop_at;"); + self.start = self.pos; + self.pos += self.usage[self.start..].bytes().take_while(|&b| f(b)).count(); + } + + fn short_or_long(&mut self, arg: &mut Arg<'a, 'a>) { + debugln!("UsageParser::short_or_long;"); + self.pos += 1; + if *self.usage.as_bytes().get(self.pos).expect(INTERNAL_ERROR_MSG) == b'-' { + self.pos += 1; + self.long(arg); + return; + } + self.short(arg) + } + + fn long(&mut self, arg: &mut Arg<'a, 'a>) { + debugln!("UsageParser::long;"); + self.stop_at(long_end); + let name = &self.usage[self.start..self.pos]; + if !self.explicit_name_set { + debugln!("UsageParser::long: setting name...{}", name); + arg.b.name = name; + } + debugln!("UsageParser::long: setting long...{}", name); + arg.s.long = Some(name); + self.prev = UsageToken::Long; + } + + fn short(&mut self, arg: &mut Arg<'a, 'a>) { + debugln!("UsageParser::short;"); + let start = &self.usage[self.pos..]; + let short = start.chars().nth(0).expect(INTERNAL_ERROR_MSG); + debugln!("UsageParser::short: setting short...{}", short); + arg.s.short = Some(short); + if arg.b.name.is_empty() { + // --long takes precedence but doesn't set self.explicit_name_set + let name = &start[..short.len_utf8()]; + debugln!("UsageParser::short: setting name...{}", name); + arg.b.name = name; + } + self.prev = UsageToken::Short; + } + + // "something..." + fn multiple(&mut self, arg: &mut Arg) { + debugln!("UsageParser::multiple;"); + let mut dot_counter = 1; + let start = self.pos; + let mut bytes = self.usage[start..].bytes(); + while bytes.next() == Some(b'.') { + dot_counter += 1; + self.pos += 1; + if dot_counter == 3 { + debugln!("UsageParser::multiple: setting multiple"); + arg.setb(ArgSettings::Multiple); + if arg.is_set(ArgSettings::TakesValue) { + arg.setb(ArgSettings::UseValueDelimiter); + arg.unsetb(ArgSettings::ValueDelimiterNotSet); + if arg.v.val_delim.is_none() { + arg.v.val_delim = Some(','); + } + } + self.prev = UsageToken::Multiple; + self.pos += 1; + break; + } + } + } + + fn help(&mut self, arg: &mut Arg<'a, 'a>) { + debugln!("UsageParser::help;"); + self.stop_at(help_start); + self.start = self.pos + 1; + self.pos = self.usage.len() - 1; + debugln!("UsageParser::help: setting help...{}", &self.usage[self.start..self.pos]); + arg.b.help = Some(&self.usage[self.start..self.pos]); + self.pos += 1; // Move to next byte to keep from thinking ending ' is a start + self.prev = UsageToken::Help; + } +} + +#[inline] +fn name_end(b: u8) -> bool { b != b']' && b != b'>' } + +#[inline] +fn token(b: u8) -> bool { b != b'\'' && b != b'.' && b != b'<' && b != b'[' && b != b'-' } + +#[inline] +fn long_end(b: u8) -> bool { + b != b'\'' && b != b'.' && b != b'<' && b != b'[' && b != b'=' && b != b' ' +} + +#[inline] +fn help_start(b: u8) -> bool { b != b'\'' } + +#[cfg(test)] +mod test { + use args::Arg; + use args::ArgSettings; + + #[test] + fn create_flag_usage() { + let a = Arg::from_usage("[flag] -f 'some help info'"); + assert_eq!(a.b.name, "flag"); + assert_eq!(a.s.short.unwrap(), 'f'); + assert!(a.s.long.is_none()); + assert_eq!(a.b.help.unwrap(), "some help info"); + assert!(!a.is_set(ArgSettings::Multiple)); + assert!(a.v.val_names.is_none()); + assert!(a.v.num_vals.is_none()); + + let b = Arg::from_usage("[flag] --flag 'some help info'"); + assert_eq!(b.b.name, "flag"); + assert_eq!(b.s.long.unwrap(), "flag"); + assert!(b.s.short.is_none()); + assert_eq!(b.b.help.unwrap(), "some help info"); + assert!(!b.is_set(ArgSettings::Multiple)); + assert!(a.v.val_names.is_none()); + assert!(a.v.num_vals.is_none()); + + let b = Arg::from_usage("--flag 'some help info'"); + assert_eq!(b.b.name, "flag"); + assert_eq!(b.s.long.unwrap(), "flag"); + assert!(b.s.short.is_none()); + assert_eq!(b.b.help.unwrap(), "some help info"); + assert!(!b.is_set(ArgSettings::Multiple)); + assert!(b.v.val_names.is_none()); + assert!(b.v.num_vals.is_none()); + + let c = Arg::from_usage("[flag] -f --flag 'some help info'"); + assert_eq!(c.b.name, "flag"); + assert_eq!(c.s.short.unwrap(), 'f'); + assert_eq!(c.s.long.unwrap(), "flag"); + assert_eq!(c.b.help.unwrap(), "some help info"); + assert!(!c.is_set(ArgSettings::Multiple)); + assert!(c.v.val_names.is_none()); + assert!(c.v.num_vals.is_none()); + + let d = Arg::from_usage("[flag] -f... 'some help info'"); + assert_eq!(d.b.name, "flag"); + assert_eq!(d.s.short.unwrap(), 'f'); + assert!(d.s.long.is_none()); + assert_eq!(d.b.help.unwrap(), "some help info"); + assert!(d.is_set(ArgSettings::Multiple)); + assert!(d.v.val_names.is_none()); + assert!(d.v.num_vals.is_none()); + + let e = Arg::from_usage("[flag] -f --flag... 'some help info'"); + assert_eq!(e.b.name, "flag"); + assert_eq!(e.s.long.unwrap(), "flag"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert_eq!(e.b.help.unwrap(), "some help info"); + assert!(e.is_set(ArgSettings::Multiple)); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("-f --flag... 'some help info'"); + assert_eq!(e.b.name, "flag"); + assert_eq!(e.s.long.unwrap(), "flag"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert_eq!(e.b.help.unwrap(), "some help info"); + assert!(e.is_set(ArgSettings::Multiple)); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("--flags"); + assert_eq!(e.b.name, "flags"); + assert_eq!(e.s.long.unwrap(), "flags"); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("--flags..."); + assert_eq!(e.b.name, "flags"); + assert_eq!(e.s.long.unwrap(), "flags"); + assert!(e.is_set(ArgSettings::Multiple)); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("[flags] -f"); + assert_eq!(e.b.name, "flags"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("[flags] -f..."); + assert_eq!(e.b.name, "flags"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert!(e.is_set(ArgSettings::Multiple)); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let a = Arg::from_usage("-f 'some help info'"); + assert_eq!(a.b.name, "f"); + assert_eq!(a.s.short.unwrap(), 'f'); + assert!(a.s.long.is_none()); + assert_eq!(a.b.help.unwrap(), "some help info"); + assert!(!a.is_set(ArgSettings::Multiple)); + assert!(a.v.val_names.is_none()); + assert!(a.v.num_vals.is_none()); + + let e = Arg::from_usage("-f"); + assert_eq!(e.b.name, "f"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + + let e = Arg::from_usage("-f..."); + assert_eq!(e.b.name, "f"); + assert_eq!(e.s.short.unwrap(), 'f'); + assert!(e.is_set(ArgSettings::Multiple)); + assert!(e.v.val_names.is_none()); + assert!(e.v.num_vals.is_none()); + } + + #[test] + fn create_option_usage0() { + // Short only + let a = Arg::from_usage("[option] -o [opt] 'some help info'"); + assert_eq!(a.b.name, "option"); + assert_eq!(a.s.short.unwrap(), 'o'); + assert!(a.s.long.is_none()); + assert_eq!(a.b.help.unwrap(), "some help info"); + assert!(!a.is_set(ArgSettings::Multiple)); + assert!(a.is_set(ArgSettings::TakesValue)); + assert!(!a.is_set(ArgSettings::Required)); + assert_eq!(a.v.val_names.unwrap().values().collect::>(), [&"opt"]); + assert!(a.v.num_vals.is_none()); + } + + #[test] + fn create_option_usage1() { + let b = Arg::from_usage("-o [opt] 'some help info'"); + assert_eq!(b.b.name, "o"); + assert_eq!(b.s.short.unwrap(), 'o'); + assert!(b.s.long.is_none()); + assert_eq!(b.b.help.unwrap(), "some help info"); + assert!(!b.is_set(ArgSettings::Multiple)); + assert!(b.is_set(ArgSettings::TakesValue)); + assert!(!b.is_set(ArgSettings::Required)); + assert_eq!(b.v.val_names.unwrap().values().collect::>(), [&"opt"]); + assert!(b.v.num_vals.is_none()); + } + + #[test] + fn create_option_usage2() { + let c = Arg::from_usage("(self, value: A) -> Result + where + A: EnumAccess<'de>, + { + let (level, variant) = value.variant_seed(LevelIdentifier)?; + // Every variant is a unit variant. + variant.unit_variant()?; + Ok(level) + } + } + + deserializer.deserialize_enum("Level", &LOG_LEVEL_NAMES[1..], LevelEnum) + } +} + +impl Serialize for LevelFilter { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + LevelFilter::Off => serializer.serialize_unit_variant("LevelFilter", 0, "OFF"), + LevelFilter::Error => serializer.serialize_unit_variant("LevelFilter", 1, "ERROR"), + LevelFilter::Warn => serializer.serialize_unit_variant("LevelFilter", 2, "WARN"), + LevelFilter::Info => serializer.serialize_unit_variant("LevelFilter", 3, "INFO"), + LevelFilter::Debug => serializer.serialize_unit_variant("LevelFilter", 4, "DEBUG"), + LevelFilter::Trace => serializer.serialize_unit_variant("LevelFilter", 5, "TRACE"), + } + } +} + +impl<'de> Deserialize<'de> for LevelFilter { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LevelFilterIdentifier; + + impl<'de> Visitor<'de> for LevelFilterIdentifier { + type Value = LevelFilter; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("log level filter") + } + + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + // Case insensitive. + FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES)) + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + let variant = str::from_utf8(value) + .map_err(|_| Error::invalid_value(Unexpected::Bytes(value), &self))?; + + self.visit_str(variant) + } + } + + impl<'de> DeserializeSeed<'de> for LevelFilterIdentifier { + type Value = LevelFilter; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_identifier(LevelFilterIdentifier) + } + } + + struct LevelFilterEnum; + + impl<'de> Visitor<'de> for LevelFilterEnum { + type Value = LevelFilter; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("log level filter") + } + + fn visit_enum(self, value: A) -> Result + where + A: EnumAccess<'de>, + { + let (level_filter, variant) = value.variant_seed(LevelFilterIdentifier)?; + // Every variant is a unit variant. + variant.unit_variant()?; + Ok(level_filter) + } + } + + deserializer.deserialize_enum("LevelFilter", &LOG_LEVEL_NAMES, LevelFilterEnum) + } +} + +#[cfg(test)] +mod tests { + extern crate serde_test; + use self::serde_test::{assert_de_tokens, assert_de_tokens_error, assert_tokens, Token}; + + use {Level, LevelFilter}; + + fn level_token(variant: &'static str) -> Token { + Token::UnitVariant { + name: "Level", + variant: variant, + } + } + + fn level_bytes_tokens(variant: &'static [u8]) -> [Token; 3] { + [ + Token::Enum { name: "Level" }, + Token::Bytes(variant), + Token::Unit, + ] + } + + fn level_filter_token(variant: &'static str) -> Token { + Token::UnitVariant { + name: "LevelFilter", + variant: variant, + } + } + + fn level_filter_bytes_tokens(variant: &'static [u8]) -> [Token; 3] { + [ + Token::Enum { + name: "LevelFilter", + }, + Token::Bytes(variant), + Token::Unit, + ] + } + + #[test] + fn test_level_ser_de() { + let cases = [ + (Level::Error, [level_token("ERROR")]), + (Level::Warn, [level_token("WARN")]), + (Level::Info, [level_token("INFO")]), + (Level::Debug, [level_token("DEBUG")]), + (Level::Trace, [level_token("TRACE")]), + ]; + + for &(s, expected) in &cases { + assert_tokens(&s, &expected); + } + } + + #[test] + fn test_level_case_insensitive() { + let cases = [ + (Level::Error, [level_token("error")]), + (Level::Warn, [level_token("warn")]), + (Level::Info, [level_token("info")]), + (Level::Debug, [level_token("debug")]), + (Level::Trace, [level_token("trace")]), + ]; + + for &(s, expected) in &cases { + assert_de_tokens(&s, &expected); + } + } + + #[test] + fn test_level_de_bytes() { + let cases = [ + (Level::Error, level_bytes_tokens(b"ERROR")), + (Level::Warn, level_bytes_tokens(b"WARN")), + (Level::Info, level_bytes_tokens(b"INFO")), + (Level::Debug, level_bytes_tokens(b"DEBUG")), + (Level::Trace, level_bytes_tokens(b"TRACE")), + ]; + + for &(value, tokens) in &cases { + assert_de_tokens(&value, &tokens); + } + } + + #[test] + fn test_level_de_error() { + let msg = "unknown variant `errorx`, expected one of \ + `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`"; + assert_de_tokens_error::(&[level_token("errorx")], msg); + } + + #[test] + fn test_level_filter_ser_de() { + let cases = [ + (LevelFilter::Off, [level_filter_token("OFF")]), + (LevelFilter::Error, [level_filter_token("ERROR")]), + (LevelFilter::Warn, [level_filter_token("WARN")]), + (LevelFilter::Info, [level_filter_token("INFO")]), + (LevelFilter::Debug, [level_filter_token("DEBUG")]), + (LevelFilter::Trace, [level_filter_token("TRACE")]), + ]; + + for &(s, expected) in &cases { + assert_tokens(&s, &expected); + } + } + + #[test] + fn test_level_filter_case_insensitive() { + let cases = [ + (LevelFilter::Off, [level_filter_token("off")]), + (LevelFilter::Error, [level_filter_token("error")]), + (LevelFilter::Warn, [level_filter_token("warn")]), + (LevelFilter::Info, [level_filter_token("info")]), + (LevelFilter::Debug, [level_filter_token("debug")]), + (LevelFilter::Trace, [level_filter_token("trace")]), + ]; + + for &(s, expected) in &cases { + assert_de_tokens(&s, &expected); + } + } + + #[test] + fn test_level_filter_de_bytes() { + let cases = [ + (LevelFilter::Off, level_filter_bytes_tokens(b"OFF")), + (LevelFilter::Error, level_filter_bytes_tokens(b"ERROR")), + (LevelFilter::Warn, level_filter_bytes_tokens(b"WARN")), + (LevelFilter::Info, level_filter_bytes_tokens(b"INFO")), + (LevelFilter::Debug, level_filter_bytes_tokens(b"DEBUG")), + (LevelFilter::Trace, level_filter_bytes_tokens(b"TRACE")), + ]; + + for &(value, tokens) in &cases { + assert_de_tokens(&value, &tokens); + } + } + + #[test] + fn test_level_filter_de_error() { + let msg = "unknown variant `errorx`, expected one of \ + `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`"; + assert_de_tokens_error::(&[level_filter_token("errorx")], msg); + } +} diff --git a/vendor/registry-40351f815f426200/log/tests/filters.rs b/vendor/registry-40351f815f426200/log/tests/filters.rs new file mode 100644 index 000000000..84449ccfe --- /dev/null +++ b/vendor/registry-40351f815f426200/log/tests/filters.rs @@ -0,0 +1,66 @@ +#[macro_use] +extern crate log; + +use std::sync::{Arc, Mutex}; +use log::{Level, LevelFilter, Log, Record, Metadata}; + +#[cfg(feature = "std")] +use log::set_boxed_logger; + +#[cfg(not(feature = "std"))] +fn set_boxed_logger(logger: Box) -> Result<(), log::SetLoggerError> { + log::set_logger(unsafe { &*Box::into_raw(logger) }) +} + +struct State { + last_log: Mutex>, +} + +struct Logger(Arc); + +impl Log for Logger { + fn enabled(&self, _: &Metadata) -> bool { + true + } + + fn log(&self, record: &Record) { + *self.0.last_log.lock().unwrap() = Some(record.level()); + } + fn flush(&self) {} +} + +fn main() { + let me = Arc::new(State { last_log: Mutex::new(None) }); + let a = me.clone(); + set_boxed_logger(Box::new(Logger(me))).unwrap(); + + test(&a, LevelFilter::Off); + test(&a, LevelFilter::Error); + test(&a, LevelFilter::Warn); + test(&a, LevelFilter::Info); + test(&a, LevelFilter::Debug); + test(&a, LevelFilter::Trace); +} + +fn test(a: &State, filter: LevelFilter) { + log::set_max_level(filter); + error!(""); + last(&a, t(Level::Error, filter)); + warn!(""); + last(&a, t(Level::Warn, filter)); + info!(""); + last(&a, t(Level::Info, filter)); + debug!(""); + last(&a, t(Level::Debug, filter)); + trace!(""); + last(&a, t(Level::Trace, filter)); + + fn t(lvl: Level, filter: LevelFilter) -> Option { + if lvl <= filter { Some(lvl) } else { None } + } +} + +fn last(state: &State, expected: Option) { + let lvl = state.last_log.lock().unwrap().take(); + assert_eq!(lvl, expected); +} diff --git a/vendor/registry-40351f815f426200/numtoa/.cargo-checksum.json b/vendor/registry-40351f815f426200/numtoa/.cargo-checksum.json new file mode 100644 index 000000000..0155eb3a8 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"4e13b8b2df85c3700056bf852bbc0d75973b5c67d3450c0f9c949c162783d85b","LICENSE-APACHE":"c95bae1d1ce0235ecccd3560b772ec1efb97f348a79f0fbe0a634f0c2ccefe2c","LICENSE-MIT":"fce969aafe49874e25d602153abe60a686ab37a7c97ff36ba4cfd270337ef7e0","README.md":"5c788c039c47e327abed0d61b1a7157851c914e33689716ec9c848cbd9baf013","src/lib.rs":"fd812addca5e63c49bd0d480be72a14bdd50f7fa78044b7796f38b8b9d911d72"},"package":"b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/numtoa/Cargo.toml b/vendor/registry-40351f815f426200/numtoa/Cargo.toml new file mode 100644 index 000000000..7a026a1b5 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/Cargo.toml @@ -0,0 +1,26 @@ +# 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 = "numtoa" +version = "0.1.0" +authors = ["Michael Aaron Murphy "] +description = "Convert numbers into stack-allocated byte arrays" +documentation = "https://docs.rs/numtoa" +readme = "README.md" +keywords = ["numbers", "convert", "numtoa", "itoa", "no_std"] +categories = ["value-formatting"] +license = "MIT OR Apache-2.0" +repository = "https://gitlab.com/mmstick/numtoa" + +[features] +std = [] diff --git a/vendor/registry-40351f815f426200/numtoa/LICENSE-APACHE b/vendor/registry-40351f815f426200/numtoa/LICENSE-APACHE new file mode 100644 index 000000000..57bc88a15 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/LICENSE-APACHE @@ -0,0 +1,202 @@ + 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/vendor/registry-40351f815f426200/numtoa/LICENSE-MIT b/vendor/registry-40351f815f426200/numtoa/LICENSE-MIT new file mode 100644 index 000000000..492da6317 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/LICENSE-MIT @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Michael Aaron Murphy + +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/vendor/registry-40351f815f426200/numtoa/README.md b/vendor/registry-40351f815f426200/numtoa/README.md new file mode 100644 index 000000000..497e906a3 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/README.md @@ -0,0 +1,65 @@ +# NumToA + +## `#![no_std]` Compatible with Zero Heap Allocations + +The standard library provides a convenient method of converting numbers into strings, but these strings are +heap-allocated. If you have an application which needs to convert large volumes of numbers into strings, but don't +want to pay the price of heap allocation, this crate provides an efficient `no_std`-compatible method of heaplessly converting numbers +into their string representations, storing the representation within a reusable byte array. + +## Supports Multiple Bases + +In addition to supporting the standard base 10 conversion, this implementation allows you to select the base of +your choice. Therefore, if you want a binary representation, set the base to 2. If you want hexadecimal, set the +base to 16. + +## No Unsafe + +Both the standard library and itoa crate rely on unsafe functions, but this implementation has been able to avoid +the use of unsafe entirely. + +## Fast + +Performance is roughly identical to that of the `itoa` crate when performing base 10 conversions. Below is a benchmark +of printing 0 through 5,000,000 to `/dev/null` + +``` +std: 1150615048 ns +itoa: 838556714 ns +numtoa: 825544518 ns +``` + +## Base 10 Example + +```rust +use numtoa::NumToA; +use std::io::{self, Write}; + +let stdout = io::stdout(); +let mut stdout = stdout.lock(); +let mut buffer = [0u8; 20]; + +let number: u32 = 162392; +let mut start_index = number.numtoa(10, &mut buffer); +let _ = stdout.write(&buffer[start_index..]); +let _ = stdout.write(b"\n"); +assert_eq!(&buffer[start_index..], b"162392"); + +let other_number: i32 = -6235; +start_index = other_number.numtoa(10, &mut buffer); +let _ = stdout.write(&buffer[start_index..]); +let _ = stdout.write(b"\n"); +assert_eq!(&buffer[start_index..], b"-6235"); + +let large_num: u64 = 35320842; +start_index = large_num.numtoa(10, &mut buffer); +let _ = stdout.write(&buffer[start_index..]); +let _ = stdout.write(b"\n"); +assert_eq!(&buffer[start_index..], b"35320842"); + +let max_u64: u64 = 18446744073709551615; +start_index = max_u64.numtoa(10, &mut buffer); +let _ = stdout.write(&buffer[start_index..]); +let _ = stdout.write(b"\n"); +assert_eq!(&buffer[start_index..], b"18446744073709551615"); +``` diff --git a/vendor/registry-40351f815f426200/numtoa/src/lib.rs b/vendor/registry-40351f815f426200/numtoa/src/lib.rs new file mode 100644 index 000000000..c15b23f09 --- /dev/null +++ b/vendor/registry-40351f815f426200/numtoa/src/lib.rs @@ -0,0 +1,540 @@ +//! The standard library provides a convenient method of converting numbers into strings, but these strings are +//! heap-allocated. If you have an application which needs to convert large volumes of numbers into strings, but don't +//! want to pay the price of heap allocation, this crate provides an efficient `no_std`-compatible method of heaplessly converting numbers +//! into their string representations, storing the representation within a reusable byte array. +//! +//! In addition to supporting the standard base 10 conversion, this implementation allows you to select the base of +//! your choice. Therefore, if you want a binary representation, set the base to 2. If you want hexadecimal, set the +//! base to 16. +//! +//! # Convenience Example +//! +//! ``` +//! use numtoa::NumToA; +//! +//! let mut buf = [0u8; 20]; +//! let mut string = String::new(); +//! +//! for number in (1..10) { +//! string.push_str(number.numtoa_str(10, &mut buf)); +//! string.push('\n'); +//! } +//! +//! println!("{}", string); +//! ``` +//! +//! ## Base 10 Example +//! ``` +//! use numtoa::NumToA; +//! use std::io::{self, Write}; +//! +//! let stdout = io::stdout(); +//! let mut stdout = stdout.lock(); +//! let mut buffer = [0u8; 20]; +//! +//! let number: u32 = 162392; +//! let mut start_indice = number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"162392"); +//! +//! let other_number: i32 = -6235; +//! start_indice = other_number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"-6235"); +//! +//! let other_number: i8 = -128; +//! start_indice = other_number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"-128"); +//! +//! let other_number: i8 = 53; +//! start_indice = other_number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"53"); +//! +//! let other_number: i16 = -256; +//! start_indice = other_number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"-256"); +//! +//! let other_number: i16 = -32768; +//! start_indice = other_number.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"-32768"); +//! +//! let large_num: u64 = 35320842; +//! start_indice = large_num.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"35320842"); +//! +//! let max_u64: u64 = 18446744073709551615; +//! start_indice = max_u64.numtoa(10, &mut buffer); +//! let _ = stdout.write(&buffer[start_indice..]); +//! let _ = stdout.write(b"\n"); +//! assert_eq!(&buffer[start_indice..], b"18446744073709551615"); +//! ``` + +#![no_std] +use core::mem::size_of; + +#[cfg(feature = "std")] +extern crate std; +#[cfg(feature = "std")] +use std::str; + +/// Converts a number into a string representation, storing the conversion into a mutable byte slice. +pub trait NumToA { + /// Given a base for encoding and a mutable byte slice, write the number into the byte slice and return the + /// indice where the inner string begins. The inner string can be extracted by slicing the byte slice from + /// that indice. + /// + /// # Panics + /// If the supplied buffer is smaller than the number of bytes needed to write the integer, this will panic. + /// On debug builds, this function will perform a check on base 10 conversions to ensure that the input array + /// is large enough to hold the largest possible value in digits. + /// + /// # Example + /// ``` + /// use numtoa::NumToA; + /// use std::io::{self, Write}; + /// + /// let stdout = io::stdout(); + /// let stdout = &mut io::stdout(); + /// + /// let mut buffer = [0u8; 20]; + /// let number = 15325; + /// let start_indice = number.numtoa(10, &mut buffer); + /// let _ = stdout.write(&buffer[start_indice..]); + /// assert_eq!(&buffer[start_indice..], b"15325"); + /// ``` + fn numtoa(self, base: T, string: &mut [u8]) -> usize; + + #[cfg(feature = "std")] + /// Convenience method for quickly getting a string from the input's array buffer. + fn numtoa_str(self, base: T, buf: &mut [u8; 20]) -> &str; +} + +// A lookup table to prevent the need for conditional branching +// The value of the remainder of each step will be used as the index +const LOOKUP: &[u8] = b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + +// A lookup table optimized for decimal lookups. Each two indices represents one possible number. +const DEC_LOOKUP: &[u8; 200] = b"0001020304050607080910111213141516171819\ + 2021222324252627282930313233343536373839\ + 4041424344454647484950515253545556575859\ + 6061626364656667686970717273747576777879\ + 8081828384858687888990919293949596979899"; + +macro_rules! base_10 { + ($number:ident, $index:ident, $string:ident) => { + // Decode four characters at the same time + while $number > 9999 { + let rem = ($number % 10000) as u16; + let (frst, scnd) = ((rem / 100) * 2, (rem % 100) * 2); + $string[$index-3..$index-1].copy_from_slice(&DEC_LOOKUP[frst as usize..frst as usize+2]); + $string[$index-1..$index+1].copy_from_slice(&DEC_LOOKUP[scnd as usize..scnd as usize+2]); + $index = $index.wrapping_sub(4); + $number /= 10000; + } + + if $number > 999 { + let (frst, scnd) = (($number / 100) * 2, ($number % 100) * 2); + $string[$index-3..$index-1].copy_from_slice(&DEC_LOOKUP[frst as usize..frst as usize+2]); + $string[$index-1..$index+1].copy_from_slice(&DEC_LOOKUP[scnd as usize..scnd as usize+2]); + $index = $index.wrapping_sub(4); + } else if $number > 99 { + let section = ($number as u16 / 10) * 2; + $string[$index-2..$index].copy_from_slice(&DEC_LOOKUP[section as usize..section as usize+2]); + $string[$index] = LOOKUP[($number % 10) as usize]; + $index = $index.wrapping_sub(3); + } else if $number > 9 { + $number *= 2; + $string[$index-1..$index+1].copy_from_slice(&DEC_LOOKUP[$number as usize..$number as usize+2]); + $index = $index.wrapping_sub(2); + } else { + $string[$index] = LOOKUP[$number as usize]; + $index = $index.wrapping_sub(1); + } + } +} + +macro_rules! impl_unsized_numtoa_for { + ($t:ty) => { + impl NumToA<$t> for $t { + fn numtoa(mut self, base: $t, string: &mut [u8]) -> usize { + // Check if the buffer is large enough and panic on debug builds if it isn't + if cfg!(debug_assertions) { + if base == 10 { + match size_of::<$t>() { + 2 => debug_assert!(string.len() >= 5, "u16 base 10 conversions require at least 5 bytes"), + 4 => debug_assert!(string.len() >= 10, "u32 base 10 conversions require at least 10 bytes"), + 8 => debug_assert!(string.len() >= 20, "u64 base 10 conversions require at least 20 bytes"), + _ => unreachable!() + } + } + } + + let mut index = string.len() - 1; + if self == 0 { + string[index] = b'0'; + return index; + } + + if base == 10 { + // Convert using optimized base 10 algorithm + base_10!(self, index, string); + } else { + while self != 0 { + let rem = self % base; + string[index] = LOOKUP[rem as usize]; + index = index.wrapping_sub(1); + self /= base; + } + } + + index.wrapping_add(1) + } + + #[cfg(feature = "std")] + fn numtoa_str(self, base: $t, buf: &mut [u8; 20]) -> &str { + let s = self.numtoa(base, buf); + unsafe { str::from_utf8_unchecked(&buf[s..]) } + } + } + } +} + +macro_rules! impl_sized_numtoa_for { + ($t:ty) => { + impl NumToA<$t> for $t { + fn numtoa(mut self, base: $t, string: &mut [u8]) -> usize { + if cfg!(debug_assertions) { + if base == 10 { + match size_of::<$t>() { + 2 => debug_assert!(string.len() >= 6, "i16 base 10 conversions require at least 6 bytes"), + 4 => debug_assert!(string.len() >= 11, "i32 base 10 conversions require at least 11 bytes"), + 8 => debug_assert!(string.len() >= 20, "i64 base 10 conversions require at least 20 bytes"), + _ => unreachable!() + } + } + } + + let mut index = string.len() - 1; + let mut is_negative = false; + + if self < 0 { + is_negative = true; + self = match self.checked_abs() { + Some(value) => value, + None => { + let value = <$t>::max_value(); + string[index] = LOOKUP[((value % base + 1) % base) as usize]; + index -= 1; + value / base + ((value % base == base - 1) as $t) + } + }; + } else if self == 0 { + string[index] = b'0'; + return index; + } + + if base == 10 { + // Convert using optimized base 10 algorithm + base_10!(self, index, string); + } else { + while self != 0 { + let rem = self % base; + string[index] = LOOKUP[rem as usize]; + index = index.wrapping_sub(1); + self /= base; + } + } + + if is_negative { + string[index] = b'-'; + index = index.wrapping_sub(1); + } + + index.wrapping_add(1) + } + + #[cfg(feature = "std")] + fn numtoa_str(self, base: $t, buf: &mut [u8; 20]) -> &str { + let s = self.numtoa(base, buf); + unsafe { str::from_utf8_unchecked(&buf[s..]) } + } + } + } +} + +impl_sized_numtoa_for!(i16); +impl_sized_numtoa_for!(i32); +impl_sized_numtoa_for!(i64); +impl_sized_numtoa_for!(isize); +impl_unsized_numtoa_for!(u16); +impl_unsized_numtoa_for!(u32); +impl_unsized_numtoa_for!(u64); +impl_unsized_numtoa_for!(usize); + +impl NumToA for i8 { + fn numtoa(mut self, base: i8, string: &mut [u8]) -> usize { + if cfg!(debug_assertions) { + if base == 10 { + debug_assert!(string.len() >= 4, "i8 conversions need at least 4 bytes"); + } + } + + let mut index = string.len() - 1; + let mut is_negative = false; + + if self < 0 { + is_negative = true; + self = match self.checked_abs() { + Some(value) => value, + None => { + let value = ::max_value(); + string[index] = LOOKUP[((value % base + 1) % base) as usize]; + index -= 1; + value / base + ((value % base == base - 1) as i8) + } + }; + } else if self == 0 { + string[index] = b'0'; + return index; + } + + if base == 10 { + if self > 99 { + let section = (self / 10) * 2; + string[index-2..index].copy_from_slice(&DEC_LOOKUP[section as usize..section as usize+2]); + string[index] = LOOKUP[(self % 10) as usize]; + index = index.wrapping_sub(3); + } else if self > 9 { + self *= 2; + string[index-1..index+1].copy_from_slice(&DEC_LOOKUP[self as usize..self as usize+2]); + index = index.wrapping_sub(2); + } else { + string[index] = LOOKUP[self as usize]; + index = index.wrapping_sub(1); + } + } else { + while self != 0 { + let rem = self % base; + string[index] = LOOKUP[rem as usize]; + index = index.wrapping_sub(1); + self /= base; + } + } + + if is_negative { + string[index] = b'-'; + index = index.wrapping_sub(1); + } + + index.wrapping_add(1) + } + + #[cfg(feature = "std")] + fn numtoa_str(self, base: Self, buf: &mut [u8; 20]) -> &str { + let s = self.numtoa(base, buf); + unsafe { str::from_utf8_unchecked(&buf[s..]) } + } +} + +impl NumToA for u8 { + fn numtoa(mut self, base: u8, string: &mut [u8]) -> usize { + if cfg!(debug_assertions) { + if base == 10 { + debug_assert!(string.len() >= 3, "u8 conversions need at least 3 bytes"); + } + } + + let mut index = string.len() - 1; + if self == 0 { + string[index] = b'0'; + return index; + } + + if base == 10 { + if self > 99 { + let section = (self / 10) * 2; + string[index-2..index].copy_from_slice(&DEC_LOOKUP[section as usize..section as usize+2]); + string[index] = LOOKUP[(self % 10) as usize]; + index = index.wrapping_sub(3); + } else if self > 9 { + self *= 2; + string[index-1..index+1].copy_from_slice(&DEC_LOOKUP[self as usize..self as usize+2]); + index = index.wrapping_sub(2); + } else { + string[index] = LOOKUP[self as usize]; + index = index.wrapping_sub(1); + } + } else { + while self != 0 { + let rem = self % base; + string[index] = LOOKUP[rem as usize]; + index = index.wrapping_sub(1); + self /= base; + } + } + + index.wrapping_add(1) + } + + #[cfg(feature = "std")] + fn numtoa_str(self, base: Self, buf: &mut [u8; 20]) -> &str { + let s = self.numtoa(base, buf); + unsafe { str::from_utf8_unchecked(&buf[s..]) } + } +} + +#[test] +fn str_convenience() { + let mut buffer = [0u8; 20]; + assert_eq!("256123", 256123.numtoa_str(10, &mut buffer)); +} + +#[test] +#[should_panic] +fn base10_u8_array_too_small() { + let mut buffer = [0u8; 2]; + let _ = 0u8.numtoa(10, &mut buffer); +} + +#[test] +fn base10_u8_array_just_right() { + let mut buffer = [0u8; 3]; + let _ = 0u8.numtoa(10, &mut buffer); +} + +#[test] +#[should_panic] +fn base10_i8_array_too_small() { + let mut buffer = [0u8; 3]; + let _ = 0i8.numtoa(10, &mut buffer); +} + +#[test] +fn base10_i8_array_just_right() { + let mut buffer = [0u8; 4]; + let i = (-127i8).numtoa(10, &mut buffer); + assert_eq!(&buffer[i..], b"-127"); +} + +#[test] +#[should_panic] +fn base10_i16_array_too_small() { + let mut buffer = [0u8; 5]; + let _ = 0i16.numtoa(10, &mut buffer); +} + +#[test] +fn base10_i16_array_just_right() { + let mut buffer = [0u8; 6]; + let i = (-12768i16).numtoa(10, &mut buffer); + assert_eq!(&buffer[i..], b"-12768"); +} + +#[test] +#[should_panic] +fn base10_u16_array_too_small() { + let mut buffer = [0u8; 4]; + let _ = 0u16.numtoa(10, &mut buffer); +} + +#[test] +fn base10_u16_array_just_right() { + let mut buffer = [0u8; 5]; + let _ = 0u16.numtoa(10, &mut buffer); +} + +#[test] +#[should_panic] +fn base10_i32_array_too_small() { + let mut buffer = [0u8; 10]; + let _ = 0i32.numtoa(10, &mut buffer); +} + +#[test] +fn base10_i32_array_just_right() { + let mut buffer = [0u8; 11]; + let _ = 0i32.numtoa(10, &mut buffer); +} + +#[test] +#[should_panic] +fn base10_u32_array_too_small() { + let mut buffer = [0u8; 9]; + let _ = 0u32.numtoa(10, &mut buffer); +} + +#[test] +fn base10_u32_array_just_right() { + let mut buffer = [0u8; 10]; + let _ = 0u32.numtoa(10, &mut buffer); +} + +#[test] +#[should_panic] +fn base10_i64_array_too_small() { + let mut buffer = [0u8; 19]; + let _ = 0i64.numtoa(10, &mut buffer); +} + +#[test] +fn base10_i64_array_just_right() { + let mut buffer = [0u8; 20]; + let _ = 0i64.numtoa(10, &mut buffer); +} + +#[test] +#[should_panic] +fn base10_u64_array_too_small() { + let mut buffer = [0u8; 19]; + let _ = 0u64.numtoa(10, &mut buffer); +} + +#[test] +fn base10_u64_array_just_right() { + let mut buffer = [0u8; 20]; + let _ = 0u64.numtoa(10, &mut buffer); +} + +#[test] +fn base8_min_signed_number() { + let mut buffer = [0u8; 30]; + let i = (-128i8).numtoa(8, &mut buffer); + assert_eq!(&buffer[i..], b"-200"); + + let i = (-32768i16).numtoa(8, &mut buffer); + assert_eq!(&buffer[i..], b"-100000"); + + let i = (-2147483648i32).numtoa(8, &mut buffer); + assert_eq!(&buffer[i..], b"-20000000000"); + + let i = (-9223372036854775808i64).numtoa(8, &mut buffer); + assert_eq!(&buffer[i..], b"-1000000000000000000000"); +} + +#[test] +fn base16_min_signed_number() { + let mut buffer = [0u8; 20]; + let i = (-128i8).numtoa(16, &mut buffer); + assert_eq!(&buffer[i..], b"-80"); + + let i = (-32768i16).numtoa(16, &mut buffer); + assert_eq!(&buffer[i..], b"-8000"); + + let i = (-2147483648i32).numtoa(16, &mut buffer); + assert_eq!(&buffer[i..], b"-80000000"); + + let i = (-9223372036854775808i64).numtoa(16, &mut buffer); + assert_eq!(&buffer[i..], b"-8000000000000000"); +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/.cargo-checksum.json b/vendor/registry-40351f815f426200/proc-macro2/.cargo-checksum.json new file mode 100644 index 000000000..ef6f59c46 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"8b5f969f3fa1acf284b10c1eca350c563cc62fe0da90d9f1aa09c6ddb4410067","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"378f5840b258e2779c39418f3f2d7b2ba96f1c7917dd6be0713f88305dbda397","README.md":"e7de11d9de411a04366b5ee96ce92216b8f97f3db1728be698f71de5e2f11737","build.rs":"c8339bb526fdc6a0d5bcb2ffbd5bf8c23b6cf1beb247cbfbc7d9e0f783668cb2","src/fallback.rs":"33a562ce167b681ebb8302f61b08aec30816980ea16a5ab29daab70c2208ac5f","src/lib.rs":"9de84db0203e305e027fb90cfdd3f389de5eb07fa89e2d37f786ead0ab18e0c6","src/strnom.rs":"60f5380106dbe568cca7abd09877e133c874fbee95d502e4830425c4613a640d","src/wrapper.rs":"9718c9a9e734a88e58945059805e09db753d711a22fede3efa296ee5fba066a6","tests/marker.rs":"0227d07bbc7f2e2ad34662a6acb65668b7dc2f79141c4faa672703a04e27bea0","tests/test.rs":"eab4362ed56b708e704c099a525db1b97bb06f798b0aa7c1ddef7aaef4c7476b"},"package":"cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/proc-macro2/Cargo.toml b/vendor/registry-40351f815f426200/proc-macro2/Cargo.toml new file mode 100644 index 000000000..da5378f02 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/Cargo.toml @@ -0,0 +1,39 @@ +# 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 = "proc-macro2" +version = "0.4.30" +authors = ["Alex Crichton "] +build = "build.rs" +description = "A stable implementation of the upcoming new `proc_macro` API. Comes with an\noption, off by default, to also reimplement itself in terms of the upstream\nunstable API.\n" +homepage = "https://github.com/alexcrichton/proc-macro2" +documentation = "https://docs.rs/proc-macro2" +readme = "README.md" +keywords = ["macros"] +license = "MIT/Apache-2.0" +repository = "https://github.com/alexcrichton/proc-macro2" +[package.metadata.docs.rs] +rustc-args = ["--cfg", "procmacro2_semver_exempt"] +rustdoc-args = ["--cfg", "procmacro2_semver_exempt"] +[dependencies.unicode-xid] +version = "0.1" +[dev-dependencies.quote] +version = "0.6" + +[features] +default = ["proc-macro"] +nightly = [] +proc-macro = [] +span-locations = [] +[badges.travis-ci] +repository = "alexcrichton/proc-macro2" diff --git a/vendor/registry-40351f815f426200/proc-macro2/LICENSE-APACHE b/vendor/registry-40351f815f426200/proc-macro2/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/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/vendor/registry-40351f815f426200/proc-macro2/LICENSE-MIT b/vendor/registry-40351f815f426200/proc-macro2/LICENSE-MIT new file mode 100644 index 000000000..39e0ed660 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/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/vendor/registry-40351f815f426200/proc-macro2/README.md b/vendor/registry-40351f815f426200/proc-macro2/README.md new file mode 100644 index 000000000..67d523dc3 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/README.md @@ -0,0 +1,100 @@ +# proc-macro2 + +[![Build Status](https://api.travis-ci.com/alexcrichton/proc-macro2.svg?branch=master)](https://travis-ci.com/alexcrichton/proc-macro2) +[![Latest Version](https://img.shields.io/crates/v/proc-macro2.svg)](https://crates.io/crates/proc-macro2) +[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/proc-macro2) + +A wrapper around the procedural macro API of the compiler's `proc_macro` crate. +This library serves three purposes: + +- **Bring proc-macro-like functionality to other contexts like build.rs and + main.rs.** Types from `proc_macro` are entirely specific to procedural macros + and cannot ever exist in code outside of a procedural macro. Meanwhile + `proc_macro2` types may exist anywhere including non-macro code. By developing + foundational libraries like [syn] and [quote] against `proc_macro2` rather + than `proc_macro`, the procedural macro ecosystem becomes easily applicable to + many other use cases and we avoid reimplementing non-macro equivalents of + those libraries. + +- **Make procedural macros unit testable.** As a consequence of being specific + to procedural macros, nothing that uses `proc_macro` can be executed from a + unit test. In order for helper libraries or components of a macro to be + testable in isolation, they must be implemented using `proc_macro2`. + +- **Provide the latest and greatest APIs across all compiler versions.** + Procedural macros were first introduced to Rust in 1.15.0 with an extremely + minimal interface. Since then, many improvements have landed to make macros + more flexible and easier to write. This library tracks the procedural macro + API of the most recent stable compiler but employs a polyfill to provide that + API consistently across any compiler since 1.15.0. + +[syn]: https://github.com/dtolnay/syn +[quote]: https://github.com/dtolnay/quote + +## Usage + +```toml +[dependencies] +proc-macro2 = "0.4" +``` + +The skeleton of a typical procedural macro typically looks like this: + +```rust +extern crate proc_macro; + +#[proc_macro_derive(MyDerive)] +pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let input = proc_macro2::TokenStream::from(input); + + let output: proc_macro2::TokenStream = { + /* transform input */ + }; + + proc_macro::TokenStream::from(output) +} +``` + +If parsing with [Syn], you'll use [`parse_macro_input!`] instead to propagate +parse errors correctly back to the compiler when parsing fails. + +[`parse_macro_input!`]: https://docs.rs/syn/0.15/syn/macro.parse_macro_input.html + +## Unstable features + +The default feature set of proc-macro2 tracks the most recent stable compiler +API. Functionality in `proc_macro` that is not yet stable is not exposed by +proc-macro2 by default. + +To opt into the additional APIs available in the most recent nightly compiler, +the `procmacro2_semver_exempt` config flag must be passed to rustc. As usual, we +will polyfill those nightly-only APIs all the way back to Rust 1.15.0. As these +are unstable APIs that track the nightly compiler, minor versions of proc-macro2 +may make breaking changes to them at any time. + +``` +RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build +``` + +Note that this must not only be done for your crate, but for any crate that +depends on your crate. This infectious nature is intentional, as it serves as a +reminder that you are outside of the normal semver guarantees. + +Semver exempt methods are marked as such in the proc-macro2 documentation. + +# 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 this crate 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/vendor/registry-40351f815f426200/proc-macro2/build.rs b/vendor/registry-40351f815f426200/proc-macro2/build.rs new file mode 100644 index 000000000..187255f2f --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/build.rs @@ -0,0 +1,157 @@ +// rustc-cfg emitted by the build script: +// +// "u128" +// Include u128 and i128 constructors for proc_macro2::Literal. Enabled on +// any compiler 1.26+. +// +// "use_proc_macro" +// Link to extern crate proc_macro. Available on any compiler and any target +// except wasm32. Requires "proc-macro" Cargo cfg to be enabled (default is +// enabled). On wasm32 we never link to proc_macro even if "proc-macro" cfg +// is enabled. +// +// "wrap_proc_macro" +// Wrap types from libproc_macro rather than polyfilling the whole API. +// Enabled on rustc 1.29+ as long as procmacro2_semver_exempt is not set, +// because we can't emulate the unstable API without emulating everything +// else. Also enabled unconditionally on nightly, in which case the +// procmacro2_semver_exempt surface area is implemented by using the +// nightly-only proc_macro API. +// +// "slow_extend" +// Fallback when `impl Extend for TokenStream` is not available. These impls +// were added one version later than the rest of the proc_macro token API. +// Enabled on rustc 1.29 only. +// +// "proc_macro_span" +// Enable non-dummy behavior of Span::start and Span::end methods which +// requires an unstable compiler feature. Enabled when building with +// nightly, unless `-Z allow-feature` in RUSTFLAGS disallows unstable +// features. +// +// "super_unstable" +// Implement the semver exempt API in terms of the nightly-only proc_macro +// API. Enabled when using procmacro2_semver_exempt on a nightly compiler. +// +// "span_locations" +// Provide methods Span::start and Span::end which give the line/column +// location of a token. Enabled by procmacro2_semver_exempt or the +// "span-locations" Cargo cfg. This is behind a cfg because tracking +// location inside spans is a performance hit. + +use std::env; +use std::process::Command; +use std::str; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + + let target = env::var("TARGET").unwrap(); + + let version = match rustc_version() { + Some(version) => version, + None => return, + }; + + if version.minor >= 26 { + println!("cargo:rustc-cfg=u128"); + } + + let semver_exempt = cfg!(procmacro2_semver_exempt); + if semver_exempt { + // https://github.com/alexcrichton/proc-macro2/issues/147 + println!("cargo:rustc-cfg=procmacro2_semver_exempt"); + } + + if semver_exempt || cfg!(feature = "span-locations") { + println!("cargo:rustc-cfg=span_locations"); + } + + if !enable_use_proc_macro(&target) { + return; + } + + println!("cargo:rustc-cfg=use_proc_macro"); + + // Rust 1.29 stabilized the necessary APIs in the `proc_macro` crate + if version.nightly || version.minor >= 29 && !semver_exempt { + println!("cargo:rustc-cfg=wrap_proc_macro"); + } + + if version.minor == 29 { + println!("cargo:rustc-cfg=slow_extend"); + } + + if version.nightly && feature_allowed("proc_macro_span") { + println!("cargo:rustc-cfg=proc_macro_span"); + } + + if semver_exempt && version.nightly { + println!("cargo:rustc-cfg=super_unstable"); + } +} + +fn enable_use_proc_macro(target: &str) -> bool { + // wasm targets don't have the `proc_macro` crate, disable this feature. + if target.contains("wasm32") { + return false; + } + + // Otherwise, only enable it if our feature is actually enabled. + cfg!(feature = "proc-macro") +} + +struct RustcVersion { + minor: u32, + nightly: bool, +} + +fn rustc_version() -> Option { + 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 nightly = version.contains("nightly"); + let mut pieces = version.split('.'); + if pieces.next() != Some("rustc 1") { + return None; + } + let minor = otry!(pieces.next()); + let minor = otry!(minor.parse().ok()); + + Some(RustcVersion { + minor: minor, + nightly: nightly, + }) +} + +fn feature_allowed(feature: &str) -> bool { + // Recognized formats: + // + // -Z allow-features=feature1,feature2 + // + // -Zallow-features=feature1,feature2 + + if let Some(rustflags) = env::var_os("RUSTFLAGS") { + for mut flag in rustflags.to_string_lossy().split(' ') { + if flag.starts_with("-Z") { + flag = &flag["-Z".len()..]; + } + if flag.starts_with("allow-features=") { + flag = &flag["allow-features=".len()..]; + return flag.split(',').any(|allowed| allowed == feature); + } + } + } + + // No allow-features= flag, allowed by default. + true +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/src/fallback.rs b/vendor/registry-40351f815f426200/proc-macro2/src/fallback.rs new file mode 100644 index 000000000..f40a87461 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/src/fallback.rs @@ -0,0 +1,1435 @@ +#[cfg(span_locations)] +use std::cell::RefCell; +#[cfg(procmacro2_semver_exempt)] +use std::cmp; +use std::fmt; +use std::iter; +#[cfg(procmacro2_semver_exempt)] +use std::path::Path; +use std::path::PathBuf; +use std::str::FromStr; +use std::vec; + +use strnom::{block_comment, skip_whitespace, whitespace, word_break, Cursor, PResult}; +use unicode_xid::UnicodeXID; + +use {Delimiter, Punct, Spacing, TokenTree}; + +#[derive(Clone)] +pub struct TokenStream { + inner: Vec, +} + +#[derive(Debug)] +pub struct LexError; + +impl TokenStream { + pub fn new() -> TokenStream { + TokenStream { inner: Vec::new() } + } + + pub fn is_empty(&self) -> bool { + self.inner.len() == 0 + } +} + +#[cfg(span_locations)] +fn get_cursor(src: &str) -> Cursor { + // Create a dummy file & add it to the source map + SOURCE_MAP.with(|cm| { + let mut cm = cm.borrow_mut(); + let name = format!("", cm.files.len()); + let span = cm.add_file(&name, src); + Cursor { + rest: src, + off: span.lo, + } + }) +} + +#[cfg(not(span_locations))] +fn get_cursor(src: &str) -> Cursor { + Cursor { rest: src } +} + +impl FromStr for TokenStream { + type Err = LexError; + + fn from_str(src: &str) -> Result { + // Create a dummy file & add it to the source map + let cursor = get_cursor(src); + + match token_stream(cursor) { + Ok((input, output)) => { + if skip_whitespace(input).len() != 0 { + Err(LexError) + } else { + Ok(output) + } + } + Err(LexError) => Err(LexError), + } + } +} + +impl fmt::Display for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut joint = false; + for (i, tt) in self.inner.iter().enumerate() { + if i != 0 && !joint { + write!(f, " ")?; + } + joint = false; + match *tt { + TokenTree::Group(ref tt) => { + let (start, end) = match tt.delimiter() { + Delimiter::Parenthesis => ("(", ")"), + Delimiter::Brace => ("{", "}"), + Delimiter::Bracket => ("[", "]"), + Delimiter::None => ("", ""), + }; + if tt.stream().into_iter().next().is_none() { + write!(f, "{} {}", start, end)? + } else { + write!(f, "{} {} {}", start, tt.stream(), end)? + } + } + TokenTree::Ident(ref tt) => write!(f, "{}", tt)?, + TokenTree::Punct(ref tt) => { + write!(f, "{}", tt.as_char())?; + match tt.spacing() { + Spacing::Alone => {} + Spacing::Joint => joint = true, + } + } + TokenTree::Literal(ref tt) => write!(f, "{}", tt)?, + } + } + + Ok(()) + } +} + +impl fmt::Debug for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str("TokenStream ")?; + f.debug_list().entries(self.clone()).finish() + } +} + +#[cfg(use_proc_macro)] +impl From<::proc_macro::TokenStream> for TokenStream { + fn from(inner: ::proc_macro::TokenStream) -> TokenStream { + inner + .to_string() + .parse() + .expect("compiler token stream parse failed") + } +} + +#[cfg(use_proc_macro)] +impl From for ::proc_macro::TokenStream { + fn from(inner: TokenStream) -> ::proc_macro::TokenStream { + inner + .to_string() + .parse() + .expect("failed to parse to compiler tokens") + } +} + +impl From for TokenStream { + fn from(tree: TokenTree) -> TokenStream { + TokenStream { inner: vec![tree] } + } +} + +impl iter::FromIterator for TokenStream { + fn from_iter>(streams: I) -> Self { + let mut v = Vec::new(); + + for token in streams.into_iter() { + v.push(token); + } + + TokenStream { inner: v } + } +} + +impl iter::FromIterator for TokenStream { + fn from_iter>(streams: I) -> Self { + let mut v = Vec::new(); + + for stream in streams.into_iter() { + v.extend(stream.inner); + } + + TokenStream { inner: v } + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + self.inner.extend(streams); + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + self.inner + .extend(streams.into_iter().flat_map(|stream| stream)); + } +} + +pub type TokenTreeIter = vec::IntoIter; + +impl IntoIterator for TokenStream { + type Item = TokenTree; + type IntoIter = TokenTreeIter; + + fn into_iter(self) -> TokenTreeIter { + self.inner.into_iter() + } +} + +#[derive(Clone, PartialEq, Eq)] +pub struct SourceFile { + path: PathBuf, +} + +impl SourceFile { + /// Get the path to this source file as a string. + pub fn path(&self) -> PathBuf { + self.path.clone() + } + + pub fn is_real(&self) -> bool { + // XXX(nika): Support real files in the future? + false + } +} + +impl fmt::Debug for SourceFile { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("SourceFile") + .field("path", &self.path()) + .field("is_real", &self.is_real()) + .finish() + } +} + +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub struct LineColumn { + pub line: usize, + pub column: usize, +} + +#[cfg(span_locations)] +thread_local! { + static SOURCE_MAP: RefCell = RefCell::new(SourceMap { + // NOTE: We start with a single dummy file which all call_site() and + // def_site() spans reference. + files: vec![{ + #[cfg(procmacro2_semver_exempt)] + { + FileInfo { + name: "".to_owned(), + span: Span { lo: 0, hi: 0 }, + lines: vec![0], + } + } + + #[cfg(not(procmacro2_semver_exempt))] + { + FileInfo { + span: Span { lo: 0, hi: 0 }, + lines: vec![0], + } + } + }], + }); +} + +#[cfg(span_locations)] +struct FileInfo { + #[cfg(procmacro2_semver_exempt)] + name: String, + span: Span, + lines: Vec, +} + +#[cfg(span_locations)] +impl FileInfo { + fn offset_line_column(&self, offset: usize) -> LineColumn { + assert!(self.span_within(Span { + lo: offset as u32, + hi: offset as u32 + })); + let offset = offset - self.span.lo as usize; + match self.lines.binary_search(&offset) { + Ok(found) => LineColumn { + line: found + 1, + column: 0, + }, + Err(idx) => LineColumn { + line: idx, + column: offset - self.lines[idx - 1], + }, + } + } + + fn span_within(&self, span: Span) -> bool { + span.lo >= self.span.lo && span.hi <= self.span.hi + } +} + +/// Computesthe offsets of each line in the given source string. +#[cfg(span_locations)] +fn lines_offsets(s: &str) -> Vec { + let mut lines = vec![0]; + let mut prev = 0; + while let Some(len) = s[prev..].find('\n') { + prev += len + 1; + lines.push(prev); + } + lines +} + +#[cfg(span_locations)] +struct SourceMap { + files: Vec, +} + +#[cfg(span_locations)] +impl SourceMap { + fn next_start_pos(&self) -> u32 { + // Add 1 so there's always space between files. + // + // We'll always have at least 1 file, as we initialize our files list + // with a dummy file. + self.files.last().unwrap().span.hi + 1 + } + + fn add_file(&mut self, name: &str, src: &str) -> Span { + let lines = lines_offsets(src); + let lo = self.next_start_pos(); + // XXX(nika): Shouild we bother doing a checked cast or checked add here? + let span = Span { + lo: lo, + hi: lo + (src.len() as u32), + }; + + #[cfg(procmacro2_semver_exempt)] + self.files.push(FileInfo { + name: name.to_owned(), + span: span, + lines: lines, + }); + + #[cfg(not(procmacro2_semver_exempt))] + self.files.push(FileInfo { + span: span, + lines: lines, + }); + let _ = name; + + span + } + + fn fileinfo(&self, span: Span) -> &FileInfo { + for file in &self.files { + if file.span_within(span) { + return file; + } + } + panic!("Invalid span with no related FileInfo!"); + } +} + +#[derive(Clone, Copy, PartialEq, Eq)] +pub struct Span { + #[cfg(span_locations)] + lo: u32, + #[cfg(span_locations)] + hi: u32, +} + +impl Span { + #[cfg(not(span_locations))] + pub fn call_site() -> Span { + Span {} + } + + #[cfg(span_locations)] + pub fn call_site() -> Span { + Span { lo: 0, hi: 0 } + } + + #[cfg(procmacro2_semver_exempt)] + pub fn def_site() -> Span { + Span::call_site() + } + + #[cfg(procmacro2_semver_exempt)] + pub fn resolved_at(&self, _other: Span) -> Span { + // Stable spans consist only of line/column information, so + // `resolved_at` and `located_at` only select which span the + // caller wants line/column information from. + *self + } + + #[cfg(procmacro2_semver_exempt)] + pub fn located_at(&self, other: Span) -> Span { + other + } + + #[cfg(procmacro2_semver_exempt)] + pub fn source_file(&self) -> SourceFile { + SOURCE_MAP.with(|cm| { + let cm = cm.borrow(); + let fi = cm.fileinfo(*self); + SourceFile { + path: Path::new(&fi.name).to_owned(), + } + }) + } + + #[cfg(span_locations)] + pub fn start(&self) -> LineColumn { + SOURCE_MAP.with(|cm| { + let cm = cm.borrow(); + let fi = cm.fileinfo(*self); + fi.offset_line_column(self.lo as usize) + }) + } + + #[cfg(span_locations)] + pub fn end(&self) -> LineColumn { + SOURCE_MAP.with(|cm| { + let cm = cm.borrow(); + let fi = cm.fileinfo(*self); + fi.offset_line_column(self.hi as usize) + }) + } + + #[cfg(procmacro2_semver_exempt)] + pub fn join(&self, other: Span) -> Option { + SOURCE_MAP.with(|cm| { + let cm = cm.borrow(); + // If `other` is not within the same FileInfo as us, return None. + if !cm.fileinfo(*self).span_within(other) { + return None; + } + Some(Span { + lo: cmp::min(self.lo, other.lo), + hi: cmp::max(self.hi, other.hi), + }) + }) + } +} + +impl fmt::Debug for Span { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + #[cfg(procmacro2_semver_exempt)] + return write!(f, "bytes({}..{})", self.lo, self.hi); + + #[cfg(not(procmacro2_semver_exempt))] + write!(f, "Span") + } +} + +pub fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) { + if cfg!(procmacro2_semver_exempt) { + debug.field("span", &span); + } +} + +#[derive(Clone)] +pub struct Group { + delimiter: Delimiter, + stream: TokenStream, + span: Span, +} + +impl Group { + pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group { + Group { + delimiter: delimiter, + stream: stream, + span: Span::call_site(), + } + } + + pub fn delimiter(&self) -> Delimiter { + self.delimiter + } + + pub fn stream(&self) -> TokenStream { + self.stream.clone() + } + + pub fn span(&self) -> Span { + self.span + } + + #[cfg(procmacro2_semver_exempt)] + pub fn span_open(&self) -> Span { + self.span + } + + #[cfg(procmacro2_semver_exempt)] + pub fn span_close(&self) -> Span { + self.span + } + + pub fn set_span(&mut self, span: Span) { + self.span = span; + } +} + +impl fmt::Display for Group { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let (left, right) = match self.delimiter { + Delimiter::Parenthesis => ("(", ")"), + Delimiter::Brace => ("{", "}"), + Delimiter::Bracket => ("[", "]"), + Delimiter::None => ("", ""), + }; + + f.write_str(left)?; + self.stream.fmt(f)?; + f.write_str(right)?; + + Ok(()) + } +} + +impl fmt::Debug for Group { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let mut debug = fmt.debug_struct("Group"); + debug.field("delimiter", &self.delimiter); + debug.field("stream", &self.stream); + #[cfg(procmacro2_semver_exempt)] + debug.field("span", &self.span); + debug.finish() + } +} + +#[derive(Clone)] +pub struct Ident { + sym: String, + span: Span, + raw: bool, +} + +impl Ident { + fn _new(string: &str, raw: bool, span: Span) -> Ident { + validate_ident(string); + + Ident { + sym: string.to_owned(), + span: span, + raw: raw, + } + } + + pub fn new(string: &str, span: Span) -> Ident { + Ident::_new(string, false, span) + } + + pub fn new_raw(string: &str, span: Span) -> Ident { + Ident::_new(string, true, span) + } + + pub fn span(&self) -> Span { + self.span + } + + pub fn set_span(&mut self, span: Span) { + self.span = span; + } +} + +#[inline] +fn is_ident_start(c: char) -> bool { + ('a' <= c && c <= 'z') + || ('A' <= c && c <= 'Z') + || c == '_' + || (c > '\x7f' && UnicodeXID::is_xid_start(c)) +} + +#[inline] +fn is_ident_continue(c: char) -> bool { + ('a' <= c && c <= 'z') + || ('A' <= c && c <= 'Z') + || c == '_' + || ('0' <= c && c <= '9') + || (c > '\x7f' && UnicodeXID::is_xid_continue(c)) +} + +fn validate_ident(string: &str) { + let validate = string; + if validate.is_empty() { + panic!("Ident is not allowed to be empty; use Option"); + } + + if validate.bytes().all(|digit| digit >= b'0' && digit <= b'9') { + panic!("Ident cannot be a number; use Literal instead"); + } + + fn ident_ok(string: &str) -> bool { + let mut chars = string.chars(); + let first = chars.next().unwrap(); + if !is_ident_start(first) { + return false; + } + for ch in chars { + if !is_ident_continue(ch) { + return false; + } + } + true + } + + if !ident_ok(validate) { + panic!("{:?} is not a valid Ident", string); + } +} + +impl PartialEq for Ident { + fn eq(&self, other: &Ident) -> bool { + self.sym == other.sym && self.raw == other.raw + } +} + +impl PartialEq for Ident +where + T: ?Sized + AsRef, +{ + fn eq(&self, other: &T) -> bool { + let other = other.as_ref(); + if self.raw { + other.starts_with("r#") && self.sym == other[2..] + } else { + self.sym == other + } + } +} + +impl fmt::Display for Ident { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + if self.raw { + "r#".fmt(f)?; + } + self.sym.fmt(f) + } +} + +impl fmt::Debug for Ident { + // Ident(proc_macro), Ident(r#union) + #[cfg(not(procmacro2_semver_exempt))] + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut debug = f.debug_tuple("Ident"); + debug.field(&format_args!("{}", self)); + debug.finish() + } + + // Ident { + // sym: proc_macro, + // span: bytes(128..138) + // } + #[cfg(procmacro2_semver_exempt)] + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut debug = f.debug_struct("Ident"); + debug.field("sym", &format_args!("{}", self)); + debug.field("span", &self.span); + debug.finish() + } +} + +#[derive(Clone)] +pub struct Literal { + text: String, + span: Span, +} + +macro_rules! suffixed_numbers { + ($($name:ident => $kind:ident,)*) => ($( + pub fn $name(n: $kind) -> Literal { + Literal::_new(format!(concat!("{}", stringify!($kind)), n)) + } + )*) +} + +macro_rules! unsuffixed_numbers { + ($($name:ident => $kind:ident,)*) => ($( + pub fn $name(n: $kind) -> Literal { + Literal::_new(n.to_string()) + } + )*) +} + +impl Literal { + fn _new(text: String) -> Literal { + Literal { + text: text, + span: Span::call_site(), + } + } + + suffixed_numbers! { + u8_suffixed => u8, + u16_suffixed => u16, + u32_suffixed => u32, + u64_suffixed => u64, + usize_suffixed => usize, + i8_suffixed => i8, + i16_suffixed => i16, + i32_suffixed => i32, + i64_suffixed => i64, + isize_suffixed => isize, + + f32_suffixed => f32, + f64_suffixed => f64, + } + + #[cfg(u128)] + suffixed_numbers! { + u128_suffixed => u128, + i128_suffixed => i128, + } + + unsuffixed_numbers! { + u8_unsuffixed => u8, + u16_unsuffixed => u16, + u32_unsuffixed => u32, + u64_unsuffixed => u64, + usize_unsuffixed => usize, + i8_unsuffixed => i8, + i16_unsuffixed => i16, + i32_unsuffixed => i32, + i64_unsuffixed => i64, + isize_unsuffixed => isize, + } + + #[cfg(u128)] + unsuffixed_numbers! { + u128_unsuffixed => u128, + i128_unsuffixed => i128, + } + + pub fn f32_unsuffixed(f: f32) -> Literal { + let mut s = f.to_string(); + if !s.contains(".") { + s.push_str(".0"); + } + Literal::_new(s) + } + + pub fn f64_unsuffixed(f: f64) -> Literal { + let mut s = f.to_string(); + if !s.contains(".") { + s.push_str(".0"); + } + Literal::_new(s) + } + + pub fn string(t: &str) -> Literal { + let mut text = String::with_capacity(t.len() + 2); + text.push('"'); + for c in t.chars() { + if c == '\'' { + // escape_default turns this into "\'" which is unnecessary. + text.push(c); + } else { + text.extend(c.escape_default()); + } + } + text.push('"'); + Literal::_new(text) + } + + pub fn character(t: char) -> Literal { + let mut text = String::new(); + text.push('\''); + if t == '"' { + // escape_default turns this into '\"' which is unnecessary. + text.push(t); + } else { + text.extend(t.escape_default()); + } + text.push('\''); + Literal::_new(text) + } + + pub fn byte_string(bytes: &[u8]) -> Literal { + let mut escaped = "b\"".to_string(); + for b in bytes { + match *b { + b'\0' => escaped.push_str(r"\0"), + b'\t' => escaped.push_str(r"\t"), + b'\n' => escaped.push_str(r"\n"), + b'\r' => escaped.push_str(r"\r"), + b'"' => escaped.push_str("\\\""), + b'\\' => escaped.push_str("\\\\"), + b'\x20'...b'\x7E' => escaped.push(*b as char), + _ => escaped.push_str(&format!("\\x{:02X}", b)), + } + } + escaped.push('"'); + Literal::_new(escaped) + } + + pub fn span(&self) -> Span { + self.span + } + + pub fn set_span(&mut self, span: Span) { + self.span = span; + } +} + +impl fmt::Display for Literal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.text.fmt(f) + } +} + +impl fmt::Debug for Literal { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let mut debug = fmt.debug_struct("Literal"); + debug.field("lit", &format_args!("{}", self.text)); + #[cfg(procmacro2_semver_exempt)] + debug.field("span", &self.span); + debug.finish() + } +} + +fn token_stream(mut input: Cursor) -> PResult { + let mut trees = Vec::new(); + loop { + let input_no_ws = skip_whitespace(input); + if input_no_ws.rest.len() == 0 { + break; + } + if let Ok((a, tokens)) = doc_comment(input_no_ws) { + input = a; + trees.extend(tokens); + continue; + } + + let (a, tt) = match token_tree(input_no_ws) { + Ok(p) => p, + Err(_) => break, + }; + trees.push(tt); + input = a; + } + Ok((input, TokenStream { inner: trees })) +} + +#[cfg(not(span_locations))] +fn spanned<'a, T>( + input: Cursor<'a>, + f: fn(Cursor<'a>) -> PResult<'a, T>, +) -> PResult<'a, (T, ::Span)> { + let (a, b) = f(skip_whitespace(input))?; + Ok((a, ((b, ::Span::_new_stable(Span::call_site()))))) +} + +#[cfg(span_locations)] +fn spanned<'a, T>( + input: Cursor<'a>, + f: fn(Cursor<'a>) -> PResult<'a, T>, +) -> PResult<'a, (T, ::Span)> { + let input = skip_whitespace(input); + let lo = input.off; + let (a, b) = f(input)?; + let hi = a.off; + let span = ::Span::_new_stable(Span { lo: lo, hi: hi }); + Ok((a, (b, span))) +} + +fn token_tree(input: Cursor) -> PResult { + let (rest, (mut tt, span)) = spanned(input, token_kind)?; + tt.set_span(span); + Ok((rest, tt)) +} + +named!(token_kind -> TokenTree, alt!( + map!(group, |g| TokenTree::Group(::Group::_new_stable(g))) + | + map!(literal, |l| TokenTree::Literal(::Literal::_new_stable(l))) // must be before symbol + | + map!(op, TokenTree::Punct) + | + symbol_leading_ws +)); + +named!(group -> Group, alt!( + delimited!( + punct!("("), + token_stream, + punct!(")") + ) => { |ts| Group::new(Delimiter::Parenthesis, ts) } + | + delimited!( + punct!("["), + token_stream, + punct!("]") + ) => { |ts| Group::new(Delimiter::Bracket, ts) } + | + delimited!( + punct!("{"), + token_stream, + punct!("}") + ) => { |ts| Group::new(Delimiter::Brace, ts) } +)); + +fn symbol_leading_ws(input: Cursor) -> PResult { + symbol(skip_whitespace(input)) +} + +fn symbol(input: Cursor) -> PResult { + let mut chars = input.char_indices(); + + let raw = input.starts_with("r#"); + if raw { + chars.next(); + chars.next(); + } + + match chars.next() { + Some((_, ch)) if is_ident_start(ch) => {} + _ => return Err(LexError), + } + + let mut end = input.len(); + for (i, ch) in chars { + if !is_ident_continue(ch) { + end = i; + break; + } + } + + let a = &input.rest[..end]; + if a == "r#_" { + Err(LexError) + } else { + let ident = if raw { + ::Ident::_new_raw(&a[2..], ::Span::call_site()) + } else { + ::Ident::new(a, ::Span::call_site()) + }; + Ok((input.advance(end), ident.into())) + } +} + +fn literal(input: Cursor) -> PResult { + let input_no_ws = skip_whitespace(input); + + match literal_nocapture(input_no_ws) { + Ok((a, ())) => { + let start = input.len() - input_no_ws.len(); + let len = input_no_ws.len() - a.len(); + let end = start + len; + Ok((a, Literal::_new(input.rest[start..end].to_string()))) + } + Err(LexError) => Err(LexError), + } +} + +named!(literal_nocapture -> (), alt!( + string + | + byte_string + | + byte + | + character + | + float + | + int +)); + +named!(string -> (), alt!( + quoted_string + | + preceded!( + punct!("r"), + raw_string + ) => { |_| () } +)); + +named!(quoted_string -> (), delimited!( + punct!("\""), + cooked_string, + tag!("\"") +)); + +fn cooked_string(input: Cursor) -> PResult<()> { + let mut chars = input.char_indices().peekable(); + while let Some((byte_offset, ch)) = chars.next() { + match ch { + '"' => { + return Ok((input.advance(byte_offset), ())); + } + '\r' => { + if let Some((_, '\n')) = chars.next() { + // ... + } else { + break; + } + } + '\\' => match chars.next() { + Some((_, 'x')) => { + if !backslash_x_char(&mut chars) { + break; + } + } + Some((_, 'n')) | Some((_, 'r')) | Some((_, 't')) | Some((_, '\\')) + | Some((_, '\'')) | Some((_, '"')) | Some((_, '0')) => {} + Some((_, 'u')) => { + if !backslash_u(&mut chars) { + break; + } + } + Some((_, '\n')) | Some((_, '\r')) => { + while let Some(&(_, ch)) = chars.peek() { + if ch.is_whitespace() { + chars.next(); + } else { + break; + } + } + } + _ => break, + }, + _ch => {} + } + } + Err(LexError) +} + +named!(byte_string -> (), alt!( + delimited!( + punct!("b\""), + cooked_byte_string, + tag!("\"") + ) => { |_| () } + | + preceded!( + punct!("br"), + raw_string + ) => { |_| () } +)); + +fn cooked_byte_string(mut input: Cursor) -> PResult<()> { + let mut bytes = input.bytes().enumerate(); + 'outer: while let Some((offset, b)) = bytes.next() { + match b { + b'"' => { + return Ok((input.advance(offset), ())); + } + b'\r' => { + if let Some((_, b'\n')) = bytes.next() { + // ... + } else { + break; + } + } + b'\\' => match bytes.next() { + Some((_, b'x')) => { + if !backslash_x_byte(&mut bytes) { + break; + } + } + Some((_, b'n')) | Some((_, b'r')) | Some((_, b't')) | Some((_, b'\\')) + | Some((_, b'0')) | Some((_, b'\'')) | Some((_, b'"')) => {} + Some((newline, b'\n')) | Some((newline, b'\r')) => { + let rest = input.advance(newline + 1); + for (offset, ch) in rest.char_indices() { + if !ch.is_whitespace() { + input = rest.advance(offset); + bytes = input.bytes().enumerate(); + continue 'outer; + } + } + break; + } + _ => break, + }, + b if b < 0x80 => {} + _ => break, + } + } + Err(LexError) +} + +fn raw_string(input: Cursor) -> PResult<()> { + let mut chars = input.char_indices(); + let mut n = 0; + while let Some((byte_offset, ch)) = chars.next() { + match ch { + '"' => { + n = byte_offset; + break; + } + '#' => {} + _ => return Err(LexError), + } + } + for (byte_offset, ch) in chars { + match ch { + '"' if input.advance(byte_offset + 1).starts_with(&input.rest[..n]) => { + let rest = input.advance(byte_offset + 1 + n); + return Ok((rest, ())); + } + '\r' => {} + _ => {} + } + } + Err(LexError) +} + +named!(byte -> (), do_parse!( + punct!("b") >> + tag!("'") >> + cooked_byte >> + tag!("'") >> + (()) +)); + +fn cooked_byte(input: Cursor) -> PResult<()> { + let mut bytes = input.bytes().enumerate(); + let ok = match bytes.next().map(|(_, b)| b) { + Some(b'\\') => match bytes.next().map(|(_, b)| b) { + Some(b'x') => backslash_x_byte(&mut bytes), + Some(b'n') | Some(b'r') | Some(b't') | Some(b'\\') | Some(b'0') | Some(b'\'') + | Some(b'"') => true, + _ => false, + }, + b => b.is_some(), + }; + if ok { + match bytes.next() { + Some((offset, _)) => { + if input.chars().as_str().is_char_boundary(offset) { + Ok((input.advance(offset), ())) + } else { + Err(LexError) + } + } + None => Ok((input.advance(input.len()), ())), + } + } else { + Err(LexError) + } +} + +named!(character -> (), do_parse!( + punct!("'") >> + cooked_char >> + tag!("'") >> + (()) +)); + +fn cooked_char(input: Cursor) -> PResult<()> { + let mut chars = input.char_indices(); + let ok = match chars.next().map(|(_, ch)| ch) { + Some('\\') => match chars.next().map(|(_, ch)| ch) { + Some('x') => backslash_x_char(&mut chars), + Some('u') => backslash_u(&mut chars), + Some('n') | Some('r') | Some('t') | Some('\\') | Some('0') | Some('\'') | Some('"') => { + true + } + _ => false, + }, + ch => ch.is_some(), + }; + if ok { + match chars.next() { + Some((idx, _)) => Ok((input.advance(idx), ())), + None => Ok((input.advance(input.len()), ())), + } + } else { + Err(LexError) + } +} + +macro_rules! next_ch { + ($chars:ident @ $pat:pat $(| $rest:pat)*) => { + match $chars.next() { + Some((_, ch)) => match ch { + $pat $(| $rest)* => ch, + _ => return false, + }, + None => return false + } + }; +} + +fn backslash_x_char(chars: &mut I) -> bool +where + I: Iterator, +{ + next_ch!(chars @ '0'...'7'); + next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F'); + true +} + +fn backslash_x_byte(chars: &mut I) -> bool +where + I: Iterator, +{ + next_ch!(chars @ b'0'...b'9' | b'a'...b'f' | b'A'...b'F'); + next_ch!(chars @ b'0'...b'9' | b'a'...b'f' | b'A'...b'F'); + true +} + +fn backslash_u(chars: &mut I) -> bool +where + I: Iterator, +{ + next_ch!(chars @ '{'); + next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F'); + loop { + let c = next_ch!(chars @ '0'...'9' | 'a'...'f' | 'A'...'F' | '_' | '}'); + if c == '}' { + return true; + } + } +} + +fn float(input: Cursor) -> PResult<()> { + let (rest, ()) = float_digits(input)?; + for suffix in &["f32", "f64"] { + if rest.starts_with(suffix) { + return word_break(rest.advance(suffix.len())); + } + } + word_break(rest) +} + +fn float_digits(input: Cursor) -> PResult<()> { + let mut chars = input.chars().peekable(); + match chars.next() { + Some(ch) if ch >= '0' && ch <= '9' => {} + _ => return Err(LexError), + } + + let mut len = 1; + let mut has_dot = false; + let mut has_exp = false; + while let Some(&ch) = chars.peek() { + match ch { + '0'...'9' | '_' => { + chars.next(); + len += 1; + } + '.' => { + if has_dot { + break; + } + chars.next(); + if chars + .peek() + .map(|&ch| ch == '.' || UnicodeXID::is_xid_start(ch)) + .unwrap_or(false) + { + return Err(LexError); + } + len += 1; + has_dot = true; + } + 'e' | 'E' => { + chars.next(); + len += 1; + has_exp = true; + break; + } + _ => break, + } + } + + let rest = input.advance(len); + if !(has_dot || has_exp || rest.starts_with("f32") || rest.starts_with("f64")) { + return Err(LexError); + } + + if has_exp { + let mut has_exp_value = false; + while let Some(&ch) = chars.peek() { + match ch { + '+' | '-' => { + if has_exp_value { + break; + } + chars.next(); + len += 1; + } + '0'...'9' => { + chars.next(); + len += 1; + has_exp_value = true; + } + '_' => { + chars.next(); + len += 1; + } + _ => break, + } + } + if !has_exp_value { + return Err(LexError); + } + } + + Ok((input.advance(len), ())) +} + +fn int(input: Cursor) -> PResult<()> { + let (rest, ()) = digits(input)?; + for suffix in &[ + "isize", "i8", "i16", "i32", "i64", "i128", "usize", "u8", "u16", "u32", "u64", "u128", + ] { + if rest.starts_with(suffix) { + return word_break(rest.advance(suffix.len())); + } + } + word_break(rest) +} + +fn digits(mut input: Cursor) -> PResult<()> { + let base = if input.starts_with("0x") { + input = input.advance(2); + 16 + } else if input.starts_with("0o") { + input = input.advance(2); + 8 + } else if input.starts_with("0b") { + input = input.advance(2); + 2 + } else { + 10 + }; + + let mut len = 0; + let mut empty = true; + for b in input.bytes() { + let digit = match b { + b'0'...b'9' => (b - b'0') as u64, + b'a'...b'f' => 10 + (b - b'a') as u64, + b'A'...b'F' => 10 + (b - b'A') as u64, + b'_' => { + if empty && base == 10 { + return Err(LexError); + } + len += 1; + continue; + } + _ => break, + }; + if digit >= base { + return Err(LexError); + } + len += 1; + empty = false; + } + if empty { + Err(LexError) + } else { + Ok((input.advance(len), ())) + } +} + +fn op(input: Cursor) -> PResult { + let input = skip_whitespace(input); + match op_char(input) { + Ok((rest, '\'')) => { + symbol(rest)?; + Ok((rest, Punct::new('\'', Spacing::Joint))) + } + Ok((rest, ch)) => { + let kind = match op_char(rest) { + Ok(_) => Spacing::Joint, + Err(LexError) => Spacing::Alone, + }; + Ok((rest, Punct::new(ch, kind))) + } + Err(LexError) => Err(LexError), + } +} + +fn op_char(input: Cursor) -> PResult { + if input.starts_with("//") || input.starts_with("/*") { + // Do not accept `/` of a comment as an op. + return Err(LexError); + } + + let mut chars = input.chars(); + let first = match chars.next() { + Some(ch) => ch, + None => { + return Err(LexError); + } + }; + let recognized = "~!@#$%^&*-=+|;:,<.>/?'"; + if recognized.contains(first) { + Ok((input.advance(first.len_utf8()), first)) + } else { + Err(LexError) + } +} + +fn doc_comment(input: Cursor) -> PResult> { + let mut trees = Vec::new(); + let (rest, ((comment, inner), span)) = spanned(input, doc_comment_contents)?; + trees.push(TokenTree::Punct(Punct::new('#', Spacing::Alone))); + if inner { + trees.push(Punct::new('!', Spacing::Alone).into()); + } + let mut stream = vec![ + TokenTree::Ident(::Ident::new("doc", span)), + TokenTree::Punct(Punct::new('=', Spacing::Alone)), + TokenTree::Literal(::Literal::string(comment)), + ]; + for tt in stream.iter_mut() { + tt.set_span(span); + } + let group = Group::new(Delimiter::Bracket, stream.into_iter().collect()); + trees.push(::Group::_new_stable(group).into()); + for tt in trees.iter_mut() { + tt.set_span(span); + } + Ok((rest, trees)) +} + +named!(doc_comment_contents -> (&str, bool), alt!( + do_parse!( + punct!("//!") >> + s: take_until_newline_or_eof!() >> + ((s, true)) + ) + | + do_parse!( + option!(whitespace) >> + peek!(tag!("/*!")) >> + s: block_comment >> + ((s, true)) + ) + | + do_parse!( + punct!("///") >> + not!(tag!("/")) >> + s: take_until_newline_or_eof!() >> + ((s, false)) + ) + | + do_parse!( + option!(whitespace) >> + peek!(tuple!(tag!("/**"), not!(tag!("*")))) >> + s: block_comment >> + ((s, false)) + ) +)); diff --git a/vendor/registry-40351f815f426200/proc-macro2/src/lib.rs b/vendor/registry-40351f815f426200/proc-macro2/src/lib.rs new file mode 100644 index 000000000..7181455c8 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/src/lib.rs @@ -0,0 +1,1156 @@ +//! A wrapper around the procedural macro API of the compiler's [`proc_macro`] +//! crate. This library serves three purposes: +//! +//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/ +//! +//! - **Bring proc-macro-like functionality to other contexts like build.rs and +//! main.rs.** Types from `proc_macro` are entirely specific to procedural +//! macros and cannot ever exist in code outside of a procedural macro. +//! Meanwhile `proc_macro2` types may exist anywhere including non-macro code. +//! By developing foundational libraries like [syn] and [quote] against +//! `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem +//! becomes easily applicable to many other use cases and we avoid +//! reimplementing non-macro equivalents of those libraries. +//! +//! - **Make procedural macros unit testable.** As a consequence of being +//! specific to procedural macros, nothing that uses `proc_macro` can be +//! executed from a unit test. In order for helper libraries or components of +//! a macro to be testable in isolation, they must be implemented using +//! `proc_macro2`. +//! +//! - **Provide the latest and greatest APIs across all compiler versions.** +//! Procedural macros were first introduced to Rust in 1.15.0 with an +//! extremely minimal interface. Since then, many improvements have landed to +//! make macros more flexible and easier to write. This library tracks the +//! procedural macro API of the most recent stable compiler but employs a +//! polyfill to provide that API consistently across any compiler since +//! 1.15.0. +//! +//! [syn]: https://github.com/dtolnay/syn +//! [quote]: https://github.com/dtolnay/quote +//! +//! # Usage +//! +//! The skeleton of a typical procedural macro typically looks like this: +//! +//! ```edition2018 +//! extern crate proc_macro; +//! +//! # const IGNORE: &str = stringify! { +//! #[proc_macro_derive(MyDerive)] +//! # }; +//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { +//! let input = proc_macro2::TokenStream::from(input); +//! +//! let output: proc_macro2::TokenStream = { +//! /* transform input */ +//! # input +//! }; +//! +//! proc_macro::TokenStream::from(output) +//! } +//! ``` +//! +//! If parsing with [Syn], you'll use [`parse_macro_input!`] instead to +//! propagate parse errors correctly back to the compiler when parsing fails. +//! +//! [`parse_macro_input!`]: https://docs.rs/syn/0.15/syn/macro.parse_macro_input.html +//! +//! # Unstable features +//! +//! The default feature set of proc-macro2 tracks the most recent stable +//! compiler API. Functionality in `proc_macro` that is not yet stable is not +//! exposed by proc-macro2 by default. +//! +//! To opt into the additional APIs available in the most recent nightly +//! compiler, the `procmacro2_semver_exempt` config flag must be passed to +//! rustc. As usual, we will polyfill those nightly-only APIs all the way back +//! to Rust 1.15.0. As these are unstable APIs that track the nightly compiler, +//! minor versions of proc-macro2 may make breaking changes to them at any time. +//! +//! ```sh +//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build +//! ``` +//! +//! Note that this must not only be done for your crate, but for any crate that +//! depends on your crate. This infectious nature is intentional, as it serves +//! as a reminder that you are outside of the normal semver guarantees. +//! +//! Semver exempt methods are marked as such in the proc-macro2 documentation. + +// Proc-macro2 types in rustdoc of other crates get linked to here. +#![doc(html_root_url = "https://docs.rs/proc-macro2/0.4.30")] +#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] +#![cfg_attr(super_unstable, feature(proc_macro_raw_ident, proc_macro_def_site))] + +#[cfg(use_proc_macro)] +extern crate proc_macro; +extern crate unicode_xid; + +use std::cmp::Ordering; +use std::fmt; +use std::hash::{Hash, Hasher}; +use std::iter::FromIterator; +use std::marker; +#[cfg(procmacro2_semver_exempt)] +use std::path::PathBuf; +use std::rc::Rc; +use std::str::FromStr; + +#[macro_use] +mod strnom; +mod fallback; + +#[cfg(not(wrap_proc_macro))] +use fallback as imp; +#[path = "wrapper.rs"] +#[cfg(wrap_proc_macro)] +mod imp; + +/// An abstract stream of tokens, or more concretely a sequence of token trees. +/// +/// This type provides interfaces for iterating over token trees and for +/// collecting token trees into one stream. +/// +/// Token stream is both the input and output of `#[proc_macro]`, +/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions. +#[derive(Clone)] +pub struct TokenStream { + inner: imp::TokenStream, + _marker: marker::PhantomData>, +} + +/// Error returned from `TokenStream::from_str`. +pub struct LexError { + inner: imp::LexError, + _marker: marker::PhantomData>, +} + +impl TokenStream { + fn _new(inner: imp::TokenStream) -> TokenStream { + TokenStream { + inner: inner, + _marker: marker::PhantomData, + } + } + + fn _new_stable(inner: fallback::TokenStream) -> TokenStream { + TokenStream { + inner: inner.into(), + _marker: marker::PhantomData, + } + } + + /// Returns an empty `TokenStream` containing no token trees. + pub fn new() -> TokenStream { + TokenStream::_new(imp::TokenStream::new()) + } + + #[deprecated(since = "0.4.4", note = "please use TokenStream::new")] + pub fn empty() -> TokenStream { + TokenStream::new() + } + + /// Checks if this `TokenStream` is empty. + pub fn is_empty(&self) -> bool { + self.inner.is_empty() + } +} + +/// `TokenStream::default()` returns an empty stream, +/// i.e. this is equivalent with `TokenStream::new()`. +impl Default for TokenStream { + fn default() -> Self { + TokenStream::new() + } +} + +/// Attempts to break the string into tokens and parse those tokens into a token +/// stream. +/// +/// May fail for a number of reasons, for example, if the string contains +/// unbalanced delimiters or characters not existing in the language. +/// +/// NOTE: Some errors may cause panics instead of returning `LexError`. We +/// reserve the right to change these errors into `LexError`s later. +impl FromStr for TokenStream { + type Err = LexError; + + fn from_str(src: &str) -> Result { + let e = src.parse().map_err(|e| LexError { + inner: e, + _marker: marker::PhantomData, + })?; + Ok(TokenStream::_new(e)) + } +} + +#[cfg(use_proc_macro)] +impl From for TokenStream { + fn from(inner: proc_macro::TokenStream) -> TokenStream { + TokenStream::_new(inner.into()) + } +} + +#[cfg(use_proc_macro)] +impl From for proc_macro::TokenStream { + fn from(inner: TokenStream) -> proc_macro::TokenStream { + inner.inner.into() + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + self.inner.extend(streams) + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + self.inner + .extend(streams.into_iter().map(|stream| stream.inner)) + } +} + +/// Collects a number of token trees into a single stream. +impl FromIterator for TokenStream { + fn from_iter>(streams: I) -> Self { + TokenStream::_new(streams.into_iter().collect()) + } +} +impl FromIterator for TokenStream { + fn from_iter>(streams: I) -> Self { + TokenStream::_new(streams.into_iter().map(|i| i.inner).collect()) + } +} + +/// Prints the token stream as a string that is supposed to be losslessly +/// convertible back into the same token stream (modulo spans), except for +/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative +/// numeric literals. +impl fmt::Display for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// Prints token in a form convenient for debugging. +impl fmt::Debug for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +impl fmt::Debug for LexError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// The source file of a given `Span`. +/// +/// This type is semver exempt and not exposed by default. +#[cfg(procmacro2_semver_exempt)] +#[derive(Clone, PartialEq, Eq)] +pub struct SourceFile { + inner: imp::SourceFile, + _marker: marker::PhantomData>, +} + +#[cfg(procmacro2_semver_exempt)] +impl SourceFile { + fn _new(inner: imp::SourceFile) -> Self { + SourceFile { + inner: inner, + _marker: marker::PhantomData, + } + } + + /// Get the path to this source file. + /// + /// ### Note + /// + /// If the code span associated with this `SourceFile` was generated by an + /// external macro, this may not be an actual path on the filesystem. Use + /// [`is_real`] to check. + /// + /// Also note that even if `is_real` returns `true`, if + /// `--remap-path-prefix` was passed on the command line, the path as given + /// may not actually be valid. + /// + /// [`is_real`]: #method.is_real + pub fn path(&self) -> PathBuf { + self.inner.path() + } + + /// Returns `true` if this source file is a real source file, and not + /// generated by an external macro's expansion. + pub fn is_real(&self) -> bool { + self.inner.is_real() + } +} + +#[cfg(procmacro2_semver_exempt)] +impl fmt::Debug for SourceFile { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// A line-column pair representing the start or end of a `Span`. +/// +/// This type is semver exempt and not exposed by default. +#[cfg(span_locations)] +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub struct LineColumn { + /// The 1-indexed line in the source file on which the span starts or ends + /// (inclusive). + pub line: usize, + /// The 0-indexed column (in UTF-8 characters) in the source file on which + /// the span starts or ends (inclusive). + pub column: usize, +} + +/// A region of source code, along with macro expansion information. +#[derive(Copy, Clone)] +pub struct Span { + inner: imp::Span, + _marker: marker::PhantomData>, +} + +impl Span { + fn _new(inner: imp::Span) -> Span { + Span { + inner: inner, + _marker: marker::PhantomData, + } + } + + fn _new_stable(inner: fallback::Span) -> Span { + Span { + inner: inner.into(), + _marker: marker::PhantomData, + } + } + + /// The span of the invocation of the current procedural macro. + /// + /// Identifiers created with this span will be resolved as if they were + /// written directly at the macro call location (call-site hygiene) and + /// other code at the macro call site will be able to refer to them as well. + pub fn call_site() -> Span { + Span::_new(imp::Span::call_site()) + } + + /// A span that resolves at the macro definition site. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn def_site() -> Span { + Span::_new(imp::Span::def_site()) + } + + /// Creates a new span with the same line/column information as `self` but + /// that resolves symbols as though it were at `other`. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn resolved_at(&self, other: Span) -> Span { + Span::_new(self.inner.resolved_at(other.inner)) + } + + /// Creates a new span with the same name resolution behavior as `self` but + /// with the line/column information of `other`. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn located_at(&self, other: Span) -> Span { + Span::_new(self.inner.located_at(other.inner)) + } + + /// Convert `proc_macro2::Span` to `proc_macro::Span`. + /// + /// This method is available when building with a nightly compiler, or when + /// building with rustc 1.29+ *without* semver exempt features. + /// + /// # Panics + /// + /// Panics if called from outside of a procedural macro. Unlike + /// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within + /// the context of a procedural macro invocation. + #[cfg(wrap_proc_macro)] + pub fn unwrap(self) -> proc_macro::Span { + self.inner.unwrap() + } + + // Soft deprecated. Please use Span::unwrap. + #[cfg(wrap_proc_macro)] + #[doc(hidden)] + pub fn unstable(self) -> proc_macro::Span { + self.unwrap() + } + + /// The original source file into which this span points. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn source_file(&self) -> SourceFile { + SourceFile::_new(self.inner.source_file()) + } + + /// Get the starting line/column in the source file for this span. + /// + /// This method requires the `"span-locations"` feature to be enabled. + #[cfg(span_locations)] + pub fn start(&self) -> LineColumn { + let imp::LineColumn { line, column } = self.inner.start(); + LineColumn { + line: line, + column: column, + } + } + + /// Get the ending line/column in the source file for this span. + /// + /// This method requires the `"span-locations"` feature to be enabled. + #[cfg(span_locations)] + pub fn end(&self) -> LineColumn { + let imp::LineColumn { line, column } = self.inner.end(); + LineColumn { + line: line, + column: column, + } + } + + /// Create a new span encompassing `self` and `other`. + /// + /// Returns `None` if `self` and `other` are from different files. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn join(&self, other: Span) -> Option { + self.inner.join(other.inner).map(Span::_new) + } + + /// Compares to spans to see if they're equal. + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn eq(&self, other: &Span) -> bool { + self.inner.eq(&other.inner) + } +} + +/// Prints a span in a form convenient for debugging. +impl fmt::Debug for Span { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`). +#[derive(Clone)] +pub enum TokenTree { + /// A token stream surrounded by bracket delimiters. + Group(Group), + /// An identifier. + Ident(Ident), + /// A single punctuation character (`+`, `,`, `$`, etc.). + Punct(Punct), + /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc. + Literal(Literal), +} + +impl TokenTree { + /// Returns the span of this tree, delegating to the `span` method of + /// the contained token or a delimited stream. + pub fn span(&self) -> Span { + match *self { + TokenTree::Group(ref t) => t.span(), + TokenTree::Ident(ref t) => t.span(), + TokenTree::Punct(ref t) => t.span(), + TokenTree::Literal(ref t) => t.span(), + } + } + + /// Configures the span for *only this token*. + /// + /// Note that if this token is a `Group` then this method will not configure + /// the span of each of the internal tokens, this will simply delegate to + /// the `set_span` method of each variant. + pub fn set_span(&mut self, span: Span) { + match *self { + TokenTree::Group(ref mut t) => t.set_span(span), + TokenTree::Ident(ref mut t) => t.set_span(span), + TokenTree::Punct(ref mut t) => t.set_span(span), + TokenTree::Literal(ref mut t) => t.set_span(span), + } + } +} + +impl From for TokenTree { + fn from(g: Group) -> TokenTree { + TokenTree::Group(g) + } +} + +impl From for TokenTree { + fn from(g: Ident) -> TokenTree { + TokenTree::Ident(g) + } +} + +impl From for TokenTree { + fn from(g: Punct) -> TokenTree { + TokenTree::Punct(g) + } +} + +impl From for TokenTree { + fn from(g: Literal) -> TokenTree { + TokenTree::Literal(g) + } +} + +/// Prints the token tree as a string that is supposed to be losslessly +/// convertible back into the same token tree (modulo spans), except for +/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative +/// numeric literals. +impl fmt::Display for TokenTree { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match *self { + TokenTree::Group(ref t) => t.fmt(f), + TokenTree::Ident(ref t) => t.fmt(f), + TokenTree::Punct(ref t) => t.fmt(f), + TokenTree::Literal(ref t) => t.fmt(f), + } + } +} + +/// Prints token tree in a form convenient for debugging. +impl fmt::Debug for TokenTree { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // Each of these has the name in the struct type in the derived debug, + // so don't bother with an extra layer of indirection + match *self { + TokenTree::Group(ref t) => t.fmt(f), + TokenTree::Ident(ref t) => { + let mut debug = f.debug_struct("Ident"); + debug.field("sym", &format_args!("{}", t)); + imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner); + debug.finish() + } + TokenTree::Punct(ref t) => t.fmt(f), + TokenTree::Literal(ref t) => t.fmt(f), + } + } +} + +/// A delimited token stream. +/// +/// A `Group` internally contains a `TokenStream` which is surrounded by +/// `Delimiter`s. +#[derive(Clone)] +pub struct Group { + inner: imp::Group, +} + +/// Describes how a sequence of token trees is delimited. +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum Delimiter { + /// `( ... )` + Parenthesis, + /// `{ ... }` + Brace, + /// `[ ... ]` + Bracket, + /// `Ø ... Ø` + /// + /// An implicit delimiter, that may, for example, appear around tokens + /// coming from a "macro variable" `$var`. It is important to preserve + /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`. + /// Implicit delimiters may not survive roundtrip of a token stream through + /// a string. + None, +} + +impl Group { + fn _new(inner: imp::Group) -> Self { + Group { inner: inner } + } + + fn _new_stable(inner: fallback::Group) -> Self { + Group { + inner: inner.into(), + } + } + + /// Creates a new `Group` with the given delimiter and token stream. + /// + /// This constructor will set the span for this group to + /// `Span::call_site()`. To change the span you can use the `set_span` + /// method below. + pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group { + Group { + inner: imp::Group::new(delimiter, stream.inner), + } + } + + /// Returns the delimiter of this `Group` + pub fn delimiter(&self) -> Delimiter { + self.inner.delimiter() + } + + /// Returns the `TokenStream` of tokens that are delimited in this `Group`. + /// + /// Note that the returned token stream does not include the delimiter + /// returned above. + pub fn stream(&self) -> TokenStream { + TokenStream::_new(self.inner.stream()) + } + + /// Returns the span for the delimiters of this token stream, spanning the + /// entire `Group`. + /// + /// ```text + /// pub fn span(&self) -> Span { + /// ^^^^^^^ + /// ``` + pub fn span(&self) -> Span { + Span::_new(self.inner.span()) + } + + /// Returns the span pointing to the opening delimiter of this group. + /// + /// ```text + /// pub fn span_open(&self) -> Span { + /// ^ + /// ``` + #[cfg(procmacro2_semver_exempt)] + pub fn span_open(&self) -> Span { + Span::_new(self.inner.span_open()) + } + + /// Returns the span pointing to the closing delimiter of this group. + /// + /// ```text + /// pub fn span_close(&self) -> Span { + /// ^ + /// ``` + #[cfg(procmacro2_semver_exempt)] + pub fn span_close(&self) -> Span { + Span::_new(self.inner.span_close()) + } + + /// Configures the span for this `Group`'s delimiters, but not its internal + /// tokens. + /// + /// This method will **not** set the span of all the internal tokens spanned + /// by this group, but rather it will only set the span of the delimiter + /// tokens at the level of the `Group`. + pub fn set_span(&mut self, span: Span) { + self.inner.set_span(span.inner) + } +} + +/// Prints the group as a string that should be losslessly convertible back +/// into the same group (modulo spans), except for possibly `TokenTree::Group`s +/// with `Delimiter::None` delimiters. +impl fmt::Display for Group { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fmt::Display::fmt(&self.inner, formatter) + } +} + +impl fmt::Debug for Group { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + fmt::Debug::fmt(&self.inner, formatter) + } +} + +/// An `Punct` is an single punctuation character like `+`, `-` or `#`. +/// +/// Multicharacter operators like `+=` are represented as two instances of +/// `Punct` with different forms of `Spacing` returned. +#[derive(Clone)] +pub struct Punct { + op: char, + spacing: Spacing, + span: Span, +} + +/// Whether an `Punct` is followed immediately by another `Punct` or followed by +/// another token or whitespace. +#[derive(Copy, Clone, Debug, Eq, PartialEq)] +pub enum Spacing { + /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`. + Alone, + /// E.g. `+` is `Joint` in `+=` or `'#`. + /// + /// Additionally, single quote `'` can join with identifiers to form + /// lifetimes `'ident`. + Joint, +} + +impl Punct { + /// Creates a new `Punct` from the given character and spacing. + /// + /// The `ch` argument must be a valid punctuation character permitted by the + /// language, otherwise the function will panic. + /// + /// The returned `Punct` will have the default span of `Span::call_site()` + /// which can be further configured with the `set_span` method below. + pub fn new(op: char, spacing: Spacing) -> Punct { + Punct { + op: op, + spacing: spacing, + span: Span::call_site(), + } + } + + /// Returns the value of this punctuation character as `char`. + pub fn as_char(&self) -> char { + self.op + } + + /// Returns the spacing of this punctuation character, indicating whether + /// it's immediately followed by another `Punct` in the token stream, so + /// they can potentially be combined into a multicharacter operator + /// (`Joint`), or it's followed by some other token or whitespace (`Alone`) + /// so the operator has certainly ended. + pub fn spacing(&self) -> Spacing { + self.spacing + } + + /// Returns the span for this punctuation character. + pub fn span(&self) -> Span { + self.span + } + + /// Configure the span for this punctuation character. + pub fn set_span(&mut self, span: Span) { + self.span = span; + } +} + +/// Prints the punctuation character as a string that should be losslessly +/// convertible back into the same character. +impl fmt::Display for Punct { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.op.fmt(f) + } +} + +impl fmt::Debug for Punct { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + let mut debug = fmt.debug_struct("Punct"); + debug.field("op", &self.op); + debug.field("spacing", &self.spacing); + imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner); + debug.finish() + } +} + +/// A word of Rust code, which may be a keyword or legal variable name. +/// +/// An identifier consists of at least one Unicode code point, the first of +/// which has the XID_Start property and the rest of which have the XID_Continue +/// property. +/// +/// - The empty string is not an identifier. Use `Option`. +/// - A lifetime is not an identifier. Use `syn::Lifetime` instead. +/// +/// An identifier constructed with `Ident::new` is permitted to be a Rust +/// keyword, though parsing one through its [`Parse`] implementation rejects +/// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the +/// behaviour of `Ident::new`. +/// +/// [`Parse`]: https://docs.rs/syn/0.15/syn/parse/trait.Parse.html +/// +/// # Examples +/// +/// A new ident can be created from a string using the `Ident::new` function. +/// A span must be provided explicitly which governs the name resolution +/// behavior of the resulting identifier. +/// +/// ```edition2018 +/// use proc_macro2::{Ident, Span}; +/// +/// fn main() { +/// let call_ident = Ident::new("calligraphy", Span::call_site()); +/// +/// println!("{}", call_ident); +/// } +/// ``` +/// +/// An ident can be interpolated into a token stream using the `quote!` macro. +/// +/// ```edition2018 +/// use proc_macro2::{Ident, Span}; +/// use quote::quote; +/// +/// fn main() { +/// let ident = Ident::new("demo", Span::call_site()); +/// +/// // Create a variable binding whose name is this ident. +/// let expanded = quote! { let #ident = 10; }; +/// +/// // Create a variable binding with a slightly different name. +/// let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site()); +/// let expanded = quote! { let #temp_ident = 10; }; +/// } +/// ``` +/// +/// A string representation of the ident is available through the `to_string()` +/// method. +/// +/// ```edition2018 +/// # use proc_macro2::{Ident, Span}; +/// # +/// # let ident = Ident::new("another_identifier", Span::call_site()); +/// # +/// // Examine the ident as a string. +/// let ident_string = ident.to_string(); +/// if ident_string.len() > 60 { +/// println!("Very long identifier: {}", ident_string) +/// } +/// ``` +#[derive(Clone)] +pub struct Ident { + inner: imp::Ident, + _marker: marker::PhantomData>, +} + +impl Ident { + fn _new(inner: imp::Ident) -> Ident { + Ident { + inner: inner, + _marker: marker::PhantomData, + } + } + + /// Creates a new `Ident` with the given `string` as well as the specified + /// `span`. + /// + /// The `string` argument must be a valid identifier permitted by the + /// language, otherwise the function will panic. + /// + /// Note that `span`, currently in rustc, configures the hygiene information + /// for this identifier. + /// + /// As of this time `Span::call_site()` explicitly opts-in to "call-site" + /// hygiene meaning that identifiers created with this span will be resolved + /// as if they were written directly at the location of the macro call, and + /// other code at the macro call site will be able to refer to them as well. + /// + /// Later spans like `Span::def_site()` will allow to opt-in to + /// "definition-site" hygiene meaning that identifiers created with this + /// span will be resolved at the location of the macro definition and other + /// code at the macro call site will not be able to refer to them. + /// + /// Due to the current importance of hygiene this constructor, unlike other + /// tokens, requires a `Span` to be specified at construction. + /// + /// # Panics + /// + /// Panics if the input string is neither a keyword nor a legal variable + /// name. If you are not sure whether the string contains an identifier and + /// need to handle an error case, use + /// syn::parse_str::<Ident> + /// rather than `Ident::new`. + pub fn new(string: &str, span: Span) -> Ident { + Ident::_new(imp::Ident::new(string, span.inner)) + } + + /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). + /// + /// This method is semver exempt and not exposed by default. + #[cfg(procmacro2_semver_exempt)] + pub fn new_raw(string: &str, span: Span) -> Ident { + Ident::_new_raw(string, span) + } + + fn _new_raw(string: &str, span: Span) -> Ident { + Ident::_new(imp::Ident::new_raw(string, span.inner)) + } + + /// Returns the span of this `Ident`. + pub fn span(&self) -> Span { + Span::_new(self.inner.span()) + } + + /// Configures the span of this `Ident`, possibly changing its hygiene + /// context. + pub fn set_span(&mut self, span: Span) { + self.inner.set_span(span.inner); + } +} + +impl PartialEq for Ident { + fn eq(&self, other: &Ident) -> bool { + self.inner == other.inner + } +} + +impl PartialEq for Ident +where + T: ?Sized + AsRef, +{ + fn eq(&self, other: &T) -> bool { + self.inner == other + } +} + +impl Eq for Ident {} + +impl PartialOrd for Ident { + fn partial_cmp(&self, other: &Ident) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for Ident { + fn cmp(&self, other: &Ident) -> Ordering { + self.to_string().cmp(&other.to_string()) + } +} + +impl Hash for Ident { + fn hash(&self, hasher: &mut H) { + self.to_string().hash(hasher) + } +} + +/// Prints the identifier as a string that should be losslessly convertible back +/// into the same identifier. +impl fmt::Display for Ident { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +impl fmt::Debug for Ident { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`), +/// byte character (`b'a'`), an integer or floating point number with or without +/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`). +/// +/// Boolean literals like `true` and `false` do not belong here, they are +/// `Ident`s. +#[derive(Clone)] +pub struct Literal { + inner: imp::Literal, + _marker: marker::PhantomData>, +} + +macro_rules! suffixed_int_literals { + ($($name:ident => $kind:ident,)*) => ($( + /// Creates a new suffixed integer literal with the specified value. + /// + /// This function will create an integer like `1u32` where the integer + /// value specified is the first part of the token and the integral is + /// also suffixed at the end. Literals created from negative numbers may + /// not survive rountrips through `TokenStream` or strings and may be + /// broken into two tokens (`-` and positive literal). + /// + /// Literals created through this method have the `Span::call_site()` + /// span by default, which can be configured with the `set_span` method + /// below. + pub fn $name(n: $kind) -> Literal { + Literal::_new(imp::Literal::$name(n)) + } + )*) +} + +macro_rules! unsuffixed_int_literals { + ($($name:ident => $kind:ident,)*) => ($( + /// Creates a new unsuffixed integer literal with the specified value. + /// + /// This function will create an integer like `1` where the integer + /// value specified is the first part of the token. No suffix is + /// specified on this token, meaning that invocations like + /// `Literal::i8_unsuffixed(1)` are equivalent to + /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers + /// may not survive rountrips through `TokenStream` or strings and may + /// be broken into two tokens (`-` and positive literal). + /// + /// Literals created through this method have the `Span::call_site()` + /// span by default, which can be configured with the `set_span` method + /// below. + pub fn $name(n: $kind) -> Literal { + Literal::_new(imp::Literal::$name(n)) + } + )*) +} + +impl Literal { + fn _new(inner: imp::Literal) -> Literal { + Literal { + inner: inner, + _marker: marker::PhantomData, + } + } + + fn _new_stable(inner: fallback::Literal) -> Literal { + Literal { + inner: inner.into(), + _marker: marker::PhantomData, + } + } + + suffixed_int_literals! { + u8_suffixed => u8, + u16_suffixed => u16, + u32_suffixed => u32, + u64_suffixed => u64, + usize_suffixed => usize, + i8_suffixed => i8, + i16_suffixed => i16, + i32_suffixed => i32, + i64_suffixed => i64, + isize_suffixed => isize, + } + + #[cfg(u128)] + suffixed_int_literals! { + u128_suffixed => u128, + i128_suffixed => i128, + } + + unsuffixed_int_literals! { + u8_unsuffixed => u8, + u16_unsuffixed => u16, + u32_unsuffixed => u32, + u64_unsuffixed => u64, + usize_unsuffixed => usize, + i8_unsuffixed => i8, + i16_unsuffixed => i16, + i32_unsuffixed => i32, + i64_unsuffixed => i64, + isize_unsuffixed => isize, + } + + #[cfg(u128)] + unsuffixed_int_literals! { + u128_unsuffixed => u128, + i128_unsuffixed => i128, + } + + pub fn f64_unsuffixed(f: f64) -> Literal { + assert!(f.is_finite()); + Literal::_new(imp::Literal::f64_unsuffixed(f)) + } + + pub fn f64_suffixed(f: f64) -> Literal { + assert!(f.is_finite()); + Literal::_new(imp::Literal::f64_suffixed(f)) + } + + /// Creates a new unsuffixed floating-point literal. + /// + /// This constructor is similar to those like `Literal::i8_unsuffixed` where + /// the float's value is emitted directly into the token but no suffix is + /// used, so it may be inferred to be a `f64` later in the compiler. + /// Literals created from negative numbers may not survive rountrips through + /// `TokenStream` or strings and may be broken into two tokens (`-` and + /// positive literal). + /// + /// # Panics + /// + /// This function requires that the specified float is finite, for example + /// if it is infinity or NaN this function will panic. + pub fn f32_unsuffixed(f: f32) -> Literal { + assert!(f.is_finite()); + Literal::_new(imp::Literal::f32_unsuffixed(f)) + } + + pub fn f32_suffixed(f: f32) -> Literal { + assert!(f.is_finite()); + Literal::_new(imp::Literal::f32_suffixed(f)) + } + + pub fn string(string: &str) -> Literal { + Literal::_new(imp::Literal::string(string)) + } + + pub fn character(ch: char) -> Literal { + Literal::_new(imp::Literal::character(ch)) + } + + pub fn byte_string(s: &[u8]) -> Literal { + Literal::_new(imp::Literal::byte_string(s)) + } + + pub fn span(&self) -> Span { + Span::_new(self.inner.span()) + } + + pub fn set_span(&mut self, span: Span) { + self.inner.set_span(span.inner); + } +} + +impl fmt::Debug for Literal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +impl fmt::Display for Literal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } +} + +/// Public implementation details for the `TokenStream` type, such as iterators. +pub mod token_stream { + use std::fmt; + use std::marker; + use std::rc::Rc; + + use imp; + pub use TokenStream; + use TokenTree; + + /// An iterator over `TokenStream`'s `TokenTree`s. + /// + /// The iteration is "shallow", e.g. the iterator doesn't recurse into + /// delimited groups, and returns whole groups as token trees. + #[derive(Clone)] + pub struct IntoIter { + inner: imp::TokenTreeIter, + _marker: marker::PhantomData>, + } + + impl Iterator for IntoIter { + type Item = TokenTree; + + fn next(&mut self) -> Option { + self.inner.next() + } + } + + impl fmt::Debug for IntoIter { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.inner.fmt(f) + } + } + + impl IntoIterator for TokenStream { + type Item = TokenTree; + type IntoIter = IntoIter; + + fn into_iter(self) -> IntoIter { + IntoIter { + inner: self.inner.into_iter(), + _marker: marker::PhantomData, + } + } + } +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/src/strnom.rs b/vendor/registry-40351f815f426200/proc-macro2/src/strnom.rs new file mode 100644 index 000000000..96789d569 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/src/strnom.rs @@ -0,0 +1,393 @@ +//! Adapted from [`nom`](https://github.com/Geal/nom). + +use std::str::{Bytes, CharIndices, Chars}; + +use unicode_xid::UnicodeXID; + +use fallback::LexError; + +#[derive(Copy, Clone, Eq, PartialEq)] +pub struct Cursor<'a> { + pub rest: &'a str, + #[cfg(span_locations)] + pub off: u32, +} + +impl<'a> Cursor<'a> { + #[cfg(not(span_locations))] + pub fn advance(&self, amt: usize) -> Cursor<'a> { + Cursor { + rest: &self.rest[amt..], + } + } + #[cfg(span_locations)] + pub fn advance(&self, amt: usize) -> Cursor<'a> { + Cursor { + rest: &self.rest[amt..], + off: self.off + (amt as u32), + } + } + + pub fn find(&self, p: char) -> Option { + self.rest.find(p) + } + + pub fn starts_with(&self, s: &str) -> bool { + self.rest.starts_with(s) + } + + pub fn is_empty(&self) -> bool { + self.rest.is_empty() + } + + pub fn len(&self) -> usize { + self.rest.len() + } + + pub fn as_bytes(&self) -> &'a [u8] { + self.rest.as_bytes() + } + + pub fn bytes(&self) -> Bytes<'a> { + self.rest.bytes() + } + + pub fn chars(&self) -> Chars<'a> { + self.rest.chars() + } + + pub fn char_indices(&self) -> CharIndices<'a> { + self.rest.char_indices() + } +} + +pub type PResult<'a, O> = Result<(Cursor<'a>, O), LexError>; + +pub fn whitespace(input: Cursor) -> PResult<()> { + if input.is_empty() { + return Err(LexError); + } + + let bytes = input.as_bytes(); + let mut i = 0; + while i < bytes.len() { + let s = input.advance(i); + if bytes[i] == b'/' { + if s.starts_with("//") + && (!s.starts_with("///") || s.starts_with("////")) + && !s.starts_with("//!") + { + if let Some(len) = s.find('\n') { + i += len + 1; + continue; + } + break; + } else if s.starts_with("/**/") { + i += 4; + continue; + } else if s.starts_with("/*") + && (!s.starts_with("/**") || s.starts_with("/***")) + && !s.starts_with("/*!") + { + let (_, com) = block_comment(s)?; + i += com.len(); + continue; + } + } + match bytes[i] { + b' ' | 0x09...0x0d => { + i += 1; + continue; + } + b if b <= 0x7f => {} + _ => { + let ch = s.chars().next().unwrap(); + if is_whitespace(ch) { + i += ch.len_utf8(); + continue; + } + } + } + return if i > 0 { Ok((s, ())) } else { Err(LexError) }; + } + Ok((input.advance(input.len()), ())) +} + +pub fn block_comment(input: Cursor) -> PResult<&str> { + if !input.starts_with("/*") { + return Err(LexError); + } + + let mut depth = 0; + let bytes = input.as_bytes(); + let mut i = 0; + let upper = bytes.len() - 1; + while i < upper { + if bytes[i] == b'/' && bytes[i + 1] == b'*' { + depth += 1; + i += 1; // eat '*' + } else if bytes[i] == b'*' && bytes[i + 1] == b'/' { + depth -= 1; + if depth == 0 { + return Ok((input.advance(i + 2), &input.rest[..i + 2])); + } + i += 1; // eat '/' + } + i += 1; + } + Err(LexError) +} + +pub fn skip_whitespace(input: Cursor) -> Cursor { + match whitespace(input) { + Ok((rest, _)) => rest, + Err(LexError) => input, + } +} + +fn is_whitespace(ch: char) -> bool { + // Rust treats left-to-right mark and right-to-left mark as whitespace + ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}' +} + +pub fn word_break(input: Cursor) -> PResult<()> { + match input.chars().next() { + Some(ch) if UnicodeXID::is_xid_continue(ch) => Err(LexError), + Some(_) | None => Ok((input, ())), + } +} + +macro_rules! named { + ($name:ident -> $o:ty, $submac:ident!( $($args:tt)* )) => { + fn $name<'a>(i: Cursor<'a>) -> $crate::strnom::PResult<'a, $o> { + $submac!(i, $($args)*) + } + }; +} + +macro_rules! alt { + ($i:expr, $e:ident | $($rest:tt)*) => { + alt!($i, call!($e) | $($rest)*) + }; + + ($i:expr, $subrule:ident!( $($args:tt)*) | $($rest:tt)*) => { + match $subrule!($i, $($args)*) { + res @ Ok(_) => res, + _ => alt!($i, $($rest)*) + } + }; + + ($i:expr, $subrule:ident!( $($args:tt)* ) => { $gen:expr } | $($rest:tt)+) => { + match $subrule!($i, $($args)*) { + Ok((i, o)) => Ok((i, $gen(o))), + Err(LexError) => alt!($i, $($rest)*) + } + }; + + ($i:expr, $e:ident => { $gen:expr } | $($rest:tt)*) => { + alt!($i, call!($e) => { $gen } | $($rest)*) + }; + + ($i:expr, $e:ident => { $gen:expr }) => { + alt!($i, call!($e) => { $gen }) + }; + + ($i:expr, $subrule:ident!( $($args:tt)* ) => { $gen:expr }) => { + match $subrule!($i, $($args)*) { + Ok((i, o)) => Ok((i, $gen(o))), + Err(LexError) => Err(LexError), + } + }; + + ($i:expr, $e:ident) => { + alt!($i, call!($e)) + }; + + ($i:expr, $subrule:ident!( $($args:tt)*)) => { + $subrule!($i, $($args)*) + }; +} + +macro_rules! do_parse { + ($i:expr, ( $($rest:expr),* )) => { + Ok(($i, ( $($rest),* ))) + }; + + ($i:expr, $e:ident >> $($rest:tt)*) => { + do_parse!($i, call!($e) >> $($rest)*) + }; + + ($i:expr, $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, _)) => do_parse!(i, $($rest)*), + } + }; + + ($i:expr, $field:ident : $e:ident >> $($rest:tt)*) => { + do_parse!($i, $field: call!($e) >> $($rest)*) + }; + + ($i:expr, $field:ident : $submac:ident!( $($args:tt)* ) >> $($rest:tt)*) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, o)) => { + let $field = o; + do_parse!(i, $($rest)*) + }, + } + }; +} + +macro_rules! peek { + ($i:expr, $submac:ident!( $($args:tt)* )) => { + match $submac!($i, $($args)*) { + Ok((_, o)) => Ok(($i, o)), + Err(LexError) => Err(LexError), + } + }; +} + +macro_rules! call { + ($i:expr, $fun:expr $(, $args:expr)*) => { + $fun($i $(, $args)*) + }; +} + +macro_rules! option { + ($i:expr, $f:expr) => { + match $f($i) { + Ok((i, o)) => Ok((i, Some(o))), + Err(LexError) => Ok(($i, None)), + } + }; +} + +macro_rules! take_until_newline_or_eof { + ($i:expr,) => {{ + if $i.len() == 0 { + Ok(($i, "")) + } else { + match $i.find('\n') { + Some(i) => Ok(($i.advance(i), &$i.rest[..i])), + None => Ok(($i.advance($i.len()), &$i.rest[..$i.len()])), + } + } + }}; +} + +macro_rules! tuple { + ($i:expr, $($rest:tt)*) => { + tuple_parser!($i, (), $($rest)*) + }; +} + +/// Do not use directly. Use `tuple!`. +macro_rules! tuple_parser { + ($i:expr, ($($parsed:tt),*), $e:ident, $($rest:tt)*) => { + tuple_parser!($i, ($($parsed),*), call!($e), $($rest)*) + }; + + ($i:expr, (), $submac:ident!( $($args:tt)* ), $($rest:tt)*) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, o)) => tuple_parser!(i, (o), $($rest)*), + } + }; + + ($i:expr, ($($parsed:tt)*), $submac:ident!( $($args:tt)* ), $($rest:tt)*) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, o)) => tuple_parser!(i, ($($parsed)* , o), $($rest)*), + } + }; + + ($i:expr, ($($parsed:tt),*), $e:ident) => { + tuple_parser!($i, ($($parsed),*), call!($e)) + }; + + ($i:expr, (), $submac:ident!( $($args:tt)* )) => { + $submac!($i, $($args)*) + }; + + ($i:expr, ($($parsed:expr),*), $submac:ident!( $($args:tt)* )) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, o)) => Ok((i, ($($parsed),*, o))) + } + }; + + ($i:expr, ($($parsed:expr),*)) => { + Ok(($i, ($($parsed),*))) + }; +} + +macro_rules! not { + ($i:expr, $submac:ident!( $($args:tt)* )) => { + match $submac!($i, $($args)*) { + Ok((_, _)) => Err(LexError), + Err(LexError) => Ok(($i, ())), + } + }; +} + +macro_rules! tag { + ($i:expr, $tag:expr) => { + if $i.starts_with($tag) { + Ok(($i.advance($tag.len()), &$i.rest[..$tag.len()])) + } else { + Err(LexError) + } + }; +} + +macro_rules! punct { + ($i:expr, $punct:expr) => { + $crate::strnom::punct($i, $punct) + }; +} + +/// Do not use directly. Use `punct!`. +pub fn punct<'a>(input: Cursor<'a>, token: &'static str) -> PResult<'a, &'a str> { + let input = skip_whitespace(input); + if input.starts_with(token) { + Ok((input.advance(token.len()), token)) + } else { + Err(LexError) + } +} + +macro_rules! preceded { + ($i:expr, $submac:ident!( $($args:tt)* ), $submac2:ident!( $($args2:tt)* )) => { + match tuple!($i, $submac!($($args)*), $submac2!($($args2)*)) { + Ok((remaining, (_, o))) => Ok((remaining, o)), + Err(LexError) => Err(LexError), + } + }; + + ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => { + preceded!($i, $submac!($($args)*), call!($g)) + }; +} + +macro_rules! delimited { + ($i:expr, $submac:ident!( $($args:tt)* ), $($rest:tt)+) => { + match tuple_parser!($i, (), $submac!($($args)*), $($rest)*) { + Err(LexError) => Err(LexError), + Ok((i1, (_, o, _))) => Ok((i1, o)) + } + }; +} + +macro_rules! map { + ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => { + match $submac!($i, $($args)*) { + Err(LexError) => Err(LexError), + Ok((i, o)) => Ok((i, call!(o, $g))) + } + }; + + ($i:expr, $f:expr, $g:expr) => { + map!($i, call!($f), $g) + }; +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/src/wrapper.rs b/vendor/registry-40351f815f426200/proc-macro2/src/wrapper.rs new file mode 100644 index 000000000..994ed24d8 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/src/wrapper.rs @@ -0,0 +1,928 @@ +use std::fmt; +use std::iter; +use std::panic::{self, PanicInfo}; +#[cfg(super_unstable)] +use std::path::PathBuf; +use std::str::FromStr; + +use fallback; +use proc_macro; + +use {Delimiter, Punct, Spacing, TokenTree}; + +#[derive(Clone)] +pub enum TokenStream { + Compiler(proc_macro::TokenStream), + Fallback(fallback::TokenStream), +} + +pub enum LexError { + Compiler(proc_macro::LexError), + Fallback(fallback::LexError), +} + +fn nightly_works() -> bool { + use std::sync::atomic::*; + use std::sync::Once; + + #[allow(deprecated)] + static WORKS: AtomicUsize = ATOMIC_USIZE_INIT; + static INIT: Once = Once::new(); + + match WORKS.load(Ordering::SeqCst) { + 1 => return false, + 2 => return true, + _ => {} + } + + // Swap in a null panic hook to avoid printing "thread panicked" to stderr, + // then use catch_unwind to determine whether the compiler's proc_macro is + // working. When proc-macro2 is used from outside of a procedural macro all + // of the proc_macro crate's APIs currently panic. + // + // The Once is to prevent the possibility of this ordering: + // + // thread 1 calls take_hook, gets the user's original hook + // thread 1 calls set_hook with the null hook + // thread 2 calls take_hook, thinks null hook is the original hook + // thread 2 calls set_hook with the null hook + // thread 1 calls set_hook with the actual original hook + // thread 2 calls set_hook with what it thinks is the original hook + // + // in which the user's hook has been lost. + // + // There is still a race condition where a panic in a different thread can + // happen during the interval that the user's original panic hook is + // unregistered such that their hook is incorrectly not called. This is + // sufficiently unlikely and less bad than printing panic messages to stderr + // on correct use of this crate. Maybe there is a libstd feature request + // here. For now, if a user needs to guarantee that this failure mode does + // not occur, they need to call e.g. `proc_macro2::Span::call_site()` from + // the main thread before launching any other threads. + INIT.call_once(|| { + type PanicHook = Fn(&PanicInfo) + Sync + Send + 'static; + + let null_hook: Box = Box::new(|_panic_info| { /* ignore */ }); + let sanity_check = &*null_hook as *const PanicHook; + let original_hook = panic::take_hook(); + panic::set_hook(null_hook); + + let works = panic::catch_unwind(|| proc_macro::Span::call_site()).is_ok(); + WORKS.store(works as usize + 1, Ordering::SeqCst); + + let hopefully_null_hook = panic::take_hook(); + panic::set_hook(original_hook); + if sanity_check != &*hopefully_null_hook { + panic!("observed race condition in proc_macro2::nightly_works"); + } + }); + nightly_works() +} + +fn mismatch() -> ! { + panic!("stable/nightly mismatch") +} + +impl TokenStream { + pub fn new() -> TokenStream { + if nightly_works() { + TokenStream::Compiler(proc_macro::TokenStream::new()) + } else { + TokenStream::Fallback(fallback::TokenStream::new()) + } + } + + pub fn is_empty(&self) -> bool { + match self { + TokenStream::Compiler(tts) => tts.is_empty(), + TokenStream::Fallback(tts) => tts.is_empty(), + } + } + + fn unwrap_nightly(self) -> proc_macro::TokenStream { + match self { + TokenStream::Compiler(s) => s, + TokenStream::Fallback(_) => mismatch(), + } + } + + fn unwrap_stable(self) -> fallback::TokenStream { + match self { + TokenStream::Compiler(_) => mismatch(), + TokenStream::Fallback(s) => s, + } + } +} + +impl FromStr for TokenStream { + type Err = LexError; + + fn from_str(src: &str) -> Result { + if nightly_works() { + Ok(TokenStream::Compiler(src.parse()?)) + } else { + Ok(TokenStream::Fallback(src.parse()?)) + } + } +} + +impl fmt::Display for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + TokenStream::Compiler(tts) => tts.fmt(f), + TokenStream::Fallback(tts) => tts.fmt(f), + } + } +} + +impl From for TokenStream { + fn from(inner: proc_macro::TokenStream) -> TokenStream { + TokenStream::Compiler(inner) + } +} + +impl From for proc_macro::TokenStream { + fn from(inner: TokenStream) -> proc_macro::TokenStream { + match inner { + TokenStream::Compiler(inner) => inner, + TokenStream::Fallback(inner) => inner.to_string().parse().unwrap(), + } + } +} + +impl From for TokenStream { + fn from(inner: fallback::TokenStream) -> TokenStream { + TokenStream::Fallback(inner) + } +} + +impl From for TokenStream { + fn from(token: TokenTree) -> TokenStream { + if !nightly_works() { + return TokenStream::Fallback(token.into()); + } + let tt: proc_macro::TokenTree = match token { + TokenTree::Group(tt) => tt.inner.unwrap_nightly().into(), + TokenTree::Punct(tt) => { + let spacing = match tt.spacing() { + Spacing::Joint => proc_macro::Spacing::Joint, + Spacing::Alone => proc_macro::Spacing::Alone, + }; + let mut op = proc_macro::Punct::new(tt.as_char(), spacing); + op.set_span(tt.span().inner.unwrap_nightly()); + op.into() + } + TokenTree::Ident(tt) => tt.inner.unwrap_nightly().into(), + TokenTree::Literal(tt) => tt.inner.unwrap_nightly().into(), + }; + TokenStream::Compiler(tt.into()) + } +} + +impl iter::FromIterator for TokenStream { + fn from_iter>(trees: I) -> Self { + if nightly_works() { + let trees = trees + .into_iter() + .map(TokenStream::from) + .flat_map(|t| match t { + TokenStream::Compiler(s) => s, + TokenStream::Fallback(_) => mismatch(), + }); + TokenStream::Compiler(trees.collect()) + } else { + TokenStream::Fallback(trees.into_iter().collect()) + } + } +} + +impl iter::FromIterator for TokenStream { + fn from_iter>(streams: I) -> Self { + let mut streams = streams.into_iter(); + match streams.next() { + #[cfg(slow_extend)] + Some(TokenStream::Compiler(first)) => { + let stream = iter::once(first) + .chain(streams.map(|s| match s { + TokenStream::Compiler(s) => s, + TokenStream::Fallback(_) => mismatch(), + })) + .collect(); + TokenStream::Compiler(stream) + } + #[cfg(not(slow_extend))] + Some(TokenStream::Compiler(mut first)) => { + first.extend(streams.map(|s| match s { + TokenStream::Compiler(s) => s, + TokenStream::Fallback(_) => mismatch(), + })); + TokenStream::Compiler(first) + } + Some(TokenStream::Fallback(mut first)) => { + first.extend(streams.map(|s| match s { + TokenStream::Fallback(s) => s, + TokenStream::Compiler(_) => mismatch(), + })); + TokenStream::Fallback(first) + } + None => TokenStream::new(), + } + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + match self { + TokenStream::Compiler(tts) => { + #[cfg(not(slow_extend))] + { + tts.extend( + streams + .into_iter() + .map(|t| TokenStream::from(t).unwrap_nightly()), + ); + } + #[cfg(slow_extend)] + { + *tts = + tts.clone() + .into_iter() + .chain(streams.into_iter().map(TokenStream::from).flat_map( + |t| match t { + TokenStream::Compiler(tts) => tts.into_iter(), + _ => mismatch(), + }, + )) + .collect(); + } + } + TokenStream::Fallback(tts) => tts.extend(streams), + } + } +} + +impl Extend for TokenStream { + fn extend>(&mut self, streams: I) { + match self { + TokenStream::Compiler(tts) => { + #[cfg(not(slow_extend))] + { + tts.extend(streams.into_iter().map(|stream| stream.unwrap_nightly())); + } + #[cfg(slow_extend)] + { + *tts = tts + .clone() + .into_iter() + .chain(streams.into_iter().flat_map(|t| match t { + TokenStream::Compiler(tts) => tts.into_iter(), + _ => mismatch(), + })) + .collect(); + } + } + TokenStream::Fallback(tts) => { + tts.extend(streams.into_iter().map(|stream| stream.unwrap_stable())) + } + } + } +} + +impl fmt::Debug for TokenStream { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + TokenStream::Compiler(tts) => tts.fmt(f), + TokenStream::Fallback(tts) => tts.fmt(f), + } + } +} + +impl From for LexError { + fn from(e: proc_macro::LexError) -> LexError { + LexError::Compiler(e) + } +} + +impl From for LexError { + fn from(e: fallback::LexError) -> LexError { + LexError::Fallback(e) + } +} + +impl fmt::Debug for LexError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + LexError::Compiler(e) => e.fmt(f), + LexError::Fallback(e) => e.fmt(f), + } + } +} + +#[derive(Clone)] +pub enum TokenTreeIter { + Compiler(proc_macro::token_stream::IntoIter), + Fallback(fallback::TokenTreeIter), +} + +impl IntoIterator for TokenStream { + type Item = TokenTree; + type IntoIter = TokenTreeIter; + + fn into_iter(self) -> TokenTreeIter { + match self { + TokenStream::Compiler(tts) => TokenTreeIter::Compiler(tts.into_iter()), + TokenStream::Fallback(tts) => TokenTreeIter::Fallback(tts.into_iter()), + } + } +} + +impl Iterator for TokenTreeIter { + type Item = TokenTree; + + fn next(&mut self) -> Option { + let token = match self { + TokenTreeIter::Compiler(iter) => iter.next()?, + TokenTreeIter::Fallback(iter) => return iter.next(), + }; + Some(match token { + proc_macro::TokenTree::Group(tt) => ::Group::_new(Group::Compiler(tt)).into(), + proc_macro::TokenTree::Punct(tt) => { + let spacing = match tt.spacing() { + proc_macro::Spacing::Joint => Spacing::Joint, + proc_macro::Spacing::Alone => Spacing::Alone, + }; + let mut o = Punct::new(tt.as_char(), spacing); + o.set_span(::Span::_new(Span::Compiler(tt.span()))); + o.into() + } + proc_macro::TokenTree::Ident(s) => ::Ident::_new(Ident::Compiler(s)).into(), + proc_macro::TokenTree::Literal(l) => ::Literal::_new(Literal::Compiler(l)).into(), + }) + } + + fn size_hint(&self) -> (usize, Option) { + match self { + TokenTreeIter::Compiler(tts) => tts.size_hint(), + TokenTreeIter::Fallback(tts) => tts.size_hint(), + } + } +} + +impl fmt::Debug for TokenTreeIter { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("TokenTreeIter").finish() + } +} + +#[derive(Clone, PartialEq, Eq)] +#[cfg(super_unstable)] +pub enum SourceFile { + Compiler(proc_macro::SourceFile), + Fallback(fallback::SourceFile), +} + +#[cfg(super_unstable)] +impl SourceFile { + fn nightly(sf: proc_macro::SourceFile) -> Self { + SourceFile::Compiler(sf) + } + + /// Get the path to this source file as a string. + pub fn path(&self) -> PathBuf { + match self { + SourceFile::Compiler(a) => a.path(), + SourceFile::Fallback(a) => a.path(), + } + } + + pub fn is_real(&self) -> bool { + match self { + SourceFile::Compiler(a) => a.is_real(), + SourceFile::Fallback(a) => a.is_real(), + } + } +} + +#[cfg(super_unstable)] +impl fmt::Debug for SourceFile { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + SourceFile::Compiler(a) => a.fmt(f), + SourceFile::Fallback(a) => a.fmt(f), + } + } +} + +#[cfg(any(super_unstable, feature = "span-locations"))] +pub struct LineColumn { + pub line: usize, + pub column: usize, +} + +#[derive(Copy, Clone)] +pub enum Span { + Compiler(proc_macro::Span), + Fallback(fallback::Span), +} + +impl Span { + pub fn call_site() -> Span { + if nightly_works() { + Span::Compiler(proc_macro::Span::call_site()) + } else { + Span::Fallback(fallback::Span::call_site()) + } + } + + #[cfg(super_unstable)] + pub fn def_site() -> Span { + if nightly_works() { + Span::Compiler(proc_macro::Span::def_site()) + } else { + Span::Fallback(fallback::Span::def_site()) + } + } + + #[cfg(super_unstable)] + pub fn resolved_at(&self, other: Span) -> Span { + match (self, other) { + (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), + (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), + _ => mismatch(), + } + } + + #[cfg(super_unstable)] + pub fn located_at(&self, other: Span) -> Span { + match (self, other) { + (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), + (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), + _ => mismatch(), + } + } + + pub fn unwrap(self) -> proc_macro::Span { + match self { + Span::Compiler(s) => s, + Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"), + } + } + + #[cfg(super_unstable)] + pub fn source_file(&self) -> SourceFile { + match self { + Span::Compiler(s) => SourceFile::nightly(s.source_file()), + Span::Fallback(s) => SourceFile::Fallback(s.source_file()), + } + } + + #[cfg(any(super_unstable, feature = "span-locations"))] + pub fn start(&self) -> LineColumn { + match self { + #[cfg(proc_macro_span)] + Span::Compiler(s) => { + let proc_macro::LineColumn { line, column } = s.start(); + LineColumn { line, column } + } + #[cfg(not(proc_macro_span))] + Span::Compiler(_) => LineColumn { line: 0, column: 0 }, + Span::Fallback(s) => { + let fallback::LineColumn { line, column } = s.start(); + LineColumn { line, column } + } + } + } + + #[cfg(any(super_unstable, feature = "span-locations"))] + pub fn end(&self) -> LineColumn { + match self { + #[cfg(proc_macro_span)] + Span::Compiler(s) => { + let proc_macro::LineColumn { line, column } = s.end(); + LineColumn { line, column } + } + #[cfg(not(proc_macro_span))] + Span::Compiler(_) => LineColumn { line: 0, column: 0 }, + Span::Fallback(s) => { + let fallback::LineColumn { line, column } = s.end(); + LineColumn { line, column } + } + } + } + + #[cfg(super_unstable)] + pub fn join(&self, other: Span) -> Option { + let ret = match (self, other) { + (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?), + (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?), + _ => return None, + }; + Some(ret) + } + + #[cfg(super_unstable)] + pub fn eq(&self, other: &Span) -> bool { + match (self, other) { + (Span::Compiler(a), Span::Compiler(b)) => a.eq(b), + (Span::Fallback(a), Span::Fallback(b)) => a.eq(b), + _ => false, + } + } + + fn unwrap_nightly(self) -> proc_macro::Span { + match self { + Span::Compiler(s) => s, + Span::Fallback(_) => mismatch(), + } + } +} + +impl From for ::Span { + fn from(proc_span: proc_macro::Span) -> ::Span { + ::Span::_new(Span::Compiler(proc_span)) + } +} + +impl From for Span { + fn from(inner: fallback::Span) -> Span { + Span::Fallback(inner) + } +} + +impl fmt::Debug for Span { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Span::Compiler(s) => s.fmt(f), + Span::Fallback(s) => s.fmt(f), + } + } +} + +pub fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) { + match span { + Span::Compiler(s) => { + debug.field("span", &s); + } + Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s), + } +} + +#[derive(Clone)] +pub enum Group { + Compiler(proc_macro::Group), + Fallback(fallback::Group), +} + +impl Group { + pub fn new(delimiter: Delimiter, stream: TokenStream) -> Group { + match stream { + TokenStream::Compiler(stream) => { + let delimiter = match delimiter { + Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis, + Delimiter::Bracket => proc_macro::Delimiter::Bracket, + Delimiter::Brace => proc_macro::Delimiter::Brace, + Delimiter::None => proc_macro::Delimiter::None, + }; + Group::Compiler(proc_macro::Group::new(delimiter, stream)) + } + TokenStream::Fallback(stream) => { + Group::Fallback(fallback::Group::new(delimiter, stream)) + } + } + } + + pub fn delimiter(&self) -> Delimiter { + match self { + Group::Compiler(g) => match g.delimiter() { + proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis, + proc_macro::Delimiter::Bracket => Delimiter::Bracket, + proc_macro::Delimiter::Brace => Delimiter::Brace, + proc_macro::Delimiter::None => Delimiter::None, + }, + Group::Fallback(g) => g.delimiter(), + } + } + + pub fn stream(&self) -> TokenStream { + match self { + Group::Compiler(g) => TokenStream::Compiler(g.stream()), + Group::Fallback(g) => TokenStream::Fallback(g.stream()), + } + } + + pub fn span(&self) -> Span { + match self { + Group::Compiler(g) => Span::Compiler(g.span()), + Group::Fallback(g) => Span::Fallback(g.span()), + } + } + + #[cfg(super_unstable)] + pub fn span_open(&self) -> Span { + match self { + Group::Compiler(g) => Span::Compiler(g.span_open()), + Group::Fallback(g) => Span::Fallback(g.span_open()), + } + } + + #[cfg(super_unstable)] + pub fn span_close(&self) -> Span { + match self { + Group::Compiler(g) => Span::Compiler(g.span_close()), + Group::Fallback(g) => Span::Fallback(g.span_close()), + } + } + + pub fn set_span(&mut self, span: Span) { + match (self, span) { + (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s), + (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s), + _ => mismatch(), + } + } + + fn unwrap_nightly(self) -> proc_macro::Group { + match self { + Group::Compiler(g) => g, + Group::Fallback(_) => mismatch(), + } + } +} + +impl From for Group { + fn from(g: fallback::Group) -> Self { + Group::Fallback(g) + } +} + +impl fmt::Display for Group { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self { + Group::Compiler(group) => group.fmt(formatter), + Group::Fallback(group) => group.fmt(formatter), + } + } +} + +impl fmt::Debug for Group { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self { + Group::Compiler(group) => group.fmt(formatter), + Group::Fallback(group) => group.fmt(formatter), + } + } +} + +#[derive(Clone)] +pub enum Ident { + Compiler(proc_macro::Ident), + Fallback(fallback::Ident), +} + +impl Ident { + pub fn new(string: &str, span: Span) -> Ident { + match span { + Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)), + Span::Fallback(s) => Ident::Fallback(fallback::Ident::new(string, s)), + } + } + + pub fn new_raw(string: &str, span: Span) -> Ident { + match span { + Span::Compiler(s) => { + let p: proc_macro::TokenStream = string.parse().unwrap(); + let ident = match p.into_iter().next() { + Some(proc_macro::TokenTree::Ident(mut i)) => { + i.set_span(s); + i + } + _ => panic!(), + }; + Ident::Compiler(ident) + } + Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw(string, s)), + } + } + + pub fn span(&self) -> Span { + match self { + Ident::Compiler(t) => Span::Compiler(t.span()), + Ident::Fallback(t) => Span::Fallback(t.span()), + } + } + + pub fn set_span(&mut self, span: Span) { + match (self, span) { + (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s), + (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s), + _ => mismatch(), + } + } + + fn unwrap_nightly(self) -> proc_macro::Ident { + match self { + Ident::Compiler(s) => s, + Ident::Fallback(_) => mismatch(), + } + } +} + +impl PartialEq for Ident { + fn eq(&self, other: &Ident) -> bool { + match (self, other) { + (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(), + (Ident::Fallback(t), Ident::Fallback(o)) => t == o, + _ => mismatch(), + } + } +} + +impl PartialEq for Ident +where + T: ?Sized + AsRef, +{ + fn eq(&self, other: &T) -> bool { + let other = other.as_ref(); + match self { + Ident::Compiler(t) => t.to_string() == other, + Ident::Fallback(t) => t == other, + } + } +} + +impl fmt::Display for Ident { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Ident::Compiler(t) => t.fmt(f), + Ident::Fallback(t) => t.fmt(f), + } + } +} + +impl fmt::Debug for Ident { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Ident::Compiler(t) => t.fmt(f), + Ident::Fallback(t) => t.fmt(f), + } + } +} + +#[derive(Clone)] +pub enum Literal { + Compiler(proc_macro::Literal), + Fallback(fallback::Literal), +} + +macro_rules! suffixed_numbers { + ($($name:ident => $kind:ident,)*) => ($( + pub fn $name(n: $kind) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::$name(n)) + } else { + Literal::Fallback(fallback::Literal::$name(n)) + } + } + )*) +} + +macro_rules! unsuffixed_integers { + ($($name:ident => $kind:ident,)*) => ($( + pub fn $name(n: $kind) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::$name(n)) + } else { + Literal::Fallback(fallback::Literal::$name(n)) + } + } + )*) +} + +impl Literal { + suffixed_numbers! { + u8_suffixed => u8, + u16_suffixed => u16, + u32_suffixed => u32, + u64_suffixed => u64, + usize_suffixed => usize, + i8_suffixed => i8, + i16_suffixed => i16, + i32_suffixed => i32, + i64_suffixed => i64, + isize_suffixed => isize, + + f32_suffixed => f32, + f64_suffixed => f64, + } + + #[cfg(u128)] + suffixed_numbers! { + i128_suffixed => i128, + u128_suffixed => u128, + } + + unsuffixed_integers! { + u8_unsuffixed => u8, + u16_unsuffixed => u16, + u32_unsuffixed => u32, + u64_unsuffixed => u64, + usize_unsuffixed => usize, + i8_unsuffixed => i8, + i16_unsuffixed => i16, + i32_unsuffixed => i32, + i64_unsuffixed => i64, + isize_unsuffixed => isize, + } + + #[cfg(u128)] + unsuffixed_integers! { + i128_unsuffixed => i128, + u128_unsuffixed => u128, + } + + pub fn f32_unsuffixed(f: f32) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::f32_unsuffixed(f)) + } else { + Literal::Fallback(fallback::Literal::f32_unsuffixed(f)) + } + } + + pub fn f64_unsuffixed(f: f64) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::f64_unsuffixed(f)) + } else { + Literal::Fallback(fallback::Literal::f64_unsuffixed(f)) + } + } + + pub fn string(t: &str) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::string(t)) + } else { + Literal::Fallback(fallback::Literal::string(t)) + } + } + + pub fn character(t: char) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::character(t)) + } else { + Literal::Fallback(fallback::Literal::character(t)) + } + } + + pub fn byte_string(bytes: &[u8]) -> Literal { + if nightly_works() { + Literal::Compiler(proc_macro::Literal::byte_string(bytes)) + } else { + Literal::Fallback(fallback::Literal::byte_string(bytes)) + } + } + + pub fn span(&self) -> Span { + match self { + Literal::Compiler(lit) => Span::Compiler(lit.span()), + Literal::Fallback(lit) => Span::Fallback(lit.span()), + } + } + + pub fn set_span(&mut self, span: Span) { + match (self, span) { + (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s), + (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s), + _ => mismatch(), + } + } + + fn unwrap_nightly(self) -> proc_macro::Literal { + match self { + Literal::Compiler(s) => s, + Literal::Fallback(_) => mismatch(), + } + } +} + +impl From for Literal { + fn from(s: fallback::Literal) -> Literal { + Literal::Fallback(s) + } +} + +impl fmt::Display for Literal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Literal::Compiler(t) => t.fmt(f), + Literal::Fallback(t) => t.fmt(f), + } + } +} + +impl fmt::Debug for Literal { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + match self { + Literal::Compiler(t) => t.fmt(f), + Literal::Fallback(t) => t.fmt(f), + } + } +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/tests/marker.rs b/vendor/registry-40351f815f426200/proc-macro2/tests/marker.rs new file mode 100644 index 000000000..7bb502762 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/tests/marker.rs @@ -0,0 +1,61 @@ +extern crate proc_macro2; + +use proc_macro2::*; + +macro_rules! assert_impl { + ($ty:ident is $($marker:ident) and +) => { + #[test] + #[allow(non_snake_case)] + fn $ty() { + fn assert_implemented() {} + assert_implemented::<$ty>(); + } + }; + + ($ty:ident is not $($marker:ident) or +) => { + #[test] + #[allow(non_snake_case)] + fn $ty() { + $( + { + // Implemented for types that implement $marker. + trait IsNotImplemented { + fn assert_not_implemented() {} + } + impl IsNotImplemented for T {} + + // Implemented for the type being tested. + trait IsImplemented { + fn assert_not_implemented() {} + } + impl IsImplemented for $ty {} + + // If $ty does not implement $marker, there is no ambiguity + // in the following trait method call. + <$ty>::assert_not_implemented(); + } + )+ + } + }; +} + +assert_impl!(Delimiter is Send and Sync); +assert_impl!(Spacing is Send and Sync); + +assert_impl!(Group is not Send or Sync); +assert_impl!(Ident is not Send or Sync); +assert_impl!(LexError is not Send or Sync); +assert_impl!(Literal is not Send or Sync); +assert_impl!(Punct is not Send or Sync); +assert_impl!(Span is not Send or Sync); +assert_impl!(TokenStream is not Send or Sync); +assert_impl!(TokenTree is not Send or Sync); + +#[cfg(procmacro2_semver_exempt)] +mod semver_exempt { + use super::*; + + assert_impl!(LineColumn is Send and Sync); + + assert_impl!(SourceFile is not Send or Sync); +} diff --git a/vendor/registry-40351f815f426200/proc-macro2/tests/test.rs b/vendor/registry-40351f815f426200/proc-macro2/tests/test.rs new file mode 100644 index 000000000..370392b65 --- /dev/null +++ b/vendor/registry-40351f815f426200/proc-macro2/tests/test.rs @@ -0,0 +1,452 @@ +extern crate proc_macro2; + +use std::str::{self, FromStr}; + +use proc_macro2::{Ident, Literal, Spacing, Span, TokenStream, TokenTree}; + +#[test] +fn idents() { + assert_eq!( + Ident::new("String", Span::call_site()).to_string(), + "String" + ); + assert_eq!(Ident::new("fn", Span::call_site()).to_string(), "fn"); + assert_eq!(Ident::new("_", Span::call_site()).to_string(), "_"); +} + +#[test] +#[cfg(procmacro2_semver_exempt)] +fn raw_idents() { + assert_eq!( + Ident::new_raw("String", Span::call_site()).to_string(), + "r#String" + ); + assert_eq!(Ident::new_raw("fn", Span::call_site()).to_string(), "r#fn"); + assert_eq!(Ident::new_raw("_", Span::call_site()).to_string(), "r#_"); +} + +#[test] +#[should_panic(expected = "Ident is not allowed to be empty; use Option")] +fn ident_empty() { + Ident::new("", Span::call_site()); +} + +#[test] +#[should_panic(expected = "Ident cannot be a number; use Literal instead")] +fn ident_number() { + Ident::new("255", Span::call_site()); +} + +#[test] +#[should_panic(expected = "\"a#\" is not a valid Ident")] +fn ident_invalid() { + Ident::new("a#", Span::call_site()); +} + +#[test] +#[should_panic(expected = "not a valid Ident")] +fn raw_ident_empty() { + Ident::new("r#", Span::call_site()); +} + +#[test] +#[should_panic(expected = "not a valid Ident")] +fn raw_ident_number() { + Ident::new("r#255", Span::call_site()); +} + +#[test] +#[should_panic(expected = "\"r#a#\" is not a valid Ident")] +fn raw_ident_invalid() { + Ident::new("r#a#", Span::call_site()); +} + +#[test] +#[should_panic(expected = "not a valid Ident")] +fn lifetime_empty() { + Ident::new("'", Span::call_site()); +} + +#[test] +#[should_panic(expected = "not a valid Ident")] +fn lifetime_number() { + Ident::new("'255", Span::call_site()); +} + +#[test] +#[should_panic(expected = r#""\'a#" is not a valid Ident"#)] +fn lifetime_invalid() { + Ident::new("'a#", Span::call_site()); +} + +#[test] +fn literal_string() { + assert_eq!(Literal::string("foo").to_string(), "\"foo\""); + assert_eq!(Literal::string("\"").to_string(), "\"\\\"\""); + assert_eq!(Literal::string("didn't").to_string(), "\"didn't\""); +} + +#[test] +fn literal_character() { + assert_eq!(Literal::character('x').to_string(), "'x'"); + assert_eq!(Literal::character('\'').to_string(), "'\\''"); + assert_eq!(Literal::character('"').to_string(), "'\"'"); +} + +#[test] +fn literal_float() { + assert_eq!(Literal::f32_unsuffixed(10.0).to_string(), "10.0"); +} + +#[test] +fn roundtrip() { + fn roundtrip(p: &str) { + println!("parse: {}", p); + let s = p.parse::().unwrap().to_string(); + println!("first: {}", s); + let s2 = s.to_string().parse::().unwrap().to_string(); + assert_eq!(s, s2); + } + roundtrip("a"); + roundtrip("<<"); + roundtrip("<<="); + roundtrip( + " + 1 + 1.0 + 1f32 + 2f64 + 1usize + 4isize + 4e10 + 1_000 + 1_0i32 + 8u8 + 9 + 0 + 0xffffffffffffffffffffffffffffffff + ", + ); + roundtrip("'a"); + roundtrip("'_"); + roundtrip("'static"); + roundtrip("'\\u{10__FFFF}'"); + roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\""); +} + +#[test] +fn fail() { + fn fail(p: &str) { + if let Ok(s) = p.parse::() { + panic!("should have failed to parse: {}\n{:#?}", p, s); + } + } + fail("1x"); + fail("1u80"); + fail("1f320"); + fail("' static"); + fail("r#1"); + fail("r#_"); +} + +#[cfg(span_locations)] +#[test] +fn span_test() { + use proc_macro2::TokenTree; + + fn check_spans(p: &str, mut lines: &[(usize, usize, usize, usize)]) { + let ts = p.parse::().unwrap(); + check_spans_internal(ts, &mut lines); + } + + fn check_spans_internal(ts: TokenStream, lines: &mut &[(usize, usize, usize, usize)]) { + for i in ts { + if let Some((&(sline, scol, eline, ecol), rest)) = lines.split_first() { + *lines = rest; + + let start = i.span().start(); + assert_eq!(start.line, sline, "sline did not match for {}", i); + assert_eq!(start.column, scol, "scol did not match for {}", i); + + let end = i.span().end(); + assert_eq!(end.line, eline, "eline did not match for {}", i); + assert_eq!(end.column, ecol, "ecol did not match for {}", i); + + match i { + TokenTree::Group(ref g) => { + check_spans_internal(g.stream().clone(), lines); + } + _ => {} + } + } + } + } + + check_spans( + "\ +/// This is a document comment +testing 123 +{ + testing 234 +}", + &[ + (1, 0, 1, 30), // # + (1, 0, 1, 30), // [ ... ] + (1, 0, 1, 30), // doc + (1, 0, 1, 30), // = + (1, 0, 1, 30), // "This is..." + (2, 0, 2, 7), // testing + (2, 8, 2, 11), // 123 + (3, 0, 5, 1), // { ... } + (4, 2, 4, 9), // testing + (4, 10, 4, 13), // 234 + ], + ); +} + +#[cfg(procmacro2_semver_exempt)] +#[cfg(not(nightly))] +#[test] +fn default_span() { + let start = Span::call_site().start(); + assert_eq!(start.line, 1); + assert_eq!(start.column, 0); + let end = Span::call_site().end(); + assert_eq!(end.line, 1); + assert_eq!(end.column, 0); + let source_file = Span::call_site().source_file(); + assert_eq!(source_file.path().to_string_lossy(), ""); + assert!(!source_file.is_real()); +} + +#[cfg(procmacro2_semver_exempt)] +#[test] +fn span_join() { + let source1 = "aaa\nbbb" + .parse::() + .unwrap() + .into_iter() + .collect::>(); + let source2 = "ccc\nddd" + .parse::() + .unwrap() + .into_iter() + .collect::>(); + + assert!(source1[0].span().source_file() != source2[0].span().source_file()); + assert_eq!( + source1[0].span().source_file(), + source1[1].span().source_file() + ); + + let joined1 = source1[0].span().join(source1[1].span()); + let joined2 = source1[0].span().join(source2[0].span()); + assert!(joined1.is_some()); + assert!(joined2.is_none()); + + let start = joined1.unwrap().start(); + let end = joined1.unwrap().end(); + assert_eq!(start.line, 1); + assert_eq!(start.column, 0); + assert_eq!(end.line, 2); + assert_eq!(end.column, 3); + + assert_eq!( + joined1.unwrap().source_file(), + source1[0].span().source_file() + ); +} + +#[test] +fn no_panic() { + let s = str::from_utf8(b"b\'\xc2\x86 \x00\x00\x00^\"").unwrap(); + assert!(s.parse::().is_err()); +} + +#[test] +fn tricky_doc_comment() { + let stream = "/**/".parse::().unwrap(); + let tokens = stream.into_iter().collect::>(); + assert!(tokens.is_empty(), "not empty -- {:?}", tokens); + + let stream = "/// doc".parse::().unwrap(); + let tokens = stream.into_iter().collect::>(); + assert!(tokens.len() == 2, "not length 2 -- {:?}", tokens); + match tokens[0] { + proc_macro2::TokenTree::Punct(ref tt) => assert_eq!(tt.as_char(), '#'), + _ => panic!("wrong token {:?}", tokens[0]), + } + let mut tokens = match tokens[1] { + proc_macro2::TokenTree::Group(ref tt) => { + assert_eq!(tt.delimiter(), proc_macro2::Delimiter::Bracket); + tt.stream().into_iter() + } + _ => panic!("wrong token {:?}", tokens[0]), + }; + + match tokens.next().unwrap() { + proc_macro2::TokenTree::Ident(ref tt) => assert_eq!(tt.to_string(), "doc"), + t => panic!("wrong token {:?}", t), + } + match tokens.next().unwrap() { + proc_macro2::TokenTree::Punct(ref tt) => assert_eq!(tt.as_char(), '='), + t => panic!("wrong token {:?}", t), + } + match tokens.next().unwrap() { + proc_macro2::TokenTree::Literal(ref tt) => { + assert_eq!(tt.to_string(), "\" doc\""); + } + t => panic!("wrong token {:?}", t), + } + assert!(tokens.next().is_none()); + + let stream = "//! doc".parse::().unwrap(); + let tokens = stream.into_iter().collect::>(); + assert!(tokens.len() == 3, "not length 3 -- {:?}", tokens); +} + +#[test] +fn op_before_comment() { + let mut tts = TokenStream::from_str("~// comment").unwrap().into_iter(); + match tts.next().unwrap() { + TokenTree::Punct(tt) => { + assert_eq!(tt.as_char(), '~'); + assert_eq!(tt.spacing(), Spacing::Alone); + } + wrong => panic!("wrong token {:?}", wrong), + } +} + +#[test] +fn raw_identifier() { + let mut tts = TokenStream::from_str("r#dyn").unwrap().into_iter(); + match tts.next().unwrap() { + TokenTree::Ident(raw) => assert_eq!("r#dyn", raw.to_string()), + wrong => panic!("wrong token {:?}", wrong), + } + assert!(tts.next().is_none()); +} + +#[test] +fn test_debug_ident() { + let ident = Ident::new("proc_macro", Span::call_site()); + + #[cfg(not(procmacro2_semver_exempt))] + let expected = "Ident(proc_macro)"; + + #[cfg(procmacro2_semver_exempt)] + let expected = "Ident { sym: proc_macro, span: bytes(0..0) }"; + + assert_eq!(expected, format!("{:?}", ident)); +} + +#[test] +fn test_debug_tokenstream() { + let tts = TokenStream::from_str("[a + 1]").unwrap(); + + #[cfg(not(procmacro2_semver_exempt))] + let expected = "\ +TokenStream [ + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + sym: a, + }, + Punct { + op: '+', + spacing: Alone, + }, + Literal { + lit: 1, + }, + ], + }, +]\ + "; + + #[cfg(not(procmacro2_semver_exempt))] + let expected_before_trailing_commas = "\ +TokenStream [ + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + sym: a + }, + Punct { + op: '+', + spacing: Alone + }, + Literal { + lit: 1 + } + ] + } +]\ + "; + + #[cfg(procmacro2_semver_exempt)] + let expected = "\ +TokenStream [ + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + sym: a, + span: bytes(2..3), + }, + Punct { + op: '+', + spacing: Alone, + span: bytes(4..5), + }, + Literal { + lit: 1, + span: bytes(6..7), + }, + ], + span: bytes(1..8), + }, +]\ + "; + + #[cfg(procmacro2_semver_exempt)] + let expected_before_trailing_commas = "\ +TokenStream [ + Group { + delimiter: Bracket, + stream: TokenStream [ + Ident { + sym: a, + span: bytes(2..3) + }, + Punct { + op: '+', + spacing: Alone, + span: bytes(4..5) + }, + Literal { + lit: 1, + span: bytes(6..7) + } + ], + span: bytes(1..8) + } +]\ + "; + + let actual = format!("{:#?}", tts); + if actual.ends_with(",\n]") { + assert_eq!(expected, actual); + } else { + assert_eq!(expected_before_trailing_commas, actual); + } +} + +#[test] +fn default_tokenstream_is_empty() { + let default_token_stream: TokenStream = Default::default(); + + assert!(default_token_stream.is_empty()); +} diff --git a/vendor/registry-40351f815f426200/quote/.cargo-checksum.json b/vendor/registry-40351f815f426200/quote/.cargo-checksum.json new file mode 100644 index 000000000..0b16c810a --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"cc812f89636414ac5e7d47651d50586d6e919b1ac0e6f3d9eba7125967da9287","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"c9a75f18b9ab2927829a208fc6aa2cf4e63b8420887ba29cdb265d6619ae82d5","README.md":"d9392d4c7af3bf9714f0a95801d64de46ffd4558cdfeea0eb85b414e555abb72","src/ext.rs":"03919239a20f8393288783a21bf6fdee12e405d13d162c9faa6f8f5ce54b003b","src/lib.rs":"c245eda59e7c953b809e00fa06ab3b61db0d5a248a85b7e4b6d5f979c977be68","src/runtime.rs":"f579bd977eae678b119eb6904d126870fe69b51e09d400abb3ec10294140926b","src/to_tokens.rs":"5b4155ff36262fb81f98ca8a9e903e9cf1ca346e72cb36a2de746e10d3b24d49","tests/conditional/integer128.rs":"d83e21a91efbaa801a82ae499111bdda2d31edaa620e78c0199eba42d69c9ee6","tests/test.rs":"810013d7fd77b738abd0ace90ce2f2f3e219c757652eabab29bc1c0ce4a73b24"},"package":"faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/quote/Cargo.toml b/vendor/registry-40351f815f426200/quote/Cargo.toml new file mode 100644 index 000000000..02a98955d --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/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 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 = "quote" +version = "0.6.12" +authors = ["David Tolnay "] +include = ["Cargo.toml", "src/**/*.rs", "tests/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] +description = "Quasi-quoting macro quote!(...)" +documentation = "https://docs.rs/quote/" +readme = "README.md" +keywords = ["syn"] +categories = ["development-tools::procedural-macro-helpers"] +license = "MIT/Apache-2.0" +repository = "https://github.com/dtolnay/quote" +[dependencies.proc-macro2] +version = "0.4.21" +default-features = false + +[features] +default = ["proc-macro"] +proc-macro = ["proc-macro2/proc-macro"] +[badges.travis-ci] +repository = "dtolnay/quote" diff --git a/vendor/registry-40351f815f426200/quote/LICENSE-APACHE b/vendor/registry-40351f815f426200/quote/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/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/vendor/registry-40351f815f426200/quote/LICENSE-MIT b/vendor/registry-40351f815f426200/quote/LICENSE-MIT new file mode 100644 index 000000000..40b8817a4 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2016 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/vendor/registry-40351f815f426200/quote/README.md b/vendor/registry-40351f815f426200/quote/README.md new file mode 100644 index 000000000..759916ace --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/README.md @@ -0,0 +1,241 @@ +Rust Quasi-Quoting +================== + +[![Build Status](https://api.travis-ci.org/dtolnay/quote.svg?branch=master)](https://travis-ci.org/dtolnay/quote) +[![Latest Version](https://img.shields.io/crates/v/quote.svg)](https://crates.io/crates/quote) +[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/quote/) + +This crate provides the [`quote!`] macro for turning Rust syntax tree data +structures into tokens of source code. + +[`quote!`]: https://docs.rs/quote/0.6/quote/macro.quote.html + +Procedural macros in Rust receive a stream of tokens as input, execute arbitrary +Rust code to determine how to manipulate those tokens, and produce a stream of +tokens to hand back to the compiler to compile into the caller's crate. +Quasi-quoting is a solution to one piece of that -- producing tokens to return +to the compiler. + +The idea of quasi-quoting is that we write *code* that we treat as *data*. +Within the `quote!` macro, we can write what looks like code to our text editor +or IDE. We get all the benefits of the editor's brace matching, syntax +highlighting, indentation, and maybe autocompletion. But rather than compiling +that as code into the current crate, we can treat it as data, pass it around, +mutate it, and eventually hand it back to the compiler as tokens to compile into +the macro caller's crate. + +This crate is motivated by the procedural macro use case, but is a +general-purpose Rust quasi-quoting library and is not specific to procedural +macros. + +*Version requirement: Quote supports any compiler version back to Rust's very +first support for procedural macros in Rust 1.15.0.* + +[*Release notes*](https://github.com/dtolnay/quote/releases) + +```toml +[dependencies] +quote = "0.6" +``` + +## Syntax + +The quote crate provides a [`quote!`] macro within which you can write Rust code +that gets packaged into a [`TokenStream`] and can be treated as data. You should +think of `TokenStream` as representing a fragment of Rust source code. + +[`TokenStream`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.TokenStream.html + +Within the `quote!` macro, interpolation is done with `#var`. Any type +implementing the [`quote::ToTokens`] trait can be interpolated. This includes +most Rust primitive types as well as most of the syntax tree types from [`syn`]. + +[`quote::ToTokens`]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html +[`syn`]: https://github.com/dtolnay/syn + +```rust +let tokens = quote! { + struct SerializeWith #generics #where_clause { + value: &'a #field_ty, + phantom: core::marker::PhantomData<#item_ty>, + } + + impl #generics serde::Serialize for SerializeWith #generics #where_clause { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + #path(self.value, serializer) + } + } + + SerializeWith { + value: #value, + phantom: core::marker::PhantomData::<#item_ty>, + } +}; +``` + +## Repetition + +Repetition is done using `#(...)*` or `#(...),*` similar to `macro_rules!`. This +iterates through the elements of any variable interpolated within the repetition +and inserts a copy of the repetition body for each one. The variables in an +interpolation may be anything that implements `IntoIterator`, including `Vec` or +a pre-existing iterator. + +- `#(#var)*` — no separators +- `#(#var),*` — the character before the asterisk is used as a separator +- `#( struct #var; )*` — the repetition can contain other things +- `#( #k => println!("{}", #v), )*` — even multiple interpolations + +Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latter +does not produce a trailing comma. This matches the behavior of delimiters in +`macro_rules!`. + +## Returning tokens to the compiler + +The `quote!` macro evaluates to an expression of type +`proc_macro2::TokenStream`. Meanwhile Rust procedural macros are expected to +return the type `proc_macro::TokenStream`. + +The difference between the two types is that `proc_macro` types are entirely +specific to procedural macros and cannot ever exist in code outside of a +procedural macro, while `proc_macro2` types may exist anywhere including tests +and non-macro code like main.rs and build.rs. This is why even the procedural +macro ecosystem is largely built around `proc_macro2`, because that ensures the +libraries are unit testable and accessible in non-macro contexts. + +There is a [`From`]-conversion in both directions so returning the output of +`quote!` from a procedural macro usually looks like `tokens.into()` or +`proc_macro::TokenStream::from(tokens)`. + +[`From`]: https://doc.rust-lang.org/std/convert/trait.From.html + +## Examples + +### Combining quoted fragments + +Usually you don't end up constructing an entire final `TokenStream` in one +piece. Different parts may come from different helper functions. The tokens +produced by `quote!` themselves implement `ToTokens` and so can be interpolated +into later `quote!` invocations to build up a final result. + +```rust +let type_definition = quote! {...}; +let methods = quote! {...}; + +let tokens = quote! { + #type_definition + #methods +}; +``` + +### Constructing identifiers + +Suppose we have an identifier `ident` which came from somewhere in a macro +input and we need to modify it in some way for the macro output. Let's consider +prepending the identifier with an underscore. + +Simply interpolating the identifier next to an underscore will not have the +behavior of concatenating them. The underscore and the identifier will continue +to be two separate tokens as if you had written `_ x`. + +```rust +// incorrect +quote! { + let mut _#ident = 0; +} +``` + +The solution is to perform token-level manipulations using the APIs provided by +Syn and proc-macro2. + +```rust +let concatenated = format!("_{}", ident); +let varname = syn::Ident::new(&concatenated, ident.span()); +quote! { + let mut #varname = 0; +} +``` + +### Making method calls + +Let's say our macro requires some type specified in the macro input to have a +constructor called `new`. We have the type in a variable called `field_type` of +type `syn::Type` and want to invoke the constructor. + +```rust +// incorrect +quote! { + let value = #field_type::new(); +} +``` + +This works only sometimes. If `field_type` is `String`, the expanded code +contains `String::new()` which is fine. But if `field_type` is something like +`Vec` then the expanded code is `Vec::new()` which is invalid syntax. +Ordinarily in handwritten Rust we would write `Vec::::new()` but for macros +often the following is more convenient. + +```rust +quote! { + let value = <#field_type>::new(); +} +``` + +This expands to `>::new()` which behaves correctly. + +A similar pattern is appropriate for trait methods. + +```rust +quote! { + let value = <#field_type as core::default::Default>::default(); +} +``` + +## Hygiene + +Any interpolated tokens preserve the `Span` information provided by their +`ToTokens` implementation. Tokens that originate within a `quote!` invocation +are spanned with [`Span::call_site()`]. + +[`Span::call_site()`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html#method.call_site + +A different span can be provided explicitly through the [`quote_spanned!`] +macro. + +[`quote_spanned!`]: https://docs.rs/quote/0.6/quote/macro.quote_spanned.html + +### Limitations + +- A non-repeating variable may not be interpolated inside of a repeating block + ([#7]). +- The same variable may not be interpolated more than once inside of a repeating + block ([#8]). + +[#7]: https://github.com/dtolnay/quote/issues/7 +[#8]: https://github.com/dtolnay/quote/issues/8 + +### Recursion limit + +The `quote!` macro relies on deep recursion so some large invocations may fail +with "recursion limit reached" when you compile. If it fails, bump up the +recursion limit by adding `#![recursion_limit = "128"]` to your crate. An even +higher limit may be necessary for especially large invocations. You don't need +this unless the compiler tells you that you need it. + +## 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 this crate 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/vendor/registry-40351f815f426200/quote/src/ext.rs b/vendor/registry-40351f815f426200/quote/src/ext.rs new file mode 100644 index 000000000..7ebbe30a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/src/ext.rs @@ -0,0 +1,112 @@ +use super::ToTokens; + +use std::iter; + +use proc_macro2::{TokenStream, TokenTree}; + +/// TokenStream extension trait with methods for appending tokens. +/// +/// This trait is sealed and cannot be implemented outside of the `quote` crate. +pub trait TokenStreamExt: private::Sealed { + /// For use by `ToTokens` implementations. + /// + /// Appends the token specified to this list of tokens. + fn append(&mut self, token: U) + where + U: Into; + + /// For use by `ToTokens` implementations. + /// + /// ```edition2018 + /// # use quote::{quote, TokenStreamExt, ToTokens}; + /// # use proc_macro2::TokenStream; + /// # + /// struct X; + /// + /// impl ToTokens for X { + /// fn to_tokens(&self, tokens: &mut TokenStream) { + /// tokens.append_all(&[true, false]); + /// } + /// } + /// + /// let tokens = quote!(#X); + /// assert_eq!(tokens.to_string(), "true false"); + /// ``` + fn append_all(&mut self, iter: I) + where + T: ToTokens, + I: IntoIterator; + + /// For use by `ToTokens` implementations. + /// + /// Appends all of the items in the iterator `I`, separated by the tokens + /// `U`. + fn append_separated(&mut self, iter: I, op: U) + where + T: ToTokens, + I: IntoIterator, + U: ToTokens; + + /// For use by `ToTokens` implementations. + /// + /// Appends all tokens in the iterator `I`, appending `U` after each + /// element, including after the last element of the iterator. + fn append_terminated(&mut self, iter: I, term: U) + where + T: ToTokens, + I: IntoIterator, + U: ToTokens; +} + +impl TokenStreamExt for TokenStream { + fn append(&mut self, token: U) + where + U: Into, + { + self.extend(iter::once(token.into())); + } + + fn append_all(&mut self, iter: I) + where + T: ToTokens, + I: IntoIterator, + { + for token in iter { + token.to_tokens(self); + } + } + + fn append_separated(&mut self, iter: I, op: U) + where + T: ToTokens, + I: IntoIterator, + U: ToTokens, + { + for (i, token) in iter.into_iter().enumerate() { + if i > 0 { + op.to_tokens(self); + } + token.to_tokens(self); + } + } + + fn append_terminated(&mut self, iter: I, term: U) + where + T: ToTokens, + I: IntoIterator, + U: ToTokens, + { + for token in iter { + token.to_tokens(self); + term.to_tokens(self); + } + } +} + +mod private { + use proc_macro2::TokenStream; + + pub trait Sealed {} + + impl Sealed for TokenStream {} +} diff --git a/vendor/registry-40351f815f426200/quote/src/lib.rs b/vendor/registry-40351f815f426200/quote/src/lib.rs new file mode 100644 index 000000000..a71d8af4c --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/src/lib.rs @@ -0,0 +1,861 @@ +//! This crate provides the [`quote!`] macro for turning Rust syntax tree data +//! structures into tokens of source code. +//! +//! [`quote!`]: macro.quote.html +//! +//! Procedural macros in Rust receive a stream of tokens as input, execute +//! arbitrary Rust code to determine how to manipulate those tokens, and produce +//! a stream of tokens to hand back to the compiler to compile into the caller's +//! crate. Quasi-quoting is a solution to one piece of that -- producing tokens +//! to return to the compiler. +//! +//! The idea of quasi-quoting is that we write *code* that we treat as *data*. +//! Within the `quote!` macro, we can write what looks like code to our text +//! editor or IDE. We get all the benefits of the editor's brace matching, +//! syntax highlighting, indentation, and maybe autocompletion. But rather than +//! compiling that as code into the current crate, we can treat it as data, pass +//! it around, mutate it, and eventually hand it back to the compiler as tokens +//! to compile into the macro caller's crate. +//! +//! This crate is motivated by the procedural macro use case, but is a +//! general-purpose Rust quasi-quoting library and is not specific to procedural +//! macros. +//! +//! *Version requirement: Quote supports any compiler version back to Rust's +//! very first support for procedural macros in Rust 1.15.0.* +//! +//! ```toml +//! [dependencies] +//! quote = "0.6" +//! ``` +//! +//! # Example +//! +//! The following quasi-quoted block of code is something you might find in [a] +//! procedural macro having to do with data structure serialization. The `#var` +//! syntax performs interpolation of runtime variables into the quoted tokens. +//! Check out the documentation of the [`quote!`] macro for more detail about +//! the syntax. See also the [`quote_spanned!`] macro which is important for +//! implementing hygienic procedural macros. +//! +//! [a]: https://serde.rs/ +//! [`quote_spanned!`]: macro.quote_spanned.html +//! +//! ```edition2018 +//! # use quote::quote; +//! # +//! # let generics = ""; +//! # let where_clause = ""; +//! # let field_ty = ""; +//! # let item_ty = ""; +//! # let path = ""; +//! # let value = ""; +//! # +//! let tokens = quote! { +//! struct SerializeWith #generics #where_clause { +//! value: &'a #field_ty, +//! phantom: core::marker::PhantomData<#item_ty>, +//! } +//! +//! impl #generics serde::Serialize for SerializeWith #generics #where_clause { +//! fn serialize(&self, serializer: S) -> Result +//! where +//! S: serde::Serializer, +//! { +//! #path(self.value, serializer) +//! } +//! } +//! +//! SerializeWith { +//! value: #value, +//! phantom: core::marker::PhantomData::<#item_ty>, +//! } +//! }; +//! ``` +//! +//! # Recursion limit +//! +//! The `quote!` macro relies on deep recursion so some large invocations may +//! fail with "recursion limit reached" when you compile. If it fails, bump up +//! the recursion limit by adding `#![recursion_limit = "128"]` to your crate. +//! An even higher limit may be necessary for especially large invocations. + +// Quote types in rustdoc of other crates get linked to here. +#![doc(html_root_url = "https://docs.rs/quote/0.6.12")] + +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" +))] +extern crate proc_macro; +extern crate proc_macro2; + +mod ext; +pub use ext::TokenStreamExt; + +mod to_tokens; +pub use to_tokens::ToTokens; + +// Not public API. +#[doc(hidden)] +#[path = "runtime.rs"] +pub mod __rt; + +/// The whole point. +/// +/// Performs variable interpolation against the input and produces it as +/// [`TokenStream`]. For returning tokens to the compiler in a procedural macro, use +/// `into()` to build a `TokenStream`. +/// +/// [`TokenStream`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.TokenStream.html +/// +/// # Interpolation +/// +/// Variable interpolation is done with `#var` (similar to `$var` in +/// `macro_rules!` macros). This grabs the `var` variable that is currently in +/// scope and inserts it in that location in the output tokens. Any type +/// implementing the [`ToTokens`] trait can be interpolated. This includes most +/// Rust primitive types as well as most of the syntax tree types from the [Syn] +/// crate. +/// +/// [`ToTokens`]: trait.ToTokens.html +/// [Syn]: https://github.com/dtolnay/syn +/// +/// Repetition is done using `#(...)*` or `#(...),*` again similar to +/// `macro_rules!`. This iterates through the elements of any variable +/// interpolated within the repetition and inserts a copy of the repetition body +/// for each one. The variables in an interpolation may be anything that +/// implements `IntoIterator`, including `Vec` or a pre-existing iterator. +/// +/// - `#(#var)*` — no separators +/// - `#(#var),*` — the character before the asterisk is used as a separator +/// - `#( struct #var; )*` — the repetition can contain other tokens +/// - `#( #k => println!("{}", #v), )*` — even multiple interpolations +/// +/// There are two limitations around interpolations in a repetition: +/// +/// - Every interpolation inside of a repetition must be a distinct variable. +/// That is, `#(#a #a)*` is not allowed. Work around this by collecting `a` +/// into a vector and taking references `a1 = &a` and `a2 = &a` which you use +/// inside the repetition: `#(#a1 #a2)*`. Where possible, use meaningful names +/// that indicate the distinct role of each copy. +/// +/// - Every interpolation inside of a repetition must be iterable. If we have +/// `vec` which is a vector and `ident` which is a single identifier, +/// `#(#ident #vec)*` is not allowed. Work around this by using +/// `std::iter::repeat(ident)` to produce an iterable that can be used from +/// within the repetition. +/// +/// # Hygiene +/// +/// Any interpolated tokens preserve the `Span` information provided by their +/// `ToTokens` implementation. Tokens that originate within the `quote!` +/// invocation are spanned with [`Span::call_site()`]. +/// +/// [`Span::call_site()`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html#method.call_site +/// +/// A different span can be provided through the [`quote_spanned!`] macro. +/// +/// [`quote_spanned!`]: macro.quote_spanned.html +/// +/// # Return type +/// +/// The macro evaluates to an expression of type `proc_macro2::TokenStream`. +/// Meanwhile Rust procedural macros are expected to return the type +/// `proc_macro::TokenStream`. +/// +/// The difference between the two types is that `proc_macro` types are entirely +/// specific to procedural macros and cannot ever exist in code outside of a +/// procedural macro, while `proc_macro2` types may exist anywhere including +/// tests and non-macro code like main.rs and build.rs. This is why even the +/// procedural macro ecosystem is largely built around `proc_macro2`, because +/// that ensures the libraries are unit testable and accessible in non-macro +/// contexts. +/// +/// There is a [`From`]-conversion in both directions so returning the output of +/// `quote!` from a procedural macro usually looks like `tokens.into()` or +/// `proc_macro::TokenStream::from(tokens)`. +/// +/// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html +/// +/// # Examples +/// +/// ## Procedural macro +/// +/// The structure of a basic procedural macro is as follows. Refer to the [Syn] +/// crate for further useful guidance on using `quote!` as part of a procedural +/// macro. +/// +/// [Syn]: https://github.com/dtolnay/syn +/// +/// ```edition2018 +/// # #[cfg(any())] +/// extern crate proc_macro; +/// # use proc_macro2 as proc_macro; +/// +/// use proc_macro::TokenStream; +/// use quote::quote; +/// +/// # const IGNORE_TOKENS: &'static str = stringify! { +/// #[proc_macro_derive(HeapSize)] +/// # }; +/// pub fn derive_heap_size(input: TokenStream) -> TokenStream { +/// // Parse the input and figure out what implementation to generate... +/// # const IGNORE_TOKENS: &'static str = stringify! { +/// let name = /* ... */; +/// let expr = /* ... */; +/// # }; +/// # +/// # let name = 0; +/// # let expr = 0; +/// +/// let expanded = quote! { +/// // The generated impl. +/// impl heapsize::HeapSize for #name { +/// fn heap_size_of_children(&self) -> usize { +/// #expr +/// } +/// } +/// }; +/// +/// // Hand the output tokens back to the compiler. +/// TokenStream::from(expanded) +/// } +/// ``` +/// +/// ## Combining quoted fragments +/// +/// Usually you don't end up constructing an entire final `TokenStream` in one +/// piece. Different parts may come from different helper functions. The tokens +/// produced by `quote!` themselves implement `ToTokens` and so can be +/// interpolated into later `quote!` invocations to build up a final result. +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// let type_definition = quote! {...}; +/// let methods = quote! {...}; +/// +/// let tokens = quote! { +/// #type_definition +/// #methods +/// }; +/// ``` +/// +/// ## Constructing identifiers +/// +/// Suppose we have an identifier `ident` which came from somewhere in a macro +/// input and we need to modify it in some way for the macro output. Let's +/// consider prepending the identifier with an underscore. +/// +/// Simply interpolating the identifier next to an underscore will not have the +/// behavior of concatenating them. The underscore and the identifier will +/// continue to be two separate tokens as if you had written `_ x`. +/// +/// ```edition2018 +/// # use proc_macro2::{self as syn, Span}; +/// # use quote::quote; +/// # +/// # let ident = syn::Ident::new("i", Span::call_site()); +/// # +/// // incorrect +/// quote! { +/// let mut _#ident = 0; +/// } +/// # ; +/// ``` +/// +/// The solution is to perform token-level manipulations using the APIs provided +/// by Syn and proc-macro2. +/// +/// ```edition2018 +/// # use proc_macro2::{self as syn, Span}; +/// # use quote::quote; +/// # +/// # let ident = syn::Ident::new("i", Span::call_site()); +/// # +/// let concatenated = format!("_{}", ident); +/// let varname = syn::Ident::new(&concatenated, ident.span()); +/// quote! { +/// let mut #varname = 0; +/// } +/// # ; +/// ``` +/// +/// ## Making method calls +/// +/// Let's say our macro requires some type specified in the macro input to have +/// a constructor called `new`. We have the type in a variable called +/// `field_type` of type `syn::Type` and want to invoke the constructor. +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// # let field_type = quote!(...); +/// # +/// // incorrect +/// quote! { +/// let value = #field_type::new(); +/// } +/// # ; +/// ``` +/// +/// This works only sometimes. If `field_type` is `String`, the expanded code +/// contains `String::new()` which is fine. But if `field_type` is something +/// like `Vec` then the expanded code is `Vec::new()` which is invalid +/// syntax. Ordinarily in handwritten Rust we would write `Vec::::new()` +/// but for macros often the following is more convenient. +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// # let field_type = quote!(...); +/// # +/// quote! { +/// let value = <#field_type>::new(); +/// } +/// # ; +/// ``` +/// +/// This expands to `>::new()` which behaves correctly. +/// +/// A similar pattern is appropriate for trait methods. +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// # let field_type = quote!(...); +/// # +/// quote! { +/// let value = <#field_type as core::default::Default>::default(); +/// } +/// # ; +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! quote { + ($($tt:tt)*) => { + quote_spanned!($crate::__rt::Span::call_site()=> $($tt)*) + }; +} + +/// Same as `quote!`, but applies a given span to all tokens originating within +/// the macro invocation. +/// +/// # Syntax +/// +/// A span expression of type [`Span`], followed by `=>`, followed by the tokens +/// to quote. The span expression should be brief -- use a variable for anything +/// more than a few characters. There should be no space before the `=>` token. +/// +/// [`Span`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html +/// +/// ```edition2018 +/// # use proc_macro2::Span; +/// # use quote::quote_spanned; +/// # +/// # const IGNORE_TOKENS: &'static str = stringify! { +/// let span = /* ... */; +/// # }; +/// # let span = Span::call_site(); +/// # let init = 0; +/// +/// // On one line, use parentheses. +/// let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init))); +/// +/// // On multiple lines, place the span at the top and use braces. +/// let tokens = quote_spanned! {span=> +/// Box::into_raw(Box::new(#init)) +/// }; +/// ``` +/// +/// The lack of space before the `=>` should look jarring to Rust programmers +/// and this is intentional. The formatting is designed to be visibly +/// off-balance and draw the eye a particular way, due to the span expression +/// being evaluated in the context of the procedural macro and the remaining +/// tokens being evaluated in the generated code. +/// +/// # Hygiene +/// +/// Any interpolated tokens preserve the `Span` information provided by their +/// `ToTokens` implementation. Tokens that originate within the `quote_spanned!` +/// invocation are spanned with the given span argument. +/// +/// # Example +/// +/// The following procedural macro code uses `quote_spanned!` to assert that a +/// particular Rust type implements the [`Sync`] trait so that references can be +/// safely shared between threads. +/// +/// [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html +/// +/// ```edition2018 +/// # use quote::{quote_spanned, TokenStreamExt, ToTokens}; +/// # use proc_macro2::{Span, TokenStream}; +/// # +/// # struct Type; +/// # +/// # impl Type { +/// # fn span(&self) -> Span { +/// # Span::call_site() +/// # } +/// # } +/// # +/// # impl ToTokens for Type { +/// # fn to_tokens(&self, _tokens: &mut TokenStream) {} +/// # } +/// # +/// # let ty = Type; +/// # let call_site = Span::call_site(); +/// # +/// let ty_span = ty.span(); +/// let assert_sync = quote_spanned! {ty_span=> +/// struct _AssertSync where #ty: Sync; +/// }; +/// ``` +/// +/// If the assertion fails, the user will see an error like the following. The +/// input span of their type is hightlighted in the error. +/// +/// ```text +/// error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied +/// --> src/main.rs:10:21 +/// | +/// 10 | static ref PTR: *const () = &(); +/// | ^^^^^^^^^ `*const ()` cannot be shared between threads safely +/// ``` +/// +/// In this example it is important for the where-clause to be spanned with the +/// line/column information of the user's input type so that error messages are +/// placed appropriately by the compiler. But it is also incredibly important +/// that `Sync` resolves at the macro definition site and not the macro call +/// site. If we resolve `Sync` at the same span that the user's type is going to +/// be resolved, then they could bypass our check by defining their own trait +/// named `Sync` that is implemented for their type. +#[macro_export(local_inner_macros)] +macro_rules! quote_spanned { + ($span:expr=> $($tt:tt)*) => {{ + let mut _s = $crate::__rt::TokenStream::new(); + let _span = $span; + quote_each_token!(_s _span $($tt)*); + _s + }}; +} + +// Extract the names of all #metavariables and pass them to the $finish macro. +// +// in: pounded_var_names!(then () a #b c #( #d )* #e) +// out: then!(() b d e) +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! pounded_var_names { + ($finish:ident ($($found:ident)*) # ( $($inner:tt)* ) $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) # [ $($inner:tt)* ] $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) # { $($inner:tt)* } $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) # $first:ident $($rest:tt)*) => { + pounded_var_names!($finish ($($found)* $first) $($rest)*) + }; + + ($finish:ident ($($found:ident)*) ( $($inner:tt)* ) $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) [ $($inner:tt)* ] $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) { $($inner:tt)* } $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($inner)* $($rest)*) + }; + + ($finish:ident ($($found:ident)*) $ignore:tt $($rest:tt)*) => { + pounded_var_names!($finish ($($found)*) $($rest)*) + }; + + ($finish:ident ($($found:ident)*)) => { + $finish!(() $($found)*) + }; +} + +// in: nested_tuples_pat!(() a b c d e) +// out: ((((a b) c) d) e) +// +// in: nested_tuples_pat!(() a) +// out: a +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! nested_tuples_pat { + (()) => { + &() + }; + + (() $first:ident $($rest:ident)*) => { + nested_tuples_pat!(($first) $($rest)*) + }; + + (($pat:pat) $first:ident $($rest:ident)*) => { + nested_tuples_pat!((($pat, $first)) $($rest)*) + }; + + (($done:pat)) => { + $done + }; +} + +// in: multi_zip_expr!(() a b c d e) +// out: a.into_iter().zip(b).zip(c).zip(d).zip(e) +// +// in: multi_zip_iter!(() a) +// out: a +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! multi_zip_expr { + (()) => { + &[] + }; + + (() $single:ident) => { + $single + }; + + (() $first:ident $($rest:ident)*) => { + multi_zip_expr!(($first.into_iter()) $($rest)*) + }; + + (($zips:expr) $first:ident $($rest:ident)*) => { + multi_zip_expr!(($zips.zip($first)) $($rest)*) + }; + + (($done:expr)) => { + $done + }; +} + +#[macro_export(local_inner_macros)] +#[doc(hidden)] +macro_rules! quote_each_token { + ($tokens:ident $span:ident) => {}; + + ($tokens:ident $span:ident # ! $($rest:tt)*) => { + quote_each_token!($tokens $span #); + quote_each_token!($tokens $span !); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident # ( $($inner:tt)* ) * $($rest:tt)*) => { + for pounded_var_names!(nested_tuples_pat () $($inner)*) + in pounded_var_names!(multi_zip_expr () $($inner)*) { + quote_each_token!($tokens $span $($inner)*); + } + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident # ( $($inner:tt)* ) $sep:tt * $($rest:tt)*) => { + for (_i, pounded_var_names!(nested_tuples_pat () $($inner)*)) + in pounded_var_names!(multi_zip_expr () $($inner)*).into_iter().enumerate() { + if _i > 0 { + quote_each_token!($tokens $span $sep); + } + quote_each_token!($tokens $span $($inner)*); + } + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident # [ $($inner:tt)* ] $($rest:tt)*) => { + quote_each_token!($tokens $span #); + $tokens.extend({ + let mut g = $crate::__rt::Group::new( + $crate::__rt::Delimiter::Bracket, + quote_spanned!($span=> $($inner)*), + ); + g.set_span($span); + Some($crate::__rt::TokenTree::from(g)) + }); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident # $first:ident $($rest:tt)*) => { + $crate::ToTokens::to_tokens(&$first, &mut $tokens); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ( $($first:tt)* ) $($rest:tt)*) => { + $tokens.extend({ + let mut g = $crate::__rt::Group::new( + $crate::__rt::Delimiter::Parenthesis, + quote_spanned!($span=> $($first)*), + ); + g.set_span($span); + Some($crate::__rt::TokenTree::from(g)) + }); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident [ $($first:tt)* ] $($rest:tt)*) => { + $tokens.extend({ + let mut g = $crate::__rt::Group::new( + $crate::__rt::Delimiter::Bracket, + quote_spanned!($span=> $($first)*), + ); + g.set_span($span); + Some($crate::__rt::TokenTree::from(g)) + }); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident { $($first:tt)* } $($rest:tt)*) => { + $tokens.extend({ + let mut g = $crate::__rt::Group::new( + $crate::__rt::Delimiter::Brace, + quote_spanned!($span=> $($first)*), + ); + g.set_span($span); + Some($crate::__rt::TokenTree::from(g)) + }); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident + $($rest:tt)*) => { + $crate::__rt::push_add(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident += $($rest:tt)*) => { + $crate::__rt::push_add_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident & $($rest:tt)*) => { + $crate::__rt::push_and(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident && $($rest:tt)*) => { + $crate::__rt::push_and_and(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident &= $($rest:tt)*) => { + $crate::__rt::push_and_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident @ $($rest:tt)*) => { + $crate::__rt::push_at(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ! $($rest:tt)*) => { + $crate::__rt::push_bang(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ^ $($rest:tt)*) => { + $crate::__rt::push_caret(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ^= $($rest:tt)*) => { + $crate::__rt::push_caret_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident : $($rest:tt)*) => { + $crate::__rt::push_colon(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident :: $($rest:tt)*) => { + $crate::__rt::push_colon2(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident , $($rest:tt)*) => { + $crate::__rt::push_comma(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident / $($rest:tt)*) => { + $crate::__rt::push_div(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident /= $($rest:tt)*) => { + $crate::__rt::push_div_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident . $($rest:tt)*) => { + $crate::__rt::push_dot(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident .. $($rest:tt)*) => { + $crate::__rt::push_dot2(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ... $($rest:tt)*) => { + $crate::__rt::push_dot3(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ..= $($rest:tt)*) => { + $crate::__rt::push_dot_dot_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident = $($rest:tt)*) => { + $crate::__rt::push_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident == $($rest:tt)*) => { + $crate::__rt::push_eq_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident >= $($rest:tt)*) => { + $crate::__rt::push_ge(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident > $($rest:tt)*) => { + $crate::__rt::push_gt(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident <= $($rest:tt)*) => { + $crate::__rt::push_le(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident < $($rest:tt)*) => { + $crate::__rt::push_lt(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident *= $($rest:tt)*) => { + $crate::__rt::push_mul_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident != $($rest:tt)*) => { + $crate::__rt::push_ne(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident | $($rest:tt)*) => { + $crate::__rt::push_or(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident |= $($rest:tt)*) => { + $crate::__rt::push_or_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident || $($rest:tt)*) => { + $crate::__rt::push_or_or(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident # $($rest:tt)*) => { + $crate::__rt::push_pound(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ? $($rest:tt)*) => { + $crate::__rt::push_question(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident -> $($rest:tt)*) => { + $crate::__rt::push_rarrow(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident <- $($rest:tt)*) => { + $crate::__rt::push_larrow(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident % $($rest:tt)*) => { + $crate::__rt::push_rem(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident %= $($rest:tt)*) => { + $crate::__rt::push_rem_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident => $($rest:tt)*) => { + $crate::__rt::push_fat_arrow(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident ; $($rest:tt)*) => { + $crate::__rt::push_semi(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident << $($rest:tt)*) => { + $crate::__rt::push_shl(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident <<= $($rest:tt)*) => { + $crate::__rt::push_shl_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident >> $($rest:tt)*) => { + $crate::__rt::push_shr(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident >>= $($rest:tt)*) => { + $crate::__rt::push_shr_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident * $($rest:tt)*) => { + $crate::__rt::push_star(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident - $($rest:tt)*) => { + $crate::__rt::push_sub(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident -= $($rest:tt)*) => { + $crate::__rt::push_sub_eq(&mut $tokens, $span); + quote_each_token!($tokens $span $($rest)*); + }; + + ($tokens:ident $span:ident $first:tt $($rest:tt)*) => { + $crate::__rt::parse(&mut $tokens, $span, quote_stringify!($first)); + quote_each_token!($tokens $span $($rest)*); + }; +} + +// Unhygienically invoke whatever `stringify` the caller has in scope i.e. not a +// local macro. The macros marked `local_inner_macros` above cannot invoke +// `stringify` directly. +#[macro_export] +#[doc(hidden)] +macro_rules! quote_stringify { + ($tt:tt) => { + stringify!($tt) + }; +} diff --git a/vendor/registry-40351f815f426200/quote/src/runtime.rs b/vendor/registry-40351f815f426200/quote/src/runtime.rs new file mode 100644 index 000000000..715a87707 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/src/runtime.rs @@ -0,0 +1,119 @@ +use ext::TokenStreamExt; +pub use proc_macro2::*; + +fn is_ident_start(c: u8) -> bool { + (b'a' <= c && c <= b'z') || (b'A' <= c && c <= b'Z') || c == b'_' +} + +fn is_ident_continue(c: u8) -> bool { + (b'a' <= c && c <= b'z') || (b'A' <= c && c <= b'Z') || c == b'_' || (b'0' <= c && c <= b'9') +} + +fn is_ident(token: &str) -> bool { + if token.bytes().all(|digit| digit >= b'0' && digit <= b'9') { + return false; + } + + let mut bytes = token.bytes(); + let first = bytes.next().unwrap(); + if !is_ident_start(first) { + return false; + } + for ch in bytes { + if !is_ident_continue(ch) { + return false; + } + } + true +} + +pub fn parse(tokens: &mut TokenStream, span: Span, s: &str) { + if is_ident(s) { + // Fast path, since idents are the most common token. + tokens.append(Ident::new(s, span)); + } else { + let s: TokenStream = s.parse().expect("invalid token stream"); + tokens.extend(s.into_iter().map(|mut t| { + t.set_span(span); + t + })); + } +} + +macro_rules! push_punct { + ($name:ident $char1:tt) => { + pub fn $name(tokens: &mut TokenStream, span: Span) { + let mut punct = Punct::new($char1, Spacing::Alone); + punct.set_span(span); + tokens.append(punct); + } + }; + ($name:ident $char1:tt $char2:tt) => { + pub fn $name(tokens: &mut TokenStream, span: Span) { + let mut punct = Punct::new($char1, Spacing::Joint); + punct.set_span(span); + tokens.append(punct); + let mut punct = Punct::new($char2, Spacing::Alone); + punct.set_span(span); + tokens.append(punct); + } + }; + ($name:ident $char1:tt $char2:tt $char3:tt) => { + pub fn $name(tokens: &mut TokenStream, span: Span) { + let mut punct = Punct::new($char1, Spacing::Joint); + punct.set_span(span); + tokens.append(punct); + let mut punct = Punct::new($char2, Spacing::Joint); + punct.set_span(span); + tokens.append(punct); + let mut punct = Punct::new($char3, Spacing::Alone); + punct.set_span(span); + tokens.append(punct); + } + }; +} + +push_punct!(push_add '+'); +push_punct!(push_add_eq '+' '='); +push_punct!(push_and '&'); +push_punct!(push_and_and '&' '&'); +push_punct!(push_and_eq '&' '='); +push_punct!(push_at '@'); +push_punct!(push_bang '!'); +push_punct!(push_caret '^'); +push_punct!(push_caret_eq '^' '='); +push_punct!(push_colon ':'); +push_punct!(push_colon2 ':' ':'); +push_punct!(push_comma ','); +push_punct!(push_div '/'); +push_punct!(push_div_eq '/' '='); +push_punct!(push_dot '.'); +push_punct!(push_dot2 '.' '.'); +push_punct!(push_dot3 '.' '.' '.'); +push_punct!(push_dot_dot_eq '.' '.' '='); +push_punct!(push_eq '='); +push_punct!(push_eq_eq '=' '='); +push_punct!(push_ge '>' '='); +push_punct!(push_gt '>'); +push_punct!(push_le '<' '='); +push_punct!(push_lt '<'); +push_punct!(push_mul_eq '*' '='); +push_punct!(push_ne '!' '='); +push_punct!(push_or '|'); +push_punct!(push_or_eq '|' '='); +push_punct!(push_or_or '|' '|'); +push_punct!(push_pound '#'); +push_punct!(push_question '?'); +push_punct!(push_rarrow '-' '>'); +push_punct!(push_larrow '<' '-'); +push_punct!(push_rem '%'); +push_punct!(push_rem_eq '%' '='); +push_punct!(push_fat_arrow '=' '>'); +push_punct!(push_semi ';'); +push_punct!(push_shl '<' '<'); +push_punct!(push_shl_eq '<' '<' '='); +push_punct!(push_shr '>' '>'); +push_punct!(push_shr_eq '>' '>' '='); +push_punct!(push_star '*'); +push_punct!(push_sub '-'); +push_punct!(push_sub_eq '-' '='); diff --git a/vendor/registry-40351f815f426200/quote/src/to_tokens.rs b/vendor/registry-40351f815f426200/quote/src/to_tokens.rs new file mode 100644 index 000000000..9d221b27b --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/src/to_tokens.rs @@ -0,0 +1,205 @@ +use super::TokenStreamExt; + +use std::borrow::Cow; +use std::iter; +use std::rc::Rc; + +use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree}; + +/// Types that can be interpolated inside a [`quote!`] invocation. +/// +/// [`quote!`]: macro.quote.html +pub trait ToTokens { + /// Write `self` to the given `TokenStream`. + /// + /// The token append methods provided by the [`TokenStreamExt`] extension + /// trait may be useful for implementing `ToTokens`. + /// + /// [`TokenStreamExt`]: trait.TokenStreamExt.html + /// + /// # Example + /// + /// Example implementation for a struct representing Rust paths like + /// `std::cmp::PartialEq`: + /// + /// ```edition2018 + /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream}; + /// use quote::{TokenStreamExt, ToTokens}; + /// + /// pub struct Path { + /// pub global: bool, + /// pub segments: Vec, + /// } + /// + /// impl ToTokens for Path { + /// fn to_tokens(&self, tokens: &mut TokenStream) { + /// for (i, segment) in self.segments.iter().enumerate() { + /// if i > 0 || self.global { + /// // Double colon `::` + /// tokens.append(Punct::new(':', Spacing::Joint)); + /// tokens.append(Punct::new(':', Spacing::Alone)); + /// } + /// segment.to_tokens(tokens); + /// } + /// } + /// } + /// # + /// # pub struct PathSegment; + /// # + /// # impl ToTokens for PathSegment { + /// # fn to_tokens(&self, tokens: &mut TokenStream) { + /// # unimplemented!() + /// # } + /// # } + /// ``` + fn to_tokens(&self, tokens: &mut TokenStream); + + /// Convert `self` directly into a `TokenStream` object. + /// + /// This method is implicitly implemented using `to_tokens`, and acts as a + /// convenience method for consumers of the `ToTokens` trait. + fn into_token_stream(self) -> TokenStream + where + Self: Sized, + { + let mut tokens = TokenStream::new(); + self.to_tokens(&mut tokens); + tokens + } +} + +impl<'a, T: ?Sized + ToTokens> ToTokens for &'a T { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens); + } +} + +impl<'a, T: ?Sized + ToTokens> ToTokens for &'a mut T { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens); + } +} + +impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens); + } +} + +impl ToTokens for Box { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens); + } +} + +impl ToTokens for Rc { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens); + } +} + +impl ToTokens for Option { + fn to_tokens(&self, tokens: &mut TokenStream) { + if let Some(ref t) = *self { + t.to_tokens(tokens); + } + } +} + +impl ToTokens for str { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Literal::string(self)); + } +} + +impl ToTokens for String { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.as_str().to_tokens(tokens); + } +} + +macro_rules! primitive { + ($($t:ident => $name:ident)*) => ($( + impl ToTokens for $t { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Literal::$name(*self)); + } + } + )*) +} + +primitive! { + i8 => i8_suffixed + i16 => i16_suffixed + i32 => i32_suffixed + i64 => i64_suffixed + isize => isize_suffixed + + u8 => u8_suffixed + u16 => u16_suffixed + u32 => u32_suffixed + u64 => u64_suffixed + usize => usize_suffixed + + f32 => f32_suffixed + f64 => f64_suffixed +} + +#[cfg(integer128)] +primitive! { + i128 => i128_suffixed + u128 => u128_suffixed +} + +impl ToTokens for char { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Literal::character(*self)); + } +} + +impl ToTokens for bool { + fn to_tokens(&self, tokens: &mut TokenStream) { + let word = if *self { "true" } else { "false" }; + tokens.append(Ident::new(word, Span::call_site())); + } +} + +impl ToTokens for Group { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(self.clone()); + } +} + +impl ToTokens for Ident { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(self.clone()); + } +} + +impl ToTokens for Punct { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(self.clone()); + } +} + +impl ToTokens for Literal { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(self.clone()); + } +} + +impl ToTokens for TokenTree { + fn to_tokens(&self, dst: &mut TokenStream) { + dst.append(self.clone()); + } +} + +impl ToTokens for TokenStream { + fn to_tokens(&self, dst: &mut TokenStream) { + dst.extend(iter::once(self.clone())); + } + + fn into_token_stream(self) -> TokenStream { + self + } +} diff --git a/vendor/registry-40351f815f426200/quote/tests/conditional/integer128.rs b/vendor/registry-40351f815f426200/quote/tests/conditional/integer128.rs new file mode 100644 index 000000000..61e227446 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/tests/conditional/integer128.rs @@ -0,0 +1,11 @@ +#[test] +fn test_integer128() { + let ii128 = -1i128; + let uu128 = 1u128; + + let tokens = quote! { + #ii128 #uu128 + }; + let expected = "-1i128 1u128"; + assert_eq!(expected, tokens.to_string()); +} diff --git a/vendor/registry-40351f815f426200/quote/tests/test.rs b/vendor/registry-40351f815f426200/quote/tests/test.rs new file mode 100644 index 000000000..f832da596 --- /dev/null +++ b/vendor/registry-40351f815f426200/quote/tests/test.rs @@ -0,0 +1,295 @@ +#![cfg_attr(feature = "cargo-clippy", allow(blacklisted_name))] + +use std::borrow::Cow; + +extern crate proc_macro2; +#[macro_use] +extern crate quote; + +use proc_macro2::{Ident, Span, TokenStream}; +use quote::TokenStreamExt; + +mod conditional { + #[cfg(integer128)] + mod integer128; +} + +struct X; + +impl quote::ToTokens for X { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Ident::new("X", Span::call_site())); + } +} + +#[test] +fn test_quote_impl() { + let tokens = quote! { + impl<'a, T: ToTokens> ToTokens for &'a T { + fn to_tokens(&self, tokens: &mut TokenStream) { + (**self).to_tokens(tokens) + } + } + }; + + let expected = concat!( + "impl < 'a , T : ToTokens > ToTokens for & 'a T { ", + "fn to_tokens ( & self , tokens : & mut TokenStream ) { ", + "( * * self ) . to_tokens ( tokens ) ", + "} ", + "}" + ); + + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_substitution() { + let x = X; + let tokens = quote!(#x <#x> (#x) [#x] {#x}); + + let expected = "X < X > ( X ) [ X ] { X }"; + + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_iter() { + let primes = &[X, X, X, X]; + + assert_eq!("X X X X", quote!(#(#primes)*).to_string()); + + assert_eq!("X , X , X , X ,", quote!(#(#primes,)*).to_string()); + + assert_eq!("X , X , X , X", quote!(#(#primes),*).to_string()); +} + +#[test] +fn test_advanced() { + let generics = quote!( <'a, T> ); + + let where_clause = quote!( where T: Serialize ); + + let field_ty = quote!(String); + + let item_ty = quote!(Cow<'a, str>); + + let path = quote!(SomeTrait::serialize_with); + + let value = quote!(self.x); + + let tokens = quote! { + struct SerializeWith #generics #where_clause { + value: &'a #field_ty, + phantom: ::std::marker::PhantomData<#item_ty>, + } + + impl #generics ::serde::Serialize for SerializeWith #generics #where_clause { + fn serialize(&self, s: &mut S) -> Result<(), S::Error> + where S: ::serde::Serializer + { + #path(self.value, s) + } + } + + SerializeWith { + value: #value, + phantom: ::std::marker::PhantomData::<#item_ty>, + } + }; + + let expected = concat!( + "struct SerializeWith < 'a , T > where T : Serialize { ", + "value : & 'a String , ", + "phantom : :: std :: marker :: PhantomData < Cow < 'a , str > > , ", + "} ", + "impl < 'a , T > :: serde :: Serialize for SerializeWith < 'a , T > where T : Serialize { ", + "fn serialize < S > ( & self , s : & mut S ) -> Result < ( ) , S :: Error > ", + "where S : :: serde :: Serializer ", + "{ ", + "SomeTrait :: serialize_with ( self . value , s ) ", + "} ", + "} ", + "SerializeWith { ", + "value : self . x , ", + "phantom : :: std :: marker :: PhantomData :: < Cow < 'a , str > > , ", + "}" + ); + + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_integer() { + let ii8 = -1i8; + let ii16 = -1i16; + let ii32 = -1i32; + let ii64 = -1i64; + let iisize = -1isize; + let uu8 = 1u8; + let uu16 = 1u16; + let uu32 = 1u32; + let uu64 = 1u64; + let uusize = 1usize; + + let tokens = quote! { + #ii8 #ii16 #ii32 #ii64 #iisize + #uu8 #uu16 #uu32 #uu64 #uusize + }; + let expected = "-1i8 -1i16 -1i32 -1i64 -1isize 1u8 1u16 1u32 1u64 1usize"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_floating() { + let e32 = 2.345f32; + + let e64 = 2.345f64; + + let tokens = quote! { + #e32 + #e64 + }; + let expected = concat!("2.345f32 2.345f64"); + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_char() { + let zero = '\0'; + let pound = '#'; + let quote = '"'; + let apost = '\''; + let newline = '\n'; + let heart = '\u{2764}'; + + let tokens = quote! { + #zero #pound #quote #apost #newline #heart + }; + let expected = "'\\u{0}' '#' '\\\"' '\\'' '\\n' '\\u{2764}'"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_str() { + let s = "\0 a 'b \" c"; + let tokens = quote!(#s); + let expected = "\"\\u{0} a \\'b \\\" c\""; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_string() { + let s = "\0 a 'b \" c".to_string(); + let tokens = quote!(#s); + let expected = "\"\\u{0} a \\'b \\\" c\""; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_ident() { + let foo = Ident::new("Foo", Span::call_site()); + let bar = Ident::new(&format!("Bar{}", 7), Span::call_site()); + let tokens = quote!(struct #foo; enum #bar {}); + let expected = "struct Foo ; enum Bar7 { }"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_duplicate() { + let ch = 'x'; + + let tokens = quote!(#ch #ch); + + let expected = "'x' 'x'"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_fancy_repetition() { + let foo = vec!["a", "b"]; + let bar = vec![true, false]; + + let tokens = quote! { + #(#foo: #bar),* + }; + + let expected = r#""a" : true , "b" : false"#; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_nested_fancy_repetition() { + let nested = vec![vec!['a', 'b', 'c'], vec!['x', 'y', 'z']]; + + let tokens = quote! { + #( + #(#nested)* + ),* + }; + + let expected = "'a' 'b' 'c' , 'x' 'y' 'z'"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_empty_repetition() { + let tokens = quote!(#(a b)* #(c d),*); + assert_eq!("", tokens.to_string()); +} + +#[test] +fn test_variable_name_conflict() { + // The implementation of `#(...),*` uses the variable `_i` but it should be + // fine, if a little confusing when debugging. + let _i = vec!['a', 'b']; + let tokens = quote! { #(#_i),* }; + let expected = "'a' , 'b'"; + assert_eq!(expected, tokens.to_string()); +} + +#[test] +fn test_empty_quote() { + let tokens = quote!(); + assert_eq!("", tokens.to_string()); +} + +#[test] +fn test_box_str() { + let b = "str".to_owned().into_boxed_str(); + let tokens = quote! { #b }; + assert_eq!("\"str\"", tokens.to_string()); +} + +#[test] +fn test_cow() { + let owned: Cow = Cow::Owned(Ident::new("owned", Span::call_site())); + + let ident = Ident::new("borrowed", Span::call_site()); + let borrowed = Cow::Borrowed(&ident); + + let tokens = quote! { #owned #borrowed }; + assert_eq!("owned borrowed", tokens.to_string()); +} + +#[test] +fn test_closure() { + fn field_i(i: usize) -> Ident { + Ident::new(&format!("__field{}", i), Span::call_site()) + } + + let fields = (0usize..3) + .map(field_i as fn(_) -> _) + .map(|var| quote! { #var }); + + let tokens = quote! { #(#fields)* }; + assert_eq!("__field0 __field1 __field2", tokens.to_string()); +} + +#[test] +fn test_append_tokens() { + let mut a = quote!(a); + let b = quote!(b); + a.append_all(b); + assert_eq!("a b", a.to_string()); +} diff --git a/vendor/registry-40351f815f426200/rand/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand/.cargo-checksum.json new file mode 100644 index 000000000..875021e18 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"ddc101ef9368ef83c21ea9e43064307b1c59b0698b78f59ea01cba32c0ef55bf","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"54c97aa3fc80f7482358b32df3fb96dbd63a4b52fb7f2eb06f1707cda7d15f09","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"d442009fc242a0670f6e7a418862c67514e2c544a43c88b24cb7f37695b8ae38","benches/distributions.rs":"fea4337cd3eb6eaa7bb3250bb04b084290a2b081d3f4679510f3e1dab9c9506b","benches/generators.rs":"19286f1022041bca7e9f83ff615534397565246d5cd26c53abcaeaebebad6773","benches/misc.rs":"c0302e0d9ab973ba4463506d90f89f903104b2a42fc11247be2056a2e1cb561f","benches/seq.rs":"188043fe02640c3936da7634517d0bc0bbdbf685739c52d2ec51a95f238aa347","build.rs":"00d4e7d3521f631913001cfaeb5c97f9dab8b550346046deb2683b962a99e9b3","examples/monte-carlo.rs":"2161c9c1ed90af6b72a5b05b6650d5fce6a983873c29c99798957099cd7a5153","examples/monty-hall.rs":"6a1921868c41d4c130a6b098632f2c127d2446ac6a73aeea10b79b845df1cbbc","src/deprecated.rs":"da2a39dfc440a09bdcdf5af93842dce0fbbc179e5e7146dc94ea861c244bf4c5","src/distributions/bernoulli.rs":"02526bdc24fe17f390505779fb38a441c6a1792c1f7e6093d8b86e143bf9e07e","src/distributions/binomial.rs":"5e2cd6ebc0a5411a4af26ff07d05dd30ae91fc47852cd29757b370ce496074b6","src/distributions/cauchy.rs":"b49d4abd1d861e9f9e9a27444680ea0e24779a6a263dce07c400cf43bab9363c","src/distributions/dirichlet.rs":"b6c0273216a05d32ab21320c11f46f80bc6a6173c93f7aa63fd397927fa365fb","src/distributions/exponential.rs":"7e8a98b63a271714c1f982dd15bc21626593691eaa92c7a76bd59af7b37a56a2","src/distributions/float.rs":"6e1e15b47f9efd282a0e7d140c141d35ece4ebbb748ce7ead620782dc492e88f","src/distributions/gamma.rs":"c922a1b7b2f20ee5a7f5241a252b8b947ab998a88a747df488380211b865f9a6","src/distributions/integer.rs":"b615123a814b118f8bc0563cd7615eec7ee171223bf8100416fb7d22e350c8d7","src/distributions/mod.rs":"6824a6a461d84aef22646d6c3ac8af5d2b5dfc90f09d537be2112fde98a9a8ea","src/distributions/normal.rs":"fe5df9d00ff4038ef6e1f6ca22971547aaec57887c700a511806da01bb4a2f17","src/distributions/other.rs":"44abe480bdc2000ca91a9d41c04e3d5fff2b08e81dfc9168d82c90ddc5cbf616","src/distributions/pareto.rs":"8a9d0f6a7b7221c5716f92b4b65dc19954c146eaeeddcc0b9533d01e2b7414ff","src/distributions/poisson.rs":"918f36d9f7b6c9c4a249b49138cf4df5e1498dd894e3856c21d2f82b83d33e53","src/distributions/triangular.rs":"5a3927b4f1306686591c6d6f3df01d774a5dbf9ec2450ee2f3ce6a71b54f744d","src/distributions/uniform.rs":"9536012592e978cda4e72cd936f21b9986704468de531fbe873f25f763afa4da","src/distributions/unit_circle.rs":"007815186a3696a3d835e9004f51e52402557a7cda09219a0ade13122578e1bd","src/distributions/unit_sphere.rs":"24b8dea60bee580378713477235ddac5e8da07e4f9ceb610fe655ec82390abaf","src/distributions/utils.rs":"68a8257290fdbbd1e72c77e55f21aab4420c6ff168ffb82f7cabc3ad815f4803","src/distributions/weibull.rs":"7678c47145bbb8455fb34326e59d05c2564d427b9c13d5d32435119fd37b5eeb","src/distributions/weighted.rs":"2c98d09ed15d204687efce857129742f905e50e96ba0518122a742f3b47753df","src/distributions/ziggurat_tables.rs":"6368acec20801c703ae76dd1e08983793732c5ac221c491f85d719ef75448b6d","src/lib.rs":"5a7c48d633e75c6d9f2598651ac7b754b3b34fec4212bdc50358a0abbc4ffc62","src/prelude.rs":"36f87f720c1ce0c9d0041872b0498e016b5578b96ba4f6152765ac5084d3b5da","src/prng/mod.rs":"e38182ca652acd0f9348e70e6896e2143b11e9cdcdb34fc78ad13b150dbd7da9","src/rngs/adapter/mod.rs":"e8f37aed72eaebc7dff20787f194e3a74da3e824e2b92a6839b7e6f01fcd911c","src/rngs/adapter/read.rs":"f9502c774607b5c3e62b87ea58698db258486b7c0dbb9b01559e3c18b468bb34","src/rngs/adapter/reseeding.rs":"0ce93bd0f00da429459bca7081346bddea85735bf2d617bcde92708907016a0d","src/rngs/entropy.rs":"cd89359f7891e955245279e4848c37733c508a8cf126eee34f2361a228014f4e","src/rngs/mock.rs":"ef812949b98e4f2eea3e62f8b3ee56edaeffc99d17625337efc882b7b2b19f4b","src/rngs/mod.rs":"440870d8066f1fbeb5d3b178bbf62d899f565d3cbc99c9b179ae4bca81b45a4f","src/rngs/small.rs":"eb942851fe2c2ce11eb0fe179efdfe2889dfc9bc72398bddbdfa327882935dd9","src/rngs/std.rs":"8420c2c32f312b2400ed23afdd9019632c2dd61bb5bd935d6d73bacbcbb9a5b2","src/rngs/thread.rs":"82ef4cf043d16d1d3e6f0037b269f817b133833240f866cd8a7b6e82d3c279ff","src/seq/index.rs":"384500a66361d21531db1380474066fa0bafb672ff7c9db00208b30a94664511","src/seq/mod.rs":"5a9938dc2ac75f393b54267abced2c5f7fbba4ffbdeb6ecdc80afe618c28fea6","tests/uniformity.rs":"0b774361f7db445bd910ad2cbac71207d01ace6881b8d501f4ff01bffd16cd68"},"package":"6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand/CHANGELOG.md b/vendor/registry-40351f815f426200/rand/CHANGELOG.md new file mode 100644 index 000000000..955e872b0 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/CHANGELOG.md @@ -0,0 +1,522 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md). + +You may also find the [Upgrade Guide](https://rust-random.github.io/book/update.html) useful. + + +## [0.6.5] - 2019-01-28 +### Crates +- Update `rand_core` to 0.4 (#703) +- Move `JitterRng` to its own crate (#685) +- Add a warm-bindgen test crate (#696) + +### Platforms +- Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng + +### Doc +- Use RFC 1946 for doc links (#691) +- Fix some doc links and notes (#711) + +## [0.6.4] - 2019-01-08 +### Fixes +- Move wasm-bindgen shims to correct crate (#686) +- Make `wasm32-unknown-unknown` compile but fail at run-time if missing bindingsg (#686) + +## [0.6.3] - 2019-01-04 +### Fixes +- Make the `std` feature require the optional `rand_os` dependency (#675) +- Re-export the optional WASM dependencies of `rand_os` from `rand` to avoid breakage (#674) + +## [0.6.2] - 2019-01-04 +### Additions +- Add `Default` for `ThreadRng` (#657) +- Move `rngs::OsRng` to `rand_os` sub-crate; clean up code; use as dependency (#643) ##BLOCKER## +- Add `rand_xoshiro` sub-crate, plus benchmarks (#642, #668) + +### Fixes +- Fix bias in `UniformInt::sample_single` (#662) +- Use `autocfg` instead of `rustc_version` for rustc version detection (#664) +- Disable `i128` and `u128` if the `target_os` is `emscripten` (#671: work-around Emscripten limitation) +- CI fixes (#660, #671) + +### Optimisations +- Optimise memory usage of `UnitCircle` and `UnitSphereSurface` distributions (no PR) + +## [0.6.1] - 2018-11-22 +- Support sampling `Duration` also for `no_std` (only since Rust 1.25) (#649) +- Disable default features of `libc` (#647) + +## [0.6.0] - 2018-11-14 + +### Project organisation +- Rand has moved from [rust-lang-nursery](https://github.com/rust-lang-nursery/rand) + to [rust-random](https://github.com/rust-random/rand)! (#578) +- Created [The Rust Random Book](https://rust-random.github.io/book/) + ([source](https://github.com/rust-random/book)) +- Update copyright and licence notices (#591, #611) +- Migrate policy documentation from the wiki (#544) + +### Platforms +- Add fork protection on Unix (#466) +- Added support for wasm-bindgen. (#541, #559, #562, #600) +- Enable `OsRng` for powerpc64, sparc and sparc64 (#609) +- Use `syscall` from `libc` on Linux instead of redefining it (#629) + +### RNGs +- Switch `SmallRng` to use PCG (#623) +- Implement `Pcg32` and `Pcg64Mcg` generators (#632) +- Move ISAAC RNGs to a dedicated crate (#551) +- Move Xorshift RNG to its own crate (#557) +- Move ChaCha and HC128 RNGs to dedicated crates (#607, #636) +- Remove usage of `Rc` from `ThreadRng` (#615) + +### Sampling and distributions +- Implement `Rng.gen_ratio()` and `Bernoulli::new_ratio()` (#491) +- Make `Uniform` strictly respect `f32` / `f64` high/low bounds (#477) +- Allow `gen_range` and `Uniform` to work on non-`Copy` types (#506) +- `Uniform` supports inclusive ranges: `Uniform::from(a..=b)`. This is + automatically enabled for Rust >= 1.27. (#566) +- Implement `TrustedLen` and `FusedIterator` for `DistIter` (#620) + +#### New distributions +- Add the `Dirichlet` distribution (#485) +- Added sampling from the unit sphere and circle. (#567) +- Implement the triangular distribution (#575) +- Implement the Weibull distribution (#576) +- Implement the Beta distribution (#574) + +#### Optimisations + +- Optimise `Bernoulli::new` (#500) +- Optimise `char` sampling (#519) +- Optimise sampling of `std::time::Duration` (#583) + +### Sequences +- Redesign the `seq` module (#483, #515) +- Add `WeightedIndex` and `choose_weighted` (#518, #547) +- Optimised and changed return type of the `sample_indices` function. (#479) +- Use `Iterator::size_hint()` to speed up `IteratorRandom::choose` (#593) + +### SIMD +- Support for generating SIMD types (#523, #542, #561, #630) + +### Other +- Revise CI scripts (#632, #635) +- Remove functionality already deprecated in 0.5 (#499) +- Support for `i128` and `u128` is automatically enabled for Rust >= 1.26. This + renders the `i128_support` feature obsolete. It still exists for backwards + compatibility but does not have any effect. This breaks programs using Rand + with `i128_support` on nightlies older than Rust 1.26. (#571) + + +## [0.5.5] - 2018-08-07 +### Documentation +- Fix links in documentation (#582) + + +## [0.5.4] - 2018-07-11 +### Platform support +- Make `OsRng` work via WASM/stdweb for WebWorkers + + +## [0.5.3] - 2018-06-26 +### Platform support +- OpenBSD, Bitrig: fix compilation (broken in 0.5.1) (#530) + + +## [0.5.2] - 2018-06-18 +### Platform support +- Hide `OsRng` and `JitterRng` on unsupported platforms (#512; fixes #503). + + +## [0.5.1] - 2018-06-08 + +### New distributions +- Added Cauchy distribution. (#474, #486) +- Added Pareto distribution. (#495) + +### Platform support and `OsRng` +- Remove blanket Unix implementation. (#484) +- Remove Wasm unimplemented stub. (#484) +- Dragonfly BSD: read from `/dev/random`. (#484) +- Bitrig: use `getentropy` like OpenBSD. (#484) +- Solaris: (untested) use `getrandom` if available, otherwise `/dev/random`. (#484) +- Emscripten, `stdweb`: split the read up in chunks. (#484) +- Emscripten, Haiku: don't do an extra blocking read from `/dev/random`. (#484) +- Linux, NetBSD, Solaris: read in blocking mode on first use in `fill_bytes`. (#484) +- Fuchsia, CloudABI: fix compilation (broken in Rand 0.5). (#484) + + +## [0.5.0] - 2018-05-21 + +### Crate features and organisation +- Minimum Rust version update: 1.22.0. (#239) +- Create a separate `rand_core` crate. (#288) +- Deprecate `rand_derive`. (#256) +- Add `prelude` (and module reorganisation). (#435) +- Add `log` feature. Logging is now available in `JitterRng`, `OsRng`, `EntropyRng` and `ReseedingRng`. (#246) +- Add `serde1` feature for some PRNGs. (#189) +- `stdweb` feature for `OsRng` support on WASM via stdweb. (#272, #336) + +### `Rng` trait +- Split `Rng` in `RngCore` and `Rng` extension trait. + `next_u32`, `next_u64` and `fill_bytes` are now part of `RngCore`. (#265) +- Add `Rng::sample`. (#256) +- Deprecate `Rng::gen_weighted_bool`. (#308) +- Add `Rng::gen_bool`. (#308) +- Remove `Rng::next_f32` and `Rng::next_f64`. (#273) +- Add optimized `Rng::fill` and `Rng::try_fill` methods. (#247) +- Deprecate `Rng::gen_iter`. (#286) +- Deprecate `Rng::gen_ascii_chars`. (#279) + +### `rand_core` crate +- `rand` now depends on new `rand_core` crate (#288) +- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288) +- Add modules to help implementing RNGs `impl` and `le`. (#209, #228) +- Add `Error` and `ErrorKind`. (#225) +- Add `CryptoRng` marker trait. (#273) +- Add `BlockRngCore` trait. (#281) +- Add `BlockRng` and `BlockRng64` wrappers to help implementations. (#281, #325) +- Revise the `SeedableRng` trait. (#233) +- Remove default implementations for `RngCore::next_u64` and `RngCore::fill_bytes`. (#288) +- Add `RngCore::try_fill_bytes`. (#225) + +### Other traits and types +- Add `FromEntropy` trait. (#233, #375) +- Add `SmallRng` wrapper. (#296) +- Rewrite `ReseedingRng` to only work with `BlockRngCore` (substantial performance improvement). (#281) +- Deprecate `weak_rng`. Use `SmallRng` instead. (#296) +- Deprecate `AsciiGenerator`. (#279) + +### Random number generators +- Switch `StdRng` and `thread_rng` to HC-128. (#277) +- `StdRng` must now be created with `from_entropy` instead of `new` +- Change `thread_rng` reseeding threshold to 32 MiB. (#277) +- PRNGs no longer implement `Copy`. (#209) +- `Debug` implementations no longer show internals. (#209) +- Implement `Clone` for `ReseedingRng`, `JitterRng`, OsRng`. (#383, #384) +- Implement serialization for `XorShiftRng`, `IsaacRng` and `Isaac64Rng` under the `serde1` feature. (#189) +- Implement `BlockRngCore` for `ChaChaCore` and `Hc128Core`. (#281) +- All PRNGs are now portable across big- and little-endian architectures. (#209) +- `Isaac64Rng::next_u32` no longer throws away half the results. (#209) +- Add `IsaacRng::new_from_u64` and `Isaac64Rng::new_from_u64`. (#209) +- Add the HC-128 CSPRNG `Hc128Rng`. (#210) +- Change ChaCha20 to have 64-bit counter and 64-bit stream. (#349) +- Changes to `JitterRng` to get its size down from 2112 to 24 bytes. (#251) +- Various performance improvements to all PRNGs. + +### Platform support and `OsRng` +- Add support for CloudABI. (#224) +- Remove support for NaCl. (#225) +- WASM support for `OsRng` via stdweb, behind the `stdweb` feature. (#272, #336) +- Use `getrandom` on more platforms for Linux, and on Android. (#338) +- Use the `SecRandomCopyBytes` interface on macOS. (#322) +- On systems that do not have a syscall interface, only keep a single file descriptor open for `OsRng`. (#239) +- On Unix, first try a single read from `/dev/random`, then `/dev/urandom`. (#338) +- Better error handling and reporting in `OsRng` (using new error type). (#225) +- `OsRng` now uses non-blocking when available. (#225) +- Add `EntropyRng`, which provides `OsRng`, but has `JitterRng` as a fallback. (#235) + +### Distributions +- New `Distribution` trait. (#256) +- Add `Distribution::sample_iter` and `Rng::::sample_iter`. (#361) +- Deprecate `Rand`, `Sample` and `IndependentSample` traits. (#256) +- Add a `Standard` distribution (replaces most `Rand` implementations). (#256) +- Add `Binomial` and `Poisson` distributions. (#96) +- Add `Bernoulli` dsitribution. (#411) +- Add `Alphanumeric` distribution. (#279) +- Remove `Closed01` distribution, add `OpenClosed01`. (#274, #420) +- Rework `Range` type, making it possible to implement it for user types. (#274) +- Rename `Range` to `Uniform`. (#395) +- Add `Uniform::new_inclusive` for inclusive ranges. (#274) +- Use widening multiply method for much faster integer range reduction. (#274) +- `Standard` distribution for `char` uses `Uniform` internally. (#274) +- `Standard` distribution for `bool` uses sign test. (#274) +- Implement `Standard` distribution for `Wrapping`. (#436) +- Implement `Uniform` distribution for `Duration`. (#427) + + +## [0.4.3] - 2018-08-16 +### Fixed +- Use correct syscall number for PowerPC (#589) + + +## [0.4.2] - 2018-01-06 +### Changed +- Use `winapi` on Windows +- Update for Fuchsia OS +- Remove dev-dependency on `log` + + +## [0.4.1] - 2017-12-17 +### Added +- `no_std` support + + +## [0.4.0-pre.0] - 2017-12-11 +### Added +- `JitterRng` added as a high-quality alternative entropy source using the + system timer +- new `seq` module with `sample_iter`, `sample_slice`, etc. +- WASM support via dummy implementations (fail at run-time) +- Additional benchmarks, covering generators and new seq code + +### Changed +- `thread_rng` uses `JitterRng` if seeding from system time fails + (slower but more secure than previous method) + +### Deprecated + - `sample` function deprecated (replaced by `sample_iter`) + + +## [0.3.20] - 2018-01-06 +### Changed +- Remove dev-dependency on `log` +- Update `fuchsia-zircon` dependency to 0.3.2 + + +## [0.3.19] - 2017-12-27 +### Changed +- Require `log <= 0.3.8` for dev builds +- Update `fuchsia-zircon` dependency to 0.3 +- Fix broken links in docs (to unblock compiler docs testing CI) + + +## [0.3.18] - 2017-11-06 +### Changed +- `thread_rng` is seeded from the system time if `OsRng` fails +- `weak_rng` now uses `thread_rng` internally + + +## [0.3.17] - 2017-10-07 +### Changed + - Fuchsia: Magenta was renamed Zircon + +## [0.3.16] - 2017-07-27 +### Added +- Implement Debug for mote non-public types +- implement `Rand` for (i|u)i128 +- Support for Fuchsia + +### Changed +- Add inline attribute to SampleRange::construct_range. + This improves the benchmark for sample in 11% and for shuffle in 16%. +- Use `RtlGenRandom` instead of `CryptGenRandom` + + +## [0.3.15] - 2016-11-26 +### Added +- Add `Rng` trait method `choose_mut` +- Redox support + +### Changed +- Use `arc4rand` for `OsRng` on FreeBSD. +- Use `arc4random(3)` for `OsRng` on OpenBSD. + +### Fixed +- Fix filling buffers 4 GiB or larger with `OsRng::fill_bytes` on Windows + + +## [0.3.14] - 2016-02-13 +### Fixed +- Inline definitions from winapi/advapi32, wich decreases build times + + +## [0.3.13] - 2016-01-09 +### Fixed +- Compatible with Rust 1.7.0-nightly (needed some extra type annotations) + + +## [0.3.12] - 2015-11-09 +### Changed +- Replaced the methods in `next_f32` and `next_f64` with the technique described + Saito & Matsumoto at MCQMC'08. The new method should exhibit a slightly more + uniform distribution. +- Depend on libc 0.2 + +### Fixed +- Fix iterator protocol issue in `rand::sample` + + +## [0.3.11] - 2015-08-31 +### Added +- Implement `Rand` for arrays with n <= 32 + + +## [0.3.10] - 2015-08-17 +### Added +- Support for NaCl platforms + +### Changed +- Allow `Rng` to be `?Sized`, impl for `&mut R` and `Box` where `R: ?Sized + Rng` + + +## [0.3.9] - 2015-06-18 +### Changed +- Use `winapi` for Windows API things + +### Fixed +- Fixed test on stable/nightly +- Fix `getrandom` syscall number for aarch64-unknown-linux-gnu + + +## [0.3.8] - 2015-04-23 +### Changed +- `log` is a dev dependency + +### Fixed +- Fix race condition of atomics in `is_getrandom_available` + + +## [0.3.7] - 2015-04-03 +### Fixed +- Derive Copy/Clone changes + + +## [0.3.6] - 2015-04-02 +### Changed +- Move to stable Rust! + + +## [0.3.5] - 2015-04-01 +### Fixed +- Compatible with Rust master + + +## [0.3.4] - 2015-03-31 +### Added +- Implement Clone for `Weighted` + +### Fixed +- Compatible with Rust master + + +## [0.3.3] - 2015-03-26 +### Fixed +- Fix compile on Windows + + +## [0.3.2] - 2015-03-26 + + +## [0.3.1] - 2015-03-26 +### Fixed +- Fix compile on Windows + + +## [0.3.0] - 2015-03-25 +### Changed +- Update to use log version 0.3.x + + +## [0.2.1] - 2015-03-22 +### Fixed +- Compatible with Rust master +- Fixed iOS compilation + + +## [0.2.0] - 2015-03-06 +### Fixed +- Compatible with Rust master (move from `old_io` to `std::io`) + + +## [0.1.4] - 2015-03-04 +### Fixed +- Compatible with Rust master (use wrapping ops) + + +## [0.1.3] - 2015-02-20 +### Fixed +- Compatible with Rust master + +### Removed +- Removed Copy implementations from RNGs + + +## [0.1.2] - 2015-02-03 +### Added +- Imported functionality from `std::rand`, including: + - `StdRng`, `SeedableRng`, `TreadRng`, `weak_rng()` + - `ReaderRng`: A wrapper around any Reader to treat it as an RNG. +- Imported documentation from `std::rand` +- Imported tests from `std::rand` + + +## [0.1.1] - 2015-02-03 +### Added +- Migrate to a cargo-compatible directory structure. + +### Fixed +- Do not use entropy during `gen_weighted_bool(1)` + + +## [Rust 0.12.0] - 2014-10-09 +### Added +- Impl Rand for tuples of arity 11 and 12 +- Include ChaCha pseudorandom generator +- Add `next_f64` and `next_f32` to Rng +- Implement Clone for PRNGs + +### Changed +- Rename `TaskRng` to `ThreadRng` and `task_rng` to `thread_rng` (since a + runtime is removed from Rust). + +### Fixed +- Improved performance of ISAAC and ISAAC64 by 30% and 12 % respectively, by + informing the optimiser that indexing is never out-of-bounds. + +### Removed +- Removed the Deprecated `choose_option` + + +## [Rust 0.11.0] - 2014-07-02 +### Added +- document when to use `OSRng` in cryptographic context, and explain why we use `/dev/urandom` instead of `/dev/random` +- `Rng::gen_iter()` which will return an infinite stream of random values +- `Rng::gen_ascii_chars()` which will return an infinite stream of random ascii characters + +### Changed +- Now only depends on libcore! +- Remove `Rng.choose()`, rename `Rng.choose_option()` to `.choose()` +- Rename OSRng to OsRng +- The WeightedChoice structure is no longer built with a `Vec>`, + but rather a `&mut [Weighted]`. This means that the WeightedChoice + structure now has a lifetime associated with it. +- The `sample` method on `Rng` has been moved to a top-level function in the + `rand` module due to its dependence on `Vec`. + +### Removed +- `Rng::gen_vec()` was removed. Previous behavior can be regained with + `rng.gen_iter().take(n).collect()` +- `Rng::gen_ascii_str()` was removed. Previous behavior can be regained with + `rng.gen_ascii_chars().take(n).collect()` +- {IsaacRng, Isaac64Rng, XorShiftRng}::new() have all been removed. These all + relied on being able to use an OSRng for seeding, but this is no longer + available in librand (where these types are defined). To retain the same + functionality, these types now implement the `Rand` trait so they can be + generated with a random seed from another random number generator. This allows + the stdlib to use an OSRng to create seeded instances of these RNGs. +- Rand implementations for `Box` and `@T` were removed. These seemed to be + pretty rare in the codebase, and it allows for librand to not depend on + liballoc. Additionally, other pointer types like Rc and Arc were not + supported. +- Remove a slew of old deprecated functions + + +## [Rust 0.10] - 2014-04-03 +### Changed +- replace `Rng.shuffle's` functionality with `.shuffle_mut` +- bubble up IO errors when creating an OSRng + +### Fixed +- Use `fill()` instead of `read()` +- Rewrite OsRng in Rust for windows + +## [0.10-pre] - 2014-03-02 +### Added +- Seperate `rand` out of the standard library diff --git a/vendor/registry-40351f815f426200/rand/COPYRIGHT b/vendor/registry-40351f815f426200/rand/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand/Cargo.toml b/vendor/registry-40351f815f426200/rand/Cargo.toml new file mode 100644 index 000000000..fc0313afa --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/Cargo.toml @@ -0,0 +1,90 @@ +# 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 = "rand" +version = "0.6.5" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +build = "build.rs" +exclude = ["/utils/*", "/.travis.yml", "/appveyor.yml", ".gitignore"] +description = "Random number generators and other randomness functionality.\n" +homepage = "https://crates.io/crates/rand" +documentation = "https://rust-random.github.io/rand" +readme = "README.md" +keywords = ["random", "rng"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[package.metadata.docs.rs] +all-features = true +[dependencies.log] +version = "0.4" +optional = true + +[dependencies.packed_simd] +version = "0.3" +features = ["into_bits"] +optional = true + +[dependencies.rand_chacha] +version = "0.1" + +[dependencies.rand_core] +version = "0.4" + +[dependencies.rand_hc] +version = "0.1" + +[dependencies.rand_isaac] +version = "0.1" + +[dependencies.rand_jitter] +version = "0.1" + +[dependencies.rand_os] +version = "0.1" +optional = true + +[dependencies.rand_pcg] +version = "0.1" + +[dependencies.rand_xorshift] +version = "0.1" +[dev-dependencies.average] +version = "0.9.2" + +[dev-dependencies.rand_xoshiro] +version = "0.1" +[build-dependencies.autocfg] +version = "0.1" + +[features] +alloc = ["rand_core/alloc"] +default = ["std"] +i128_support = [] +nightly = ["simd_support"] +serde1 = ["rand_core/serde1", "rand_isaac/serde1", "rand_xorshift/serde1"] +simd_support = ["packed_simd"] +std = ["rand_core/std", "alloc", "rand_os", "rand_jitter/std"] +stdweb = ["rand_os/stdweb"] +wasm-bindgen = ["rand_os/wasm-bindgen"] +[target."cfg(unix)".dependencies.libc] +version = "0.2" +default-features = false +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["minwindef", "ntsecapi", "profileapi", "winnt"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand/LICENSE-MIT b/vendor/registry-40351f815f426200/rand/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand/README.md b/vendor/registry-40351f815f426200/rand/README.md new file mode 100644 index 000000000..314a57fd6 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/README.md @@ -0,0 +1,122 @@ +# Rand + +[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Crate](https://img.shields.io/crates/v/rand.svg)](https://crates.io/crates/rand) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand) +[![API](https://docs.rs/rand/badge.svg)](https://docs.rs/rand) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +A Rust library for random number generation. + +Rand provides utilities to generate random numbers, to convert them to useful +types and distributions, and some randomness-related algorithms. + +The core random number generation traits of Rand live in the [rand_core]( +https://crates.io/crates/rand_core) crate but are also exposed here; RNG +implementations should prefer to use `rand_core` while most other users should +depend on `rand`. + +Documentation: +- [The Rust Rand Book](https://rust-random.github.io/book) +- [API reference (master)](https://rust-random.github.io/rand) +- [API reference (docs.rs)](https://docs.rs/rand) + + +## Usage + +Add this to your `Cargo.toml`: + +```toml +[dependencies] +rand = "0.6" +``` + +To get started using Rand, see [The Book](https://rust-random.github.io/book). + + +## Versions + +The Rand lib is not yet stable, however we are careful to limit breaking changes +and warn via deprecation wherever possible. Patch versions never introduce +breaking changes. The following minor versions are supported: + +- Version 0.6 was released in November 2018, redesigning the `seq` module, + moving most PRNGs to external crates, and many small changes. +- Version 0.5 was released in May 2018, as a major reorganisation + (introducing `RngCore` and `rand_core`, and deprecating `Rand` and the + previous distribution traits). +- Version 0.4 was released in December 2017, but contained almost no breaking + changes from the 0.3 series. + +A detailed [changelog](CHANGELOG.md) is available. + +When upgrading to the next minor series (especially 0.4 → 0.5), we recommend +reading the [Upgrade Guide](https://rust-random.github.io/book/update.html). + +### Rust version requirements + +Since version 0.5, Rand requires **Rustc version 1.22 or greater**. +Rand 0.4 and 0.3 (since approx. June 2017) require Rustc version 1.15 or +greater. Subsets of the Rand code may work with older Rust versions, but this +is not supported. + +Travis CI always has a build with a pinned version of Rustc matching the oldest +supported Rust release. The current policy is that this can be updated in any +Rand release if required, but the change must be noted in the changelog. + +To avoid bumping the required version unnecessarily, we use a `build.rs` script +to auto-detect the compiler version and enable certain features or change code +paths automatically. Since this makes it easy to unintentionally make use of +features requiring a more recent Rust version, we recommend testing with a +pinned version of Rustc if you require compatibility with a specific version. + +## Crate Features + +Rand is built with the `std` and `rand_os` features enabled by default: + +- `std` enables functionality dependent on the `std` lib and implies `alloc` + and `rand_os` +- `rand_os` enables the `rand_os` crate, `rngs::OsRng` and enables its usage; + the continued existance of this feature is not guaranteed so users are + encouraged to specify `std` instead + +The following optional features are available: + +- `alloc` can be used instead of `std` to provide `Vec` and `Box`. +- `log` enables some logging via the `log` crate. +- `nightly` enables all unstable features (`simd_support`). +- `serde1` enables serialization for some types, via Serde version 1. +- `simd_support` enables uniform sampling of SIMD types (integers and floats). +- `stdweb` enables support for `OsRng` on `wasm32-unknown-unknown` via `stdweb` + combined with `cargo-web`. +- `wasm-bindgen` enables support for `OsRng` on `wasm32-unknown-unknown` via + [`wasm-bindgen`] + +[`wasm-bindgen`]: https://github.com/rustwasm/wasm-bindgen + +`no_std` mode is activated by setting `default-features = false`; this removes +functionality depending on `std`: + +- `thread_rng()`, and `random()` are not available, as they require thread-local + storage and an entropy source. +- `OsRng` and `EntropyRng` are unavailable. +- `JitterRng` code is still present, but a nanosecond timer must be provided via + `JitterRng::new_with_timer` +- Since no external entropy is available, it is not possible to create + generators with fresh seeds using the `FromEntropy` trait (user must provide + a seed). +- Several non-linear distributions distributions are unavailable since `exp` + and `log` functions are not provided in `core`. +- Large parts of the `seq`-uence module are unavailable, unless the `alloc` + feature is used (several APIs and many implementations require `Vec`). + + +# License + +Rand is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand/benches/distributions.rs b/vendor/registry-40351f815f426200/rand/benches/distributions.rs new file mode 100644 index 000000000..069a82856 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/benches/distributions.rs @@ -0,0 +1,259 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +#![feature(test)] + +extern crate test; +extern crate rand; + +const RAND_BENCH_N: u64 = 1000; + +use std::mem::size_of; +use test::Bencher; +use std::time::Duration; + +use rand::{Rng, FromEntropy}; +use rand::rngs::SmallRng; +use rand::distributions::*; + +macro_rules! distr_int { + ($fnn:ident, $ty:ty, $distr:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = $distr; + + b.iter(|| { + let mut accum = 0 as $ty; + for _ in 0..::RAND_BENCH_N { + let x: $ty = distr.sample(&mut rng); + accum = accum.wrapping_add(x); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +macro_rules! distr_float { + ($fnn:ident, $ty:ty, $distr:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = $distr; + + b.iter(|| { + let mut accum = 0.0; + for _ in 0..::RAND_BENCH_N { + let x: $ty = distr.sample(&mut rng); + accum += x; + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +macro_rules! distr_duration { + ($fnn:ident, $distr:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = $distr; + + b.iter(|| { + let mut accum = Duration::new(0, 0); + for _ in 0..::RAND_BENCH_N { + let x: Duration = distr.sample(&mut rng); + accum = accum.checked_add(x).unwrap_or(Duration::new(u64::max_value(), 999_999_999)); + } + accum + }); + b.bytes = size_of::() as u64 * ::RAND_BENCH_N; + } + } +} + +macro_rules! distr { + ($fnn:ident, $ty:ty, $distr:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = $distr; + + b.iter(|| { + let mut accum = 0u32; + for _ in 0..::RAND_BENCH_N { + let x: $ty = distr.sample(&mut rng); + accum = accum.wrapping_add(x as u32); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +macro_rules! distr_arr { + ($fnn:ident, $ty:ty, $distr:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = $distr; + + b.iter(|| { + let mut accum = 0u32; + for _ in 0..::RAND_BENCH_N { + let x: $ty = distr.sample(&mut rng); + accum = accum.wrapping_add(x[0] as u32); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +// uniform +distr_int!(distr_uniform_i8, i8, Uniform::new(20i8, 100)); +distr_int!(distr_uniform_i16, i16, Uniform::new(-500i16, 2000)); +distr_int!(distr_uniform_i32, i32, Uniform::new(-200_000_000i32, 800_000_000)); +distr_int!(distr_uniform_i64, i64, Uniform::new(3i64, 123_456_789_123)); +distr_int!(distr_uniform_i128, i128, Uniform::new(-123_456_789_123i128, 123_456_789_123_456_789)); + +distr_float!(distr_uniform_f32, f32, Uniform::new(2.26f32, 2.319)); +distr_float!(distr_uniform_f64, f64, Uniform::new(2.26f64, 2.319)); + +const LARGE_SEC: u64 = u64::max_value() / 1000; + +distr_duration!(distr_uniform_duration_largest, + Uniform::new_inclusive(Duration::new(0, 0), Duration::new(u64::max_value(), 999_999_999)) +); +distr_duration!(distr_uniform_duration_large, + Uniform::new(Duration::new(0, 0), Duration::new(LARGE_SEC, 1_000_000_000 / 2)) +); +distr_duration!(distr_uniform_duration_one, + Uniform::new(Duration::new(0, 0), Duration::new(1, 0)) +); +distr_duration!(distr_uniform_duration_variety, + Uniform::new(Duration::new(10000, 423423), Duration::new(200000, 6969954)) +); +distr_duration!(distr_uniform_duration_edge, + Uniform::new_inclusive(Duration::new(LARGE_SEC, 999_999_999), Duration::new(LARGE_SEC + 1, 1)) +); + + +// standard +distr_int!(distr_standard_i8, i8, Standard); +distr_int!(distr_standard_i16, i16, Standard); +distr_int!(distr_standard_i32, i32, Standard); +distr_int!(distr_standard_i64, i64, Standard); +distr_int!(distr_standard_i128, i128, Standard); + +distr!(distr_standard_bool, bool, Standard); +distr!(distr_standard_alphanumeric, char, Alphanumeric); +distr!(distr_standard_codepoint, char, Standard); + +distr_float!(distr_standard_f32, f32, Standard); +distr_float!(distr_standard_f64, f64, Standard); +distr_float!(distr_open01_f32, f32, Open01); +distr_float!(distr_open01_f64, f64, Open01); +distr_float!(distr_openclosed01_f32, f32, OpenClosed01); +distr_float!(distr_openclosed01_f64, f64, OpenClosed01); + +// distributions +distr_float!(distr_exp, f64, Exp::new(1.23 * 4.56)); +distr_float!(distr_normal, f64, Normal::new(-1.23, 4.56)); +distr_float!(distr_log_normal, f64, LogNormal::new(-1.23, 4.56)); +distr_float!(distr_gamma_large_shape, f64, Gamma::new(10., 1.0)); +distr_float!(distr_gamma_small_shape, f64, Gamma::new(0.1, 1.0)); +distr_float!(distr_cauchy, f64, Cauchy::new(4.2, 6.9)); +distr_int!(distr_binomial, u64, Binomial::new(20, 0.7)); +distr_int!(distr_poisson, u64, Poisson::new(4.0)); +distr!(distr_bernoulli, bool, Bernoulli::new(0.18)); +distr_arr!(distr_circle, [f64; 2], UnitCircle::new()); +distr_arr!(distr_sphere_surface, [f64; 3], UnitSphereSurface::new()); + +// Weighted +distr_int!(distr_weighted_i8, usize, WeightedIndex::new(&[1i8, 2, 3, 4, 12, 0, 2, 1]).unwrap()); +distr_int!(distr_weighted_u32, usize, WeightedIndex::new(&[1u32, 2, 3, 4, 12, 0, 2, 1]).unwrap()); +distr_int!(distr_weighted_f64, usize, WeightedIndex::new(&[1.0f64, 0.001, 1.0/3.0, 4.01, 0.0, 3.3, 22.0, 0.001]).unwrap()); +distr_int!(distr_weighted_large_set, usize, WeightedIndex::new((0..10000).rev().chain(1..10001)).unwrap()); + +// construct and sample from a range +macro_rules! gen_range_int { + ($fnn:ident, $ty:ident, $low:expr, $high:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + + b.iter(|| { + let mut high = $high; + let mut accum: $ty = 0; + for _ in 0..::RAND_BENCH_N { + accum = accum.wrapping_add(rng.gen_range($low, high)); + // force recalculation of range each time + high = high.wrapping_add(1) & std::$ty::MAX; + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +gen_range_int!(gen_range_i8, i8, -20i8, 100); +gen_range_int!(gen_range_i16, i16, -500i16, 2000); +gen_range_int!(gen_range_i32, i32, -200_000_000i32, 800_000_000); +gen_range_int!(gen_range_i64, i64, 3i64, 123_456_789_123); +gen_range_int!(gen_range_i128, i128, -12345678901234i128, 123_456_789_123_456_789); + +// construct and sample from a floating-point range +macro_rules! gen_range_float { + ($fnn:ident, $ty:ident, $low:expr, $high:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + + b.iter(|| { + let mut high = $high; + let mut low = $low; + let mut accum: $ty = 0.0; + for _ in 0..::RAND_BENCH_N { + accum += rng.gen_range(low, high); + // force recalculation of range each time + low += 0.9; + high += 1.1; + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * ::RAND_BENCH_N; + } + } +} + +gen_range_float!(gen_range_f32, f32, -20000.0f32, 100000.0); +gen_range_float!(gen_range_f64, f64, 123.456f64, 7890.12); + +#[bench] +fn dist_iter(b: &mut Bencher) { + let mut rng = SmallRng::from_entropy(); + let distr = Normal::new(-2.71828, 3.14159); + let mut iter = distr.sample_iter(&mut rng); + + b.iter(|| { + let mut accum = 0.0; + for _ in 0..::RAND_BENCH_N { + accum += iter.next().unwrap(); + } + accum + }); + b.bytes = size_of::() as u64 * ::RAND_BENCH_N; +} diff --git a/vendor/registry-40351f815f426200/rand/benches/generators.rs b/vendor/registry-40351f815f426200/rand/benches/generators.rs new file mode 100644 index 000000000..a6e3a4232 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/benches/generators.rs @@ -0,0 +1,240 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +#![feature(test)] + +extern crate test; +extern crate rand; +extern crate rand_isaac; +extern crate rand_chacha; +extern crate rand_hc; +extern crate rand_pcg; +extern crate rand_xorshift; +extern crate rand_xoshiro; + +const RAND_BENCH_N: u64 = 1000; +const BYTES_LEN: usize = 1024; + +use std::mem::size_of; +use test::{black_box, Bencher}; + +use rand::prelude::*; +use rand::rngs::adapter::ReseedingRng; +use rand::rngs::{OsRng, JitterRng, EntropyRng}; +use rand_isaac::{IsaacRng, Isaac64Rng}; +use rand_chacha::ChaChaRng; +use rand_hc::{Hc128Rng, Hc128Core}; +use rand_pcg::{Lcg64Xsh32, Mcg128Xsl64}; +use rand_xorshift::XorShiftRng; +use rand_xoshiro::{Xoshiro256StarStar, Xoshiro256Plus, Xoshiro128StarStar, + Xoshiro128Plus, Xoroshiro128StarStar, Xoroshiro128Plus, SplitMix64, + Xoroshiro64StarStar, Xoroshiro64Star}; + +macro_rules! gen_bytes { + ($fnn:ident, $gen:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = $gen; + let mut buf = [0u8; BYTES_LEN]; + b.iter(|| { + for _ in 0..RAND_BENCH_N { + rng.fill_bytes(&mut buf); + black_box(buf); + } + }); + b.bytes = BYTES_LEN as u64 * RAND_BENCH_N; + } + } +} + +gen_bytes!(gen_bytes_xorshift, XorShiftRng::from_entropy()); +gen_bytes!(gen_bytes_xoshiro256starstar, Xoshiro256StarStar::from_entropy()); +gen_bytes!(gen_bytes_xoshiro256plus, Xoshiro256Plus::from_entropy()); +gen_bytes!(gen_bytes_xoshiro128starstar, Xoshiro128StarStar::from_entropy()); +gen_bytes!(gen_bytes_xoshiro128plus, Xoshiro128Plus::from_entropy()); +gen_bytes!(gen_bytes_xoroshiro128starstar, Xoroshiro128StarStar::from_entropy()); +gen_bytes!(gen_bytes_xoroshiro128plus, Xoroshiro128Plus::from_entropy()); +gen_bytes!(gen_bytes_xoroshiro64starstar, Xoroshiro64StarStar::from_entropy()); +gen_bytes!(gen_bytes_xoroshiro64star, Xoroshiro64Star::from_entropy()); +gen_bytes!(gen_bytes_splitmix64, SplitMix64::from_entropy()); +gen_bytes!(gen_bytes_lcg64_xsh32, Lcg64Xsh32::from_entropy()); +gen_bytes!(gen_bytes_mcg128_xsh64, Mcg128Xsl64::from_entropy()); +gen_bytes!(gen_bytes_chacha20, ChaChaRng::from_entropy()); +gen_bytes!(gen_bytes_hc128, Hc128Rng::from_entropy()); +gen_bytes!(gen_bytes_isaac, IsaacRng::from_entropy()); +gen_bytes!(gen_bytes_isaac64, Isaac64Rng::from_entropy()); +gen_bytes!(gen_bytes_std, StdRng::from_entropy()); +gen_bytes!(gen_bytes_small, SmallRng::from_entropy()); +gen_bytes!(gen_bytes_os, OsRng::new().unwrap()); + +macro_rules! gen_uint { + ($fnn:ident, $ty:ty, $gen:expr) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = $gen; + b.iter(|| { + let mut accum: $ty = 0; + for _ in 0..RAND_BENCH_N { + accum = accum.wrapping_add(rng.gen::<$ty>()); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * RAND_BENCH_N; + } + } +} + +gen_uint!(gen_u32_xorshift, u32, XorShiftRng::from_entropy()); +gen_uint!(gen_u32_xoshiro256starstar, u32, Xoshiro256StarStar::from_entropy()); +gen_uint!(gen_u32_xoshiro256plus, u32, Xoshiro256Plus::from_entropy()); +gen_uint!(gen_u32_xoshiro128starstar, u32, Xoshiro128StarStar::from_entropy()); +gen_uint!(gen_u32_xoshiro128plus, u32, Xoshiro128Plus::from_entropy()); +gen_uint!(gen_u32_xoroshiro128starstar, u32, Xoroshiro128StarStar::from_entropy()); +gen_uint!(gen_u32_xoroshiro128plus, u32, Xoroshiro128Plus::from_entropy()); +gen_uint!(gen_u32_xoroshiro64starstar, u32, Xoroshiro64StarStar::from_entropy()); +gen_uint!(gen_u32_xoroshiro64star, u32, Xoroshiro64Star::from_entropy()); +gen_uint!(gen_u32_splitmix64, u32, SplitMix64::from_entropy()); +gen_uint!(gen_u32_lcg64_xsh32, u32, Lcg64Xsh32::from_entropy()); +gen_uint!(gen_u32_mcg128_xsh64, u32, Mcg128Xsl64::from_entropy()); +gen_uint!(gen_u32_chacha20, u32, ChaChaRng::from_entropy()); +gen_uint!(gen_u32_hc128, u32, Hc128Rng::from_entropy()); +gen_uint!(gen_u32_isaac, u32, IsaacRng::from_entropy()); +gen_uint!(gen_u32_isaac64, u32, Isaac64Rng::from_entropy()); +gen_uint!(gen_u32_std, u32, StdRng::from_entropy()); +gen_uint!(gen_u32_small, u32, SmallRng::from_entropy()); +gen_uint!(gen_u32_os, u32, OsRng::new().unwrap()); + +gen_uint!(gen_u64_xorshift, u64, XorShiftRng::from_entropy()); +gen_uint!(gen_u64_xoshiro256starstar, u64, Xoshiro256StarStar::from_entropy()); +gen_uint!(gen_u64_xoshiro256plus, u64, Xoshiro256Plus::from_entropy()); +gen_uint!(gen_u64_xoshiro128starstar, u64, Xoshiro128StarStar::from_entropy()); +gen_uint!(gen_u64_xoshiro128plus, u64, Xoshiro128Plus::from_entropy()); +gen_uint!(gen_u64_xoroshiro128starstar, u64, Xoroshiro128StarStar::from_entropy()); +gen_uint!(gen_u64_xoroshiro128plus, u64, Xoroshiro128Plus::from_entropy()); +gen_uint!(gen_u64_xoroshiro64starstar, u64, Xoroshiro64StarStar::from_entropy()); +gen_uint!(gen_u64_xoroshiro64star, u64, Xoroshiro64Star::from_entropy()); +gen_uint!(gen_u64_splitmix64, u64, SplitMix64::from_entropy()); +gen_uint!(gen_u64_lcg64_xsh32, u64, Lcg64Xsh32::from_entropy()); +gen_uint!(gen_u64_mcg128_xsh64, u64, Mcg128Xsl64::from_entropy()); +gen_uint!(gen_u64_chacha20, u64, ChaChaRng::from_entropy()); +gen_uint!(gen_u64_hc128, u64, Hc128Rng::from_entropy()); +gen_uint!(gen_u64_isaac, u64, IsaacRng::from_entropy()); +gen_uint!(gen_u64_isaac64, u64, Isaac64Rng::from_entropy()); +gen_uint!(gen_u64_std, u64, StdRng::from_entropy()); +gen_uint!(gen_u64_small, u64, SmallRng::from_entropy()); +gen_uint!(gen_u64_os, u64, OsRng::new().unwrap()); + +// Do not test JitterRng like the others by running it RAND_BENCH_N times per, +// measurement, because it is way too slow. Only run it once. +#[bench] +fn gen_u64_jitter(b: &mut Bencher) { + let mut rng = JitterRng::new().unwrap(); + b.iter(|| { + rng.gen::() + }); + b.bytes = size_of::() as u64; +} + +macro_rules! init_gen { + ($fnn:ident, $gen:ident) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = XorShiftRng::from_entropy(); + b.iter(|| { + let r2 = $gen::from_rng(&mut rng).unwrap(); + r2 + }); + } + } +} + +init_gen!(init_xorshift, XorShiftRng); +init_gen!(init_xoshiro256starstar, Xoshiro256StarStar); +init_gen!(init_xoshiro256plus, Xoshiro256Plus); +init_gen!(init_xoshiro128starstar, Xoshiro128StarStar); +init_gen!(init_xoshiro128plus, Xoshiro128Plus); +init_gen!(init_xoroshiro128starstar, Xoroshiro128StarStar); +init_gen!(init_xoroshiro128plus, Xoroshiro128Plus); +init_gen!(init_xoroshiro64starstar, Xoroshiro64StarStar); +init_gen!(init_xoroshiro64star, Xoroshiro64Star); +init_gen!(init_splitmix64, SplitMix64); +init_gen!(init_lcg64_xsh32, Lcg64Xsh32); +init_gen!(init_mcg128_xsh64, Mcg128Xsl64); +init_gen!(init_hc128, Hc128Rng); +init_gen!(init_isaac, IsaacRng); +init_gen!(init_isaac64, Isaac64Rng); +init_gen!(init_chacha, ChaChaRng); + +#[bench] +fn init_jitter(b: &mut Bencher) { + b.iter(|| { + JitterRng::new().unwrap() + }); +} + + +const RESEEDING_THRESHOLD: u64 = 1024*1024*1024; // something high enough to get + // deterministic measurements + +#[bench] +fn reseeding_hc128_bytes(b: &mut Bencher) { + let mut rng = ReseedingRng::new(Hc128Core::from_entropy(), + RESEEDING_THRESHOLD, + EntropyRng::new()); + let mut buf = [0u8; BYTES_LEN]; + b.iter(|| { + for _ in 0..RAND_BENCH_N { + rng.fill_bytes(&mut buf); + black_box(buf); + } + }); + b.bytes = BYTES_LEN as u64 * RAND_BENCH_N; +} + +macro_rules! reseeding_uint { + ($fnn:ident, $ty:ty) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = ReseedingRng::new(Hc128Core::from_entropy(), + RESEEDING_THRESHOLD, + EntropyRng::new()); + b.iter(|| { + let mut accum: $ty = 0; + for _ in 0..RAND_BENCH_N { + accum = accum.wrapping_add(rng.gen::<$ty>()); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * RAND_BENCH_N; + } + } +} + +reseeding_uint!(reseeding_hc128_u32, u32); +reseeding_uint!(reseeding_hc128_u64, u64); + + +macro_rules! threadrng_uint { + ($fnn:ident, $ty:ty) => { + #[bench] + fn $fnn(b: &mut Bencher) { + let mut rng = thread_rng(); + b.iter(|| { + let mut accum: $ty = 0; + for _ in 0..RAND_BENCH_N { + accum = accum.wrapping_add(rng.gen::<$ty>()); + } + accum + }); + b.bytes = size_of::<$ty>() as u64 * RAND_BENCH_N; + } + } +} + +threadrng_uint!(thread_rng_u32, u32); +threadrng_uint!(thread_rng_u64, u64); diff --git a/vendor/registry-40351f815f426200/rand/benches/misc.rs b/vendor/registry-40351f815f426200/rand/benches/misc.rs new file mode 100644 index 000000000..8fb3a832f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/benches/misc.rs @@ -0,0 +1,160 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +#![feature(test)] + +extern crate test; +extern crate rand; + +const RAND_BENCH_N: u64 = 1000; + +use test::Bencher; + +use rand::prelude::*; + +#[bench] +fn misc_gen_bool_const(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let mut accum = true; + for _ in 0..::RAND_BENCH_N { + accum ^= rng.gen_bool(0.18); + } + accum + }) +} + +#[bench] +fn misc_gen_bool_var(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let mut accum = true; + let mut p = 0.18; + for _ in 0..::RAND_BENCH_N { + accum ^= rng.gen_bool(p); + p += 0.0001; + } + accum + }) +} + +#[bench] +fn misc_gen_ratio_const(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let mut accum = true; + for _ in 0..::RAND_BENCH_N { + accum ^= rng.gen_ratio(2, 3); + } + accum + }) +} + +#[bench] +fn misc_gen_ratio_var(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let mut accum = true; + for i in 2..(::RAND_BENCH_N as u32 + 2) { + accum ^= rng.gen_ratio(i, i + 1); + } + accum + }) +} + +#[bench] +fn misc_bernoulli_const(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let d = rand::distributions::Bernoulli::new(0.18); + let mut accum = true; + for _ in 0..::RAND_BENCH_N { + accum ^= rng.sample(d); + } + accum + }) +} + +#[bench] +fn misc_bernoulli_var(b: &mut Bencher) { + let mut rng = StdRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let mut accum = true; + let mut p = 0.18; + for _ in 0..::RAND_BENCH_N { + let d = rand::distributions::Bernoulli::new(p); + accum ^= rng.sample(d); + p += 0.0001; + } + accum + }) +} + +macro_rules! sample_binomial { + ($name:ident, $n:expr, $p:expr) => { + #[bench] + fn $name(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + let (n, p) = ($n, $p); + b.iter(|| { + let d = rand::distributions::Binomial::new(n, p); + rng.sample(d) + }) + } + } +} + +sample_binomial!(misc_binomial_1, 1, 0.9); +sample_binomial!(misc_binomial_10, 10, 0.9); +sample_binomial!(misc_binomial_100, 100, 0.99); +sample_binomial!(misc_binomial_1000, 1000, 0.01); +sample_binomial!(misc_binomial_1e12, 1000_000_000_000, 0.2); + +#[bench] +fn gen_1k_iter_repeat(b: &mut Bencher) { + use std::iter; + let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let v: Vec = iter::repeat(()).map(|()| rng.gen()).take(128).collect(); + v + }); + b.bytes = 1024; +} + +#[bench] +fn gen_1k_sample_iter(b: &mut Bencher) { + use rand::distributions::{Distribution, Standard}; + let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + let v: Vec = Standard.sample_iter(&mut rng).take(128).collect(); + v + }); + b.bytes = 1024; +} + +#[bench] +fn gen_1k_gen_array(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + b.iter(|| { + // max supported array length is 32! + let v: [[u64; 32]; 4] = rng.gen(); + v + }); + b.bytes = 1024; +} + +#[bench] +fn gen_1k_fill(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(&mut thread_rng()).unwrap(); + let mut buf = [0u64; 128]; + b.iter(|| { + rng.fill(&mut buf[..]); + buf + }); + b.bytes = 1024; +} diff --git a/vendor/registry-40351f815f426200/rand/benches/seq.rs b/vendor/registry-40351f815f426200/rand/benches/seq.rs new file mode 100644 index 000000000..0ca3398f2 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/benches/seq.rs @@ -0,0 +1,174 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +#![feature(test)] +#![allow(non_snake_case)] + +extern crate test; +extern crate rand; + +use test::Bencher; + +use rand::prelude::*; +use rand::seq::*; +use std::mem::size_of; + +const RAND_BENCH_N: u64 = 1000; + +#[bench] +fn seq_shuffle_100(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &mut [usize] = &mut [1; 100]; + b.iter(|| { + x.shuffle(&mut rng); + x[0] + }) +} + +#[bench] +fn seq_slice_choose_1_of_1000(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &mut [usize] = &mut [1; 1000]; + for i in 0..1000 { + x[i] = i; + } + b.iter(|| { + let mut s = 0; + for _ in 0..RAND_BENCH_N { + s += x.choose(&mut rng).unwrap(); + } + s + }); + b.bytes = size_of::() as u64 * ::RAND_BENCH_N; +} + +macro_rules! seq_slice_choose_multiple { + ($name:ident, $amount:expr, $length:expr) => { + #[bench] + fn $name(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &[i32] = &[$amount; $length]; + let mut result = [0i32; $amount]; + b.iter(|| { + // Collect full result to prevent unwanted shortcuts getting + // first element (in case sample_indices returns an iterator). + for (slot, sample) in result.iter_mut().zip( + x.choose_multiple(&mut rng, $amount)) { + *slot = *sample; + } + result[$amount-1] + }) + } + } +} + +seq_slice_choose_multiple!(seq_slice_choose_multiple_1_of_1000, 1, 1000); +seq_slice_choose_multiple!(seq_slice_choose_multiple_950_of_1000, 950, 1000); +seq_slice_choose_multiple!(seq_slice_choose_multiple_10_of_100, 10, 100); +seq_slice_choose_multiple!(seq_slice_choose_multiple_90_of_100, 90, 100); + +#[bench] +fn seq_iter_choose_from_1000(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &mut [usize] = &mut [1; 1000]; + for i in 0..1000 { + x[i] = i; + } + b.iter(|| { + let mut s = 0; + for _ in 0..RAND_BENCH_N { + s += x.iter().choose(&mut rng).unwrap(); + } + s + }); + b.bytes = size_of::() as u64 * ::RAND_BENCH_N; +} + +#[derive(Clone)] +struct UnhintedIterator { + iter: I, +} +impl Iterator for UnhintedIterator { + type Item = I::Item; + fn next(&mut self) -> Option { + self.iter.next() + } +} + +#[derive(Clone)] +struct WindowHintedIterator { + iter: I, + window_size: usize, +} +impl Iterator for WindowHintedIterator { + type Item = I::Item; + fn next(&mut self) -> Option { + self.iter.next() + } + fn size_hint(&self) -> (usize, Option) { + (std::cmp::min(self.iter.len(), self.window_size), None) + } +} + +#[bench] +fn seq_iter_unhinted_choose_from_1000(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &[usize] = &[1; 1000]; + b.iter(|| { + UnhintedIterator { iter: x.iter() }.choose(&mut rng).unwrap() + }) +} + +#[bench] +fn seq_iter_window_hinted_choose_from_1000(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &[usize] = &[1; 1000]; + b.iter(|| { + WindowHintedIterator { iter: x.iter(), window_size: 7 }.choose(&mut rng) + }) +} + +#[bench] +fn seq_iter_choose_multiple_10_of_100(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &[usize] = &[1; 100]; + b.iter(|| { + x.iter().cloned().choose_multiple(&mut rng, 10) + }) +} + +#[bench] +fn seq_iter_choose_multiple_fill_10_of_100(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + let x : &[usize] = &[1; 100]; + let mut buf = [0; 10]; + b.iter(|| { + x.iter().cloned().choose_multiple_fill(&mut rng, &mut buf) + }) +} + +macro_rules! sample_indices { + ($name:ident, $fn:ident, $amount:expr, $length:expr) => { + #[bench] + fn $name(b: &mut Bencher) { + let mut rng = SmallRng::from_rng(thread_rng()).unwrap(); + b.iter(|| { + index::$fn(&mut rng, $length, $amount) + }) + } + } +} + +sample_indices!(misc_sample_indices_1_of_1k, sample, 1, 1000); +sample_indices!(misc_sample_indices_10_of_1k, sample, 10, 1000); +sample_indices!(misc_sample_indices_100_of_1k, sample, 100, 1000); +sample_indices!(misc_sample_indices_100_of_1M, sample, 100, 1000_000); +sample_indices!(misc_sample_indices_100_of_1G, sample, 100, 1000_000_000); +sample_indices!(misc_sample_indices_200_of_1G, sample, 200, 1000_000_000); +sample_indices!(misc_sample_indices_400_of_1G, sample, 400, 1000_000_000); +sample_indices!(misc_sample_indices_600_of_1G, sample, 600, 1000_000_000); diff --git a/vendor/registry-40351f815f426200/rand/build.rs b/vendor/registry-40351f815f426200/rand/build.rs new file mode 100644 index 000000000..a554ad987 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/build.rs @@ -0,0 +1,10 @@ +extern crate autocfg; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + + let ac = autocfg::new(); + ac.emit_rustc_version(1, 25); + ac.emit_rustc_version(1, 26); + ac.emit_rustc_version(1, 27); +} diff --git a/vendor/registry-40351f815f426200/rand/examples/monte-carlo.rs b/vendor/registry-40351f815f426200/rand/examples/monte-carlo.rs new file mode 100644 index 000000000..916299686 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/examples/monte-carlo.rs @@ -0,0 +1,51 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2018 The Rust Project 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. + +//! # Monte Carlo estimation of π +//! +//! Imagine that we have a square with sides of length 2 and a unit circle +//! (radius = 1), both centered at the origin. The areas are: +//! +//! ```text +//! area of circle = πr² = π * r * r = π +//! area of square = 2² = 4 +//! ``` +//! +//! The circle is entirely within the square, so if we sample many points +//! randomly from the square, roughly π / 4 of them should be inside the circle. +//! +//! We can use the above fact to estimate the value of π: pick many points in +//! the square at random, calculate the fraction that fall within the circle, +//! and multiply this fraction by 4. + +#![cfg(feature="std")] + + +extern crate rand; + +use rand::distributions::{Distribution, Uniform}; + +fn main() { + let range = Uniform::new(-1.0f64, 1.0); + let mut rng = rand::thread_rng(); + + let total = 1_000_000; + let mut in_circle = 0; + + for _ in 0..total { + let a = range.sample(&mut rng); + let b = range.sample(&mut rng); + if a*a + b*b <= 1.0 { + in_circle += 1; + } + } + + // prints something close to 3.14159... + println!("π is approximately {}", 4. * (in_circle as f64) / (total as f64)); +} diff --git a/vendor/registry-40351f815f426200/rand/examples/monty-hall.rs b/vendor/registry-40351f815f426200/rand/examples/monty-hall.rs new file mode 100644 index 000000000..0932c5efb --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/examples/monty-hall.rs @@ -0,0 +1,116 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2018 The Rust Project 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. + +//! ## Monty Hall Problem +//! +//! This is a simulation of the [Monty Hall Problem][]: +//! +//! > Suppose you're on a game show, and you're given the choice of three doors: +//! > Behind one door is a car; behind the others, goats. You pick a door, say +//! > No. 1, and the host, who knows what's behind the doors, opens another +//! > door, say No. 3, which has a goat. He then says to you, "Do you want to +//! > pick door No. 2?" Is it to your advantage to switch your choice? +//! +//! The rather unintuitive answer is that you will have a 2/3 chance of winning +//! if you switch and a 1/3 chance of winning if you don't, so it's better to +//! switch. +//! +//! This program will simulate the game show and with large enough simulation +//! steps it will indeed confirm that it is better to switch. +//! +//! [Monty Hall Problem]: https://en.wikipedia.org/wiki/Monty_Hall_problem + +#![cfg(feature="std")] + + +extern crate rand; + +use rand::Rng; +use rand::distributions::{Distribution, Uniform}; + +struct SimulationResult { + win: bool, + switch: bool, +} + +// Run a single simulation of the Monty Hall problem. +fn simulate(random_door: &Uniform, rng: &mut R) + -> SimulationResult { + let car = random_door.sample(rng); + + // This is our initial choice + let mut choice = random_door.sample(rng); + + // The game host opens a door + let open = game_host_open(car, choice, rng); + + // Shall we switch? + let switch = rng.gen(); + if switch { + choice = switch_door(choice, open); + } + + SimulationResult { win: choice == car, switch } +} + +// Returns the door the game host opens given our choice and knowledge of +// where the car is. The game host will never open the door with the car. +fn game_host_open(car: u32, choice: u32, rng: &mut R) -> u32 { + use rand::seq::SliceRandom; + *free_doors(&[car, choice]).choose(rng).unwrap() +} + +// Returns the door we switch to, given our current choice and +// the open door. There will only be one valid door. +fn switch_door(choice: u32, open: u32) -> u32 { + free_doors(&[choice, open])[0] +} + +fn free_doors(blocked: &[u32]) -> Vec { + (0..3).filter(|x| !blocked.contains(x)).collect() +} + +fn main() { + // The estimation will be more accurate with more simulations + let num_simulations = 10000; + + let mut rng = rand::thread_rng(); + let random_door = Uniform::new(0u32, 3); + + let (mut switch_wins, mut switch_losses) = (0, 0); + let (mut keep_wins, mut keep_losses) = (0, 0); + + println!("Running {} simulations...", num_simulations); + for _ in 0..num_simulations { + let result = simulate(&random_door, &mut rng); + + match (result.win, result.switch) { + (true, true) => switch_wins += 1, + (true, false) => keep_wins += 1, + (false, true) => switch_losses += 1, + (false, false) => keep_losses += 1, + } + } + + let total_switches = switch_wins + switch_losses; + let total_keeps = keep_wins + keep_losses; + + println!("Switched door {} times with {} wins and {} losses", + total_switches, switch_wins, switch_losses); + + println!("Kept our choice {} times with {} wins and {} losses", + total_keeps, keep_wins, keep_losses); + + // With a large number of simulations, the values should converge to + // 0.667 and 0.333 respectively. + println!("Estimated chance to win if we switch: {}", + switch_wins as f32 / total_switches as f32); + println!("Estimated chance to win if we don't: {}", + keep_wins as f32 / total_keeps as f32); +} diff --git a/vendor/registry-40351f815f426200/rand/src/deprecated.rs b/vendor/registry-40351f815f426200/rand/src/deprecated.rs new file mode 100644 index 000000000..88eb09fce --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/deprecated.rs @@ -0,0 +1,544 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Deprecated re-exports (we can't add deprecation warnings otherwise) + +#![allow(deprecated)] + +use rngs; +use {RngCore, CryptoRng, SeedableRng, Error}; +use rand_core::block::BlockRngCore; +use rand_isaac; +use rand_chacha; +use rand_hc; + +#[cfg(feature="std")] +use std::io::Read; + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", + note="import from rand_isaac crate instead, or use the newer Hc128Rng")] +pub struct IsaacRng(rand_isaac::IsaacRng); + +impl RngCore for IsaacRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for IsaacRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + IsaacRng(rand_isaac::IsaacRng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + rand_isaac::IsaacRng::from_rng(rng).map(IsaacRng) + } +} + +impl IsaacRng { + pub fn new_from_u64(seed: u64) -> Self { + IsaacRng(rand_isaac::IsaacRng::new_from_u64(seed)) + } +} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", + note="import from rand_isaac crate instead, or use newer Hc128Rng")] +pub struct Isaac64Rng(rand_isaac::Isaac64Rng); + +impl RngCore for Isaac64Rng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for Isaac64Rng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Isaac64Rng(rand_isaac::Isaac64Rng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + rand_isaac::Isaac64Rng::from_rng(rng).map(Isaac64Rng) + } +} + +impl Isaac64Rng { + pub fn new_from_u64(seed: u64) -> Self { + Isaac64Rng(rand_isaac::Isaac64Rng::new_from_u64(seed)) + } +} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", note="import from rand_chacha crate instead")] +pub struct ChaChaRng(rand_chacha::ChaChaRng); + +impl RngCore for ChaChaRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for ChaChaRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + ChaChaRng(rand_chacha::ChaChaRng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + rand_chacha::ChaChaRng::from_rng(rng).map(ChaChaRng) + } +} + +impl ChaChaRng { + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + pub fn get_word_pos(&self) -> u128 { + self.0.get_word_pos() + } + + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + pub fn set_word_pos(&mut self, word_offset: u128) { + self.0.set_word_pos(word_offset) + } + + pub fn set_stream(&mut self, stream: u64) { + self.0.set_stream(stream) + } +} + +impl CryptoRng for ChaChaRng {} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", note="import from rand_hc crate instead")] +pub struct Hc128Rng(rand_hc::Hc128Rng); + +impl RngCore for Hc128Rng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for Hc128Rng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Hc128Rng(rand_hc::Hc128Rng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + rand_hc::Hc128Rng::from_rng(rng).map(Hc128Rng) + } +} + +impl CryptoRng for Hc128Rng {} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", note="import from rand_xorshift crate instead")] +pub struct XorShiftRng(::rand_xorshift::XorShiftRng); + +impl RngCore for XorShiftRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for XorShiftRng { + type Seed = <::rand_xorshift::XorShiftRng as SeedableRng>::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + XorShiftRng(::rand_xorshift::XorShiftRng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + ::rand_xorshift::XorShiftRng::from_rng(rng).map(XorShiftRng) + } +} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", + note="import with rand::prelude::* or rand::rngs::StdRng instead")] +pub struct StdRng(rngs::StdRng); + +impl RngCore for StdRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for StdRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + StdRng(rngs::StdRng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + rngs::StdRng::from_rng(rng).map(StdRng) + } +} + +impl CryptoRng for StdRng {} + + +#[cfg(feature="rand_os")] +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", note="import with rand::rngs::OsRng instead")] +pub struct OsRng(rngs::OsRng); + +#[cfg(feature="rand_os")] +impl RngCore for OsRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(feature="rand_os")] +impl OsRng { + pub fn new() -> Result { + rngs::OsRng::new().map(OsRng) + } +} + +#[cfg(feature="rand_os")] +impl CryptoRng for OsRng {} + + +#[cfg(feature="std")] +#[derive(Debug)] +#[deprecated(since="0.6.0", note="import with rand::rngs::EntropyRng instead")] +pub struct EntropyRng(rngs::EntropyRng); + +#[cfg(feature="std")] +impl RngCore for EntropyRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(feature="std")] +impl EntropyRng { + pub fn new() -> Self { + EntropyRng(rngs::EntropyRng::new()) + } +} + +#[cfg(feature="std")] +impl Default for EntropyRng { + fn default() -> Self { + EntropyRng::new() + } +} + +#[cfg(feature="std")] +impl CryptoRng for EntropyRng {} + + +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", note="import with rand::rngs::JitterRng instead")] +pub struct JitterRng(rngs::JitterRng); + +impl RngCore for JitterRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl JitterRng { + #[cfg(all(feature="std", not(target_arch = "wasm32")))] + pub fn new() -> Result { + rngs::JitterRng::new().map(JitterRng) + } + + pub fn new_with_timer(timer: fn() -> u64) -> JitterRng { + JitterRng(rngs::JitterRng::new_with_timer(timer)) + } + + pub fn set_rounds(&mut self, rounds: u8) { + self.0.set_rounds(rounds) + } + + pub fn test_timer(&mut self) -> Result { + self.0.test_timer() + } + + #[cfg(feature="std")] + pub fn timer_stats(&mut self, var_rounds: bool) -> i64 { + self.0.timer_stats(var_rounds) + } +} + +impl CryptoRng for JitterRng {} + + +#[cfg(feature="std")] +#[derive(Clone, Debug)] +#[deprecated(since="0.6.0", + note="import with rand::prelude::* or rand::rngs::ThreadRng instead")] +pub struct ThreadRng(rngs::ThreadRng); + +#[cfg(feature="std")] +impl RngCore for ThreadRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(feature="std")] +impl CryptoRng for ThreadRng {} + + +#[cfg(feature="std")] +#[derive(Debug)] +#[deprecated(since="0.6.0", note="import with rand::rngs::adapter::ReadRng instead")] +pub struct ReadRng(rngs::adapter::ReadRng); + +#[cfg(feature="std")] +impl RngCore for ReadRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(feature="std")] +impl ReadRng { + pub fn new(r: R) -> ReadRng { + ReadRng(rngs::adapter::ReadRng::new(r)) + } +} + + +#[derive(Clone, Debug)] +pub struct ReseedingRng(rngs::adapter::ReseedingRng) +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore; + +impl RngCore for ReseedingRng +where R: BlockRngCore + SeedableRng, + ::Results: AsRef<[u32]> + AsMut<[u32]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl ReseedingRng +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore +{ + pub fn new(rng: R, threshold: u64, reseeder: Rsdr) -> Self { + ReseedingRng(rngs::adapter::ReseedingRng::new(rng, threshold, reseeder)) + } + + pub fn reseed(&mut self) -> Result<(), Error> { + self.0.reseed() + } +} + +impl CryptoRng for ReseedingRng +where R: BlockRngCore + SeedableRng + CryptoRng, + Rsdr: RngCore + CryptoRng {} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/bernoulli.rs b/vendor/registry-40351f815f426200/rand/src/distributions/bernoulli.rs new file mode 100644 index 000000000..f49618c67 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/bernoulli.rs @@ -0,0 +1,165 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The Bernoulli distribution. + +use Rng; +use distributions::Distribution; + +/// The Bernoulli distribution. +/// +/// This is a special case of the Binomial distribution where `n = 1`. +/// +/// # Example +/// +/// ```rust +/// use rand::distributions::{Bernoulli, Distribution}; +/// +/// let d = Bernoulli::new(0.3); +/// let v = d.sample(&mut rand::thread_rng()); +/// println!("{} is from a Bernoulli distribution", v); +/// ``` +/// +/// # Precision +/// +/// This `Bernoulli` distribution uses 64 bits from the RNG (a `u64`), +/// so only probabilities that are multiples of 2-64 can be +/// represented. +#[derive(Clone, Copy, Debug)] +pub struct Bernoulli { + /// Probability of success, relative to the maximal integer. + p_int: u64, +} + +// To sample from the Bernoulli distribution we use a method that compares a +// random `u64` value `v < (p * 2^64)`. +// +// If `p == 1.0`, the integer `v` to compare against can not represented as a +// `u64`. We manually set it to `u64::MAX` instead (2^64 - 1 instead of 2^64). +// Note that value of `p < 1.0` can never result in `u64::MAX`, because an +// `f64` only has 53 bits of precision, and the next largest value of `p` will +// result in `2^64 - 2048`. +// +// Also there is a 100% theoretical concern: if someone consistenly wants to +// generate `true` using the Bernoulli distribution (i.e. by using a probability +// of `1.0`), just using `u64::MAX` is not enough. On average it would return +// false once every 2^64 iterations. Some people apparently care about this +// case. +// +// That is why we special-case `u64::MAX` to always return `true`, without using +// the RNG, and pay the performance price for all uses that *are* reasonable. +// Luckily, if `new()` and `sample` are close, the compiler can optimize out the +// extra check. +const ALWAYS_TRUE: u64 = ::core::u64::MAX; + +// This is just `2.0.powi(64)`, but written this way because it is not available +// in `no_std` mode. +const SCALE: f64 = 2.0 * (1u64 << 63) as f64; + +impl Bernoulli { + /// Construct a new `Bernoulli` with the given probability of success `p`. + /// + /// # Panics + /// + /// If `p < 0` or `p > 1`. + /// + /// # Precision + /// + /// For `p = 1.0`, the resulting distribution will always generate true. + /// For `p = 0.0`, the resulting distribution will always generate false. + /// + /// This method is accurate for any input `p` in the range `[0, 1]` which is + /// a multiple of 2-64. (Note that not all multiples of + /// 2-64 in `[0, 1]` can be represented as a `f64`.) + #[inline] + pub fn new(p: f64) -> Bernoulli { + if p < 0.0 || p >= 1.0 { + if p == 1.0 { return Bernoulli { p_int: ALWAYS_TRUE } } + panic!("Bernoulli::new not called with 0.0 <= p <= 1.0"); + } + Bernoulli { p_int: (p * SCALE) as u64 } + } + + /// Construct a new `Bernoulli` with the probability of success of + /// `numerator`-in-`denominator`. I.e. `new_ratio(2, 3)` will return + /// a `Bernoulli` with a 2-in-3 chance, or about 67%, of returning `true`. + /// + /// If `numerator == denominator` then the returned `Bernoulli` will always + /// return `true`. If `numerator == 0` it will always return `false`. + /// + /// # Panics + /// + /// If `denominator == 0` or `numerator > denominator`. + /// + #[inline] + pub fn from_ratio(numerator: u32, denominator: u32) -> Bernoulli { + assert!(numerator <= denominator); + if numerator == denominator { + return Bernoulli { p_int: ::core::u64::MAX } + } + let p_int = ((numerator as f64 / denominator as f64) * SCALE) as u64; + Bernoulli { p_int } + } +} + +impl Distribution for Bernoulli { + #[inline] + fn sample(&self, rng: &mut R) -> bool { + // Make sure to always return true for p = 1.0. + if self.p_int == ALWAYS_TRUE { return true; } + let v: u64 = rng.gen(); + v < self.p_int + } +} + +#[cfg(test)] +mod test { + use Rng; + use distributions::Distribution; + use super::Bernoulli; + + #[test] + fn test_trivial() { + let mut r = ::test::rng(1); + let always_false = Bernoulli::new(0.0); + let always_true = Bernoulli::new(1.0); + for _ in 0..5 { + assert_eq!(r.sample::(&always_false), false); + assert_eq!(r.sample::(&always_true), true); + assert_eq!(Distribution::::sample(&always_false, &mut r), false); + assert_eq!(Distribution::::sample(&always_true, &mut r), true); + } + } + + #[test] + fn test_average() { + const P: f64 = 0.3; + const NUM: u32 = 3; + const DENOM: u32 = 10; + let d1 = Bernoulli::new(P); + let d2 = Bernoulli::from_ratio(NUM, DENOM); + const N: u32 = 100_000; + + let mut sum1: u32 = 0; + let mut sum2: u32 = 0; + let mut rng = ::test::rng(2); + for _ in 0..N { + if d1.sample(&mut rng) { + sum1 += 1; + } + if d2.sample(&mut rng) { + sum2 += 1; + } + } + let avg1 = (sum1 as f64) / (N as f64); + assert!((avg1 - P).abs() < 5e-3); + + let avg2 = (sum2 as f64) / (N as f64); + assert!((avg2 - (NUM as f64)/(DENOM as f64)).abs() < 5e-3); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/binomial.rs b/vendor/registry-40351f815f426200/rand/src/distributions/binomial.rs new file mode 100644 index 000000000..2df393e53 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/binomial.rs @@ -0,0 +1,177 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2016-2017 The Rust Project 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. + +//! The binomial distribution. + +use Rng; +use distributions::{Distribution, Bernoulli, Cauchy}; +use distributions::utils::log_gamma; + +/// The binomial distribution `Binomial(n, p)`. +/// +/// This distribution has density function: +/// `f(k) = n!/(k! (n-k)!) p^k (1-p)^(n-k)` for `k >= 0`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Binomial, Distribution}; +/// +/// let bin = Binomial::new(20, 0.3); +/// let v = bin.sample(&mut rand::thread_rng()); +/// println!("{} is from a binomial distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Binomial { + /// Number of trials. + n: u64, + /// Probability of success. + p: f64, +} + +impl Binomial { + /// Construct a new `Binomial` with the given shape parameters `n` (number + /// of trials) and `p` (probability of success). + /// + /// Panics if `p < 0` or `p > 1`. + pub fn new(n: u64, p: f64) -> Binomial { + assert!(p >= 0.0, "Binomial::new called with p < 0"); + assert!(p <= 1.0, "Binomial::new called with p > 1"); + Binomial { n, p } + } +} + +impl Distribution for Binomial { + fn sample(&self, rng: &mut R) -> u64 { + // Handle these values directly. + if self.p == 0.0 { + return 0; + } else if self.p == 1.0 { + return self.n; + } + + // For low n, it is faster to sample directly. For both methods, + // performance is independent of p. On Intel Haswell CPU this method + // appears to be faster for approx n < 300. + if self.n < 300 { + let mut result = 0; + let d = Bernoulli::new(self.p); + for _ in 0 .. self.n { + result += rng.sample(d) as u32; + } + return result as u64; + } + + // binomial distribution is symmetrical with respect to p -> 1-p, k -> n-k + // switch p so that it is less than 0.5 - this allows for lower expected values + // we will just invert the result at the end + let p = if self.p <= 0.5 { + self.p + } else { + 1.0 - self.p + }; + + // prepare some cached values + let float_n = self.n as f64; + let ln_fact_n = log_gamma(float_n + 1.0); + let pc = 1.0 - p; + let log_p = p.ln(); + let log_pc = pc.ln(); + let expected = self.n as f64 * p; + let sq = (expected * (2.0 * pc)).sqrt(); + + let mut lresult; + + // we use the Cauchy distribution as the comparison distribution + // f(x) ~ 1/(1+x^2) + let cauchy = Cauchy::new(0.0, 1.0); + loop { + let mut comp_dev: f64; + loop { + // draw from the Cauchy distribution + comp_dev = rng.sample(cauchy); + // shift the peak of the comparison ditribution + lresult = expected + sq * comp_dev; + // repeat the drawing until we are in the range of possible values + if lresult >= 0.0 && lresult < float_n + 1.0 { + break; + } + } + + // the result should be discrete + lresult = lresult.floor(); + + let log_binomial_dist = ln_fact_n - log_gamma(lresult+1.0) - + log_gamma(float_n - lresult + 1.0) + lresult*log_p + (float_n - lresult)*log_pc; + // this is the binomial probability divided by the comparison probability + // we will generate a uniform random value and if it is larger than this, + // we interpret it as a value falling out of the distribution and repeat + let comparison_coeff = (log_binomial_dist.exp() * sq) * (1.2 * (1.0 + comp_dev*comp_dev)); + + if comparison_coeff >= rng.gen() { + break; + } + } + + // invert the result for p < 0.5 + if p != self.p { + self.n - lresult as u64 + } else { + lresult as u64 + } + } +} + +#[cfg(test)] +mod test { + use Rng; + use distributions::Distribution; + use super::Binomial; + + fn test_binomial_mean_and_variance(n: u64, p: f64, rng: &mut R) { + let binomial = Binomial::new(n, p); + + let expected_mean = n as f64 * p; + let expected_variance = n as f64 * p * (1.0 - p); + + let mut results = [0.0; 1000]; + for i in results.iter_mut() { *i = binomial.sample(rng) as f64; } + + let mean = results.iter().sum::() / results.len() as f64; + assert!((mean as f64 - expected_mean).abs() < expected_mean / 50.0); + + let variance = + results.iter().map(|x| (x - mean) * (x - mean)).sum::() + / results.len() as f64; + assert!((variance - expected_variance).abs() < expected_variance / 10.0); + } + + #[test] + fn test_binomial() { + let mut rng = ::test::rng(351); + test_binomial_mean_and_variance(150, 0.1, &mut rng); + test_binomial_mean_and_variance(70, 0.6, &mut rng); + test_binomial_mean_and_variance(40, 0.5, &mut rng); + test_binomial_mean_and_variance(20, 0.7, &mut rng); + test_binomial_mean_and_variance(20, 0.5, &mut rng); + } + + #[test] + fn test_binomial_end_points() { + let mut rng = ::test::rng(352); + assert_eq!(rng.sample(Binomial::new(20, 0.0)), 0); + assert_eq!(rng.sample(Binomial::new(20, 1.0)), 20); + } + + #[test] + #[should_panic] + fn test_binomial_invalid_lambda_neg() { + Binomial::new(20, -10.0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/cauchy.rs b/vendor/registry-40351f815f426200/rand/src/distributions/cauchy.rs new file mode 100644 index 000000000..feef015a3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/cauchy.rs @@ -0,0 +1,115 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2016-2017 The Rust Project 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. + +//! The Cauchy distribution. + +use Rng; +use distributions::Distribution; +use std::f64::consts::PI; + +/// The Cauchy distribution `Cauchy(median, scale)`. +/// +/// This distribution has a density function: +/// `f(x) = 1 / (pi * scale * (1 + ((x - median) / scale)^2))` +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Cauchy, Distribution}; +/// +/// let cau = Cauchy::new(2.0, 5.0); +/// let v = cau.sample(&mut rand::thread_rng()); +/// println!("{} is from a Cauchy(2, 5) distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Cauchy { + median: f64, + scale: f64 +} + +impl Cauchy { + /// Construct a new `Cauchy` with the given shape parameters + /// `median` the peak location and `scale` the scale factor. + /// Panics if `scale <= 0`. + pub fn new(median: f64, scale: f64) -> Cauchy { + assert!(scale > 0.0, "Cauchy::new called with scale factor <= 0"); + Cauchy { + median, + scale + } + } +} + +impl Distribution for Cauchy { + fn sample(&self, rng: &mut R) -> f64 { + // sample from [0, 1) + let x = rng.gen::(); + // get standard cauchy random number + // note that π/2 is not exactly representable, even if x=0.5 the result is finite + let comp_dev = (PI * x).tan(); + // shift and scale according to parameters + let result = self.median + self.scale * comp_dev; + result + } +} + +#[cfg(test)] +mod test { + use distributions::Distribution; + use super::Cauchy; + + fn median(mut numbers: &mut [f64]) -> f64 { + sort(&mut numbers); + let mid = numbers.len() / 2; + numbers[mid] + } + + fn sort(numbers: &mut [f64]) { + numbers.sort_by(|a, b| a.partial_cmp(b).unwrap()); + } + + #[test] + fn test_cauchy_median() { + let cauchy = Cauchy::new(10.0, 5.0); + let mut rng = ::test::rng(123); + let mut numbers: [f64; 1000] = [0.0; 1000]; + for i in 0..1000 { + numbers[i] = cauchy.sample(&mut rng); + } + let median = median(&mut numbers); + println!("Cauchy median: {}", median); + assert!((median - 10.0).abs() < 0.5); // not 100% certain, but probable enough + } + + #[test] + fn test_cauchy_mean() { + let cauchy = Cauchy::new(10.0, 5.0); + let mut rng = ::test::rng(123); + let mut sum = 0.0; + for _ in 0..1000 { + sum += cauchy.sample(&mut rng); + } + let mean = sum / 1000.0; + println!("Cauchy mean: {}", mean); + // for a Cauchy distribution the mean should not converge + assert!((mean - 10.0).abs() > 0.5); // not 100% certain, but probable enough + } + + #[test] + #[should_panic] + fn test_cauchy_invalid_scale_zero() { + Cauchy::new(0.0, 0.0); + } + + #[test] + #[should_panic] + fn test_cauchy_invalid_scale_neg() { + Cauchy::new(0.0, -10.0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/dirichlet.rs b/vendor/registry-40351f815f426200/rand/src/distributions/dirichlet.rs new file mode 100644 index 000000000..19384b82d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/dirichlet.rs @@ -0,0 +1,137 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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. + +//! The dirichlet distribution. + +use Rng; +use distributions::Distribution; +use distributions::gamma::Gamma; + +/// The dirichelet distribution `Dirichlet(alpha)`. +/// +/// The Dirichlet distribution is a family of continuous multivariate +/// probability distributions parameterized by a vector alpha of positive reals. +/// It is a multivariate generalization of the beta distribution. +/// +/// # Example +/// +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::Dirichlet; +/// +/// let dirichlet = Dirichlet::new(vec![1.0, 2.0, 3.0]); +/// let samples = dirichlet.sample(&mut rand::thread_rng()); +/// println!("{:?} is from a Dirichlet([1.0, 2.0, 3.0]) distribution", samples); +/// ``` + +#[derive(Clone, Debug)] +pub struct Dirichlet { + /// Concentration parameters (alpha) + alpha: Vec, +} + +impl Dirichlet { + /// Construct a new `Dirichlet` with the given alpha parameter `alpha`. + /// + /// # Panics + /// - if `alpha.len() < 2` + /// + #[inline] + pub fn new>>(alpha: V) -> Dirichlet { + let a = alpha.into(); + assert!(a.len() > 1); + for i in 0..a.len() { + assert!(a[i] > 0.0); + } + + Dirichlet { alpha: a } + } + + /// Construct a new `Dirichlet` with the given shape parameter `alpha` and `size`. + /// + /// # Panics + /// - if `alpha <= 0.0` + /// - if `size < 2` + /// + #[inline] + pub fn new_with_param(alpha: f64, size: usize) -> Dirichlet { + assert!(alpha > 0.0); + assert!(size > 1); + Dirichlet { + alpha: vec![alpha; size], + } + } +} + +impl Distribution> for Dirichlet { + fn sample(&self, rng: &mut R) -> Vec { + let n = self.alpha.len(); + let mut samples = vec![0.0f64; n]; + let mut sum = 0.0f64; + + for i in 0..n { + let g = Gamma::new(self.alpha[i], 1.0); + samples[i] = g.sample(rng); + sum += samples[i]; + } + let invacc = 1.0 / sum; + for i in 0..n { + samples[i] *= invacc; + } + samples + } +} + +#[cfg(test)] +mod test { + use super::Dirichlet; + use distributions::Distribution; + + #[test] + fn test_dirichlet() { + let d = Dirichlet::new(vec![1.0, 2.0, 3.0]); + let mut rng = ::test::rng(221); + let samples = d.sample(&mut rng); + let _: Vec = samples + .into_iter() + .map(|x| { + assert!(x > 0.0); + x + }) + .collect(); + } + + #[test] + fn test_dirichlet_with_param() { + let alpha = 0.5f64; + let size = 2; + let d = Dirichlet::new_with_param(alpha, size); + let mut rng = ::test::rng(221); + let samples = d.sample(&mut rng); + let _: Vec = samples + .into_iter() + .map(|x| { + assert!(x > 0.0); + x + }) + .collect(); + } + + #[test] + #[should_panic] + fn test_dirichlet_invalid_length() { + Dirichlet::new_with_param(0.5f64, 1); + } + + #[test] + #[should_panic] + fn test_dirichlet_invalid_alpha() { + Dirichlet::new_with_param(0.0f64, 2); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/exponential.rs b/vendor/registry-40351f815f426200/rand/src/distributions/exponential.rs new file mode 100644 index 000000000..76752a60e --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/exponential.rs @@ -0,0 +1,124 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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. + +//! The exponential distribution. + +use {Rng}; +use distributions::{ziggurat_tables, Distribution}; +use distributions::utils::ziggurat; + +/// Samples floating-point numbers according to the exponential distribution, +/// with rate parameter `λ = 1`. This is equivalent to `Exp::new(1.0)` or +/// sampling with `-rng.gen::().ln()`, but faster. +/// +/// See `Exp` for the general exponential distribution. +/// +/// Implemented via the ZIGNOR variant[^1] of the Ziggurat method. The exact +/// description in the paper was adjusted to use tables for the exponential +/// distribution rather than normal. +/// +/// [^1]: Jurgen A. Doornik (2005). [*An Improved Ziggurat Method to +/// Generate Normal Random Samples*]( +/// https://www.doornik.com/research/ziggurat.pdf). +/// Nuffield College, Oxford +/// +/// # Example +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::Exp1; +/// +/// let val: f64 = SmallRng::from_entropy().sample(Exp1); +/// println!("{}", val); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Exp1; + +// This could be done via `-rng.gen::().ln()` but that is slower. +impl Distribution for Exp1 { + #[inline] + fn sample(&self, rng: &mut R) -> f64 { + #[inline] + fn pdf(x: f64) -> f64 { + (-x).exp() + } + #[inline] + fn zero_case(rng: &mut R, _u: f64) -> f64 { + ziggurat_tables::ZIG_EXP_R - rng.gen::().ln() + } + + ziggurat(rng, false, + &ziggurat_tables::ZIG_EXP_X, + &ziggurat_tables::ZIG_EXP_F, + pdf, zero_case) + } +} + +/// The exponential distribution `Exp(lambda)`. +/// +/// This distribution has density function: `f(x) = lambda * exp(-lambda * x)` +/// for `x > 0`. +/// +/// Note that [`Exp1`][crate::distributions::Exp1] is an optimised implementation for `lambda = 1`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Exp, Distribution}; +/// +/// let exp = Exp::new(2.0); +/// let v = exp.sample(&mut rand::thread_rng()); +/// println!("{} is from a Exp(2) distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Exp { + /// `lambda` stored as `1/lambda`, since this is what we scale by. + lambda_inverse: f64 +} + +impl Exp { + /// Construct a new `Exp` with the given shape parameter + /// `lambda`. Panics if `lambda <= 0`. + #[inline] + pub fn new(lambda: f64) -> Exp { + assert!(lambda > 0.0, "Exp::new called with `lambda` <= 0"); + Exp { lambda_inverse: 1.0 / lambda } + } +} + +impl Distribution for Exp { + fn sample(&self, rng: &mut R) -> f64 { + let n: f64 = rng.sample(Exp1); + n * self.lambda_inverse + } +} + +#[cfg(test)] +mod test { + use distributions::Distribution; + use super::Exp; + + #[test] + fn test_exp() { + let exp = Exp::new(10.0); + let mut rng = ::test::rng(221); + for _ in 0..1000 { + assert!(exp.sample(&mut rng) >= 0.0); + } + } + #[test] + #[should_panic] + fn test_exp_invalid_lambda_zero() { + Exp::new(0.0); + } + #[test] + #[should_panic] + fn test_exp_invalid_lambda_neg() { + Exp::new(-10.0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/float.rs b/vendor/registry-40351f815f426200/rand/src/distributions/float.rs new file mode 100644 index 000000000..0dd5caa4a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/float.rs @@ -0,0 +1,259 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Basic floating-point number distributions + +use core::mem; +use Rng; +use distributions::{Distribution, Standard}; +use distributions::utils::FloatSIMDUtils; +#[cfg(feature="simd_support")] +use packed_simd::*; + +/// A distribution to sample floating point numbers uniformly in the half-open +/// interval `(0, 1]`, i.e. including 1 but not 0. +/// +/// All values that can be generated are of the form `n * ε/2`. For `f32` +/// the 23 most significant random bits of a `u32` are used and for `f64` the +/// 53 most significant bits of a `u64` are used. The conversion uses the +/// multiplicative method. +/// +/// See also: [`Standard`] which samples from `[0, 1)`, [`Open01`] +/// which samples from `(0, 1)` and [`Uniform`] which samples from arbitrary +/// ranges. +/// +/// # Example +/// ``` +/// use rand::{thread_rng, Rng}; +/// use rand::distributions::OpenClosed01; +/// +/// let val: f32 = thread_rng().sample(OpenClosed01); +/// println!("f32 from (0, 1): {}", val); +/// ``` +/// +/// [`Standard`]: crate::distributions::Standard +/// [`Open01`]: crate::distributions::Open01 +/// [`Uniform`]: crate::distributions::uniform::Uniform +#[derive(Clone, Copy, Debug)] +pub struct OpenClosed01; + +/// A distribution to sample floating point numbers uniformly in the open +/// interval `(0, 1)`, i.e. not including either endpoint. +/// +/// All values that can be generated are of the form `n * ε + ε/2`. For `f32` +/// the 22 most significant random bits of an `u32` are used, for `f64` 52 from +/// an `u64`. The conversion uses a transmute-based method. +/// +/// See also: [`Standard`] which samples from `[0, 1)`, [`OpenClosed01`] +/// which samples from `(0, 1]` and [`Uniform`] which samples from arbitrary +/// ranges. +/// +/// # Example +/// ``` +/// use rand::{thread_rng, Rng}; +/// use rand::distributions::Open01; +/// +/// let val: f32 = thread_rng().sample(Open01); +/// println!("f32 from (0, 1): {}", val); +/// ``` +/// +/// [`Standard`]: crate::distributions::Standard +/// [`OpenClosed01`]: crate::distributions::OpenClosed01 +/// [`Uniform`]: crate::distributions::uniform::Uniform +#[derive(Clone, Copy, Debug)] +pub struct Open01; + + +pub(crate) trait IntoFloat { + type F; + + /// Helper method to combine the fraction and a contant exponent into a + /// float. + /// + /// Only the least significant bits of `self` may be set, 23 for `f32` and + /// 52 for `f64`. + /// The resulting value will fall in a range that depends on the exponent. + /// As an example the range with exponent 0 will be + /// [20..21), which is [1..2). + fn into_float_with_exponent(self, exponent: i32) -> Self::F; +} + +macro_rules! float_impls { + ($ty:ident, $uty:ident, $f_scalar:ident, $u_scalar:ty, + $fraction_bits:expr, $exponent_bias:expr) => { + impl IntoFloat for $uty { + type F = $ty; + #[inline(always)] + fn into_float_with_exponent(self, exponent: i32) -> $ty { + // The exponent is encoded using an offset-binary representation + let exponent_bits: $u_scalar = + (($exponent_bias + exponent) as $u_scalar) << $fraction_bits; + // TODO: use from_bits when min compiler > 1.25 (see #545) + // $ty::from_bits(self | exponent_bits) + unsafe{ mem::transmute(self | exponent_bits) } + } + } + + impl Distribution<$ty> for Standard { + fn sample(&self, rng: &mut R) -> $ty { + // Multiply-based method; 24/53 random bits; [0, 1) interval. + // We use the most significant bits because for simple RNGs + // those are usually more random. + let float_size = mem::size_of::<$f_scalar>() as u32 * 8; + let precision = $fraction_bits + 1; + let scale = 1.0 / ((1 as $u_scalar << precision) as $f_scalar); + + let value: $uty = rng.gen(); + let value = value >> (float_size - precision); + scale * $ty::cast_from_int(value) + } + } + + impl Distribution<$ty> for OpenClosed01 { + fn sample(&self, rng: &mut R) -> $ty { + // Multiply-based method; 24/53 random bits; (0, 1] interval. + // We use the most significant bits because for simple RNGs + // those are usually more random. + let float_size = mem::size_of::<$f_scalar>() as u32 * 8; + let precision = $fraction_bits + 1; + let scale = 1.0 / ((1 as $u_scalar << precision) as $f_scalar); + + let value: $uty = rng.gen(); + let value = value >> (float_size - precision); + // Add 1 to shift up; will not overflow because of right-shift: + scale * $ty::cast_from_int(value + 1) + } + } + + impl Distribution<$ty> for Open01 { + fn sample(&self, rng: &mut R) -> $ty { + // Transmute-based method; 23/52 random bits; (0, 1) interval. + // We use the most significant bits because for simple RNGs + // those are usually more random. + use core::$f_scalar::EPSILON; + let float_size = mem::size_of::<$f_scalar>() as u32 * 8; + + let value: $uty = rng.gen(); + let fraction = value >> (float_size - $fraction_bits); + fraction.into_float_with_exponent(0) - (1.0 - EPSILON / 2.0) + } + } + } +} + +float_impls! { f32, u32, f32, u32, 23, 127 } +float_impls! { f64, u64, f64, u64, 52, 1023 } + +#[cfg(feature="simd_support")] +float_impls! { f32x2, u32x2, f32, u32, 23, 127 } +#[cfg(feature="simd_support")] +float_impls! { f32x4, u32x4, f32, u32, 23, 127 } +#[cfg(feature="simd_support")] +float_impls! { f32x8, u32x8, f32, u32, 23, 127 } +#[cfg(feature="simd_support")] +float_impls! { f32x16, u32x16, f32, u32, 23, 127 } + +#[cfg(feature="simd_support")] +float_impls! { f64x2, u64x2, f64, u64, 52, 1023 } +#[cfg(feature="simd_support")] +float_impls! { f64x4, u64x4, f64, u64, 52, 1023 } +#[cfg(feature="simd_support")] +float_impls! { f64x8, u64x8, f64, u64, 52, 1023 } + + +#[cfg(test)] +mod tests { + use Rng; + use distributions::{Open01, OpenClosed01}; + use rngs::mock::StepRng; + #[cfg(feature="simd_support")] + use packed_simd::*; + + const EPSILON32: f32 = ::core::f32::EPSILON; + const EPSILON64: f64 = ::core::f64::EPSILON; + + macro_rules! test_f32 { + ($fnn:ident, $ty:ident, $ZERO:expr, $EPSILON:expr) => { + #[test] + fn $fnn() { + // Standard + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.gen::<$ty>(), $ZERO); + let mut one = StepRng::new(1 << 8 | 1 << (8 + 32), 0); + assert_eq!(one.gen::<$ty>(), $EPSILON / 2.0); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.gen::<$ty>(), 1.0 - $EPSILON / 2.0); + + // OpenClosed01 + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.sample::<$ty, _>(OpenClosed01), + 0.0 + $EPSILON / 2.0); + let mut one = StepRng::new(1 << 8 | 1 << (8 + 32), 0); + assert_eq!(one.sample::<$ty, _>(OpenClosed01), $EPSILON); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.sample::<$ty, _>(OpenClosed01), $ZERO + 1.0); + + // Open01 + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.sample::<$ty, _>(Open01), 0.0 + $EPSILON / 2.0); + let mut one = StepRng::new(1 << 9 | 1 << (9 + 32), 0); + assert_eq!(one.sample::<$ty, _>(Open01), $EPSILON / 2.0 * 3.0); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.sample::<$ty, _>(Open01), 1.0 - $EPSILON / 2.0); + } + } + } + test_f32! { f32_edge_cases, f32, 0.0, EPSILON32 } + #[cfg(feature="simd_support")] + test_f32! { f32x2_edge_cases, f32x2, f32x2::splat(0.0), f32x2::splat(EPSILON32) } + #[cfg(feature="simd_support")] + test_f32! { f32x4_edge_cases, f32x4, f32x4::splat(0.0), f32x4::splat(EPSILON32) } + #[cfg(feature="simd_support")] + test_f32! { f32x8_edge_cases, f32x8, f32x8::splat(0.0), f32x8::splat(EPSILON32) } + #[cfg(feature="simd_support")] + test_f32! { f32x16_edge_cases, f32x16, f32x16::splat(0.0), f32x16::splat(EPSILON32) } + + macro_rules! test_f64 { + ($fnn:ident, $ty:ident, $ZERO:expr, $EPSILON:expr) => { + #[test] + fn $fnn() { + // Standard + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.gen::<$ty>(), $ZERO); + let mut one = StepRng::new(1 << 11, 0); + assert_eq!(one.gen::<$ty>(), $EPSILON / 2.0); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.gen::<$ty>(), 1.0 - $EPSILON / 2.0); + + // OpenClosed01 + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.sample::<$ty, _>(OpenClosed01), + 0.0 + $EPSILON / 2.0); + let mut one = StepRng::new(1 << 11, 0); + assert_eq!(one.sample::<$ty, _>(OpenClosed01), $EPSILON); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.sample::<$ty, _>(OpenClosed01), $ZERO + 1.0); + + // Open01 + let mut zeros = StepRng::new(0, 0); + assert_eq!(zeros.sample::<$ty, _>(Open01), 0.0 + $EPSILON / 2.0); + let mut one = StepRng::new(1 << 12, 0); + assert_eq!(one.sample::<$ty, _>(Open01), $EPSILON / 2.0 * 3.0); + let mut max = StepRng::new(!0, 0); + assert_eq!(max.sample::<$ty, _>(Open01), 1.0 - $EPSILON / 2.0); + } + } + } + test_f64! { f64_edge_cases, f64, 0.0, EPSILON64 } + #[cfg(feature="simd_support")] + test_f64! { f64x2_edge_cases, f64x2, f64x2::splat(0.0), f64x2::splat(EPSILON64) } + #[cfg(feature="simd_support")] + test_f64! { f64x4_edge_cases, f64x4, f64x4::splat(0.0), f64x4::splat(EPSILON64) } + #[cfg(feature="simd_support")] + test_f64! { f64x8_edge_cases, f64x8, f64x8::splat(0.0), f64x8::splat(EPSILON64) } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/gamma.rs b/vendor/registry-40351f815f426200/rand/src/distributions/gamma.rs new file mode 100644 index 000000000..43ac2bc15 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/gamma.rs @@ -0,0 +1,413 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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. + +//! The Gamma and derived distributions. + +use self::GammaRepr::*; +use self::ChiSquaredRepr::*; + +use Rng; +use distributions::normal::StandardNormal; +use distributions::{Distribution, Exp, Open01}; + +/// The Gamma distribution `Gamma(shape, scale)` distribution. +/// +/// The density function of this distribution is +/// +/// ```text +/// f(x) = x^(k - 1) * exp(-x / θ) / (Γ(k) * θ^k) +/// ``` +/// +/// where `Γ` is the Gamma function, `k` is the shape and `θ` is the +/// scale and both `k` and `θ` are strictly positive. +/// +/// The algorithm used is that described by Marsaglia & Tsang 2000[^1], +/// falling back to directly sampling from an Exponential for `shape +/// == 1`, and using the boosting technique described in that paper for +/// `shape < 1`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Distribution, Gamma}; +/// +/// let gamma = Gamma::new(2.0, 5.0); +/// let v = gamma.sample(&mut rand::thread_rng()); +/// println!("{} is from a Gamma(2, 5) distribution", v); +/// ``` +/// +/// [^1]: George Marsaglia and Wai Wan Tsang. 2000. "A Simple Method for +/// Generating Gamma Variables" *ACM Trans. Math. Softw.* 26, 3 +/// (September 2000), 363-372. +/// DOI:[10.1145/358407.358414](https://doi.acm.org/10.1145/358407.358414) +#[derive(Clone, Copy, Debug)] +pub struct Gamma { + repr: GammaRepr, +} + +#[derive(Clone, Copy, Debug)] +enum GammaRepr { + Large(GammaLargeShape), + One(Exp), + Small(GammaSmallShape) +} + +// These two helpers could be made public, but saving the +// match-on-Gamma-enum branch from using them directly (e.g. if one +// knows that the shape is always > 1) doesn't appear to be much +// faster. + +/// Gamma distribution where the shape parameter is less than 1. +/// +/// Note, samples from this require a compulsory floating-point `pow` +/// call, which makes it significantly slower than sampling from a +/// gamma distribution where the shape parameter is greater than or +/// equal to 1. +/// +/// See `Gamma` for sampling from a Gamma distribution with general +/// shape parameters. +#[derive(Clone, Copy, Debug)] +struct GammaSmallShape { + inv_shape: f64, + large_shape: GammaLargeShape +} + +/// Gamma distribution where the shape parameter is larger than 1. +/// +/// See `Gamma` for sampling from a Gamma distribution with general +/// shape parameters. +#[derive(Clone, Copy, Debug)] +struct GammaLargeShape { + scale: f64, + c: f64, + d: f64 +} + +impl Gamma { + /// Construct an object representing the `Gamma(shape, scale)` + /// distribution. + /// + /// Panics if `shape <= 0` or `scale <= 0`. + #[inline] + pub fn new(shape: f64, scale: f64) -> Gamma { + assert!(shape > 0.0, "Gamma::new called with shape <= 0"); + assert!(scale > 0.0, "Gamma::new called with scale <= 0"); + + let repr = if shape == 1.0 { + One(Exp::new(1.0 / scale)) + } else if shape < 1.0 { + Small(GammaSmallShape::new_raw(shape, scale)) + } else { + Large(GammaLargeShape::new_raw(shape, scale)) + }; + Gamma { repr } + } +} + +impl GammaSmallShape { + fn new_raw(shape: f64, scale: f64) -> GammaSmallShape { + GammaSmallShape { + inv_shape: 1. / shape, + large_shape: GammaLargeShape::new_raw(shape + 1.0, scale) + } + } +} + +impl GammaLargeShape { + fn new_raw(shape: f64, scale: f64) -> GammaLargeShape { + let d = shape - 1. / 3.; + GammaLargeShape { + scale, + c: 1. / (9. * d).sqrt(), + d + } + } +} + +impl Distribution for Gamma { + fn sample(&self, rng: &mut R) -> f64 { + match self.repr { + Small(ref g) => g.sample(rng), + One(ref g) => g.sample(rng), + Large(ref g) => g.sample(rng), + } + } +} +impl Distribution for GammaSmallShape { + fn sample(&self, rng: &mut R) -> f64 { + let u: f64 = rng.sample(Open01); + + self.large_shape.sample(rng) * u.powf(self.inv_shape) + } +} +impl Distribution for GammaLargeShape { + fn sample(&self, rng: &mut R) -> f64 { + loop { + let x = rng.sample(StandardNormal); + let v_cbrt = 1.0 + self.c * x; + if v_cbrt <= 0.0 { // a^3 <= 0 iff a <= 0 + continue + } + + let v = v_cbrt * v_cbrt * v_cbrt; + let u: f64 = rng.sample(Open01); + + let x_sqr = x * x; + if u < 1.0 - 0.0331 * x_sqr * x_sqr || + u.ln() < 0.5 * x_sqr + self.d * (1.0 - v + v.ln()) { + return self.d * v * self.scale + } + } + } +} + +/// The chi-squared distribution `χ²(k)`, where `k` is the degrees of +/// freedom. +/// +/// For `k > 0` integral, this distribution is the sum of the squares +/// of `k` independent standard normal random variables. For other +/// `k`, this uses the equivalent characterisation +/// `χ²(k) = Gamma(k/2, 2)`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{ChiSquared, Distribution}; +/// +/// let chi = ChiSquared::new(11.0); +/// let v = chi.sample(&mut rand::thread_rng()); +/// println!("{} is from a χ²(11) distribution", v) +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct ChiSquared { + repr: ChiSquaredRepr, +} + +#[derive(Clone, Copy, Debug)] +enum ChiSquaredRepr { + // k == 1, Gamma(alpha, ..) is particularly slow for alpha < 1, + // e.g. when alpha = 1/2 as it would be for this case, so special- + // casing and using the definition of N(0,1)^2 is faster. + DoFExactlyOne, + DoFAnythingElse(Gamma), +} + +impl ChiSquared { + /// Create a new chi-squared distribution with degrees-of-freedom + /// `k`. Panics if `k < 0`. + pub fn new(k: f64) -> ChiSquared { + let repr = if k == 1.0 { + DoFExactlyOne + } else { + assert!(k > 0.0, "ChiSquared::new called with `k` < 0"); + DoFAnythingElse(Gamma::new(0.5 * k, 2.0)) + }; + ChiSquared { repr } + } +} +impl Distribution for ChiSquared { + fn sample(&self, rng: &mut R) -> f64 { + match self.repr { + DoFExactlyOne => { + // k == 1 => N(0,1)^2 + let norm = rng.sample(StandardNormal); + norm * norm + } + DoFAnythingElse(ref g) => g.sample(rng) + } + } +} + +/// The Fisher F distribution `F(m, n)`. +/// +/// This distribution is equivalent to the ratio of two normalised +/// chi-squared distributions, that is, `F(m,n) = (χ²(m)/m) / +/// (χ²(n)/n)`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{FisherF, Distribution}; +/// +/// let f = FisherF::new(2.0, 32.0); +/// let v = f.sample(&mut rand::thread_rng()); +/// println!("{} is from an F(2, 32) distribution", v) +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct FisherF { + numer: ChiSquared, + denom: ChiSquared, + // denom_dof / numer_dof so that this can just be a straight + // multiplication, rather than a division. + dof_ratio: f64, +} + +impl FisherF { + /// Create a new `FisherF` distribution, with the given + /// parameter. Panics if either `m` or `n` are not positive. + pub fn new(m: f64, n: f64) -> FisherF { + assert!(m > 0.0, "FisherF::new called with `m < 0`"); + assert!(n > 0.0, "FisherF::new called with `n < 0`"); + + FisherF { + numer: ChiSquared::new(m), + denom: ChiSquared::new(n), + dof_ratio: n / m + } + } +} +impl Distribution for FisherF { + fn sample(&self, rng: &mut R) -> f64 { + self.numer.sample(rng) / self.denom.sample(rng) * self.dof_ratio + } +} + +/// The Student t distribution, `t(nu)`, where `nu` is the degrees of +/// freedom. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{StudentT, Distribution}; +/// +/// let t = StudentT::new(11.0); +/// let v = t.sample(&mut rand::thread_rng()); +/// println!("{} is from a t(11) distribution", v) +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct StudentT { + chi: ChiSquared, + dof: f64 +} + +impl StudentT { + /// Create a new Student t distribution with `n` degrees of + /// freedom. Panics if `n <= 0`. + pub fn new(n: f64) -> StudentT { + assert!(n > 0.0, "StudentT::new called with `n <= 0`"); + StudentT { + chi: ChiSquared::new(n), + dof: n + } + } +} +impl Distribution for StudentT { + fn sample(&self, rng: &mut R) -> f64 { + let norm = rng.sample(StandardNormal); + norm * (self.dof / self.chi.sample(rng)).sqrt() + } +} + +/// The Beta distribution with shape parameters `alpha` and `beta`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Distribution, Beta}; +/// +/// let beta = Beta::new(2.0, 5.0); +/// let v = beta.sample(&mut rand::thread_rng()); +/// println!("{} is from a Beta(2, 5) distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Beta { + gamma_a: Gamma, + gamma_b: Gamma, +} + +impl Beta { + /// Construct an object representing the `Beta(alpha, beta)` + /// distribution. + /// + /// Panics if `shape <= 0` or `scale <= 0`. + pub fn new(alpha: f64, beta: f64) -> Beta { + assert!((alpha > 0.) & (beta > 0.)); + Beta { + gamma_a: Gamma::new(alpha, 1.), + gamma_b: Gamma::new(beta, 1.), + } + } +} + +impl Distribution for Beta { + fn sample(&self, rng: &mut R) -> f64 { + let x = self.gamma_a.sample(rng); + let y = self.gamma_b.sample(rng); + x / (x + y) + } +} + +#[cfg(test)] +mod test { + use distributions::Distribution; + use super::{Beta, ChiSquared, StudentT, FisherF}; + + #[test] + fn test_chi_squared_one() { + let chi = ChiSquared::new(1.0); + let mut rng = ::test::rng(201); + for _ in 0..1000 { + chi.sample(&mut rng); + } + } + #[test] + fn test_chi_squared_small() { + let chi = ChiSquared::new(0.5); + let mut rng = ::test::rng(202); + for _ in 0..1000 { + chi.sample(&mut rng); + } + } + #[test] + fn test_chi_squared_large() { + let chi = ChiSquared::new(30.0); + let mut rng = ::test::rng(203); + for _ in 0..1000 { + chi.sample(&mut rng); + } + } + #[test] + #[should_panic] + fn test_chi_squared_invalid_dof() { + ChiSquared::new(-1.0); + } + + #[test] + fn test_f() { + let f = FisherF::new(2.0, 32.0); + let mut rng = ::test::rng(204); + for _ in 0..1000 { + f.sample(&mut rng); + } + } + + #[test] + fn test_t() { + let t = StudentT::new(11.0); + let mut rng = ::test::rng(205); + for _ in 0..1000 { + t.sample(&mut rng); + } + } + + #[test] + fn test_beta() { + let beta = Beta::new(1.0, 2.0); + let mut rng = ::test::rng(201); + for _ in 0..1000 { + beta.sample(&mut rng); + } + } + + #[test] + #[should_panic] + fn test_beta_invalid_dof() { + Beta::new(0., 0.); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/integer.rs b/vendor/registry-40351f815f426200/rand/src/distributions/integer.rs new file mode 100644 index 000000000..7e408dbf1 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/integer.rs @@ -0,0 +1,161 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The implementations of the `Standard` distribution for integer types. + +use {Rng}; +use distributions::{Distribution, Standard}; +#[cfg(feature="simd_support")] +use packed_simd::*; +#[cfg(all(target_arch = "x86", feature="nightly"))] +use core::arch::x86::*; +#[cfg(all(target_arch = "x86_64", feature="nightly"))] +use core::arch::x86_64::*; + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> u8 { + rng.next_u32() as u8 + } +} + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> u16 { + rng.next_u32() as u16 + } +} + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> u32 { + rng.next_u32() + } +} + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> u64 { + rng.next_u64() + } +} + +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> u128 { + // Use LE; we explicitly generate one value before the next. + let x = rng.next_u64() as u128; + let y = rng.next_u64() as u128; + (y << 64) | x + } +} + +impl Distribution for Standard { + #[inline] + #[cfg(any(target_pointer_width = "32", target_pointer_width = "16"))] + fn sample(&self, rng: &mut R) -> usize { + rng.next_u32() as usize + } + + #[inline] + #[cfg(target_pointer_width = "64")] + fn sample(&self, rng: &mut R) -> usize { + rng.next_u64() as usize + } +} + +macro_rules! impl_int_from_uint { + ($ty:ty, $uty:ty) => { + impl Distribution<$ty> for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> $ty { + rng.gen::<$uty>() as $ty + } + } + } +} + +impl_int_from_uint! { i8, u8 } +impl_int_from_uint! { i16, u16 } +impl_int_from_uint! { i32, u32 } +impl_int_from_uint! { i64, u64 } +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] impl_int_from_uint! { i128, u128 } +impl_int_from_uint! { isize, usize } + +#[cfg(feature="simd_support")] +macro_rules! simd_impl { + ($(($intrinsic:ident, $vec:ty),)+) => {$( + impl Distribution<$intrinsic> for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> $intrinsic { + $intrinsic::from_bits(rng.gen::<$vec>()) + } + } + )+}; + + ($bits:expr,) => {}; + ($bits:expr, $ty:ty, $($ty_more:ty,)*) => { + simd_impl!($bits, $($ty_more,)*); + + impl Distribution<$ty> for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> $ty { + let mut vec: $ty = Default::default(); + unsafe { + let ptr = &mut vec; + let b_ptr = &mut *(ptr as *mut $ty as *mut [u8; $bits/8]); + rng.fill_bytes(b_ptr); + } + vec.to_le() + } + } + }; +} + +#[cfg(feature="simd_support")] +simd_impl!(16, u8x2, i8x2,); +#[cfg(feature="simd_support")] +simd_impl!(32, u8x4, i8x4, u16x2, i16x2,); +#[cfg(feature="simd_support")] +simd_impl!(64, u8x8, i8x8, u16x4, i16x4, u32x2, i32x2,); +#[cfg(feature="simd_support")] +simd_impl!(128, u8x16, i8x16, u16x8, i16x8, u32x4, i32x4, u64x2, i64x2,); +#[cfg(feature="simd_support")] +simd_impl!(256, u8x32, i8x32, u16x16, i16x16, u32x8, i32x8, u64x4, i64x4,); +#[cfg(feature="simd_support")] +simd_impl!(512, u8x64, i8x64, u16x32, i16x32, u32x16, i32x16, u64x8, i64x8,); +#[cfg(all(feature="simd_support", feature="nightly", any(target_arch="x86", target_arch="x86_64")))] +simd_impl!((__m64, u8x8), (__m128i, u8x16), (__m256i, u8x32),); + +#[cfg(test)] +mod tests { + use Rng; + use distributions::{Standard}; + + #[test] + fn test_integers() { + let mut rng = ::test::rng(806); + + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + rng.sample::(Standard); + + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + rng.sample::(Standard); + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + rng.sample::(Standard); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/mod.rs b/vendor/registry-40351f815f426200/rand/src/distributions/mod.rs new file mode 100644 index 000000000..6e2d6c7ba --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/mod.rs @@ -0,0 +1,608 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2017 The Rust Project 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. + +//! Generating random samples from probability distributions. +//! +//! This module is the home of the [`Distribution`] trait and several of its +//! implementations. It is the workhorse behind some of the convenient +//! functionality of the [`Rng`] trait, including [`gen`], [`gen_range`] and +//! of course [`sample`]. +//! +//! Abstractly, a [probability distribution] describes the probability of +//! occurance of each value in its sample space. +//! +//! More concretely, an implementation of `Distribution` for type `X` is an +//! algorithm for choosing values from the sample space (a subset of `T`) +//! according to the distribution `X` represents, using an external source of +//! randomness (an RNG supplied to the `sample` function). +//! +//! A type `X` may implement `Distribution` for multiple types `T`. +//! Any type implementing [`Distribution`] is stateless (i.e. immutable), +//! but it may have internal parameters set at construction time (for example, +//! [`Uniform`] allows specification of its sample space as a range within `T`). +//! +//! +//! # The `Standard` distribution +//! +//! The [`Standard`] distribution is important to mention. This is the +//! distribution used by [`Rng::gen()`] and represents the "default" way to +//! produce a random value for many different types, including most primitive +//! types, tuples, arrays, and a few derived types. See the documentation of +//! [`Standard`] for more details. +//! +//! Implementing `Distribution` for [`Standard`] for user types `T` makes it +//! possible to generate type `T` with [`Rng::gen()`], and by extension also +//! with the [`random()`] function. +//! +//! +//! # Distribution to sample from a `Uniform` range +//! +//! The [`Uniform`] distribution is more flexible than [`Standard`], but also +//! more specialised: it supports fewer target types, but allows the sample +//! space to be specified as an arbitrary range within its target type `T`. +//! Both [`Standard`] and [`Uniform`] are in some sense uniform distributions. +//! +//! Values may be sampled from this distribution using [`Rng::gen_range`] or +//! by creating a distribution object with [`Uniform::new`], +//! [`Uniform::new_inclusive`] or `From`. When the range limits are not +//! known at compile time it is typically faster to reuse an existing +//! distribution object than to call [`Rng::gen_range`]. +//! +//! User types `T` may also implement `Distribution` for [`Uniform`], +//! although this is less straightforward than for [`Standard`] (see the +//! documentation in the [`uniform`] module. Doing so enables generation of +//! values of type `T` with [`Rng::gen_range`]. +//! +//! +//! # Other distributions +//! +//! There are surprisingly many ways to uniformly generate random floats. A +//! range between 0 and 1 is standard, but the exact bounds (open vs closed) +//! and accuracy differ. In addition to the [`Standard`] distribution Rand offers +//! [`Open01`] and [`OpenClosed01`]. See "Floating point implementation" section of +//! [`Standard`] documentation for more details. +//! +//! [`Alphanumeric`] is a simple distribution to sample random letters and +//! numbers of the `char` type; in contrast [`Standard`] may sample any valid +//! `char`. +//! +//! [`WeightedIndex`] can be used to do weighted sampling from a set of items, +//! such as from an array. +//! +//! # Non-uniform probability distributions +//! +//! Rand currently provides the following probability distributions: +//! +//! - Related to real-valued quantities that grow linearly +//! (e.g. errors, offsets): +//! - [`Normal`] distribution, and [`StandardNormal`] as a primitive +//! - [`Cauchy`] distribution +//! - Related to Bernoulli trials (yes/no events, with a given probability): +//! - [`Binomial`] distribution +//! - [`Bernoulli`] distribution, similar to [`Rng::gen_bool`]. +//! - Related to positive real-valued quantities that grow exponentially +//! (e.g. prices, incomes, populations): +//! - [`LogNormal`] distribution +//! - Related to the occurrence of independent events at a given rate: +//! - [`Pareto`] distribution +//! - [`Poisson`] distribution +//! - [`Exp`]onential distribution, and [`Exp1`] as a primitive +//! - [`Weibull`] distribution +//! - Gamma and derived distributions: +//! - [`Gamma`] distribution +//! - [`ChiSquared`] distribution +//! - [`StudentT`] distribution +//! - [`FisherF`] distribution +//! - Triangular distribution: +//! - [`Beta`] distribution +//! - [`Triangular`] distribution +//! - Multivariate probability distributions +//! - [`Dirichlet`] distribution +//! - [`UnitSphereSurface`] distribution +//! - [`UnitCircle`] distribution +//! +//! # Examples +//! +//! Sampling from a distribution: +//! +//! ``` +//! use rand::{thread_rng, Rng}; +//! use rand::distributions::Exp; +//! +//! let exp = Exp::new(2.0); +//! let v = thread_rng().sample(exp); +//! println!("{} is from an Exp(2) distribution", v); +//! ``` +//! +//! Implementing the [`Standard`] distribution for a user type: +//! +//! ``` +//! # #![allow(dead_code)] +//! use rand::Rng; +//! use rand::distributions::{Distribution, Standard}; +//! +//! struct MyF32 { +//! x: f32, +//! } +//! +//! impl Distribution for Standard { +//! fn sample(&self, rng: &mut R) -> MyF32 { +//! MyF32 { x: rng.gen() } +//! } +//! } +//! ``` +//! +//! +//! [probability distribution]: https://en.wikipedia.org/wiki/Probability_distribution +//! [`gen_range`]: Rng::gen_range +//! [`gen`]: Rng::gen +//! [`sample`]: Rng::sample +//! [`new_inclusive`]: Uniform::new_inclusive +//! [`Alphanumeric`]: distributions::Alphanumeric +//! [`Bernoulli`]: distributions::Bernoulli +//! [`Beta`]: distributions::Beta +//! [`Binomial`]: distributions::Binomial +//! [`Cauchy`]: distributions::Cauchy +//! [`ChiSquared`]: distributions::ChiSquared +//! [`Dirichlet`]: distributions::Dirichlet +//! [`Exp`]: distributions::Exp +//! [`Exp1`]: distributions::Exp1 +//! [`FisherF`]: distributions::FisherF +//! [`Gamma`]: distributions::Gamma +//! [`LogNormal`]: distributions::LogNormal +//! [`Normal`]: distributions::Normal +//! [`Open01`]: distributions::Open01 +//! [`OpenClosed01`]: distributions::OpenClosed01 +//! [`Pareto`]: distributions::Pareto +//! [`Poisson`]: distributions::Poisson +//! [`Standard`]: distributions::Standard +//! [`StandardNormal`]: distributions::StandardNormal +//! [`StudentT`]: distributions::StudentT +//! [`Triangular`]: distributions::Triangular +//! [`Uniform`]: distributions::Uniform +//! [`Uniform::new`]: distributions::Uniform::new +//! [`Uniform::new_inclusive`]: distributions::Uniform::new_inclusive +//! [`UnitSphereSurface`]: distributions::UnitSphereSurface +//! [`UnitCircle`]: distributions::UnitCircle +//! [`Weibull`]: distributions::Weibull +//! [`WeightedIndex`]: distributions::WeightedIndex + +#[cfg(any(rustc_1_26, features="nightly"))] +use core::iter; +use Rng; + +pub use self::other::Alphanumeric; +#[doc(inline)] pub use self::uniform::Uniform; +pub use self::float::{OpenClosed01, Open01}; +pub use self::bernoulli::Bernoulli; +#[cfg(feature="alloc")] pub use self::weighted::{WeightedIndex, WeightedError}; +#[cfg(feature="std")] pub use self::unit_sphere::UnitSphereSurface; +#[cfg(feature="std")] pub use self::unit_circle::UnitCircle; +#[cfg(feature="std")] pub use self::gamma::{Gamma, ChiSquared, FisherF, + StudentT, Beta}; +#[cfg(feature="std")] pub use self::normal::{Normal, LogNormal, StandardNormal}; +#[cfg(feature="std")] pub use self::exponential::{Exp, Exp1}; +#[cfg(feature="std")] pub use self::pareto::Pareto; +#[cfg(feature="std")] pub use self::poisson::Poisson; +#[cfg(feature="std")] pub use self::binomial::Binomial; +#[cfg(feature="std")] pub use self::cauchy::Cauchy; +#[cfg(feature="std")] pub use self::dirichlet::Dirichlet; +#[cfg(feature="std")] pub use self::triangular::Triangular; +#[cfg(feature="std")] pub use self::weibull::Weibull; + +pub mod uniform; +mod bernoulli; +#[cfg(feature="alloc")] mod weighted; +#[cfg(feature="std")] mod unit_sphere; +#[cfg(feature="std")] mod unit_circle; +#[cfg(feature="std")] mod gamma; +#[cfg(feature="std")] mod normal; +#[cfg(feature="std")] mod exponential; +#[cfg(feature="std")] mod pareto; +#[cfg(feature="std")] mod poisson; +#[cfg(feature="std")] mod binomial; +#[cfg(feature="std")] mod cauchy; +#[cfg(feature="std")] mod dirichlet; +#[cfg(feature="std")] mod triangular; +#[cfg(feature="std")] mod weibull; + +mod float; +mod integer; +mod other; +mod utils; +#[cfg(feature="std")] mod ziggurat_tables; + +/// Types (distributions) that can be used to create a random instance of `T`. +/// +/// It is possible to sample from a distribution through both the +/// `Distribution` and [`Rng`] traits, via `distr.sample(&mut rng)` and +/// `rng.sample(distr)`. They also both offer the [`sample_iter`] method, which +/// produces an iterator that samples from the distribution. +/// +/// All implementations are expected to be immutable; this has the significant +/// advantage of not needing to consider thread safety, and for most +/// distributions efficient state-less sampling algorithms are available. +/// +/// [`sample_iter`]: Distribution::method.sample_iter +pub trait Distribution { + /// Generate a random value of `T`, using `rng` as the source of randomness. + fn sample(&self, rng: &mut R) -> T; + + /// Create an iterator that generates random values of `T`, using `rng` as + /// the source of randomness. + /// + /// # Example + /// + /// ``` + /// use rand::thread_rng; + /// use rand::distributions::{Distribution, Alphanumeric, Uniform, Standard}; + /// + /// let mut rng = thread_rng(); + /// + /// // Vec of 16 x f32: + /// let v: Vec = Standard.sample_iter(&mut rng).take(16).collect(); + /// + /// // String: + /// let s: String = Alphanumeric.sample_iter(&mut rng).take(7).collect(); + /// + /// // Dice-rolling: + /// let die_range = Uniform::new_inclusive(1, 6); + /// let mut roll_die = die_range.sample_iter(&mut rng); + /// while roll_die.next().unwrap() != 6 { + /// println!("Not a 6; rolling again!"); + /// } + /// ``` + fn sample_iter<'a, R>(&'a self, rng: &'a mut R) -> DistIter<'a, Self, R, T> + where Self: Sized, R: Rng + { + DistIter { + distr: self, + rng: rng, + phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, T, D: Distribution> Distribution for &'a D { + fn sample(&self, rng: &mut R) -> T { + (*self).sample(rng) + } +} + + +/// An iterator that generates random values of `T` with distribution `D`, +/// using `R` as the source of randomness. +/// +/// This `struct` is created by the [`sample_iter`] method on [`Distribution`]. +/// See its documentation for more. +/// +/// [`sample_iter`]: Distribution::sample_iter +#[derive(Debug)] +pub struct DistIter<'a, D: 'a, R: 'a, T> { + distr: &'a D, + rng: &'a mut R, + phantom: ::core::marker::PhantomData, +} + +impl<'a, D, R, T> Iterator for DistIter<'a, D, R, T> + where D: Distribution, R: Rng + 'a +{ + type Item = T; + + #[inline(always)] + fn next(&mut self) -> Option { + Some(self.distr.sample(self.rng)) + } + + fn size_hint(&self) -> (usize, Option) { + (usize::max_value(), None) + } +} + +#[cfg(rustc_1_26)] +impl<'a, D, R, T> iter::FusedIterator for DistIter<'a, D, R, T> + where D: Distribution, R: Rng + 'a {} + +#[cfg(features = "nightly")] +impl<'a, D, R, T> iter::TrustedLen for DistIter<'a, D, R, T> + where D: Distribution, R: Rng + 'a {} + + +/// A generic random value distribution, implemented for many primitive types. +/// Usually generates values with a numerically uniform distribution, and with a +/// range appropriate to the type. +/// +/// ## Built-in Implementations +/// +/// Assuming the provided `Rng` is well-behaved, these implementations +/// generate values with the following ranges and distributions: +/// +/// * Integers (`i32`, `u32`, `isize`, `usize`, etc.): Uniformly distributed +/// over all values of the type. +/// * `char`: Uniformly distributed over all Unicode scalar values, i.e. all +/// code points in the range `0...0x10_FFFF`, except for the range +/// `0xD800...0xDFFF` (the surrogate code points). This includes +/// unassigned/reserved code points. +/// * `bool`: Generates `false` or `true`, each with probability 0.5. +/// * Floating point types (`f32` and `f64`): Uniformly distributed in the +/// half-open range `[0, 1)`. See notes below. +/// * Wrapping integers (`Wrapping`), besides the type identical to their +/// normal integer variants. +/// +/// The following aggregate types also implement the distribution `Standard` as +/// long as their component types implement it: +/// +/// * Tuples and arrays: Each element of the tuple or array is generated +/// independently, using the `Standard` distribution recursively. +/// * `Option` where `Standard` is implemented for `T`: Returns `None` with +/// probability 0.5; otherwise generates a random `x: T` and returns `Some(x)`. +/// +/// # Example +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::Standard; +/// +/// let val: f32 = SmallRng::from_entropy().sample(Standard); +/// println!("f32 from [0, 1): {}", val); +/// ``` +/// +/// # Floating point implementation +/// The floating point implementations for `Standard` generate a random value in +/// the half-open interval `[0, 1)`, i.e. including 0 but not 1. +/// +/// All values that can be generated are of the form `n * ε/2`. For `f32` +/// the 23 most significant random bits of a `u32` are used and for `f64` the +/// 53 most significant bits of a `u64` are used. The conversion uses the +/// multiplicative method: `(rng.gen::<$uty>() >> N) as $ty * (ε/2)`. +/// +/// See also: [`Open01`] which samples from `(0, 1)`, [`OpenClosed01`] which +/// samples from `(0, 1]` and `Rng::gen_range(0, 1)` which also samples from +/// `[0, 1)`. Note that `Open01` and `gen_range` (which uses [`Uniform`]) use +/// transmute-based methods which yield 1 bit less precision but may perform +/// faster on some architectures (on modern Intel CPUs all methods have +/// approximately equal performance). +/// +/// [`Uniform`]: uniform::Uniform +#[derive(Clone, Copy, Debug)] +pub struct Standard; + + +/// A value with a particular weight for use with `WeightedChoice`. +#[deprecated(since="0.6.0", note="use WeightedIndex instead")] +#[allow(deprecated)] +#[derive(Copy, Clone, Debug)] +pub struct Weighted { + /// The numerical weight of this item + pub weight: u32, + /// The actual item which is being weighted + pub item: T, +} + +/// A distribution that selects from a finite collection of weighted items. +/// +/// Deprecated: use [`WeightedIndex`] instead. +/// +/// [`WeightedIndex`]: WeightedIndex +#[deprecated(since="0.6.0", note="use WeightedIndex instead")] +#[allow(deprecated)] +#[derive(Debug)] +pub struct WeightedChoice<'a, T:'a> { + items: &'a mut [Weighted], + weight_range: Uniform, +} + +#[deprecated(since="0.6.0", note="use WeightedIndex instead")] +#[allow(deprecated)] +impl<'a, T: Clone> WeightedChoice<'a, T> { + /// Create a new `WeightedChoice`. + /// + /// Panics if: + /// + /// - `items` is empty + /// - the total weight is 0 + /// - the total weight is larger than a `u32` can contain. + pub fn new(items: &'a mut [Weighted]) -> WeightedChoice<'a, T> { + // strictly speaking, this is subsumed by the total weight == 0 case + assert!(!items.is_empty(), "WeightedChoice::new called with no items"); + + let mut running_total: u32 = 0; + + // we convert the list from individual weights to cumulative + // weights so we can binary search. This *could* drop elements + // with weight == 0 as an optimisation. + for item in items.iter_mut() { + running_total = match running_total.checked_add(item.weight) { + Some(n) => n, + None => panic!("WeightedChoice::new called with a total weight \ + larger than a u32 can contain") + }; + + item.weight = running_total; + } + assert!(running_total != 0, "WeightedChoice::new called with a total weight of 0"); + + WeightedChoice { + items, + // we're likely to be generating numbers in this range + // relatively often, so might as well cache it + weight_range: Uniform::new(0, running_total) + } + } +} + +#[deprecated(since="0.6.0", note="use WeightedIndex instead")] +#[allow(deprecated)] +impl<'a, T: Clone> Distribution for WeightedChoice<'a, T> { + fn sample(&self, rng: &mut R) -> T { + // we want to find the first element that has cumulative + // weight > sample_weight, which we do by binary since the + // cumulative weights of self.items are sorted. + + // choose a weight in [0, total_weight) + let sample_weight = self.weight_range.sample(rng); + + // short circuit when it's the first item + if sample_weight < self.items[0].weight { + return self.items[0].item.clone(); + } + + let mut idx = 0; + let mut modifier = self.items.len(); + + // now we know that every possibility has an element to the + // left, so we can just search for the last element that has + // cumulative weight <= sample_weight, then the next one will + // be "it". (Note that this greatest element will never be the + // last element of the vector, since sample_weight is chosen + // in [0, total_weight) and the cumulative weight of the last + // one is exactly the total weight.) + while modifier > 1 { + let i = idx + modifier / 2; + if self.items[i].weight <= sample_weight { + // we're small, so look to the right, but allow this + // exact element still. + idx = i; + // we need the `/ 2` to round up otherwise we'll drop + // the trailing elements when `modifier` is odd. + modifier += 1; + } else { + // otherwise we're too big, so go left. (i.e. do + // nothing) + } + modifier /= 2; + } + self.items[idx + 1].item.clone() + } +} + +#[cfg(test)] +mod tests { + use rngs::mock::StepRng; + #[allow(deprecated)] + use super::{WeightedChoice, Weighted, Distribution}; + + #[test] + #[allow(deprecated)] + fn test_weighted_choice() { + // this makes assumptions about the internal implementation of + // WeightedChoice. It may fail when the implementation in + // `distributions::uniform::UniformInt` changes. + + macro_rules! t { + ($items:expr, $expected:expr) => {{ + let mut items = $items; + let mut total_weight = 0; + for item in &items { total_weight += item.weight; } + + let wc = WeightedChoice::new(&mut items); + let expected = $expected; + + // Use extremely large steps between the random numbers, because + // we test with small ranges and `UniformInt` is designed to prefer + // the most significant bits. + let mut rng = StepRng::new(0, !0 / (total_weight as u64)); + + for &val in expected.iter() { + assert_eq!(wc.sample(&mut rng), val) + } + }} + } + + t!([Weighted { weight: 1, item: 10}], [10]); + + // skip some + t!([Weighted { weight: 0, item: 20}, + Weighted { weight: 2, item: 21}, + Weighted { weight: 0, item: 22}, + Weighted { weight: 1, item: 23}], + [21, 21, 23]); + + // different weights + t!([Weighted { weight: 4, item: 30}, + Weighted { weight: 3, item: 31}], + [30, 31, 30, 31, 30, 31, 30]); + + // check that we're binary searching + // correctly with some vectors of odd + // length. + t!([Weighted { weight: 1, item: 40}, + Weighted { weight: 1, item: 41}, + Weighted { weight: 1, item: 42}, + Weighted { weight: 1, item: 43}, + Weighted { weight: 1, item: 44}], + [40, 41, 42, 43, 44]); + t!([Weighted { weight: 1, item: 50}, + Weighted { weight: 1, item: 51}, + Weighted { weight: 1, item: 52}, + Weighted { weight: 1, item: 53}, + Weighted { weight: 1, item: 54}, + Weighted { weight: 1, item: 55}, + Weighted { weight: 1, item: 56}], + [50, 54, 51, 55, 52, 56, 53]); + } + + #[test] + #[allow(deprecated)] + fn test_weighted_clone_initialization() { + let initial : Weighted = Weighted {weight: 1, item: 1}; + let clone = initial.clone(); + assert_eq!(initial.weight, clone.weight); + assert_eq!(initial.item, clone.item); + } + + #[test] #[should_panic] + #[allow(deprecated)] + fn test_weighted_clone_change_weight() { + let initial : Weighted = Weighted {weight: 1, item: 1}; + let mut clone = initial.clone(); + clone.weight = 5; + assert_eq!(initial.weight, clone.weight); + } + + #[test] #[should_panic] + #[allow(deprecated)] + fn test_weighted_clone_change_item() { + let initial : Weighted = Weighted {weight: 1, item: 1}; + let mut clone = initial.clone(); + clone.item = 5; + assert_eq!(initial.item, clone.item); + + } + + #[test] #[should_panic] + #[allow(deprecated)] + fn test_weighted_choice_no_items() { + WeightedChoice::::new(&mut []); + } + #[test] #[should_panic] + #[allow(deprecated)] + fn test_weighted_choice_zero_weight() { + WeightedChoice::new(&mut [Weighted { weight: 0, item: 0}, + Weighted { weight: 0, item: 1}]); + } + #[test] #[should_panic] + #[allow(deprecated)] + fn test_weighted_choice_weight_overflows() { + let x = ::core::u32::MAX / 2; // x + x + 2 is the overflow + WeightedChoice::new(&mut [Weighted { weight: x, item: 0 }, + Weighted { weight: 1, item: 1 }, + Weighted { weight: x, item: 2 }, + Weighted { weight: 1, item: 3 }]); + } + + #[cfg(feature="std")] + #[test] + fn test_distributions_iter() { + use distributions::Normal; + let mut rng = ::test::rng(210); + let distr = Normal::new(10.0, 10.0); + let results: Vec<_> = distr.sample_iter(&mut rng).take(100).collect(); + println!("{:?}", results); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/normal.rs b/vendor/registry-40351f815f426200/rand/src/distributions/normal.rs new file mode 100644 index 000000000..089865e0a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/normal.rs @@ -0,0 +1,197 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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. + +//! The normal and derived distributions. + +use Rng; +use distributions::{ziggurat_tables, Distribution, Open01}; +use distributions::utils::ziggurat; + +/// Samples floating-point numbers according to the normal distribution +/// `N(0, 1)` (a.k.a. a standard normal, or Gaussian). This is equivalent to +/// `Normal::new(0.0, 1.0)` but faster. +/// +/// See `Normal` for the general normal distribution. +/// +/// Implemented via the ZIGNOR variant[^1] of the Ziggurat method. +/// +/// [^1]: Jurgen A. Doornik (2005). [*An Improved Ziggurat Method to +/// Generate Normal Random Samples*]( +/// https://www.doornik.com/research/ziggurat.pdf). +/// Nuffield College, Oxford +/// +/// # Example +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::StandardNormal; +/// +/// let val: f64 = SmallRng::from_entropy().sample(StandardNormal); +/// println!("{}", val); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct StandardNormal; + +impl Distribution for StandardNormal { + fn sample(&self, rng: &mut R) -> f64 { + #[inline] + fn pdf(x: f64) -> f64 { + (-x*x/2.0).exp() + } + #[inline] + fn zero_case(rng: &mut R, u: f64) -> f64 { + // compute a random number in the tail by hand + + // strange initial conditions, because the loop is not + // do-while, so the condition should be true on the first + // run, they get overwritten anyway (0 < 1, so these are + // good). + let mut x = 1.0f64; + let mut y = 0.0f64; + + while -2.0 * y < x * x { + let x_: f64 = rng.sample(Open01); + let y_: f64 = rng.sample(Open01); + + x = x_.ln() / ziggurat_tables::ZIG_NORM_R; + y = y_.ln(); + } + + if u < 0.0 { x - ziggurat_tables::ZIG_NORM_R } else { ziggurat_tables::ZIG_NORM_R - x } + } + + ziggurat(rng, true, // this is symmetric + &ziggurat_tables::ZIG_NORM_X, + &ziggurat_tables::ZIG_NORM_F, + pdf, zero_case) + } +} + +/// The normal distribution `N(mean, std_dev**2)`. +/// +/// This uses the ZIGNOR variant of the Ziggurat method, see [`StandardNormal`] +/// for more details. +/// +/// Note that [`StandardNormal`] is an optimised implementation for mean 0, and +/// standard deviation 1. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Normal, Distribution}; +/// +/// // mean 2, standard deviation 3 +/// let normal = Normal::new(2.0, 3.0); +/// let v = normal.sample(&mut rand::thread_rng()); +/// println!("{} is from a N(2, 9) distribution", v) +/// ``` +/// +/// [`StandardNormal`]: crate::distributions::StandardNormal +#[derive(Clone, Copy, Debug)] +pub struct Normal { + mean: f64, + std_dev: f64, +} + +impl Normal { + /// Construct a new `Normal` distribution with the given mean and + /// standard deviation. + /// + /// # Panics + /// + /// Panics if `std_dev < 0`. + #[inline] + pub fn new(mean: f64, std_dev: f64) -> Normal { + assert!(std_dev >= 0.0, "Normal::new called with `std_dev` < 0"); + Normal { + mean, + std_dev + } + } +} +impl Distribution for Normal { + fn sample(&self, rng: &mut R) -> f64 { + let n = rng.sample(StandardNormal); + self.mean + self.std_dev * n + } +} + + +/// The log-normal distribution `ln N(mean, std_dev**2)`. +/// +/// If `X` is log-normal distributed, then `ln(X)` is `N(mean, std_dev**2)` +/// distributed. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{LogNormal, Distribution}; +/// +/// // mean 2, standard deviation 3 +/// let log_normal = LogNormal::new(2.0, 3.0); +/// let v = log_normal.sample(&mut rand::thread_rng()); +/// println!("{} is from an ln N(2, 9) distribution", v) +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct LogNormal { + norm: Normal +} + +impl LogNormal { + /// Construct a new `LogNormal` distribution with the given mean + /// and standard deviation. + /// + /// # Panics + /// + /// Panics if `std_dev < 0`. + #[inline] + pub fn new(mean: f64, std_dev: f64) -> LogNormal { + assert!(std_dev >= 0.0, "LogNormal::new called with `std_dev` < 0"); + LogNormal { norm: Normal::new(mean, std_dev) } + } +} +impl Distribution for LogNormal { + fn sample(&self, rng: &mut R) -> f64 { + self.norm.sample(rng).exp() + } +} + +#[cfg(test)] +mod tests { + use distributions::Distribution; + use super::{Normal, LogNormal}; + + #[test] + fn test_normal() { + let norm = Normal::new(10.0, 10.0); + let mut rng = ::test::rng(210); + for _ in 0..1000 { + norm.sample(&mut rng); + } + } + #[test] + #[should_panic] + fn test_normal_invalid_sd() { + Normal::new(10.0, -1.0); + } + + + #[test] + fn test_log_normal() { + let lnorm = LogNormal::new(10.0, 10.0); + let mut rng = ::test::rng(211); + for _ in 0..1000 { + lnorm.sample(&mut rng); + } + } + #[test] + #[should_panic] + fn test_log_normal_invalid_sd() { + LogNormal::new(10.0, -1.0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/other.rs b/vendor/registry-40351f815f426200/rand/src/distributions/other.rs new file mode 100644 index 000000000..2295f790d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/other.rs @@ -0,0 +1,219 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The implementations of the `Standard` distribution for other built-in types. + +use core::char; +use core::num::Wrapping; + +use {Rng}; +use distributions::{Distribution, Standard, Uniform}; + +// ----- Sampling distributions ----- + +/// Sample a `char`, uniformly distributed over ASCII letters and numbers: +/// a-z, A-Z and 0-9. +/// +/// # Example +/// +/// ``` +/// use std::iter; +/// use rand::{Rng, thread_rng}; +/// use rand::distributions::Alphanumeric; +/// +/// let mut rng = thread_rng(); +/// let chars: String = iter::repeat(()) +/// .map(|()| rng.sample(Alphanumeric)) +/// .take(7) +/// .collect(); +/// println!("Random chars: {}", chars); +/// ``` +#[derive(Debug)] +pub struct Alphanumeric; + + +// ----- Implementations of distributions ----- + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> char { + // A valid `char` is either in the interval `[0, 0xD800)` or + // `(0xDFFF, 0x11_0000)`. All `char`s must therefore be in + // `[0, 0x11_0000)` but not in the "gap" `[0xD800, 0xDFFF]` which is + // reserved for surrogates. This is the size of that gap. + const GAP_SIZE: u32 = 0xDFFF - 0xD800 + 1; + + // Uniform::new(0, 0x11_0000 - GAP_SIZE) can also be used but it + // seemed slower. + let range = Uniform::new(GAP_SIZE, 0x11_0000); + + let mut n = range.sample(rng); + if n <= 0xDFFF { + n -= GAP_SIZE; + } + unsafe { char::from_u32_unchecked(n) } + } +} + +impl Distribution for Alphanumeric { + fn sample(&self, rng: &mut R) -> char { + const RANGE: u32 = 26 + 26 + 10; + const GEN_ASCII_STR_CHARSET: &[u8] = + b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\ + abcdefghijklmnopqrstuvwxyz\ + 0123456789"; + // We can pick from 62 characters. This is so close to a power of 2, 64, + // that we can do better than `Uniform`. Use a simple bitshift and + // rejection sampling. We do not use a bitmask, because for small RNGs + // the most significant bits are usually of higher quality. + loop { + let var = rng.next_u32() >> (32 - 6); + if var < RANGE { + return GEN_ASCII_STR_CHARSET[var as usize] as char + } + } + } +} + +impl Distribution for Standard { + #[inline] + fn sample(&self, rng: &mut R) -> bool { + // We can compare against an arbitrary bit of an u32 to get a bool. + // Because the least significant bits of a lower quality RNG can have + // simple patterns, we compare against the most significant bit. This is + // easiest done using a sign test. + (rng.next_u32() as i32) < 0 + } +} + +macro_rules! tuple_impl { + // use variables to indicate the arity of the tuple + ($($tyvar:ident),* ) => { + // the trailing commas are for the 1 tuple + impl< $( $tyvar ),* > + Distribution<( $( $tyvar ),* , )> + for Standard + where $( Standard: Distribution<$tyvar> ),* + { + #[inline] + fn sample(&self, _rng: &mut R) -> ( $( $tyvar ),* , ) { + ( + // use the $tyvar's to get the appropriate number of + // repeats (they're not actually needed) + $( + _rng.gen::<$tyvar>() + ),* + , + ) + } + } + } +} + +impl Distribution<()> for Standard { + #[inline] + fn sample(&self, _: &mut R) -> () { () } +} +tuple_impl!{A} +tuple_impl!{A, B} +tuple_impl!{A, B, C} +tuple_impl!{A, B, C, D} +tuple_impl!{A, B, C, D, E} +tuple_impl!{A, B, C, D, E, F} +tuple_impl!{A, B, C, D, E, F, G} +tuple_impl!{A, B, C, D, E, F, G, H} +tuple_impl!{A, B, C, D, E, F, G, H, I} +tuple_impl!{A, B, C, D, E, F, G, H, I, J} +tuple_impl!{A, B, C, D, E, F, G, H, I, J, K} +tuple_impl!{A, B, C, D, E, F, G, H, I, J, K, L} + +macro_rules! array_impl { + // recursive, given at least one type parameter: + {$n:expr, $t:ident, $($ts:ident,)*} => { + array_impl!{($n - 1), $($ts,)*} + + impl Distribution<[T; $n]> for Standard where Standard: Distribution { + #[inline] + fn sample(&self, _rng: &mut R) -> [T; $n] { + [_rng.gen::<$t>(), $(_rng.gen::<$ts>()),*] + } + } + }; + // empty case: + {$n:expr,} => { + impl Distribution<[T; $n]> for Standard { + fn sample(&self, _rng: &mut R) -> [T; $n] { [] } + } + }; +} + +array_impl!{32, 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,} + +impl Distribution> for Standard where Standard: Distribution { + #[inline] + fn sample(&self, rng: &mut R) -> Option { + // UFCS is needed here: https://github.com/rust-lang/rust/issues/24066 + if rng.gen::() { + Some(rng.gen()) + } else { + None + } + } +} + +impl Distribution> for Standard where Standard: Distribution { + #[inline] + fn sample(&self, rng: &mut R) -> Wrapping { + Wrapping(rng.gen()) + } +} + + +#[cfg(test)] +mod tests { + use {Rng, RngCore, Standard}; + use distributions::Alphanumeric; + #[cfg(all(not(feature="std"), feature="alloc"))] use alloc::string::String; + + #[test] + fn test_misc() { + let rng: &mut RngCore = &mut ::test::rng(820); + + rng.sample::(Standard); + rng.sample::(Standard); + } + + #[cfg(feature="alloc")] + #[test] + fn test_chars() { + use core::iter; + let mut rng = ::test::rng(805); + + // Test by generating a relatively large number of chars, so we also + // take the rejection sampling path. + let word: String = iter::repeat(()) + .map(|()| rng.gen::()).take(1000).collect(); + assert!(word.len() != 0); + } + + #[test] + fn test_alphanumeric() { + let mut rng = ::test::rng(806); + + // Test by generating a relatively large number of chars, so we also + // take the rejection sampling path. + let mut incorrect = false; + for _ in 0..100 { + let c = rng.sample(Alphanumeric); + incorrect |= !((c >= '0' && c <= '9') || + (c >= 'A' && c <= 'Z') || + (c >= 'a' && c <= 'z') ); + } + assert!(incorrect == false); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/pareto.rs b/vendor/registry-40351f815f426200/rand/src/distributions/pareto.rs new file mode 100644 index 000000000..744a157fd --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/pareto.rs @@ -0,0 +1,74 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The Pareto distribution. + +use Rng; +use distributions::{Distribution, OpenClosed01}; + +/// Samples floating-point numbers according to the Pareto distribution +/// +/// # Example +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::Pareto; +/// +/// let val: f64 = SmallRng::from_entropy().sample(Pareto::new(1., 2.)); +/// println!("{}", val); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Pareto { + scale: f64, + inv_neg_shape: f64, +} + +impl Pareto { + /// Construct a new Pareto distribution with given `scale` and `shape`. + /// + /// In the literature, `scale` is commonly written as xm or k and + /// `shape` is often written as α. + /// + /// # Panics + /// + /// `scale` and `shape` have to be non-zero and positive. + pub fn new(scale: f64, shape: f64) -> Pareto { + assert!((scale > 0.) & (shape > 0.)); + Pareto { scale, inv_neg_shape: -1.0 / shape } + } +} + +impl Distribution for Pareto { + fn sample(&self, rng: &mut R) -> f64 { + let u: f64 = rng.sample(OpenClosed01); + self.scale * u.powf(self.inv_neg_shape) + } +} + +#[cfg(test)] +mod tests { + use distributions::Distribution; + use super::Pareto; + + #[test] + #[should_panic] + fn invalid() { + Pareto::new(0., 0.); + } + + #[test] + fn sample() { + let scale = 1.0; + let shape = 2.0; + let d = Pareto::new(scale, shape); + let mut rng = ::test::rng(1); + for _ in 0..1000 { + let r = d.sample(&mut rng); + assert!(r >= scale); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/poisson.rs b/vendor/registry-40351f815f426200/rand/src/distributions/poisson.rs new file mode 100644 index 000000000..1244caada --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/poisson.rs @@ -0,0 +1,157 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2016-2017 The Rust Project 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. + +//! The Poisson distribution. + +use Rng; +use distributions::{Distribution, Cauchy}; +use distributions::utils::log_gamma; + +/// The Poisson distribution `Poisson(lambda)`. +/// +/// This distribution has a density function: +/// `f(k) = lambda^k * exp(-lambda) / k!` for `k >= 0`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Poisson, Distribution}; +/// +/// let poi = Poisson::new(2.0); +/// let v = poi.sample(&mut rand::thread_rng()); +/// println!("{} is from a Poisson(2) distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Poisson { + lambda: f64, + // precalculated values + exp_lambda: f64, + log_lambda: f64, + sqrt_2lambda: f64, + magic_val: f64, +} + +impl Poisson { + /// Construct a new `Poisson` with the given shape parameter + /// `lambda`. Panics if `lambda <= 0`. + pub fn new(lambda: f64) -> Poisson { + assert!(lambda > 0.0, "Poisson::new called with lambda <= 0"); + let log_lambda = lambda.ln(); + Poisson { + lambda, + exp_lambda: (-lambda).exp(), + log_lambda, + sqrt_2lambda: (2.0 * lambda).sqrt(), + magic_val: lambda * log_lambda - log_gamma(1.0 + lambda), + } + } +} + +impl Distribution for Poisson { + fn sample(&self, rng: &mut R) -> u64 { + // using the algorithm from Numerical Recipes in C + + // for low expected values use the Knuth method + if self.lambda < 12.0 { + let mut result = 0; + let mut p = 1.0; + while p > self.exp_lambda { + p *= rng.gen::(); + result += 1; + } + result - 1 + } + // high expected values - rejection method + else { + let mut int_result: u64; + + // we use the Cauchy distribution as the comparison distribution + // f(x) ~ 1/(1+x^2) + let cauchy = Cauchy::new(0.0, 1.0); + + loop { + let mut result; + let mut comp_dev; + + loop { + // draw from the Cauchy distribution + comp_dev = rng.sample(cauchy); + // shift the peak of the comparison ditribution + result = self.sqrt_2lambda * comp_dev + self.lambda; + // repeat the drawing until we are in the range of possible values + if result >= 0.0 { + break; + } + } + // now the result is a random variable greater than 0 with Cauchy distribution + // the result should be an integer value + result = result.floor(); + int_result = result as u64; + + // this is the ratio of the Poisson distribution to the comparison distribution + // the magic value scales the distribution function to a range of approximately 0-1 + // since it is not exact, we multiply the ratio by 0.9 to avoid ratios greater than 1 + // this doesn't change the resulting distribution, only increases the rate of failed drawings + let check = 0.9 * (1.0 + comp_dev * comp_dev) + * (result * self.log_lambda - log_gamma(1.0 + result) - self.magic_val).exp(); + + // check with uniform random value - if below the threshold, we are within the target distribution + if rng.gen::() <= check { + break; + } + } + int_result + } + } +} + +#[cfg(test)] +mod test { + use distributions::Distribution; + use super::Poisson; + + #[test] + fn test_poisson_10() { + let poisson = Poisson::new(10.0); + let mut rng = ::test::rng(123); + let mut sum = 0; + for _ in 0..1000 { + sum += poisson.sample(&mut rng); + } + let avg = (sum as f64) / 1000.0; + println!("Poisson average: {}", avg); + assert!((avg - 10.0).abs() < 0.5); // not 100% certain, but probable enough + } + + #[test] + fn test_poisson_15() { + // Take the 'high expected values' path + let poisson = Poisson::new(15.0); + let mut rng = ::test::rng(123); + let mut sum = 0; + for _ in 0..1000 { + sum += poisson.sample(&mut rng); + } + let avg = (sum as f64) / 1000.0; + println!("Poisson average: {}", avg); + assert!((avg - 15.0).abs() < 0.5); // not 100% certain, but probable enough + } + + #[test] + #[should_panic] + fn test_poisson_invalid_lambda_zero() { + Poisson::new(0.0); + } + + #[test] + #[should_panic] + fn test_poisson_invalid_lambda_neg() { + Poisson::new(-10.0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/triangular.rs b/vendor/registry-40351f815f426200/rand/src/distributions/triangular.rs new file mode 100644 index 000000000..a6eef5c26 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/triangular.rs @@ -0,0 +1,86 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. +//! The triangular distribution. + +use Rng; +use distributions::{Distribution, Standard}; + +/// The triangular distribution. +/// +/// # Example +/// +/// ```rust +/// use rand::distributions::{Triangular, Distribution}; +/// +/// let d = Triangular::new(0., 5., 2.5); +/// let v = d.sample(&mut rand::thread_rng()); +/// println!("{} is from a triangular distribution", v); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Triangular { + min: f64, + max: f64, + mode: f64, +} + +impl Triangular { + /// Construct a new `Triangular` with minimum `min`, maximum `max` and mode + /// `mode`. + /// + /// # Panics + /// + /// If `max < mode`, `mode < max` or `max == min`. + /// + #[inline] + pub fn new(min: f64, max: f64, mode: f64) -> Triangular { + assert!(max >= mode); + assert!(mode >= min); + assert!(max != min); + Triangular { min, max, mode } + } +} + +impl Distribution for Triangular { + #[inline] + fn sample(&self, rng: &mut R) -> f64 { + let f: f64 = rng.sample(Standard); + let diff_mode_min = self.mode - self.min; + let diff_max_min = self.max - self.min; + if f * diff_max_min < diff_mode_min { + self.min + (f * diff_max_min * diff_mode_min).sqrt() + } else { + self.max - ((1. - f) * diff_max_min * (self.max - self.mode)).sqrt() + } + } +} + +#[cfg(test)] +mod test { + use distributions::Distribution; + use super::Triangular; + + #[test] + fn test_new() { + for &(min, max, mode) in &[ + (-1., 1., 0.), (1., 2., 1.), (5., 25., 25.), (1e-5, 1e5, 1e-3), + (0., 1., 0.9), (-4., -0.5, -2.), (-13.039, 8.41, 1.17), + ] { + println!("{} {} {}", min, max, mode); + let _ = Triangular::new(min, max, mode); + } + } + + #[test] + fn test_sample() { + let norm = Triangular::new(0., 1., 0.5); + let mut rng = ::test::rng(1); + for _ in 0..1000 { + norm.sample(&mut rng); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/uniform.rs b/vendor/registry-40351f815f426200/rand/src/distributions/uniform.rs new file mode 100644 index 000000000..19b49345b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/uniform.rs @@ -0,0 +1,1283 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017 The Rust Project 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 distribution uniformly sampling numbers within a given range. +//! +//! [`Uniform`] is the standard distribution to sample uniformly from a range; +//! e.g. `Uniform::new_inclusive(1, 6)` can sample integers from 1 to 6, like a +//! standard die. [`Rng::gen_range`] supports any type supported by +//! [`Uniform`]. +//! +//! This distribution is provided with support for several primitive types +//! (all integer and floating-point types) as well as [`std::time::Duration`], +//! and supports extension to user-defined types via a type-specific *back-end* +//! implementation. +//! +//! The types [`UniformInt`], [`UniformFloat`] and [`UniformDuration`] are the +//! back-ends supporting sampling from primitive integer and floating-point +//! ranges as well as from [`std::time::Duration`]; these types do not normally +//! need to be used directly (unless implementing a derived back-end). +//! +//! # Example usage +//! +//! ``` +//! use rand::{Rng, thread_rng}; +//! use rand::distributions::Uniform; +//! +//! let mut rng = thread_rng(); +//! let side = Uniform::new(-10.0, 10.0); +//! +//! // sample between 1 and 10 points +//! for _ in 0..rng.gen_range(1, 11) { +//! // sample a point from the square with sides -10 - 10 in two dimensions +//! let (x, y) = (rng.sample(side), rng.sample(side)); +//! println!("Point: {}, {}", x, y); +//! } +//! ``` +//! +//! # Extending `Uniform` to support a custom type +//! +//! To extend [`Uniform`] to support your own types, write a back-end which +//! implements the [`UniformSampler`] trait, then implement the [`SampleUniform`] +//! helper trait to "register" your back-end. See the `MyF32` example below. +//! +//! At a minimum, the back-end needs to store any parameters needed for sampling +//! (e.g. the target range) and implement `new`, `new_inclusive` and `sample`. +//! Those methods should include an assert to check the range is valid (i.e. +//! `low < high`). The example below merely wraps another back-end. +//! +//! The `new`, `new_inclusive` and `sample_single` functions use arguments of +//! type SampleBorrow in order to support passing in values by reference or +//! by value. In the implementation of these functions, you can choose to +//! simply use the reference returned by [`SampleBorrow::borrow`], or you can choose +//! to copy or clone the value, whatever is appropriate for your type. +//! +//! ``` +//! use rand::prelude::*; +//! use rand::distributions::uniform::{Uniform, SampleUniform, +//! UniformSampler, UniformFloat, SampleBorrow}; +//! +//! struct MyF32(f32); +//! +//! #[derive(Clone, Copy, Debug)] +//! struct UniformMyF32 { +//! inner: UniformFloat, +//! } +//! +//! impl UniformSampler for UniformMyF32 { +//! type X = MyF32; +//! fn new(low: B1, high: B2) -> Self +//! where B1: SampleBorrow + Sized, +//! B2: SampleBorrow + Sized +//! { +//! UniformMyF32 { +//! inner: UniformFloat::::new(low.borrow().0, high.borrow().0), +//! } +//! } +//! fn new_inclusive(low: B1, high: B2) -> Self +//! where B1: SampleBorrow + Sized, +//! B2: SampleBorrow + Sized +//! { +//! UniformSampler::new(low, high) +//! } +//! fn sample(&self, rng: &mut R) -> Self::X { +//! MyF32(self.inner.sample(rng)) +//! } +//! } +//! +//! impl SampleUniform for MyF32 { +//! type Sampler = UniformMyF32; +//! } +//! +//! let (low, high) = (MyF32(17.0f32), MyF32(22.0f32)); +//! let uniform = Uniform::new(low, high); +//! let x = uniform.sample(&mut thread_rng()); +//! ``` +//! +//! [`SampleUniform`]: crate::distributions::uniform::SampleUniform +//! [`UniformSampler`]: crate::distributions::uniform::UniformSampler +//! [`UniformInt`]: crate::distributions::uniform::UniformInt +//! [`UniformFloat`]: crate::distributions::uniform::UniformFloat +//! [`UniformDuration`]: crate::distributions::uniform::UniformDuration +//! [`SampleBorrow::borrow`]: crate::distributions::uniform::SampleBorrow::borrow + +#[cfg(feature = "std")] +use std::time::Duration; +#[cfg(all(not(feature = "std"), rustc_1_25))] +use core::time::Duration; + +use Rng; +use distributions::Distribution; +use distributions::float::IntoFloat; +use distributions::utils::{WideningMultiply, FloatSIMDUtils, FloatAsSIMD, BoolAsSIMD}; + +#[cfg(not(feature = "std"))] +#[allow(unused_imports)] // rustc doesn't detect that this is actually used +use distributions::utils::Float; + + +#[cfg(feature="simd_support")] +use packed_simd::*; + +/// Sample values uniformly between two bounds. +/// +/// [`Uniform::new`] and [`Uniform::new_inclusive`] construct a uniform +/// distribution sampling from the given range; these functions may do extra +/// work up front to make sampling of multiple values faster. +/// +/// When sampling from a constant range, many calculations can happen at +/// compile-time and all methods should be fast; for floating-point ranges and +/// the full range of integer types this should have comparable performance to +/// the `Standard` distribution. +/// +/// Steps are taken to avoid bias which might be present in naive +/// implementations; for example `rng.gen::() % 170` samples from the range +/// `[0, 169]` but is twice as likely to select numbers less than 85 than other +/// values. Further, the implementations here give more weight to the high-bits +/// generated by the RNG than the low bits, since with some RNGs the low-bits +/// are of lower quality than the high bits. +/// +/// Implementations must sample in `[low, high)` range for +/// `Uniform::new(low, high)`, i.e., excluding `high`. In particular care must +/// be taken to ensure that rounding never results values `< low` or `>= high`. +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{Distribution, Uniform}; +/// +/// fn main() { +/// let between = Uniform::from(10..10000); +/// let mut rng = rand::thread_rng(); +/// let mut sum = 0; +/// for _ in 0..1000 { +/// sum += between.sample(&mut rng); +/// } +/// println!("{}", sum); +/// } +/// ``` +/// +/// [`new`]: Uniform::new +/// [`new_inclusive`]: Uniform::new_inclusive +#[derive(Clone, Copy, Debug)] +pub struct Uniform { + inner: X::Sampler, +} + +impl Uniform { + /// Create a new `Uniform` instance which samples uniformly from the half + /// open range `[low, high)` (excluding `high`). Panics if `low >= high`. + pub fn new(low: B1, high: B2) -> Uniform + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + Uniform { inner: X::Sampler::new(low, high) } + } + + /// Create a new `Uniform` instance which samples uniformly from the closed + /// range `[low, high]` (inclusive). Panics if `low > high`. + pub fn new_inclusive(low: B1, high: B2) -> Uniform + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + Uniform { inner: X::Sampler::new_inclusive(low, high) } + } +} + +impl Distribution for Uniform { + fn sample(&self, rng: &mut R) -> X { + self.inner.sample(rng) + } +} + +/// Helper trait for creating objects using the correct implementation of +/// [`UniformSampler`] for the sampling type. +/// +/// See the [module documentation] on how to implement [`Uniform`] range +/// sampling for a custom type. +/// +/// [module documentation]: crate::distributions::uniform +pub trait SampleUniform: Sized { + /// The `UniformSampler` implementation supporting type `X`. + type Sampler: UniformSampler; +} + +/// Helper trait handling actual uniform sampling. +/// +/// See the [module documentation] on how to implement [`Uniform`] range +/// sampling for a custom type. +/// +/// Implementation of [`sample_single`] is optional, and is only useful when +/// the implementation can be faster than `Self::new(low, high).sample(rng)`. +/// +/// [module documentation]: crate::distributions::uniform +/// [`sample_single`]: UniformSampler::sample_single +pub trait UniformSampler: Sized { + /// The type sampled by this implementation. + type X; + + /// Construct self, with inclusive lower bound and exclusive upper bound + /// `[low, high)`. + /// + /// Usually users should not call this directly but instead use + /// `Uniform::new`, which asserts that `low < high` before calling this. + fn new(low: B1, high: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized; + + /// Construct self, with inclusive bounds `[low, high]`. + /// + /// Usually users should not call this directly but instead use + /// `Uniform::new_inclusive`, which asserts that `low <= high` before + /// calling this. + fn new_inclusive(low: B1, high: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized; + + /// Sample a value. + fn sample(&self, rng: &mut R) -> Self::X; + + /// Sample a single value uniformly from a range with inclusive lower bound + /// and exclusive upper bound `[low, high)`. + /// + /// Usually users should not call this directly but instead use + /// `Uniform::sample_single`, which asserts that `low < high` before calling + /// this. + /// + /// Via this method, implementations can provide a method optimized for + /// sampling only a single value from the specified range. The default + /// implementation simply calls `UniformSampler::new` then `sample` on the + /// result. + fn sample_single(low: B1, high: B2, rng: &mut R) + -> Self::X + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let uniform: Self = UniformSampler::new(low, high); + uniform.sample(rng) + } +} + +impl From<::core::ops::Range> for Uniform { + fn from(r: ::core::ops::Range) -> Uniform { + Uniform::new(r.start, r.end) + } +} + +#[cfg(rustc_1_27)] +impl From<::core::ops::RangeInclusive> for Uniform { + fn from(r: ::core::ops::RangeInclusive) -> Uniform { + Uniform::new_inclusive(r.start(), r.end()) + } +} + +/// Helper trait similar to [`Borrow`] but implemented +/// only for SampleUniform and references to SampleUniform in +/// order to resolve ambiguity issues. +/// +/// [`Borrow`]: std::borrow::Borrow +pub trait SampleBorrow { + /// Immutably borrows from an owned value. See [`Borrow::borrow`] + /// + /// [`Borrow::borrow`]: std::borrow::Borrow::borrow + fn borrow(&self) -> &Borrowed; +} +impl SampleBorrow for Borrowed where Borrowed: SampleUniform { + #[inline(always)] + fn borrow(&self) -> &Borrowed { self } +} +impl<'a, Borrowed> SampleBorrow for &'a Borrowed where Borrowed: SampleUniform { + #[inline(always)] + fn borrow(&self) -> &Borrowed { *self } +} + +//////////////////////////////////////////////////////////////////////////////// + +// What follows are all back-ends. + + +/// The back-end implementing [`UniformSampler`] for integer types. +/// +/// Unless you are implementing [`UniformSampler`] for your own type, this type +/// should not be used directly, use [`Uniform`] instead. +/// +/// # Implementation notes +/// +/// For a closed range, the number of possible numbers we should generate is +/// `range = (high - low + 1)`. It is not possible to end up with a uniform +/// distribution if we map *all* the random integers that can be generated to +/// this range. We have to map integers from a `zone` that is a multiple of the +/// range. The rest of the integers, that cause a bias, are rejected. +/// +/// The problem with `range` is that to cover the full range of the type, it has +/// to store `unsigned_max + 1`, which can't be represented. But if the range +/// covers the full range of the type, no modulus is needed. A range of size 0 +/// can't exist, so we use that to represent this special case. Wrapping +/// arithmetic even makes representing `unsigned_max + 1` as 0 simple. +/// +/// We don't calculate `zone` directly, but first calculate the number of +/// integers to reject. To handle `unsigned_max + 1` not fitting in the type, +/// we use: +/// `ints_to_reject = (unsigned_max + 1) % range;` +/// `ints_to_reject = (unsigned_max - range + 1) % range;` +/// +/// The smallest integer PRNGs generate is `u32`. That is why for small integer +/// sizes (`i8`/`u8` and `i16`/`u16`) there is an optimization: don't pick the +/// largest zone that can fit in the small type, but pick the largest zone that +/// can fit in an `u32`. `ints_to_reject` is always less than half the size of +/// the small integer. This means the first bit of `zone` is always 1, and so +/// are all the other preceding bits of a larger integer. The easiest way to +/// grow the `zone` for the larger type is to simply sign extend it. +/// +/// An alternative to using a modulus is widening multiply: After a widening +/// multiply by `range`, the result is in the high word. Then comparing the low +/// word against `zone` makes sure our distribution is uniform. +#[derive(Clone, Copy, Debug)] +pub struct UniformInt { + low: X, + range: X, + zone: X, +} + +macro_rules! uniform_int_impl { + ($ty:ty, $signed:ty, $unsigned:ident, + $i_large:ident, $u_large:ident) => { + impl SampleUniform for $ty { + type Sampler = UniformInt<$ty>; + } + + impl UniformSampler for UniformInt<$ty> { + // We play free and fast with unsigned vs signed here + // (when $ty is signed), but that's fine, since the + // contract of this macro is for $ty and $unsigned to be + // "bit-equal", so casting between them is a no-op. + + type X = $ty; + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low < high, "Uniform::new called with `low >= high`"); + UniformSampler::new_inclusive(low, high - 1) + } + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new_inclusive(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low <= high, + "Uniform::new_inclusive called with `low > high`"); + let unsigned_max = ::core::$unsigned::MAX; + + let range = high.wrapping_sub(low).wrapping_add(1) as $unsigned; + let ints_to_reject = + if range > 0 { + (unsigned_max - range + 1) % range + } else { + 0 + }; + let zone = unsigned_max - ints_to_reject; + + UniformInt { + low: low, + // These are really $unsigned values, but store as $ty: + range: range as $ty, + zone: zone as $ty + } + } + + fn sample(&self, rng: &mut R) -> Self::X { + let range = self.range as $unsigned as $u_large; + if range > 0 { + // Grow `zone` to fit a type of at least 32 bits, by + // sign-extending it (the first bit is always 1, so are all + // the preceding bits of the larger type). + // For types that already have the right size, all the + // casting is a no-op. + let zone = self.zone as $signed as $i_large as $u_large; + loop { + let v: $u_large = rng.gen(); + let (hi, lo) = v.wmul(range); + if lo <= zone { + return self.low.wrapping_add(hi as $ty); + } + } + } else { + // Sample from the entire integer range. + rng.gen() + } + } + + fn sample_single(low_b: B1, high_b: B2, rng: &mut R) + -> Self::X + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low < high, + "Uniform::sample_single called with low >= high"); + let range = high.wrapping_sub(low) as $unsigned as $u_large; + let zone = + if ::core::$unsigned::MAX <= ::core::u16::MAX as $unsigned { + // Using a modulus is faster than the approximation for + // i8 and i16. I suppose we trade the cost of one + // modulus for near-perfect branch prediction. + let unsigned_max: $u_large = ::core::$u_large::MAX; + let ints_to_reject = (unsigned_max - range + 1) % range; + unsigned_max - ints_to_reject + } else { + // conservative but fast approximation. `- 1` is necessary to allow the + // same comparison without bias. + (range << range.leading_zeros()).wrapping_sub(1) + }; + + loop { + let v: $u_large = rng.gen(); + let (hi, lo) = v.wmul(range); + if lo <= zone { + return low.wrapping_add(hi as $ty); + } + } + } + } + } +} + +uniform_int_impl! { i8, i8, u8, i32, u32 } +uniform_int_impl! { i16, i16, u16, i32, u32 } +uniform_int_impl! { i32, i32, u32, i32, u32 } +uniform_int_impl! { i64, i64, u64, i64, u64 } +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] +uniform_int_impl! { i128, i128, u128, u128, u128 } +uniform_int_impl! { isize, isize, usize, isize, usize } +uniform_int_impl! { u8, i8, u8, i32, u32 } +uniform_int_impl! { u16, i16, u16, i32, u32 } +uniform_int_impl! { u32, i32, u32, i32, u32 } +uniform_int_impl! { u64, i64, u64, i64, u64 } +uniform_int_impl! { usize, isize, usize, isize, usize } +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] +uniform_int_impl! { u128, u128, u128, i128, u128 } + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +macro_rules! uniform_simd_int_impl { + ($ty:ident, $unsigned:ident, $u_scalar:ident) => { + // The "pick the largest zone that can fit in an `u32`" optimization + // is less useful here. Multiple lanes complicate things, we don't + // know the PRNG's minimal output size, and casting to a larger vector + // is generally a bad idea for SIMD performance. The user can still + // implement it manually. + + // TODO: look into `Uniform::::new(0u32, 100)` functionality + // perhaps `impl SampleUniform for $u_scalar`? + impl SampleUniform for $ty { + type Sampler = UniformInt<$ty>; + } + + impl UniformSampler for UniformInt<$ty> { + type X = $ty; + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low.lt(high).all(), "Uniform::new called with `low >= high`"); + UniformSampler::new_inclusive(low, high - 1) + } + + #[inline] // if the range is constant, this helps LLVM to do the + // calculations at compile-time. + fn new_inclusive(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low.le(high).all(), + "Uniform::new_inclusive called with `low > high`"); + let unsigned_max = ::core::$u_scalar::MAX; + + // NOTE: these may need to be replaced with explicitly + // wrapping operations if `packed_simd` changes + let range: $unsigned = ((high - low) + 1).cast(); + // `% 0` will panic at runtime. + let not_full_range = range.gt($unsigned::splat(0)); + // replacing 0 with `unsigned_max` allows a faster `select` + // with bitwise OR + let modulo = not_full_range.select(range, $unsigned::splat(unsigned_max)); + // wrapping addition + let ints_to_reject = (unsigned_max - range + 1) % modulo; + // When `range` is 0, `lo` of `v.wmul(range)` will always be + // zero which means only one sample is needed. + let zone = unsigned_max - ints_to_reject; + + UniformInt { + low: low, + // These are really $unsigned values, but store as $ty: + range: range.cast(), + zone: zone.cast(), + } + } + + fn sample(&self, rng: &mut R) -> Self::X { + let range: $unsigned = self.range.cast(); + let zone: $unsigned = self.zone.cast(); + + // This might seem very slow, generating a whole new + // SIMD vector for every sample rejection. For most uses + // though, the chance of rejection is small and provides good + // general performance. With multiple lanes, that chance is + // multiplied. To mitigate this, we replace only the lanes of + // the vector which fail, iteratively reducing the chance of + // rejection. The replacement method does however add a little + // overhead. Benchmarking or calculating probabilities might + // reveal contexts where this replacement method is slower. + let mut v: $unsigned = rng.gen(); + loop { + let (hi, lo) = v.wmul(range); + let mask = lo.le(zone); + if mask.all() { + let hi: $ty = hi.cast(); + // wrapping addition + let result = self.low + hi; + // `select` here compiles to a blend operation + // When `range.eq(0).none()` the compare and blend + // operations are avoided. + let v: $ty = v.cast(); + return range.gt($unsigned::splat(0)).select(result, v); + } + // Replace only the failing lanes + v = mask.select(v, rng.gen()); + } + } + } + }; + + // bulk implementation + ($(($unsigned:ident, $signed:ident),)+ $u_scalar:ident) => { + $( + uniform_simd_int_impl!($unsigned, $unsigned, $u_scalar); + uniform_simd_int_impl!($signed, $unsigned, $u_scalar); + )+ + }; +} + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +uniform_simd_int_impl! { + (u64x2, i64x2), + (u64x4, i64x4), + (u64x8, i64x8), + u64 +} + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +uniform_simd_int_impl! { + (u32x2, i32x2), + (u32x4, i32x4), + (u32x8, i32x8), + (u32x16, i32x16), + u32 +} + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +uniform_simd_int_impl! { + (u16x2, i16x2), + (u16x4, i16x4), + (u16x8, i16x8), + (u16x16, i16x16), + (u16x32, i16x32), + u16 +} + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +uniform_simd_int_impl! { + (u8x2, i8x2), + (u8x4, i8x4), + (u8x8, i8x8), + (u8x16, i8x16), + (u8x32, i8x32), + (u8x64, i8x64), + u8 +} + + +/// The back-end implementing [`UniformSampler`] for floating-point types. +/// +/// Unless you are implementing [`UniformSampler`] for your own type, this type +/// should not be used directly, use [`Uniform`] instead. +/// +/// # Implementation notes +/// +/// Instead of generating a float in the `[0, 1)` range using [`Standard`], the +/// `UniformFloat` implementation converts the output of an PRNG itself. This +/// way one or two steps can be optimized out. +/// +/// The floats are first converted to a value in the `[1, 2)` interval using a +/// transmute-based method, and then mapped to the expected range with a +/// multiply and addition. Values produced this way have what equals 22 bits of +/// random digits for an `f32`, and 52 for an `f64`. +/// +/// [`new`]: UniformSampler::new +/// [`new_inclusive`]: UniformSampler::new_inclusive +/// [`Standard`]: crate::distributions::Standard +#[derive(Clone, Copy, Debug)] +pub struct UniformFloat { + low: X, + scale: X, +} + +macro_rules! uniform_float_impl { + ($ty:ty, $uty:ident, $f_scalar:ident, $u_scalar:ident, $bits_to_discard:expr) => { + impl SampleUniform for $ty { + type Sampler = UniformFloat<$ty>; + } + + impl UniformSampler for UniformFloat<$ty> { + type X = $ty; + + fn new(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low.all_lt(high), + "Uniform::new called with `low >= high`"); + assert!(low.all_finite() && high.all_finite(), + "Uniform::new called with non-finite boundaries"); + let max_rand = <$ty>::splat((::core::$u_scalar::MAX >> $bits_to_discard) + .into_float_with_exponent(0) - 1.0); + + let mut scale = high - low; + + loop { + let mask = (scale * max_rand + low).ge_mask(high); + if mask.none() { + break; + } + scale = scale.decrease_masked(mask); + } + + debug_assert!(<$ty>::splat(0.0).all_le(scale)); + + UniformFloat { low, scale } + } + + fn new_inclusive(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low.all_le(high), + "Uniform::new_inclusive called with `low > high`"); + assert!(low.all_finite() && high.all_finite(), + "Uniform::new_inclusive called with non-finite boundaries"); + let max_rand = <$ty>::splat((::core::$u_scalar::MAX >> $bits_to_discard) + .into_float_with_exponent(0) - 1.0); + + let mut scale = (high - low) / max_rand; + + loop { + let mask = (scale * max_rand + low).gt_mask(high); + if mask.none() { + break; + } + scale = scale.decrease_masked(mask); + } + + debug_assert!(<$ty>::splat(0.0).all_le(scale)); + + UniformFloat { low, scale } + } + + fn sample(&self, rng: &mut R) -> Self::X { + // Generate a value in the range [1, 2) + let value1_2 = (rng.gen::<$uty>() >> $bits_to_discard) + .into_float_with_exponent(0); + + // Get a value in the range [0, 1) in order to avoid + // overflowing into infinity when multiplying with scale + let value0_1 = value1_2 - 1.0; + + // We don't use `f64::mul_add`, because it is not available with + // `no_std`. Furthermore, it is slower for some targets (but + // faster for others). However, the order of multiplication and + // addition is important, because on some platforms (e.g. ARM) + // it will be optimized to a single (non-FMA) instruction. + value0_1 * self.scale + self.low + } + + #[inline] + fn sample_single(low_b: B1, high_b: B2, rng: &mut R) + -> Self::X + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low.all_lt(high), + "Uniform::sample_single called with low >= high"); + let mut scale = high - low; + + loop { + // Generate a value in the range [1, 2) + let value1_2 = (rng.gen::<$uty>() >> $bits_to_discard) + .into_float_with_exponent(0); + + // Get a value in the range [0, 1) in order to avoid + // overflowing into infinity when multiplying with scale + let value0_1 = value1_2 - 1.0; + + // Doing multiply before addition allows some architectures + // to use a single instruction. + let res = value0_1 * scale + low; + + debug_assert!(low.all_le(res) || !scale.all_finite()); + if res.all_lt(high) { + return res; + } + + // This handles a number of edge cases. + // * `low` or `high` is NaN. In this case `scale` and + // `res` are going to end up as NaN. + // * `low` is negative infinity and `high` is finite. + // `scale` is going to be infinite and `res` will be + // NaN. + // * `high` is positive infinity and `low` is finite. + // `scale` is going to be infinite and `res` will + // be infinite or NaN (if value0_1 is 0). + // * `low` is negative infinity and `high` is positive + // infinity. `scale` will be infinite and `res` will + // be NaN. + // * `low` and `high` are finite, but `high - low` + // overflows to infinite. `scale` will be infinite + // and `res` will be infinite or NaN (if value0_1 is 0). + // So if `high` or `low` are non-finite, we are guaranteed + // to fail the `res < high` check above and end up here. + // + // While we technically should check for non-finite `low` + // and `high` before entering the loop, by doing the checks + // here instead, we allow the common case to avoid these + // checks. But we are still guaranteed that if `low` or + // `high` are non-finite we'll end up here and can do the + // appropriate checks. + // + // Likewise `high - low` overflowing to infinity is also + // rare, so handle it here after the common case. + let mask = !scale.finite_mask(); + if mask.any() { + assert!(low.all_finite() && high.all_finite(), + "Uniform::sample_single called with non-finite boundaries"); + scale = scale.decrease_masked(mask); + } + } + } + } + } +} + +uniform_float_impl! { f32, u32, f32, u32, 32 - 23 } +uniform_float_impl! { f64, u64, f64, u64, 64 - 52 } + +#[cfg(feature="simd_support")] +uniform_float_impl! { f32x2, u32x2, f32, u32, 32 - 23 } +#[cfg(feature="simd_support")] +uniform_float_impl! { f32x4, u32x4, f32, u32, 32 - 23 } +#[cfg(feature="simd_support")] +uniform_float_impl! { f32x8, u32x8, f32, u32, 32 - 23 } +#[cfg(feature="simd_support")] +uniform_float_impl! { f32x16, u32x16, f32, u32, 32 - 23 } + +#[cfg(feature="simd_support")] +uniform_float_impl! { f64x2, u64x2, f64, u64, 64 - 52 } +#[cfg(feature="simd_support")] +uniform_float_impl! { f64x4, u64x4, f64, u64, 64 - 52 } +#[cfg(feature="simd_support")] +uniform_float_impl! { f64x8, u64x8, f64, u64, 64 - 52 } + + + +/// The back-end implementing [`UniformSampler`] for `Duration`. +/// +/// Unless you are implementing [`UniformSampler`] for your own types, this type +/// should not be used directly, use [`Uniform`] instead. +#[cfg(any(feature = "std", rustc_1_25))] +#[derive(Clone, Copy, Debug)] +pub struct UniformDuration { + mode: UniformDurationMode, + offset: u32, +} + +#[cfg(any(feature = "std", rustc_1_25))] +#[derive(Debug, Copy, Clone)] +enum UniformDurationMode { + Small { + secs: u64, + nanos: Uniform, + }, + Medium { + nanos: Uniform, + }, + Large { + max_secs: u64, + max_nanos: u32, + secs: Uniform, + } +} + +#[cfg(any(feature = "std", rustc_1_25))] +impl SampleUniform for Duration { + type Sampler = UniformDuration; +} + +#[cfg(any(feature = "std", rustc_1_25))] +impl UniformSampler for UniformDuration { + type X = Duration; + + #[inline] + fn new(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low < high, "Uniform::new called with `low >= high`"); + UniformDuration::new_inclusive(low, high - Duration::new(0, 1)) + } + + #[inline] + fn new_inclusive(low_b: B1, high_b: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + let low = *low_b.borrow(); + let high = *high_b.borrow(); + assert!(low <= high, "Uniform::new_inclusive called with `low > high`"); + + let low_s = low.as_secs(); + let low_n = low.subsec_nanos(); + let mut high_s = high.as_secs(); + let mut high_n = high.subsec_nanos(); + + if high_n < low_n { + high_s = high_s - 1; + high_n = high_n + 1_000_000_000; + } + + let mode = if low_s == high_s { + UniformDurationMode::Small { + secs: low_s, + nanos: Uniform::new_inclusive(low_n, high_n), + } + } else { + let max = high_s + .checked_mul(1_000_000_000) + .and_then(|n| n.checked_add(high_n as u64)); + + if let Some(higher_bound) = max { + let lower_bound = low_s * 1_000_000_000 + low_n as u64; + UniformDurationMode::Medium { + nanos: Uniform::new_inclusive(lower_bound, higher_bound), + } + } else { + // An offset is applied to simplify generation of nanoseconds + let max_nanos = high_n - low_n; + UniformDurationMode::Large { + max_secs: high_s, + max_nanos, + secs: Uniform::new_inclusive(low_s, high_s), + } + } + }; + UniformDuration { + mode, + offset: low_n, + } + } + + #[inline] + fn sample(&self, rng: &mut R) -> Duration { + match self.mode { + UniformDurationMode::Small { secs, nanos } => { + let n = nanos.sample(rng); + Duration::new(secs, n) + } + UniformDurationMode::Medium { nanos } => { + let nanos = nanos.sample(rng); + Duration::new(nanos / 1_000_000_000, (nanos % 1_000_000_000) as u32) + } + UniformDurationMode::Large { max_secs, max_nanos, secs } => { + // constant folding means this is at least as fast as `gen_range` + let nano_range = Uniform::new(0, 1_000_000_000); + loop { + let s = secs.sample(rng); + let n = nano_range.sample(rng); + if !(s == max_secs && n > max_nanos) { + let sum = n + self.offset; + break Duration::new(s, sum); + } + } + } + } + } +} + +#[cfg(test)] +mod tests { + use Rng; + use rngs::mock::StepRng; + use distributions::uniform::Uniform; + use distributions::utils::FloatAsSIMD; + #[cfg(feature="simd_support")] use packed_simd::*; + + #[should_panic] + #[test] + fn test_uniform_bad_limits_equal_int() { + Uniform::new(10, 10); + } + + #[test] + fn test_uniform_good_limits_equal_int() { + let mut rng = ::test::rng(804); + let dist = Uniform::new_inclusive(10, 10); + for _ in 0..20 { + assert_eq!(rng.sample(dist), 10); + } + } + + #[should_panic] + #[test] + fn test_uniform_bad_limits_flipped_int() { + Uniform::new(10, 5); + } + + #[test] + fn test_integers() { + use core::{i8, i16, i32, i64, isize}; + use core::{u8, u16, u32, u64, usize}; + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + use core::{i128, u128}; + + let mut rng = ::test::rng(251); + macro_rules! t { + ($ty:ident, $v:expr, $le:expr, $lt:expr) => {{ + for &(low, high) in $v.iter() { + let my_uniform = Uniform::new(low, high); + for _ in 0..1000 { + let v: $ty = rng.sample(my_uniform); + assert!($le(low, v) && $lt(v, high)); + } + + let my_uniform = Uniform::new_inclusive(low, high); + for _ in 0..1000 { + let v: $ty = rng.sample(my_uniform); + assert!($le(low, v) && $le(v, high)); + } + + let my_uniform = Uniform::new(&low, high); + for _ in 0..1000 { + let v: $ty = rng.sample(my_uniform); + assert!($le(low, v) && $lt(v, high)); + } + + let my_uniform = Uniform::new_inclusive(&low, &high); + for _ in 0..1000 { + let v: $ty = rng.sample(my_uniform); + assert!($le(low, v) && $le(v, high)); + } + + for _ in 0..1000 { + let v: $ty = rng.gen_range(low, high); + assert!($le(low, v) && $lt(v, high)); + } + } + }}; + + // scalar bulk + ($($ty:ident),*) => {{ + $(t!( + $ty, + [(0, 10), (10, 127), ($ty::MIN, $ty::MAX)], + |x, y| x <= y, + |x, y| x < y + );)* + }}; + + // simd bulk + ($($ty:ident),* => $scalar:ident) => {{ + $(t!( + $ty, + [ + ($ty::splat(0), $ty::splat(10)), + ($ty::splat(10), $ty::splat(127)), + ($ty::splat($scalar::MIN), $ty::splat($scalar::MAX)), + ], + |x: $ty, y| x.le(y).all(), + |x: $ty, y| x.lt(y).all() + );)* + }}; + } + t!(i8, i16, i32, i64, isize, + u8, u16, u32, u64, usize); + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + t!(i128, u128); + + #[cfg(all(feature = "simd_support", feature = "nightly"))] + { + t!(u8x2, u8x4, u8x8, u8x16, u8x32, u8x64 => u8); + t!(i8x2, i8x4, i8x8, i8x16, i8x32, i8x64 => i8); + t!(u16x2, u16x4, u16x8, u16x16, u16x32 => u16); + t!(i16x2, i16x4, i16x8, i16x16, i16x32 => i16); + t!(u32x2, u32x4, u32x8, u32x16 => u32); + t!(i32x2, i32x4, i32x8, i32x16 => i32); + t!(u64x2, u64x4, u64x8 => u64); + t!(i64x2, i64x4, i64x8 => i64); + } + } + + #[test] + fn test_floats() { + let mut rng = ::test::rng(252); + let mut zero_rng = StepRng::new(0, 0); + let mut max_rng = StepRng::new(0xffff_ffff_ffff_ffff, 0); + macro_rules! t { + ($ty:ty, $f_scalar:ident, $bits_shifted:expr) => {{ + let v: &[($f_scalar, $f_scalar)]= + &[(0.0, 100.0), + (-1e35, -1e25), + (1e-35, 1e-25), + (-1e35, 1e35), + (<$f_scalar>::from_bits(0), <$f_scalar>::from_bits(3)), + (-<$f_scalar>::from_bits(10), -<$f_scalar>::from_bits(1)), + (-<$f_scalar>::from_bits(5), 0.0), + (-<$f_scalar>::from_bits(7), -0.0), + (10.0, ::core::$f_scalar::MAX), + (-100.0, ::core::$f_scalar::MAX), + (-::core::$f_scalar::MAX / 5.0, ::core::$f_scalar::MAX), + (-::core::$f_scalar::MAX, ::core::$f_scalar::MAX / 5.0), + (-::core::$f_scalar::MAX * 0.8, ::core::$f_scalar::MAX * 0.7), + (-::core::$f_scalar::MAX, ::core::$f_scalar::MAX), + ]; + for &(low_scalar, high_scalar) in v.iter() { + for lane in 0..<$ty>::lanes() { + let low = <$ty>::splat(0.0 as $f_scalar).replace(lane, low_scalar); + let high = <$ty>::splat(1.0 as $f_scalar).replace(lane, high_scalar); + let my_uniform = Uniform::new(low, high); + let my_incl_uniform = Uniform::new_inclusive(low, high); + for _ in 0..100 { + let v = rng.sample(my_uniform).extract(lane); + assert!(low_scalar <= v && v < high_scalar); + let v = rng.sample(my_incl_uniform).extract(lane); + assert!(low_scalar <= v && v <= high_scalar); + let v = rng.gen_range(low, high).extract(lane); + assert!(low_scalar <= v && v < high_scalar); + } + + assert_eq!(rng.sample(Uniform::new_inclusive(low, low)).extract(lane), low_scalar); + + assert_eq!(zero_rng.sample(my_uniform).extract(lane), low_scalar); + assert_eq!(zero_rng.sample(my_incl_uniform).extract(lane), low_scalar); + assert_eq!(zero_rng.gen_range(low, high).extract(lane), low_scalar); + assert!(max_rng.sample(my_uniform).extract(lane) < high_scalar); + assert!(max_rng.sample(my_incl_uniform).extract(lane) <= high_scalar); + + // Don't run this test for really tiny differences between high and low + // since for those rounding might result in selecting high for a very + // long time. + if (high_scalar - low_scalar) > 0.0001 { + let mut lowering_max_rng = + StepRng::new(0xffff_ffff_ffff_ffff, + (-1i64 << $bits_shifted) as u64); + assert!(lowering_max_rng.gen_range(low, high).extract(lane) < high_scalar); + } + } + } + + assert_eq!(rng.sample(Uniform::new_inclusive(::core::$f_scalar::MAX, + ::core::$f_scalar::MAX)), + ::core::$f_scalar::MAX); + assert_eq!(rng.sample(Uniform::new_inclusive(-::core::$f_scalar::MAX, + -::core::$f_scalar::MAX)), + -::core::$f_scalar::MAX); + }} + } + + t!(f32, f32, 32 - 23); + t!(f64, f64, 64 - 52); + #[cfg(feature="simd_support")] + { + t!(f32x2, f32, 32 - 23); + t!(f32x4, f32, 32 - 23); + t!(f32x8, f32, 32 - 23); + t!(f32x16, f32, 32 - 23); + t!(f64x2, f64, 64 - 52); + t!(f64x4, f64, 64 - 52); + t!(f64x8, f64, 64 - 52); + } + } + + #[test] + #[cfg(all(feature="std", + not(target_arch = "wasm32"), + not(target_arch = "asmjs")))] + fn test_float_assertions() { + use std::panic::catch_unwind; + use super::SampleUniform; + fn range(low: T, high: T) { + let mut rng = ::test::rng(253); + rng.gen_range(low, high); + } + + macro_rules! t { + ($ty:ident, $f_scalar:ident) => {{ + let v: &[($f_scalar, $f_scalar)] = + &[(::std::$f_scalar::NAN, 0.0), + (1.0, ::std::$f_scalar::NAN), + (::std::$f_scalar::NAN, ::std::$f_scalar::NAN), + (1.0, 0.5), + (::std::$f_scalar::MAX, -::std::$f_scalar::MAX), + (::std::$f_scalar::INFINITY, ::std::$f_scalar::INFINITY), + (::std::$f_scalar::NEG_INFINITY, ::std::$f_scalar::NEG_INFINITY), + (::std::$f_scalar::NEG_INFINITY, 5.0), + (5.0, ::std::$f_scalar::INFINITY), + (::std::$f_scalar::NAN, ::std::$f_scalar::INFINITY), + (::std::$f_scalar::NEG_INFINITY, ::std::$f_scalar::NAN), + (::std::$f_scalar::NEG_INFINITY, ::std::$f_scalar::INFINITY), + ]; + for &(low_scalar, high_scalar) in v.iter() { + for lane in 0..<$ty>::lanes() { + let low = <$ty>::splat(0.0 as $f_scalar).replace(lane, low_scalar); + let high = <$ty>::splat(1.0 as $f_scalar).replace(lane, high_scalar); + assert!(catch_unwind(|| range(low, high)).is_err()); + assert!(catch_unwind(|| Uniform::new(low, high)).is_err()); + assert!(catch_unwind(|| Uniform::new_inclusive(low, high)).is_err()); + assert!(catch_unwind(|| range(low, low)).is_err()); + assert!(catch_unwind(|| Uniform::new(low, low)).is_err()); + } + } + }} + } + + t!(f32, f32); + t!(f64, f64); + #[cfg(feature="simd_support")] + { + t!(f32x2, f32); + t!(f32x4, f32); + t!(f32x8, f32); + t!(f32x16, f32); + t!(f64x2, f64); + t!(f64x4, f64); + t!(f64x8, f64); + } + } + + + #[test] + #[cfg(any(feature = "std", rustc_1_25))] + fn test_durations() { + #[cfg(feature = "std")] + use std::time::Duration; + #[cfg(all(not(feature = "std"), rustc_1_25))] + use core::time::Duration; + + let mut rng = ::test::rng(253); + + let v = &[(Duration::new(10, 50000), Duration::new(100, 1234)), + (Duration::new(0, 100), Duration::new(1, 50)), + (Duration::new(0, 0), Duration::new(u64::max_value(), 999_999_999))]; + for &(low, high) in v.iter() { + let my_uniform = Uniform::new(low, high); + for _ in 0..1000 { + let v = rng.sample(my_uniform); + assert!(low <= v && v < high); + } + } + } + + #[test] + fn test_custom_uniform() { + use distributions::uniform::{UniformSampler, UniformFloat, SampleUniform, SampleBorrow}; + #[derive(Clone, Copy, PartialEq, PartialOrd)] + struct MyF32 { + x: f32, + } + #[derive(Clone, Copy, Debug)] + struct UniformMyF32 { + inner: UniformFloat, + } + impl UniformSampler for UniformMyF32 { + type X = MyF32; + fn new(low: B1, high: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + UniformMyF32 { + inner: UniformFloat::::new(low.borrow().x, high.borrow().x), + } + } + fn new_inclusive(low: B1, high: B2) -> Self + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized + { + UniformSampler::new(low, high) + } + fn sample(&self, rng: &mut R) -> Self::X { + MyF32 { x: self.inner.sample(rng) } + } + } + impl SampleUniform for MyF32 { + type Sampler = UniformMyF32; + } + + let (low, high) = (MyF32{ x: 17.0f32 }, MyF32{ x: 22.0f32 }); + let uniform = Uniform::new(low, high); + let mut rng = ::test::rng(804); + for _ in 0..100 { + let x: MyF32 = rng.sample(uniform); + assert!(low <= x && x < high); + } + } + + #[test] + fn test_uniform_from_std_range() { + let r = Uniform::from(2u32..7); + assert_eq!(r.inner.low, 2); + assert_eq!(r.inner.range, 5); + let r = Uniform::from(2.0f64..7.0); + assert_eq!(r.inner.low, 2.0); + assert_eq!(r.inner.scale, 5.0); + } + + #[cfg(rustc_1_27)] + #[test] + fn test_uniform_from_std_range_inclusive() { + let r = Uniform::from(2u32..=6); + assert_eq!(r.inner.low, 2); + assert_eq!(r.inner.range, 5); + let r = Uniform::from(2.0f64..=7.0); + assert_eq!(r.inner.low, 2.0); + assert!(r.inner.scale > 5.0); + assert!(r.inner.scale < 5.0 + 1e-14); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/unit_circle.rs b/vendor/registry-40351f815f426200/rand/src/distributions/unit_circle.rs new file mode 100644 index 000000000..01ab76a38 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/unit_circle.rs @@ -0,0 +1,101 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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 Rng; +use distributions::{Distribution, Uniform}; + +/// Samples uniformly from the edge of the unit circle in two dimensions. +/// +/// Implemented via a method by von Neumann[^1]. +/// +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{UnitCircle, Distribution}; +/// +/// let circle = UnitCircle::new(); +/// let v = circle.sample(&mut rand::thread_rng()); +/// println!("{:?} is from the unit circle.", v) +/// ``` +/// +/// [^1]: von Neumann, J. (1951) [*Various Techniques Used in Connection with +/// Random Digits.*](https://mcnp.lanl.gov/pdf_files/nbs_vonneumann.pdf) +/// NBS Appl. Math. Ser., No. 12. Washington, DC: U.S. Government Printing +/// Office, pp. 36-38. +#[derive(Clone, Copy, Debug)] +pub struct UnitCircle; + +impl UnitCircle { + /// Construct a new `UnitCircle` distribution. + #[inline] + pub fn new() -> UnitCircle { + UnitCircle + } +} + +impl Distribution<[f64; 2]> for UnitCircle { + #[inline] + fn sample(&self, rng: &mut R) -> [f64; 2] { + let uniform = Uniform::new(-1., 1.); + let mut x1; + let mut x2; + let mut sum; + loop { + x1 = uniform.sample(rng); + x2 = uniform.sample(rng); + sum = x1*x1 + x2*x2; + if sum < 1. { + break; + } + } + let diff = x1*x1 - x2*x2; + [diff / sum, 2.*x1*x2 / sum] + } +} + +#[cfg(test)] +mod tests { + use distributions::Distribution; + use super::UnitCircle; + + /// Assert that two numbers are almost equal to each other. + /// + /// On panic, this macro will print the values of the expressions with their + /// debug representations. + macro_rules! assert_almost_eq { + ($a:expr, $b:expr, $prec:expr) => ( + let diff = ($a - $b).abs(); + if diff > $prec { + panic!(format!( + "assertion failed: `abs(left - right) = {:.1e} < {:e}`, \ + (left: `{}`, right: `{}`)", + diff, $prec, $a, $b)); + } + ); + } + + #[test] + fn norm() { + let mut rng = ::test::rng(1); + let dist = UnitCircle::new(); + for _ in 0..1000 { + let x = dist.sample(&mut rng); + assert_almost_eq!(x[0]*x[0] + x[1]*x[1], 1., 1e-15); + } + } + + #[test] + fn value_stability() { + let mut rng = ::test::rng(2); + let dist = UnitCircle::new(); + assert_eq!(dist.sample(&mut rng), [-0.8032118336637037, 0.5956935036263119]); + assert_eq!(dist.sample(&mut rng), [-0.4742919588505423, -0.880367615130018]); + assert_eq!(dist.sample(&mut rng), [0.9297328981467168, 0.368234623716601]); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/unit_sphere.rs b/vendor/registry-40351f815f426200/rand/src/distributions/unit_sphere.rs new file mode 100644 index 000000000..37de88b6a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/unit_sphere.rs @@ -0,0 +1,99 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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 Rng; +use distributions::{Distribution, Uniform}; + +/// Samples uniformly from the surface of the unit sphere in three dimensions. +/// +/// Implemented via a method by Marsaglia[^1]. +/// +/// +/// # Example +/// +/// ``` +/// use rand::distributions::{UnitSphereSurface, Distribution}; +/// +/// let sphere = UnitSphereSurface::new(); +/// let v = sphere.sample(&mut rand::thread_rng()); +/// println!("{:?} is from the unit sphere surface.", v) +/// ``` +/// +/// [^1]: Marsaglia, George (1972). [*Choosing a Point from the Surface of a +/// Sphere.*](https://doi.org/10.1214/aoms/1177692644) +/// Ann. Math. Statist. 43, no. 2, 645--646. +#[derive(Clone, Copy, Debug)] +pub struct UnitSphereSurface; + +impl UnitSphereSurface { + /// Construct a new `UnitSphereSurface` distribution. + #[inline] + pub fn new() -> UnitSphereSurface { + UnitSphereSurface + } +} + +impl Distribution<[f64; 3]> for UnitSphereSurface { + #[inline] + fn sample(&self, rng: &mut R) -> [f64; 3] { + let uniform = Uniform::new(-1., 1.); + loop { + let (x1, x2) = (uniform.sample(rng), uniform.sample(rng)); + let sum = x1*x1 + x2*x2; + if sum >= 1. { + continue; + } + let factor = 2. * (1.0_f64 - sum).sqrt(); + return [x1 * factor, x2 * factor, 1. - 2.*sum]; + } + } +} + +#[cfg(test)] +mod tests { + use distributions::Distribution; + use super::UnitSphereSurface; + + /// Assert that two numbers are almost equal to each other. + /// + /// On panic, this macro will print the values of the expressions with their + /// debug representations. + macro_rules! assert_almost_eq { + ($a:expr, $b:expr, $prec:expr) => ( + let diff = ($a - $b).abs(); + if diff > $prec { + panic!(format!( + "assertion failed: `abs(left - right) = {:.1e} < {:e}`, \ + (left: `{}`, right: `{}`)", + diff, $prec, $a, $b)); + } + ); + } + + #[test] + fn norm() { + let mut rng = ::test::rng(1); + let dist = UnitSphereSurface::new(); + for _ in 0..1000 { + let x = dist.sample(&mut rng); + assert_almost_eq!(x[0]*x[0] + x[1]*x[1] + x[2]*x[2], 1., 1e-15); + } + } + + #[test] + fn value_stability() { + let mut rng = ::test::rng(2); + let dist = UnitSphereSurface::new(); + assert_eq!(dist.sample(&mut rng), + [-0.24950027180862533, -0.7552572587896719, 0.6060825747478084]); + assert_eq!(dist.sample(&mut rng), + [0.47604534507233487, -0.797200864987207, -0.3712837328763685]); + assert_eq!(dist.sample(&mut rng), + [0.9795722330927367, 0.18692349236651176, 0.07414747571708524]); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/utils.rs b/vendor/registry-40351f815f426200/rand/src/distributions/utils.rs new file mode 100644 index 000000000..d4d364263 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/utils.rs @@ -0,0 +1,504 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Math helper functions + +#[cfg(feature="simd_support")] +use packed_simd::*; +#[cfg(feature="std")] +use distributions::ziggurat_tables; +#[cfg(feature="std")] +use Rng; + + +pub trait WideningMultiply { + type Output; + + fn wmul(self, x: RHS) -> Self::Output; +} + +macro_rules! wmul_impl { + ($ty:ty, $wide:ty, $shift:expr) => { + impl WideningMultiply for $ty { + type Output = ($ty, $ty); + + #[inline(always)] + fn wmul(self, x: $ty) -> Self::Output { + let tmp = (self as $wide) * (x as $wide); + ((tmp >> $shift) as $ty, tmp as $ty) + } + } + }; + + // simd bulk implementation + ($(($ty:ident, $wide:ident),)+, $shift:expr) => { + $( + impl WideningMultiply for $ty { + type Output = ($ty, $ty); + + #[inline(always)] + fn wmul(self, x: $ty) -> Self::Output { + // For supported vectors, this should compile to a couple + // supported multiply & swizzle instructions (no actual + // casting). + // TODO: optimize + let y: $wide = self.cast(); + let x: $wide = x.cast(); + let tmp = y * x; + let hi: $ty = (tmp >> $shift).cast(); + let lo: $ty = tmp.cast(); + (hi, lo) + } + } + )+ + }; +} +wmul_impl! { u8, u16, 8 } +wmul_impl! { u16, u32, 16 } +wmul_impl! { u32, u64, 32 } +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] +wmul_impl! { u64, u128, 64 } + +// This code is a translation of the __mulddi3 function in LLVM's +// compiler-rt. It is an optimised variant of the common method +// `(a + b) * (c + d) = ac + ad + bc + bd`. +// +// For some reason LLVM can optimise the C version very well, but +// keeps shuffling registers in this Rust translation. +macro_rules! wmul_impl_large { + ($ty:ty, $half:expr) => { + impl WideningMultiply for $ty { + type Output = ($ty, $ty); + + #[inline(always)] + fn wmul(self, b: $ty) -> Self::Output { + const LOWER_MASK: $ty = !0 >> $half; + let mut low = (self & LOWER_MASK).wrapping_mul(b & LOWER_MASK); + let mut t = low >> $half; + low &= LOWER_MASK; + t += (self >> $half).wrapping_mul(b & LOWER_MASK); + low += (t & LOWER_MASK) << $half; + let mut high = t >> $half; + t = low >> $half; + low &= LOWER_MASK; + t += (b >> $half).wrapping_mul(self & LOWER_MASK); + low += (t & LOWER_MASK) << $half; + high += t >> $half; + high += (self >> $half).wrapping_mul(b >> $half); + + (high, low) + } + } + }; + + // simd bulk implementation + (($($ty:ty,)+) $scalar:ty, $half:expr) => { + $( + impl WideningMultiply for $ty { + type Output = ($ty, $ty); + + #[inline(always)] + fn wmul(self, b: $ty) -> Self::Output { + // needs wrapping multiplication + const LOWER_MASK: $scalar = !0 >> $half; + let mut low = (self & LOWER_MASK) * (b & LOWER_MASK); + let mut t = low >> $half; + low &= LOWER_MASK; + t += (self >> $half) * (b & LOWER_MASK); + low += (t & LOWER_MASK) << $half; + let mut high = t >> $half; + t = low >> $half; + low &= LOWER_MASK; + t += (b >> $half) * (self & LOWER_MASK); + low += (t & LOWER_MASK) << $half; + high += t >> $half; + high += (self >> $half) * (b >> $half); + + (high, low) + } + } + )+ + }; +} +#[cfg(not(all(rustc_1_26, not(target_os = "emscripten"))))] +wmul_impl_large! { u64, 32 } +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] +wmul_impl_large! { u128, 64 } + +macro_rules! wmul_impl_usize { + ($ty:ty) => { + impl WideningMultiply for usize { + type Output = (usize, usize); + + #[inline(always)] + fn wmul(self, x: usize) -> Self::Output { + let (high, low) = (self as $ty).wmul(x as $ty); + (high as usize, low as usize) + } + } + } +} +#[cfg(target_pointer_width = "32")] +wmul_impl_usize! { u32 } +#[cfg(target_pointer_width = "64")] +wmul_impl_usize! { u64 } + +#[cfg(all(feature = "simd_support", feature = "nightly"))] +mod simd_wmul { + #[cfg(target_arch = "x86")] + use core::arch::x86::*; + #[cfg(target_arch = "x86_64")] + use core::arch::x86_64::*; + use super::*; + + wmul_impl! { + (u8x2, u16x2), + (u8x4, u16x4), + (u8x8, u16x8), + (u8x16, u16x16), + (u8x32, u16x32),, + 8 + } + + wmul_impl! { (u16x2, u32x2),, 16 } + #[cfg(not(target_feature = "sse2"))] + wmul_impl! { (u16x4, u32x4),, 16 } + #[cfg(not(target_feature = "sse4.2"))] + wmul_impl! { (u16x8, u32x8),, 16 } + #[cfg(not(target_feature = "avx2"))] + wmul_impl! { (u16x16, u32x16),, 16 } + + // 16-bit lane widths allow use of the x86 `mulhi` instructions, which + // means `wmul` can be implemented with only two instructions. + #[allow(unused_macros)] + macro_rules! wmul_impl_16 { + ($ty:ident, $intrinsic:ident, $mulhi:ident, $mullo:ident) => { + impl WideningMultiply for $ty { + type Output = ($ty, $ty); + + #[inline(always)] + fn wmul(self, x: $ty) -> Self::Output { + let b = $intrinsic::from_bits(x); + let a = $intrinsic::from_bits(self); + let hi = $ty::from_bits(unsafe { $mulhi(a, b) }); + let lo = $ty::from_bits(unsafe { $mullo(a, b) }); + (hi, lo) + } + } + }; + } + + #[cfg(target_feature = "sse2")] + wmul_impl_16! { u16x4, __m64, _mm_mulhi_pu16, _mm_mullo_pi16 } + #[cfg(target_feature = "sse4.2")] + wmul_impl_16! { u16x8, __m128i, _mm_mulhi_epu16, _mm_mullo_epi16 } + #[cfg(target_feature = "avx2")] + wmul_impl_16! { u16x16, __m256i, _mm256_mulhi_epu16, _mm256_mullo_epi16 } + // FIXME: there are no `__m512i` types in stdsimd yet, so `wmul::` + // cannot use the same implementation. + + wmul_impl! { + (u32x2, u64x2), + (u32x4, u64x4), + (u32x8, u64x8),, + 32 + } + + // TODO: optimize, this seems to seriously slow things down + wmul_impl_large! { (u8x64,) u8, 4 } + wmul_impl_large! { (u16x32,) u16, 8 } + wmul_impl_large! { (u32x16,) u32, 16 } + wmul_impl_large! { (u64x2, u64x4, u64x8,) u64, 32 } +} +#[cfg(all(feature = "simd_support", feature = "nightly"))] +pub use self::simd_wmul::*; + + +/// Helper trait when dealing with scalar and SIMD floating point types. +pub(crate) trait FloatSIMDUtils { + // `PartialOrd` for vectors compares lexicographically. We want to compare all + // the individual SIMD lanes instead, and get the combined result over all + // lanes. This is possible using something like `a.lt(b).all()`, but we + // implement it as a trait so we can write the same code for `f32` and `f64`. + // Only the comparison functions we need are implemented. + fn all_lt(self, other: Self) -> bool; + fn all_le(self, other: Self) -> bool; + fn all_finite(self) -> bool; + + type Mask; + fn finite_mask(self) -> Self::Mask; + fn gt_mask(self, other: Self) -> Self::Mask; + fn ge_mask(self, other: Self) -> Self::Mask; + + // Decrease all lanes where the mask is `true` to the next lower value + // representable by the floating-point type. At least one of the lanes + // must be set. + fn decrease_masked(self, mask: Self::Mask) -> Self; + + // Convert from int value. Conversion is done while retaining the numerical + // value, not by retaining the binary representation. + type UInt; + fn cast_from_int(i: Self::UInt) -> Self; +} + +/// Implement functions available in std builds but missing from core primitives +#[cfg(not(std))] +pub(crate) trait Float : Sized { + type Bits; + + fn is_nan(self) -> bool; + fn is_infinite(self) -> bool; + fn is_finite(self) -> bool; + fn to_bits(self) -> Self::Bits; + fn from_bits(v: Self::Bits) -> Self; +} + +/// Implement functions on f32/f64 to give them APIs similar to SIMD types +pub(crate) trait FloatAsSIMD : Sized { + #[inline(always)] + fn lanes() -> usize { 1 } + #[inline(always)] + fn splat(scalar: Self) -> Self { scalar } + #[inline(always)] + fn extract(self, index: usize) -> Self { debug_assert_eq!(index, 0); self } + #[inline(always)] + fn replace(self, index: usize, new_value: Self) -> Self { debug_assert_eq!(index, 0); new_value } +} + +pub(crate) trait BoolAsSIMD : Sized { + fn any(self) -> bool; + fn all(self) -> bool; + fn none(self) -> bool; +} + +impl BoolAsSIMD for bool { + #[inline(always)] + fn any(self) -> bool { self } + #[inline(always)] + fn all(self) -> bool { self } + #[inline(always)] + fn none(self) -> bool { !self } +} + +macro_rules! scalar_float_impl { + ($ty:ident, $uty:ident) => { + #[cfg(not(std))] + impl Float for $ty { + type Bits = $uty; + + #[inline] + fn is_nan(self) -> bool { + self != self + } + + #[inline] + fn is_infinite(self) -> bool { + self == ::core::$ty::INFINITY || self == ::core::$ty::NEG_INFINITY + } + + #[inline] + fn is_finite(self) -> bool { + !(self.is_nan() || self.is_infinite()) + } + + #[inline] + fn to_bits(self) -> Self::Bits { + unsafe { ::core::mem::transmute(self) } + } + + #[inline] + fn from_bits(v: Self::Bits) -> Self { + // It turns out the safety issues with sNaN were overblown! Hooray! + unsafe { ::core::mem::transmute(v) } + } + } + + impl FloatSIMDUtils for $ty { + type Mask = bool; + #[inline(always)] + fn all_lt(self, other: Self) -> bool { self < other } + #[inline(always)] + fn all_le(self, other: Self) -> bool { self <= other } + #[inline(always)] + fn all_finite(self) -> bool { self.is_finite() } + #[inline(always)] + fn finite_mask(self) -> Self::Mask { self.is_finite() } + #[inline(always)] + fn gt_mask(self, other: Self) -> Self::Mask { self > other } + #[inline(always)] + fn ge_mask(self, other: Self) -> Self::Mask { self >= other } + #[inline(always)] + fn decrease_masked(self, mask: Self::Mask) -> Self { + debug_assert!(mask, "At least one lane must be set"); + <$ty>::from_bits(self.to_bits() - 1) + } + type UInt = $uty; + fn cast_from_int(i: Self::UInt) -> Self { i as $ty } + } + + impl FloatAsSIMD for $ty {} + } +} + +scalar_float_impl!(f32, u32); +scalar_float_impl!(f64, u64); + + +#[cfg(feature="simd_support")] +macro_rules! simd_impl { + ($ty:ident, $f_scalar:ident, $mty:ident, $uty:ident) => { + impl FloatSIMDUtils for $ty { + type Mask = $mty; + #[inline(always)] + fn all_lt(self, other: Self) -> bool { self.lt(other).all() } + #[inline(always)] + fn all_le(self, other: Self) -> bool { self.le(other).all() } + #[inline(always)] + fn all_finite(self) -> bool { self.finite_mask().all() } + #[inline(always)] + fn finite_mask(self) -> Self::Mask { + // This can possibly be done faster by checking bit patterns + let neg_inf = $ty::splat(::core::$f_scalar::NEG_INFINITY); + let pos_inf = $ty::splat(::core::$f_scalar::INFINITY); + self.gt(neg_inf) & self.lt(pos_inf) + } + #[inline(always)] + fn gt_mask(self, other: Self) -> Self::Mask { self.gt(other) } + #[inline(always)] + fn ge_mask(self, other: Self) -> Self::Mask { self.ge(other) } + #[inline(always)] + fn decrease_masked(self, mask: Self::Mask) -> Self { + // Casting a mask into ints will produce all bits set for + // true, and 0 for false. Adding that to the binary + // representation of a float means subtracting one from + // the binary representation, resulting in the next lower + // value representable by $ty. This works even when the + // current value is infinity. + debug_assert!(mask.any(), "At least one lane must be set"); + <$ty>::from_bits(<$uty>::from_bits(self) + <$uty>::from_bits(mask)) + } + type UInt = $uty; + fn cast_from_int(i: Self::UInt) -> Self { i.cast() } + } + } +} + +#[cfg(feature="simd_support")] simd_impl! { f32x2, f32, m32x2, u32x2 } +#[cfg(feature="simd_support")] simd_impl! { f32x4, f32, m32x4, u32x4 } +#[cfg(feature="simd_support")] simd_impl! { f32x8, f32, m32x8, u32x8 } +#[cfg(feature="simd_support")] simd_impl! { f32x16, f32, m32x16, u32x16 } +#[cfg(feature="simd_support")] simd_impl! { f64x2, f64, m64x2, u64x2 } +#[cfg(feature="simd_support")] simd_impl! { f64x4, f64, m64x4, u64x4 } +#[cfg(feature="simd_support")] simd_impl! { f64x8, f64, m64x8, u64x8 } + +/// Calculates ln(gamma(x)) (natural logarithm of the gamma +/// function) using the Lanczos approximation. +/// +/// The approximation expresses the gamma function as: +/// `gamma(z+1) = sqrt(2*pi)*(z+g+0.5)^(z+0.5)*exp(-z-g-0.5)*Ag(z)` +/// `g` is an arbitrary constant; we use the approximation with `g=5`. +/// +/// Noting that `gamma(z+1) = z*gamma(z)` and applying `ln` to both sides: +/// `ln(gamma(z)) = (z+0.5)*ln(z+g+0.5)-(z+g+0.5) + ln(sqrt(2*pi)*Ag(z)/z)` +/// +/// `Ag(z)` is an infinite series with coefficients that can be calculated +/// ahead of time - we use just the first 6 terms, which is good enough +/// for most purposes. +#[cfg(feature="std")] +pub fn log_gamma(x: f64) -> f64 { + // precalculated 6 coefficients for the first 6 terms of the series + let coefficients: [f64; 6] = [ + 76.18009172947146, + -86.50532032941677, + 24.01409824083091, + -1.231739572450155, + 0.1208650973866179e-2, + -0.5395239384953e-5, + ]; + + // (x+0.5)*ln(x+g+0.5)-(x+g+0.5) + let tmp = x + 5.5; + let log = (x + 0.5) * tmp.ln() - tmp; + + // the first few terms of the series for Ag(x) + let mut a = 1.000000000190015; + let mut denom = x; + for coeff in &coefficients { + denom += 1.0; + a += coeff / denom; + } + + // get everything together + // a is Ag(x) + // 2.5066... is sqrt(2pi) + log + (2.5066282746310005 * a / x).ln() +} + +/// Sample a random number using the Ziggurat method (specifically the +/// ZIGNOR variant from Doornik 2005). Most of the arguments are +/// directly from the paper: +/// +/// * `rng`: source of randomness +/// * `symmetric`: whether this is a symmetric distribution, or one-sided with P(x < 0) = 0. +/// * `X`: the $x_i$ abscissae. +/// * `F`: precomputed values of the PDF at the $x_i$, (i.e. $f(x_i)$) +/// * `F_DIFF`: precomputed values of $f(x_i) - f(x_{i+1})$ +/// * `pdf`: the probability density function +/// * `zero_case`: manual sampling from the tail when we chose the +/// bottom box (i.e. i == 0) + +// the perf improvement (25-50%) is definitely worth the extra code +// size from force-inlining. +#[cfg(feature="std")] +#[inline(always)] +pub fn ziggurat( + rng: &mut R, + symmetric: bool, + x_tab: ziggurat_tables::ZigTable, + f_tab: ziggurat_tables::ZigTable, + mut pdf: P, + mut zero_case: Z) + -> f64 where P: FnMut(f64) -> f64, Z: FnMut(&mut R, f64) -> f64 { + use distributions::float::IntoFloat; + loop { + // As an optimisation we re-implement the conversion to a f64. + // From the remaining 12 most significant bits we use 8 to construct `i`. + // This saves us generating a whole extra random number, while the added + // precision of using 64 bits for f64 does not buy us much. + let bits = rng.next_u64(); + let i = bits as usize & 0xff; + + let u = if symmetric { + // Convert to a value in the range [2,4) and substract to get [-1,1) + // We can't convert to an open range directly, that would require + // substracting `3.0 - EPSILON`, which is not representable. + // It is possible with an extra step, but an open range does not + // seem neccesary for the ziggurat algorithm anyway. + (bits >> 12).into_float_with_exponent(1) - 3.0 + } else { + // Convert to a value in the range [1,2) and substract to get (0,1) + (bits >> 12).into_float_with_exponent(0) + - (1.0 - ::core::f64::EPSILON / 2.0) + }; + let x = u * x_tab[i]; + + let test_x = if symmetric { x.abs() } else {x}; + + // algebraically equivalent to |u| < x_tab[i+1]/x_tab[i] (or u < x_tab[i+1]/x_tab[i]) + if test_x < x_tab[i + 1] { + return x; + } + if i == 0 { + return zero_case(rng, u); + } + // algebraically equivalent to f1 + DRanU()*(f0 - f1) < 1 + if f_tab[i + 1] + (f_tab[i] - f_tab[i + 1]) * rng.gen::() < pdf(x) { + return x; + } + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/weibull.rs b/vendor/registry-40351f815f426200/rand/src/distributions/weibull.rs new file mode 100644 index 000000000..5fbe10ae9 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/weibull.rs @@ -0,0 +1,71 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The Weibull distribution. + +use Rng; +use distributions::{Distribution, OpenClosed01}; + +/// Samples floating-point numbers according to the Weibull distribution +/// +/// # Example +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::Weibull; +/// +/// let val: f64 = SmallRng::from_entropy().sample(Weibull::new(1., 10.)); +/// println!("{}", val); +/// ``` +#[derive(Clone, Copy, Debug)] +pub struct Weibull { + inv_shape: f64, + scale: f64, +} + +impl Weibull { + /// Construct a new `Weibull` distribution with given `scale` and `shape`. + /// + /// # Panics + /// + /// `scale` and `shape` have to be non-zero and positive. + pub fn new(scale: f64, shape: f64) -> Weibull { + assert!((scale > 0.) & (shape > 0.)); + Weibull { inv_shape: 1./shape, scale } + } +} + +impl Distribution for Weibull { + fn sample(&self, rng: &mut R) -> f64 { + let x: f64 = rng.sample(OpenClosed01); + self.scale * (-x.ln()).powf(self.inv_shape) + } +} + +#[cfg(test)] +mod tests { + use distributions::Distribution; + use super::Weibull; + + #[test] + #[should_panic] + fn invalid() { + Weibull::new(0., 0.); + } + + #[test] + fn sample() { + let scale = 1.0; + let shape = 2.0; + let d = Weibull::new(scale, shape); + let mut rng = ::test::rng(1); + for _ in 0..1000 { + let r = d.sample(&mut rng); + assert!(r >= 0.); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/weighted.rs b/vendor/registry-40351f815f426200/rand/src/distributions/weighted.rs new file mode 100644 index 000000000..d7499596e --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/weighted.rs @@ -0,0 +1,230 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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 Rng; +use distributions::Distribution; +use distributions::uniform::{UniformSampler, SampleUniform, SampleBorrow}; +use ::core::cmp::PartialOrd; +use core::fmt; + +// Note that this whole module is only imported if feature="alloc" is enabled. +#[cfg(not(feature="std"))] use alloc::vec::Vec; + +/// A distribution using weighted sampling to pick a discretely selected +/// item. +/// +/// Sampling a `WeightedIndex` distribution returns the index of a randomly +/// selected element from the iterator used when the `WeightedIndex` was +/// created. The chance of a given element being picked is proportional to the +/// value of the element. The weights can use any type `X` for which an +/// implementation of [`Uniform`] exists. +/// +/// # Performance +/// +/// A `WeightedIndex` contains a `Vec` and a [`Uniform`] and so its +/// size is the sum of the size of those objects, possibly plus some alignment. +/// +/// Creating a `WeightedIndex` will allocate enough space to hold `N - 1` +/// weights of type `X`, where `N` is the number of weights. However, since +/// `Vec` doesn't guarantee a particular growth strategy, additional memory +/// might be allocated but not used. Since the `WeightedIndex` object also +/// contains, this might cause additional allocations, though for primitive +/// types, ['Uniform`] doesn't allocate any memory. +/// +/// Time complexity of sampling from `WeightedIndex` is `O(log N)` where +/// `N` is the number of weights. +/// +/// Sampling from `WeightedIndex` will result in a single call to +/// `Uniform::sample` (method of the [`Distribution`] trait), which typically +/// will request a single value from the underlying [`RngCore`], though the +/// exact number depends on the implementaiton of `Uniform::sample`. +/// +/// # Example +/// +/// ``` +/// use rand::prelude::*; +/// use rand::distributions::WeightedIndex; +/// +/// let choices = ['a', 'b', 'c']; +/// let weights = [2, 1, 1]; +/// let dist = WeightedIndex::new(&weights).unwrap(); +/// let mut rng = thread_rng(); +/// for _ in 0..100 { +/// // 50% chance to print 'a', 25% chance to print 'b', 25% chance to print 'c' +/// println!("{}", choices[dist.sample(&mut rng)]); +/// } +/// +/// let items = [('a', 0), ('b', 3), ('c', 7)]; +/// let dist2 = WeightedIndex::new(items.iter().map(|item| item.1)).unwrap(); +/// for _ in 0..100 { +/// // 0% chance to print 'a', 30% chance to print 'b', 70% chance to print 'c' +/// println!("{}", items[dist2.sample(&mut rng)].0); +/// } +/// ``` +/// +/// [`Uniform`]: crate::distributions::uniform::Uniform +/// [`RngCore`]: rand_core::RngCore +#[derive(Debug, Clone)] +pub struct WeightedIndex { + cumulative_weights: Vec, + weight_distribution: X::Sampler, +} + +impl WeightedIndex { + /// Creates a new a `WeightedIndex` [`Distribution`] using the values + /// in `weights`. The weights can use any type `X` for which an + /// implementation of [`Uniform`] exists. + /// + /// Returns an error if the iterator is empty, if any weight is `< 0`, or + /// if its total value is 0. + /// + /// [`Uniform`]: crate::distributions::uniform::Uniform + pub fn new(weights: I) -> Result, WeightedError> + where I: IntoIterator, + I::Item: SampleBorrow, + X: for<'a> ::core::ops::AddAssign<&'a X> + + Clone + + Default { + let mut iter = weights.into_iter(); + let mut total_weight: X = iter.next() + .ok_or(WeightedError::NoItem)? + .borrow() + .clone(); + + let zero = ::default(); + if total_weight < zero { + return Err(WeightedError::NegativeWeight); + } + + let mut weights = Vec::::with_capacity(iter.size_hint().0); + for w in iter { + if *w.borrow() < zero { + return Err(WeightedError::NegativeWeight); + } + weights.push(total_weight.clone()); + total_weight += w.borrow(); + } + + if total_weight == zero { + return Err(WeightedError::AllWeightsZero); + } + let distr = X::Sampler::new(zero, total_weight); + + Ok(WeightedIndex { cumulative_weights: weights, weight_distribution: distr }) + } +} + +impl Distribution for WeightedIndex where + X: SampleUniform + PartialOrd { + fn sample(&self, rng: &mut R) -> usize { + use ::core::cmp::Ordering; + let chosen_weight = self.weight_distribution.sample(rng); + // Find the first item which has a weight *higher* than the chosen weight. + self.cumulative_weights.binary_search_by( + |w| if *w <= chosen_weight { Ordering::Less } else { Ordering::Greater }).unwrap_err() + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_weightedindex() { + let mut r = ::test::rng(700); + const N_REPS: u32 = 5000; + let weights = [1u32, 2, 3, 0, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7]; + let total_weight = weights.iter().sum::() as f32; + + let verify = |result: [i32; 14]| { + for (i, count) in result.iter().enumerate() { + let exp = (weights[i] * N_REPS) as f32 / total_weight; + let mut err = (*count as f32 - exp).abs(); + if err != 0.0 { + err /= exp; + } + assert!(err <= 0.25); + } + }; + + // WeightedIndex from vec + let mut chosen = [0i32; 14]; + let distr = WeightedIndex::new(weights.to_vec()).unwrap(); + for _ in 0..N_REPS { + chosen[distr.sample(&mut r)] += 1; + } + verify(chosen); + + // WeightedIndex from slice + chosen = [0i32; 14]; + let distr = WeightedIndex::new(&weights[..]).unwrap(); + for _ in 0..N_REPS { + chosen[distr.sample(&mut r)] += 1; + } + verify(chosen); + + // WeightedIndex from iterator + chosen = [0i32; 14]; + let distr = WeightedIndex::new(weights.iter()).unwrap(); + for _ in 0..N_REPS { + chosen[distr.sample(&mut r)] += 1; + } + verify(chosen); + + for _ in 0..5 { + assert_eq!(WeightedIndex::new(&[0, 1]).unwrap().sample(&mut r), 1); + assert_eq!(WeightedIndex::new(&[1, 0]).unwrap().sample(&mut r), 0); + assert_eq!(WeightedIndex::new(&[0, 0, 0, 0, 10, 0]).unwrap().sample(&mut r), 4); + } + + assert_eq!(WeightedIndex::new(&[10][0..0]).unwrap_err(), WeightedError::NoItem); + assert_eq!(WeightedIndex::new(&[0]).unwrap_err(), WeightedError::AllWeightsZero); + assert_eq!(WeightedIndex::new(&[10, 20, -1, 30]).unwrap_err(), WeightedError::NegativeWeight); + assert_eq!(WeightedIndex::new(&[-10, 20, 1, 30]).unwrap_err(), WeightedError::NegativeWeight); + assert_eq!(WeightedIndex::new(&[-10]).unwrap_err(), WeightedError::NegativeWeight); + } +} + +/// Error type returned from `WeightedIndex::new`. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum WeightedError { + /// The provided iterator contained no items. + NoItem, + + /// A weight lower than zero was used. + NegativeWeight, + + /// All items in the provided iterator had a weight of zero. + AllWeightsZero, +} + +impl WeightedError { + fn msg(&self) -> &str { + match *self { + WeightedError::NoItem => "No items found", + WeightedError::NegativeWeight => "Item has negative weight", + WeightedError::AllWeightsZero => "All items had weight zero", + } + } +} + +#[cfg(feature="std")] +impl ::std::error::Error for WeightedError { + fn description(&self) -> &str { + self.msg() + } + fn cause(&self) -> Option<&::std::error::Error> { + None + } +} + +impl fmt::Display for WeightedError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.msg()) + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/distributions/ziggurat_tables.rs b/vendor/registry-40351f815f426200/rand/src/distributions/ziggurat_tables.rs new file mode 100644 index 000000000..ca1ce3041 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/distributions/ziggurat_tables.rs @@ -0,0 +1,279 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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. + +// Tables for distributions which are sampled using the ziggurat +// algorithm. Autogenerated by `ziggurat_tables.py`. + +pub type ZigTable = &'static [f64; 257]; +pub const ZIG_NORM_R: f64 = 3.654152885361008796; +pub static ZIG_NORM_X: [f64; 257] = + [3.910757959537090045, 3.654152885361008796, 3.449278298560964462, 3.320244733839166074, + 3.224575052047029100, 3.147889289517149969, 3.083526132001233044, 3.027837791768635434, + 2.978603279880844834, 2.934366867207854224, 2.894121053612348060, 2.857138730872132548, + 2.822877396825325125, 2.790921174000785765, 2.760944005278822555, 2.732685359042827056, + 2.705933656121858100, 2.680514643284522158, 2.656283037575502437, 2.633116393630324570, + 2.610910518487548515, 2.589575986706995181, 2.569035452680536569, 2.549221550323460761, + 2.530075232158516929, 2.511544441625342294, 2.493583041269680667, 2.476149939669143318, + 2.459208374333311298, 2.442725318198956774, 2.426670984935725972, 2.411018413899685520, + 2.395743119780480601, 2.380822795170626005, 2.366237056715818632, 2.351967227377659952, + 2.337996148795031370, 2.324308018869623016, 2.310888250599850036, 2.297723348901329565, + 2.284800802722946056, 2.272108990226823888, 2.259637095172217780, 2.247375032945807760, + 2.235313384928327984, 2.223443340090905718, 2.211756642882544366, 2.200245546609647995, + 2.188902771624720689, 2.177721467738641614, 2.166695180352645966, 2.155817819875063268, + 2.145083634046203613, 2.134487182844320152, 2.124023315687815661, 2.113687150684933957, + 2.103474055713146829, 2.093379631137050279, 2.083399693996551783, 2.073530263516978778, + 2.063767547809956415, 2.054107931648864849, 2.044547965215732788, 2.035084353727808715, + 2.025713947862032960, 2.016433734904371722, 2.007240830558684852, 1.998132471356564244, + 1.989106007615571325, 1.980158896898598364, 1.971288697931769640, 1.962493064942461896, + 1.953769742382734043, 1.945116560006753925, 1.936531428273758904, 1.928012334050718257, + 1.919557336591228847, 1.911164563769282232, 1.902832208548446369, 1.894558525668710081, + 1.886341828534776388, 1.878180486290977669, 1.870072921069236838, 1.862017605397632281, + 1.854013059758148119, 1.846057850283119750, 1.838150586580728607, 1.830289919680666566, + 1.822474540091783224, 1.814703175964167636, 1.806974591348693426, 1.799287584547580199, + 1.791640986550010028, 1.784033659547276329, 1.776464495522344977, 1.768932414909077933, + 1.761436365316706665, 1.753975320315455111, 1.746548278279492994, 1.739154261283669012, + 1.731792314050707216, 1.724461502945775715, 1.717160915015540690, 1.709889657069006086, + 1.702646854797613907, 1.695431651932238548, 1.688243209434858727, 1.681080704722823338, + 1.673943330923760353, 1.666830296159286684, 1.659740822855789499, 1.652674147080648526, + 1.645629517902360339, 1.638606196773111146, 1.631603456932422036, 1.624620582830568427, + 1.617656869570534228, 1.610711622367333673, 1.603784156023583041, 1.596873794420261339, + 1.589979870021648534, 1.583101723393471438, 1.576238702733332886, 1.569390163412534456, + 1.562555467528439657, 1.555733983466554893, 1.548925085471535512, 1.542128153226347553, + 1.535342571438843118, 1.528567729435024614, 1.521803020758293101, 1.515047842773992404, + 1.508301596278571965, 1.501563685112706548, 1.494833515777718391, 1.488110497054654369, + 1.481394039625375747, 1.474683555695025516, 1.467978458615230908, 1.461278162507407830, + 1.454582081885523293, 1.447889631277669675, 1.441200224845798017, 1.434513276002946425, + 1.427828197027290358, 1.421144398672323117, 1.414461289772464658, 1.407778276843371534, + 1.401094763676202559, 1.394410150925071257, 1.387723835686884621, 1.381035211072741964, + 1.374343665770030531, 1.367648583594317957, 1.360949343030101844, 1.354245316759430606, + 1.347535871177359290, 1.340820365893152122, 1.334098153216083604, 1.327368577624624679, + 1.320630975217730096, 1.313884673146868964, 1.307128989027353860, 1.300363230327433728, + 1.293586693733517645, 1.286798664489786415, 1.279998415710333237, 1.273185207661843732, + 1.266358287014688333, 1.259516886060144225, 1.252660221891297887, 1.245787495544997903, + 1.238897891102027415, 1.231990574742445110, 1.225064693752808020, 1.218119375481726552, + 1.211153726239911244, 1.204166830140560140, 1.197157747875585931, 1.190125515422801650, + 1.183069142678760732, 1.175987612011489825, 1.168879876726833800, 1.161744859441574240, + 1.154581450355851802, 1.147388505416733873, 1.140164844363995789, 1.132909248648336975, + 1.125620459211294389, 1.118297174115062909, 1.110938046009249502, 1.103541679420268151, + 1.096106627847603487, 1.088631390649514197, 1.081114409698889389, 1.073554065787871714, + 1.065948674757506653, 1.058296483326006454, 1.050595664586207123, 1.042844313139370538, + 1.035040439828605274, 1.027181966030751292, 1.019266717460529215, 1.011292417434978441, + 1.003256679539591412, 0.995156999629943084, 0.986990747093846266, 0.978755155288937750, + 0.970447311058864615, 0.962064143217605250, 0.953602409875572654, 0.945058684462571130, + 0.936429340280896860, 0.927710533396234771, 0.918898183643734989, 0.909987953490768997, + 0.900975224455174528, 0.891855070726792376, 0.882622229578910122, 0.873271068082494550, + 0.863795545546826915, 0.854189171001560554, 0.844444954902423661, 0.834555354079518752, + 0.824512208745288633, 0.814306670128064347, 0.803929116982664893, 0.793369058833152785, + 0.782615023299588763, 0.771654424216739354, 0.760473406422083165, 0.749056662009581653, + 0.737387211425838629, 0.725446140901303549, 0.713212285182022732, 0.700661841097584448, + 0.687767892786257717, 0.674499822827436479, 0.660822574234205984, 0.646695714884388928, + 0.632072236375024632, 0.616896989996235545, 0.601104617743940417, 0.584616766093722262, + 0.567338257040473026, 0.549151702313026790, 0.529909720646495108, 0.509423329585933393, + 0.487443966121754335, 0.463634336771763245, 0.437518402186662658, 0.408389134588000746, + 0.375121332850465727, 0.335737519180459465, 0.286174591747260509, 0.215241895913273806, + 0.000000000000000000]; +pub static ZIG_NORM_F: [f64; 257] = + [0.000477467764586655, 0.001260285930498598, 0.002609072746106363, 0.004037972593371872, + 0.005522403299264754, 0.007050875471392110, 0.008616582769422917, 0.010214971439731100, + 0.011842757857943104, 0.013497450601780807, 0.015177088307982072, 0.016880083152595839, + 0.018605121275783350, 0.020351096230109354, 0.022117062707379922, 0.023902203305873237, + 0.025705804008632656, 0.027527235669693315, 0.029365939758230111, 0.031221417192023690, + 0.033093219458688698, 0.034980941461833073, 0.036884215688691151, 0.038802707404656918, + 0.040736110656078753, 0.042684144916619378, 0.044646552251446536, 0.046623094902089664, + 0.048613553216035145, 0.050617723861121788, 0.052635418276973649, 0.054666461325077916, + 0.056710690106399467, 0.058767952921137984, 0.060838108349751806, 0.062921024437977854, + 0.065016577971470438, 0.067124653828023989, 0.069245144397250269, 0.071377949059141965, + 0.073522973714240991, 0.075680130359194964, 0.077849336702372207, 0.080030515814947509, + 0.082223595813495684, 0.084428509570654661, 0.086645194450867782, 0.088873592068594229, + 0.091113648066700734, 0.093365311913026619, 0.095628536713353335, 0.097903279039215627, + 0.100189498769172020, 0.102487158942306270, 0.104796225622867056, 0.107116667775072880, + 0.109448457147210021, 0.111791568164245583, 0.114145977828255210, 0.116511665626037014, + 0.118888613443345698, 0.121276805485235437, 0.123676228202051403, 0.126086870220650349, + 0.128508722280473636, 0.130941777174128166, 0.133386029692162844, 0.135841476571757352, + 0.138308116449064322, 0.140785949814968309, 0.143274978974047118, 0.145775208006537926, + 0.148286642733128721, 0.150809290682410169, 0.153343161060837674, 0.155888264725064563, + 0.158444614156520225, 0.161012223438117663, 0.163591108232982951, 0.166181285765110071, + 0.168782774801850333, 0.171395595638155623, 0.174019770082499359, 0.176655321444406654, + 0.179302274523530397, 0.181960655600216487, 0.184630492427504539, 0.187311814224516926, + 0.190004651671193070, 0.192709036904328807, 0.195425003514885592, 0.198152586546538112, + 0.200891822495431333, 0.203642749311121501, 0.206405406398679298, 0.209179834621935651, + 0.211966076307852941, 0.214764175252008499, 0.217574176725178370, 0.220396127481011589, + 0.223230075764789593, 0.226076071323264877, 0.228934165415577484, 0.231804410825248525, + 0.234686861873252689, 0.237581574432173676, 0.240488605941449107, 0.243408015423711988, + 0.246339863502238771, 0.249284212419516704, 0.252241126056943765, 0.255210669955677150, + 0.258192911338648023, 0.261187919133763713, 0.264195763998317568, 0.267216518344631837, + 0.270250256366959984, 0.273297054069675804, 0.276356989296781264, 0.279430141762765316, + 0.282516593084849388, 0.285616426816658109, 0.288729728483353931, 0.291856585618280984, + 0.294997087801162572, 0.298151326697901342, 0.301319396102034120, 0.304501391977896274, + 0.307697412505553769, 0.310907558127563710, 0.314131931597630143, 0.317370638031222396, + 0.320623784958230129, 0.323891482377732021, 0.327173842814958593, 0.330470981380537099, + 0.333783015832108509, 0.337110066638412809, 0.340452257045945450, 0.343809713148291340, + 0.347182563958251478, 0.350570941482881204, 0.353974980801569250, 0.357394820147290515, + 0.360830600991175754, 0.364282468130549597, 0.367750569780596226, 0.371235057669821344, + 0.374736087139491414, 0.378253817247238111, 0.381788410875031348, 0.385340034841733958, + 0.388908860020464597, 0.392495061461010764, 0.396098818517547080, 0.399720314981931668, + 0.403359739222868885, 0.407017284331247953, 0.410693148271983222, 0.414387534042706784, + 0.418100649839684591, 0.421832709231353298, 0.425583931339900579, 0.429354541031341519, + 0.433144769114574058, 0.436954852549929273, 0.440785034667769915, 0.444635565397727750, + 0.448506701509214067, 0.452398706863882505, 0.456311852680773566, 0.460246417814923481, + 0.464202689050278838, 0.468180961407822172, 0.472181538469883255, 0.476204732721683788, + 0.480250865911249714, 0.484320269428911598, 0.488413284707712059, 0.492530263646148658, + 0.496671569054796314, 0.500837575128482149, 0.505028667945828791, 0.509245245998136142, + 0.513487720749743026, 0.517756517232200619, 0.522052074674794864, 0.526374847174186700, + 0.530725304406193921, 0.535103932383019565, 0.539511234259544614, 0.543947731192649941, + 0.548413963257921133, 0.552910490428519918, 0.557437893621486324, 0.561996775817277916, + 0.566587763258951771, 0.571211506738074970, 0.575868682975210544, 0.580559996103683473, + 0.585286179266300333, 0.590047996335791969, 0.594846243770991268, 0.599681752622167719, + 0.604555390700549533, 0.609468064928895381, 0.614420723892076803, 0.619414360609039205, + 0.624450015550274240, 0.629528779928128279, 0.634651799290960050, 0.639820277456438991, + 0.645035480824251883, 0.650298743114294586, 0.655611470583224665, 0.660975147780241357, + 0.666391343912380640, 0.671861719900766374, 0.677388036222513090, 0.682972161648791376, + 0.688616083008527058, 0.694321916130032579, 0.700091918140490099, 0.705928501336797409, + 0.711834248882358467, 0.717811932634901395, 0.723864533472881599, 0.729995264565802437, + 0.736207598131266683, 0.742505296344636245, 0.748892447223726720, 0.755373506511754500, + 0.761953346841546475, 0.768637315803334831, 0.775431304986138326, 0.782341832659861902, + 0.789376143571198563, 0.796542330428254619, 0.803849483176389490, 0.811307874318219935, + 0.818929191609414797, 0.826726833952094231, 0.834716292992930375, 0.842915653118441077, + 0.851346258465123684, 0.860033621203008636, 0.869008688043793165, 0.878309655816146839, + 0.887984660763399880, 0.898095921906304051, 0.908726440060562912, 0.919991505048360247, + 0.932060075968990209, 0.945198953453078028, 0.959879091812415930, 0.977101701282731328, + 1.000000000000000000]; +pub const ZIG_EXP_R: f64 = 7.697117470131050077; +pub static ZIG_EXP_X: [f64; 257] = + [8.697117470131052741, 7.697117470131050077, 6.941033629377212577, 6.478378493832569696, + 6.144164665772472667, 5.882144315795399869, 5.666410167454033697, 5.482890627526062488, + 5.323090505754398016, 5.181487281301500047, 5.054288489981304089, 4.938777085901250530, + 4.832939741025112035, 4.735242996601741083, 4.644491885420085175, 4.559737061707351380, + 4.480211746528421912, 4.405287693473573185, 4.334443680317273007, 4.267242480277365857, + 4.203313713735184365, 4.142340865664051464, 4.084051310408297830, 4.028208544647936762, + 3.974606066673788796, 3.923062500135489739, 3.873417670399509127, 3.825529418522336744, + 3.779270992411667862, 3.734528894039797375, 3.691201090237418825, 3.649195515760853770, + 3.608428813128909507, 3.568825265648337020, 3.530315889129343354, 3.492837654774059608, + 3.456332821132760191, 3.420748357251119920, 3.386035442460300970, 3.352149030900109405, + 3.319047470970748037, 3.286692171599068679, 3.255047308570449882, 3.224079565286264160, + 3.193757903212240290, 3.164053358025972873, 3.134938858084440394, 3.106389062339824481, + 3.078380215254090224, 3.050890016615455114, 3.023897504455676621, 2.997382949516130601, + 2.971327759921089662, 2.945714394895045718, 2.920526286512740821, 2.895747768600141825, + 2.871364012015536371, 2.847360965635188812, 2.823725302450035279, 2.800444370250737780, + 2.777506146439756574, 2.754899196562344610, 2.732612636194700073, 2.710636095867928752, + 2.688959688741803689, 2.667573980773266573, 2.646469963151809157, 2.625639026797788489, + 2.605072938740835564, 2.584763820214140750, 2.564704126316905253, 2.544886627111869970, + 2.525304390037828028, 2.505950763528594027, 2.486819361740209455, 2.467904050297364815, + 2.449198932978249754, 2.430698339264419694, 2.412396812688870629, 2.394289099921457886, + 2.376370140536140596, 2.358635057409337321, 2.341079147703034380, 2.323697874390196372, + 2.306486858283579799, 2.289441870532269441, 2.272558825553154804, 2.255833774367219213, + 2.239262898312909034, 2.222842503111036816, 2.206569013257663858, 2.190438966723220027, + 2.174449009937774679, 2.158595893043885994, 2.142876465399842001, 2.127287671317368289, + 2.111826546019042183, 2.096490211801715020, 2.081275874393225145, 2.066180819490575526, + 2.051202409468584786, 2.036338080248769611, 2.021585338318926173, 2.006941757894518563, + 1.992404978213576650, 1.977972700957360441, 1.963642687789548313, 1.949412758007184943, + 1.935280786297051359, 1.921244700591528076, 1.907302480018387536, 1.893452152939308242, + 1.879691795072211180, 1.866019527692827973, 1.852433515911175554, 1.838931967018879954, + 1.825513128903519799, 1.812175288526390649, 1.798916770460290859, 1.785735935484126014, + 1.772631179231305643, 1.759600930889074766, 1.746643651946074405, 1.733757834985571566, + 1.720942002521935299, 1.708194705878057773, 1.695514524101537912, 1.682900062917553896, + 1.670349953716452118, 1.657862852574172763, 1.645437439303723659, 1.633072416535991334, + 1.620766508828257901, 1.608518461798858379, 1.596327041286483395, 1.584191032532688892, + 1.572109239386229707, 1.560080483527888084, 1.548103603714513499, 1.536177455041032092, + 1.524300908219226258, 1.512472848872117082, 1.500692176842816750, 1.488957805516746058, + 1.477268661156133867, 1.465623682245745352, 1.454021818848793446, 1.442462031972012504, + 1.430943292938879674, 1.419464582769983219, 1.408024891569535697, 1.396623217917042137, + 1.385258568263121992, 1.373929956328490576, 1.362636402505086775, 1.351376933258335189, + 1.340150580529504643, 1.328956381137116560, 1.317793376176324749, 1.306660610415174117, + 1.295557131686601027, 1.284481990275012642, 1.273434238296241139, 1.262412929069615330, + 1.251417116480852521, 1.240445854334406572, 1.229498195693849105, 1.218573192208790124, + 1.207669893426761121, 1.196787346088403092, 1.185924593404202199, 1.175080674310911677, + 1.164254622705678921, 1.153445466655774743, 1.142652227581672841, 1.131873919411078511, + 1.121109547701330200, 1.110358108727411031, 1.099618588532597308, 1.088889961938546813, + 1.078171191511372307, 1.067461226479967662, 1.056759001602551429, 1.046063435977044209, + 1.035373431790528542, 1.024687873002617211, 1.014005623957096480, 1.003325527915696735, + 0.992646405507275897, 0.981967053085062602, 0.971286240983903260, 0.960602711668666509, + 0.949915177764075969, 0.939222319955262286, 0.928522784747210395, 0.917815182070044311, + 0.907098082715690257, 0.896370015589889935, 0.885629464761751528, 0.874874866291025066, + 0.864104604811004484, 0.853317009842373353, 0.842510351810368485, 0.831682837734273206, + 0.820832606554411814, 0.809957724057418282, 0.799056177355487174, 0.788125868869492430, + 0.777164609759129710, 0.766170112735434672, 0.755139984181982249, 0.744071715500508102, + 0.732962673584365398, 0.721810090308756203, 0.710611050909655040, 0.699362481103231959, + 0.688061132773747808, 0.676703568029522584, 0.665286141392677943, 0.653804979847664947, + 0.642255960424536365, 0.630634684933490286, 0.618936451394876075, 0.607156221620300030, + 0.595288584291502887, 0.583327712748769489, 0.571267316532588332, 0.559100585511540626, + 0.546820125163310577, 0.534417881237165604, 0.521885051592135052, 0.509211982443654398, + 0.496388045518671162, 0.483401491653461857, 0.470239275082169006, 0.456886840931420235, + 0.443327866073552401, 0.429543940225410703, 0.415514169600356364, 0.401214678896277765, + 0.386617977941119573, 0.371692145329917234, 0.356399760258393816, 0.340696481064849122, + 0.324529117016909452, 0.307832954674932158, 0.290527955491230394, 0.272513185478464703, + 0.253658363385912022, 0.233790483059674731, 0.212671510630966620, 0.189958689622431842, + 0.165127622564187282, 0.137304980940012589, 0.104838507565818778, 0.063852163815001570, + 0.000000000000000000]; +pub static ZIG_EXP_F: [f64; 257] = + [0.000167066692307963, 0.000454134353841497, 0.000967269282327174, 0.001536299780301573, + 0.002145967743718907, 0.002788798793574076, 0.003460264777836904, 0.004157295120833797, + 0.004877655983542396, 0.005619642207205489, 0.006381905937319183, 0.007163353183634991, + 0.007963077438017043, 0.008780314985808977, 0.009614413642502212, 0.010464810181029981, + 0.011331013597834600, 0.012212592426255378, 0.013109164931254991, 0.014020391403181943, + 0.014945968011691148, 0.015885621839973156, 0.016839106826039941, 0.017806200410911355, + 0.018786700744696024, 0.019780424338009740, 0.020787204072578114, 0.021806887504283581, + 0.022839335406385240, 0.023884420511558174, 0.024942026419731787, 0.026012046645134221, + 0.027094383780955803, 0.028188948763978646, 0.029295660224637411, 0.030414443910466622, + 0.031545232172893622, 0.032687963508959555, 0.033842582150874358, 0.035009037697397431, + 0.036187284781931443, 0.037377282772959382, 0.038578995503074871, 0.039792391023374139, + 0.041017441380414840, 0.042254122413316254, 0.043502413568888197, 0.044762297732943289, + 0.046033761076175184, 0.047316792913181561, 0.048611385573379504, 0.049917534282706379, + 0.051235237055126281, 0.052564494593071685, 0.053905310196046080, 0.055257689676697030, + 0.056621641283742870, 0.057997175631200659, 0.059384305633420280, 0.060783046445479660, + 0.062193415408541036, 0.063615431999807376, 0.065049117786753805, 0.066494496385339816, + 0.067951593421936643, 0.069420436498728783, 0.070901055162371843, 0.072393480875708752, + 0.073897746992364746, 0.075413888734058410, 0.076941943170480517, 0.078481949201606435, + 0.080033947542319905, 0.081597980709237419, 0.083174093009632397, 0.084762330532368146, + 0.086362741140756927, 0.087975374467270231, 0.089600281910032886, 0.091237516631040197, + 0.092887133556043569, 0.094549189376055873, 0.096223742550432825, 0.097910853311492213, + 0.099610583670637132, 0.101322997425953631, 0.103048160171257702, 0.104786139306570145, + 0.106537004050001632, 0.108300825451033755, 0.110077676405185357, 0.111867631670056283, + 0.113670767882744286, 0.115487163578633506, 0.117316899211555525, 0.119160057175327641, + 0.121016721826674792, 0.122886979509545108, 0.124770918580830933, 0.126668629437510671, + 0.128580204545228199, 0.130505738468330773, 0.132445327901387494, 0.134399071702213602, + 0.136367070926428829, 0.138349428863580176, 0.140346251074862399, 0.142357645432472146, + 0.144383722160634720, 0.146424593878344889, 0.148480375643866735, 0.150551185001039839, + 0.152637142027442801, 0.154738369384468027, 0.156854992369365148, 0.158987138969314129, + 0.161134939917591952, 0.163298528751901734, 0.165478041874935922, 0.167673618617250081, + 0.169885401302527550, 0.172113535315319977, 0.174358169171353411, 0.176619454590494829, + 0.178897546572478278, 0.181192603475496261, 0.183504787097767436, 0.185834262762197083, + 0.188181199404254262, 0.190545769663195363, 0.192928149976771296, 0.195328520679563189, + 0.197747066105098818, 0.200183974691911210, 0.202639439093708962, 0.205113656293837654, + 0.207606827724221982, 0.210119159388988230, 0.212650861992978224, 0.215202151075378628, + 0.217773247148700472, 0.220364375843359439, 0.222975768058120111, 0.225607660116683956, + 0.228260293930716618, 0.230933917169627356, 0.233628783437433291, 0.236345152457059560, + 0.239083290262449094, 0.241843469398877131, 0.244625969131892024, 0.247431075665327543, + 0.250259082368862240, 0.253110290015629402, 0.255985007030415324, 0.258883549749016173, + 0.261806242689362922, 0.264753418835062149, 0.267725419932044739, 0.270722596799059967, + 0.273745309652802915, 0.276793928448517301, 0.279868833236972869, 0.282970414538780746, + 0.286099073737076826, 0.289255223489677693, 0.292439288161892630, 0.295651704281261252, + 0.298892921015581847, 0.302163400675693528, 0.305463619244590256, 0.308794066934560185, + 0.312155248774179606, 0.315547685227128949, 0.318971912844957239, 0.322428484956089223, + 0.325917972393556354, 0.329440964264136438, 0.332998068761809096, 0.336589914028677717, + 0.340217149066780189, 0.343880444704502575, 0.347580494621637148, 0.351318016437483449, + 0.355093752866787626, 0.358908472948750001, 0.362762973354817997, 0.366658079781514379, + 0.370594648435146223, 0.374573567615902381, 0.378595759409581067, 0.382662181496010056, + 0.386773829084137932, 0.390931736984797384, 0.395136981833290435, 0.399390684475231350, + 0.403694012530530555, 0.408048183152032673, 0.412454465997161457, 0.416914186433003209, + 0.421428728997616908, 0.425999541143034677, 0.430628137288459167, 0.435316103215636907, + 0.440065100842354173, 0.444876873414548846, 0.449753251162755330, 0.454696157474615836, + 0.459707615642138023, 0.464789756250426511, 0.469944825283960310, 0.475175193037377708, + 0.480483363930454543, 0.485871987341885248, 0.491343869594032867, 0.496901987241549881, + 0.502549501841348056, 0.508289776410643213, 0.514126393814748894, 0.520063177368233931, + 0.526104213983620062, 0.532253880263043655, 0.538516872002862246, 0.544898237672440056, + 0.551403416540641733, 0.558038282262587892, 0.564809192912400615, 0.571723048664826150, + 0.578787358602845359, 0.586010318477268366, 0.593400901691733762, 0.600968966365232560, + 0.608725382079622346, 0.616682180915207878, 0.624852738703666200, 0.633251994214366398, + 0.641896716427266423, 0.650805833414571433, 0.660000841079000145, 0.669506316731925177, + 0.679350572264765806, 0.689566496117078431, 0.700192655082788606, 0.711274760805076456, + 0.722867659593572465, 0.735038092431424039, 0.747868621985195658, 0.761463388849896838, + 0.775956852040116218, 0.791527636972496285, 0.808421651523009044, 0.826993296643051101, + 0.847785500623990496, 0.871704332381204705, 0.900469929925747703, 0.938143680862176477, + 1.000000000000000000]; diff --git a/vendor/registry-40351f815f426200/rand/src/lib.rs b/vendor/registry-40351f815f426200/rand/src/lib.rs new file mode 100644 index 000000000..9c0482f32 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/lib.rs @@ -0,0 +1,830 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2017 The Rust Project 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. + +//! Utilities for random number generation +//! +//! Rand provides utilities to generate random numbers, to convert them to +//! useful types and distributions, and some randomness-related algorithms. +//! +//! # Quick Start +//! +//! To get you started quickly, the easiest and highest-level way to get +//! a random value is to use [`random()`]; alternatively you can use +//! [`thread_rng()`]. The [`Rng`] trait provides a useful API on all RNGs, while +//! the [`distributions`] and [`seq`] modules provide further +//! functionality on top of RNGs. +//! +//! ``` +//! use rand::prelude::*; +//! +//! if rand::random() { // generates a boolean +//! // Try printing a random unicode code point (probably a bad idea)! +//! println!("char: {}", rand::random::()); +//! } +//! +//! let mut rng = rand::thread_rng(); +//! let y: f64 = rng.gen(); // generates a float between 0 and 1 +//! +//! let mut nums: Vec = (1..100).collect(); +//! nums.shuffle(&mut rng); +//! ``` +//! +//! # The Book +//! +//! For the user guide and futher documentation, please read +//! [The Rust Rand Book](https://rust-random.github.io/book). + + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![cfg_attr(not(feature="std"), no_std)] +#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))] +#![cfg_attr(all(feature="simd_support", feature="nightly"), feature(stdsimd))] + +#[cfg(feature = "std")] extern crate core; +#[cfg(all(feature = "alloc", not(feature="std")))] #[macro_use] extern crate alloc; + +#[cfg(feature="simd_support")] extern crate packed_simd; + +extern crate rand_jitter; +#[cfg(feature = "rand_os")] +extern crate rand_os; + +extern crate rand_core; +extern crate rand_isaac; // only for deprecations +extern crate rand_chacha; // only for deprecations +extern crate rand_hc; +extern crate rand_pcg; +extern crate rand_xorshift; + +#[cfg(feature = "log")] #[macro_use] extern crate log; +#[allow(unused)] +#[cfg(not(feature = "log"))] macro_rules! trace { ($($x:tt)*) => () } +#[allow(unused)] +#[cfg(not(feature = "log"))] macro_rules! debug { ($($x:tt)*) => () } +#[allow(unused)] +#[cfg(not(feature = "log"))] macro_rules! info { ($($x:tt)*) => () } +#[allow(unused)] +#[cfg(not(feature = "log"))] macro_rules! warn { ($($x:tt)*) => () } +#[allow(unused)] +#[cfg(not(feature = "log"))] macro_rules! error { ($($x:tt)*) => () } + + +// Re-exports from rand_core +pub use rand_core::{RngCore, CryptoRng, SeedableRng}; +pub use rand_core::{ErrorKind, Error}; + +// Public exports +#[cfg(feature="std")] pub use rngs::thread::thread_rng; + +// Public modules +pub mod distributions; +pub mod prelude; +#[deprecated(since="0.6.0")] +pub mod prng; +pub mod rngs; +pub mod seq; + +//////////////////////////////////////////////////////////////////////////////// +// Compatibility re-exports. Documentation is hidden; will be removed eventually. + +#[doc(hidden)] mod deprecated; + +#[allow(deprecated)] +#[doc(hidden)] pub use deprecated::ReseedingRng; + +#[allow(deprecated)] +#[cfg(feature="std")] #[doc(hidden)] pub use deprecated::EntropyRng; + +#[allow(deprecated)] +#[cfg(feature="rand_os")] +#[doc(hidden)] +pub use deprecated::OsRng; + +#[allow(deprecated)] +#[doc(hidden)] pub use deprecated::{ChaChaRng, IsaacRng, Isaac64Rng, XorShiftRng}; +#[allow(deprecated)] +#[doc(hidden)] pub use deprecated::StdRng; + + +#[allow(deprecated)] +#[doc(hidden)] +pub mod jitter { + pub use deprecated::JitterRng; + pub use rngs::TimerError; +} +#[allow(deprecated)] +#[cfg(feature="rand_os")] +#[doc(hidden)] +pub mod os { + pub use deprecated::OsRng; +} +#[allow(deprecated)] +#[doc(hidden)] +pub mod chacha { + pub use deprecated::ChaChaRng; +} +#[allow(deprecated)] +#[doc(hidden)] +pub mod isaac { + pub use deprecated::{IsaacRng, Isaac64Rng}; +} +#[allow(deprecated)] +#[cfg(feature="std")] +#[doc(hidden)] +pub mod read { + pub use deprecated::ReadRng; +} + +#[allow(deprecated)] +#[cfg(feature="std")] #[doc(hidden)] pub use deprecated::ThreadRng; + +//////////////////////////////////////////////////////////////////////////////// + + +use core::{mem, slice}; +use distributions::{Distribution, Standard}; +use distributions::uniform::{SampleUniform, UniformSampler, SampleBorrow}; + +/// An automatically-implemented extension trait on [`RngCore`] providing high-level +/// generic methods for sampling values and other convenience methods. +/// +/// This is the primary trait to use when generating random values. +/// +/// # Generic usage +/// +/// The basic pattern is `fn foo(rng: &mut R)`. Some +/// things are worth noting here: +/// +/// - Since `Rng: RngCore` and every `RngCore` implements `Rng`, it makes no +/// difference whether we use `R: Rng` or `R: RngCore`. +/// - The `+ ?Sized` un-bounding allows functions to be called directly on +/// type-erased references; i.e. `foo(r)` where `r: &mut RngCore`. Without +/// this it would be necessary to write `foo(&mut r)`. +/// +/// An alternative pattern is possible: `fn foo(rng: R)`. This has some +/// trade-offs. It allows the argument to be consumed directly without a `&mut` +/// (which is how `from_rng(thread_rng())` works); also it still works directly +/// on references (including type-erased references). Unfortunately within the +/// function `foo` it is not known whether `rng` is a reference type or not, +/// hence many uses of `rng` require an extra reference, either explicitly +/// (`distr.sample(&mut rng)`) or implicitly (`rng.gen()`); one may hope the +/// optimiser can remove redundant references later. +/// +/// Example: +/// +/// ``` +/// # use rand::thread_rng; +/// use rand::Rng; +/// +/// fn foo(rng: &mut R) -> f32 { +/// rng.gen() +/// } +/// +/// # let v = foo(&mut thread_rng()); +/// ``` +pub trait Rng: RngCore { + /// Return a random value supporting the [`Standard`] distribution. + /// + /// [`Standard`]: distributions::Standard + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// + /// let mut rng = thread_rng(); + /// let x: u32 = rng.gen(); + /// println!("{}", x); + /// println!("{:?}", rng.gen::<(f64, bool)>()); + /// ``` + #[inline] + fn gen(&mut self) -> T where Standard: Distribution { + Standard.sample(self) + } + + /// Generate a random value in the range [`low`, `high`), i.e. inclusive of + /// `low` and exclusive of `high`. + /// + /// This function is optimised for the case that only a single sample is + /// made from the given range. See also the [`Uniform`] distribution + /// type which may be faster if sampling from the same range repeatedly. + /// + /// # Panics + /// + /// Panics if `low >= high`. + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// + /// let mut rng = thread_rng(); + /// let n: u32 = rng.gen_range(0, 10); + /// println!("{}", n); + /// let m: f64 = rng.gen_range(-40.0f64, 1.3e5f64); + /// println!("{}", m); + /// ``` + /// + /// [`Uniform`]: distributions::uniform::Uniform + fn gen_range(&mut self, low: B1, high: B2) -> T + where B1: SampleBorrow + Sized, + B2: SampleBorrow + Sized { + T::Sampler::sample_single(low, high, self) + } + + /// Sample a new value, using the given distribution. + /// + /// ### Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// use rand::distributions::Uniform; + /// + /// let mut rng = thread_rng(); + /// let x = rng.sample(Uniform::new(10u32, 15)); + /// // Type annotation requires two types, the type and distribution; the + /// // distribution can be inferred. + /// let y = rng.sample::(Uniform::new(10, 15)); + /// ``` + fn sample>(&mut self, distr: D) -> T { + distr.sample(self) + } + + /// Create an iterator that generates values using the given distribution. + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// use rand::distributions::{Alphanumeric, Uniform, Standard}; + /// + /// let mut rng = thread_rng(); + /// + /// // Vec of 16 x f32: + /// let v: Vec = thread_rng().sample_iter(&Standard).take(16).collect(); + /// + /// // String: + /// let s: String = rng.sample_iter(&Alphanumeric).take(7).collect(); + /// + /// // Combined values + /// println!("{:?}", thread_rng().sample_iter(&Standard).take(5) + /// .collect::>()); + /// + /// // Dice-rolling: + /// let die_range = Uniform::new_inclusive(1, 6); + /// let mut roll_die = rng.sample_iter(&die_range); + /// while roll_die.next().unwrap() != 6 { + /// println!("Not a 6; rolling again!"); + /// } + /// ``` + fn sample_iter<'a, T, D: Distribution>(&'a mut self, distr: &'a D) + -> distributions::DistIter<'a, D, Self, T> where Self: Sized + { + distr.sample_iter(self) + } + + /// Fill `dest` entirely with random bytes (uniform value distribution), + /// where `dest` is any type supporting [`AsByteSliceMut`], namely slices + /// and arrays over primitive integer types (`i8`, `i16`, `u32`, etc.). + /// + /// On big-endian platforms this performs byte-swapping to ensure + /// portability of results from reproducible generators. + /// + /// This uses [`fill_bytes`] internally which may handle some RNG errors + /// implicitly (e.g. waiting if the OS generator is not ready), but panics + /// on other errors. See also [`try_fill`] which returns errors. + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// + /// let mut arr = [0i8; 20]; + /// thread_rng().fill(&mut arr[..]); + /// ``` + /// + /// [`fill_bytes`]: RngCore::fill_bytes + /// [`try_fill`]: Rng::try_fill + fn fill(&mut self, dest: &mut T) { + self.fill_bytes(dest.as_byte_slice_mut()); + dest.to_le(); + } + + /// Fill `dest` entirely with random bytes (uniform value distribution), + /// where `dest` is any type supporting [`AsByteSliceMut`], namely slices + /// and arrays over primitive integer types (`i8`, `i16`, `u32`, etc.). + /// + /// On big-endian platforms this performs byte-swapping to ensure + /// portability of results from reproducible generators. + /// + /// This uses [`try_fill_bytes`] internally and forwards all RNG errors. In + /// some cases errors may be resolvable; see [`ErrorKind`] and + /// documentation for the RNG in use. If you do not plan to handle these + /// errors you may prefer to use [`fill`]. + /// + /// # Example + /// + /// ``` + /// # use rand::Error; + /// use rand::{thread_rng, Rng}; + /// + /// # fn try_inner() -> Result<(), Error> { + /// let mut arr = [0u64; 4]; + /// thread_rng().try_fill(&mut arr[..])?; + /// # Ok(()) + /// # } + /// + /// # try_inner().unwrap() + /// ``` + /// + /// [`try_fill_bytes`]: RngCore::try_fill_bytes + /// [`fill`]: Rng::fill + fn try_fill(&mut self, dest: &mut T) -> Result<(), Error> { + self.try_fill_bytes(dest.as_byte_slice_mut())?; + dest.to_le(); + Ok(()) + } + + /// Return a bool with a probability `p` of being true. + /// + /// See also the [`Bernoulli`] distribution, which may be faster if + /// sampling from the same probability repeatedly. + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// + /// let mut rng = thread_rng(); + /// println!("{}", rng.gen_bool(1.0 / 3.0)); + /// ``` + /// + /// # Panics + /// + /// If `p < 0` or `p > 1`. + /// + /// [`Bernoulli`]: distributions::bernoulli::Bernoulli + #[inline] + fn gen_bool(&mut self, p: f64) -> bool { + let d = distributions::Bernoulli::new(p); + self.sample(d) + } + + /// Return a bool with a probability of `numerator/denominator` of being + /// true. I.e. `gen_ratio(2, 3)` has chance of 2 in 3, or about 67%, of + /// returning true. If `numerator == denominator`, then the returned value + /// is guaranteed to be `true`. If `numerator == 0`, then the returned + /// value is guaranteed to be `false`. + /// + /// See also the [`Bernoulli`] distribution, which may be faster if + /// sampling from the same `numerator` and `denominator` repeatedly. + /// + /// # Panics + /// + /// If `denominator == 0` or `numerator > denominator`. + /// + /// # Example + /// + /// ``` + /// use rand::{thread_rng, Rng}; + /// + /// let mut rng = thread_rng(); + /// println!("{}", rng.gen_ratio(2, 3)); + /// ``` + /// + /// [`Bernoulli`]: distributions::bernoulli::Bernoulli + #[inline] + fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool { + let d = distributions::Bernoulli::from_ratio(numerator, denominator); + self.sample(d) + } + + /// Return a random element from `values`. + /// + /// Deprecated: use [`seq::SliceRandom::choose`] instead. + #[deprecated(since="0.6.0", note="use SliceRandom::choose instead")] + fn choose<'a, T>(&mut self, values: &'a [T]) -> Option<&'a T> { + use seq::SliceRandom; + values.choose(self) + } + + /// Return a mutable pointer to a random element from `values`. + /// + /// Deprecated: use [`seq::SliceRandom::choose_mut`] instead. + #[deprecated(since="0.6.0", note="use SliceRandom::choose_mut instead")] + fn choose_mut<'a, T>(&mut self, values: &'a mut [T]) -> Option<&'a mut T> { + use seq::SliceRandom; + values.choose_mut(self) + } + + /// Shuffle a mutable slice in place. + /// + /// Deprecated: use [`seq::SliceRandom::shuffle`] instead. + #[deprecated(since="0.6.0", note="use SliceRandom::shuffle instead")] + fn shuffle(&mut self, values: &mut [T]) { + use seq::SliceRandom; + values.shuffle(self) + } +} + +impl Rng for R {} + +/// Trait for casting types to byte slices +/// +/// This is used by the [`Rng::fill`] and [`Rng::try_fill`] methods. +pub trait AsByteSliceMut { + /// Return a mutable reference to self as a byte slice + fn as_byte_slice_mut(&mut self) -> &mut [u8]; + + /// Call `to_le` on each element (i.e. byte-swap on Big Endian platforms). + fn to_le(&mut self); +} + +impl AsByteSliceMut for [u8] { + fn as_byte_slice_mut(&mut self) -> &mut [u8] { + self + } + + fn to_le(&mut self) {} +} + +macro_rules! impl_as_byte_slice { + ($t:ty) => { + impl AsByteSliceMut for [$t] { + fn as_byte_slice_mut(&mut self) -> &mut [u8] { + if self.len() == 0 { + unsafe { + // must not use null pointer + slice::from_raw_parts_mut(0x1 as *mut u8, 0) + } + } else { + unsafe { + slice::from_raw_parts_mut(&mut self[0] + as *mut $t + as *mut u8, + self.len() * mem::size_of::<$t>() + ) + } + } + } + + fn to_le(&mut self) { + for x in self { + *x = x.to_le(); + } + } + } + } +} + +impl_as_byte_slice!(u16); +impl_as_byte_slice!(u32); +impl_as_byte_slice!(u64); +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] impl_as_byte_slice!(u128); +impl_as_byte_slice!(usize); +impl_as_byte_slice!(i8); +impl_as_byte_slice!(i16); +impl_as_byte_slice!(i32); +impl_as_byte_slice!(i64); +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] impl_as_byte_slice!(i128); +impl_as_byte_slice!(isize); + +macro_rules! impl_as_byte_slice_arrays { + ($n:expr,) => {}; + ($n:expr, $N:ident, $($NN:ident,)*) => { + impl_as_byte_slice_arrays!($n - 1, $($NN,)*); + + impl AsByteSliceMut for [T; $n] where [T]: AsByteSliceMut { + fn as_byte_slice_mut(&mut self) -> &mut [u8] { + self[..].as_byte_slice_mut() + } + + fn to_le(&mut self) { + self[..].to_le() + } + } + }; + (!div $n:expr,) => {}; + (!div $n:expr, $N:ident, $($NN:ident,)*) => { + impl_as_byte_slice_arrays!(!div $n / 2, $($NN,)*); + + impl AsByteSliceMut for [T; $n] where [T]: AsByteSliceMut { + fn as_byte_slice_mut(&mut self) -> &mut [u8] { + self[..].as_byte_slice_mut() + } + + fn to_le(&mut self) { + self[..].to_le() + } + } + }; +} +impl_as_byte_slice_arrays!(32, N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,); +impl_as_byte_slice_arrays!(!div 4096, N,N,N,N,N,N,N,); + + +/// A convenience extension to [`SeedableRng`] allowing construction from fresh +/// entropy. This trait is automatically implemented for any PRNG implementing +/// [`SeedableRng`] and is not intended to be implemented by users. +/// +/// This is equivalent to using `SeedableRng::from_rng(EntropyRng::new())` then +/// unwrapping the result. +/// +/// Since this is convenient and secure, it is the recommended way to create +/// PRNGs, though two alternatives may be considered: +/// +/// * Deterministic creation using [`SeedableRng::from_seed`] with a fixed seed +/// * Seeding from `thread_rng`: `SeedableRng::from_rng(thread_rng())?`; +/// this will usually be faster and should also be secure, but requires +/// trusting one extra component. +/// +/// ## Example +/// +/// ``` +/// use rand::{Rng, FromEntropy}; +/// use rand::rngs::StdRng; +/// +/// let mut rng = StdRng::from_entropy(); +/// println!("Random die roll: {}", rng.gen_range(1, 7)); +/// ``` +/// +/// [`EntropyRng`]: rngs::EntropyRng +#[cfg(feature="std")] +pub trait FromEntropy: SeedableRng { + /// Creates a new instance, automatically seeded with fresh entropy. + /// + /// Normally this will use `OsRng`, but if that fails `JitterRng` will be + /// used instead. Both should be suitable for cryptography. It is possible + /// that both entropy sources will fail though unlikely; failures would + /// almost certainly be platform limitations or build issues, i.e. most + /// applications targetting PC/mobile platforms should not need to worry + /// about this failing. + /// + /// # Panics + /// + /// If all entropy sources fail this will panic. If you need to handle + /// errors, use the following code, equivalent aside from error handling: + /// + /// ``` + /// # use rand::Error; + /// use rand::prelude::*; + /// use rand::rngs::EntropyRng; + /// + /// # fn try_inner() -> Result<(), Error> { + /// // This uses StdRng, but is valid for any R: SeedableRng + /// let mut rng = StdRng::from_rng(EntropyRng::new())?; + /// + /// println!("random number: {}", rng.gen_range(1, 10)); + /// # Ok(()) + /// # } + /// + /// # try_inner().unwrap() + /// ``` + fn from_entropy() -> Self; +} + +#[cfg(feature="std")] +impl FromEntropy for R { + fn from_entropy() -> R { + R::from_rng(rngs::EntropyRng::new()).unwrap_or_else(|err| + panic!("FromEntropy::from_entropy() failed: {}", err)) + } +} + + +/// Generates a random value using the thread-local random number generator. +/// +/// This is simply a shortcut for `thread_rng().gen()`. See [`thread_rng`] for +/// documentation of the entropy source and [`Standard`] for documentation of +/// distributions and type-specific generation. +/// +/// # Examples +/// +/// ``` +/// let x = rand::random::(); +/// println!("{}", x); +/// +/// let y = rand::random::(); +/// println!("{}", y); +/// +/// if rand::random() { // generates a boolean +/// println!("Better lucky than good!"); +/// } +/// ``` +/// +/// If you're calling `random()` in a loop, caching the generator as in the +/// following example can increase performance. +/// +/// ``` +/// use rand::Rng; +/// +/// let mut v = vec![1, 2, 3]; +/// +/// for x in v.iter_mut() { +/// *x = rand::random() +/// } +/// +/// // can be made faster by caching thread_rng +/// +/// let mut rng = rand::thread_rng(); +/// +/// for x in v.iter_mut() { +/// *x = rng.gen(); +/// } +/// ``` +/// +/// [`Standard`]: distributions::Standard +#[cfg(feature="std")] +#[inline] +pub fn random() -> T where Standard: Distribution { + thread_rng().gen() +} + +#[cfg(test)] +mod test { + use rngs::mock::StepRng; + use rngs::StdRng; + use super::*; + #[cfg(all(not(feature="std"), feature="alloc"))] use alloc::boxed::Box; + + pub struct TestRng { inner: R } + + impl RngCore for TestRng { + fn next_u32(&mut self) -> u32 { + self.inner.next_u32() + } + fn next_u64(&mut self) -> u64 { + self.inner.next_u64() + } + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.inner.fill_bytes(dest) + } + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.inner.try_fill_bytes(dest) + } + } + + pub fn rng(seed: u64) -> TestRng { + TestRng { inner: StdRng::seed_from_u64(seed) } + } + + #[test] + fn test_fill_bytes_default() { + let mut r = StepRng::new(0x11_22_33_44_55_66_77_88, 0); + + // check every remainder mod 8, both in small and big vectors. + let lengths = [0, 1, 2, 3, 4, 5, 6, 7, + 80, 81, 82, 83, 84, 85, 86, 87]; + for &n in lengths.iter() { + let mut buffer = [0u8; 87]; + let v = &mut buffer[0..n]; + r.fill_bytes(v); + + // use this to get nicer error messages. + for (i, &byte) in v.iter().enumerate() { + if byte == 0 { + panic!("byte {} of {} is zero", i, n) + } + } + } + } + + #[test] + fn test_fill() { + let x = 9041086907909331047; // a random u64 + let mut rng = StepRng::new(x, 0); + + // Convert to byte sequence and back to u64; byte-swap twice if BE. + let mut array = [0u64; 2]; + rng.fill(&mut array[..]); + assert_eq!(array, [x, x]); + assert_eq!(rng.next_u64(), x); + + // Convert to bytes then u32 in LE order + let mut array = [0u32; 2]; + rng.fill(&mut array[..]); + assert_eq!(array, [x as u32, (x >> 32) as u32]); + assert_eq!(rng.next_u32(), x as u32); + } + + #[test] + fn test_fill_empty() { + let mut array = [0u32; 0]; + let mut rng = StepRng::new(0, 1); + rng.fill(&mut array); + rng.fill(&mut array[..]); + } + + #[test] + fn test_gen_range() { + let mut r = rng(101); + for _ in 0..1000 { + let a = r.gen_range(-4711, 17); + assert!(a >= -4711 && a < 17); + let a = r.gen_range(-3i8, 42); + assert!(a >= -3i8 && a < 42i8); + let a = r.gen_range(&10u16, 99); + assert!(a >= 10u16 && a < 99u16); + let a = r.gen_range(-100i32, &2000); + assert!(a >= -100i32 && a < 2000i32); + let a = r.gen_range(&12u32, &24u32); + assert!(a >= 12u32 && a < 24u32); + + assert_eq!(r.gen_range(0u32, 1), 0u32); + assert_eq!(r.gen_range(-12i64, -11), -12i64); + assert_eq!(r.gen_range(3_000_000, 3_000_001), 3_000_000); + } + } + + #[test] + #[should_panic] + fn test_gen_range_panic_int() { + let mut r = rng(102); + r.gen_range(5, -2); + } + + #[test] + #[should_panic] + fn test_gen_range_panic_usize() { + let mut r = rng(103); + r.gen_range(5, 2); + } + + #[test] + fn test_gen_bool() { + let mut r = rng(105); + for _ in 0..5 { + assert_eq!(r.gen_bool(0.0), false); + assert_eq!(r.gen_bool(1.0), true); + } + } + + #[test] + fn test_rng_trait_object() { + use distributions::{Distribution, Standard}; + let mut rng = rng(109); + let mut r = &mut rng as &mut RngCore; + r.next_u32(); + r.gen::(); + assert_eq!(r.gen_range(0, 1), 0); + let _c: u8 = Standard.sample(&mut r); + } + + #[test] + #[cfg(feature="alloc")] + fn test_rng_boxed_trait() { + use distributions::{Distribution, Standard}; + let rng = rng(110); + let mut r = Box::new(rng) as Box; + r.next_u32(); + r.gen::(); + assert_eq!(r.gen_range(0, 1), 0); + let _c: u8 = Standard.sample(&mut r); + } + + #[test] + #[cfg(feature="std")] + fn test_random() { + // not sure how to test this aside from just getting some values + let _n : usize = random(); + let _f : f32 = random(); + let _o : Option> = random(); + let _many : ((), + (usize, + isize, + Option<(u32, (bool,))>), + (u8, i8, u16, i16, u32, i32, u64, i64), + (f32, (f64, (f64,)))) = random(); + } + + #[test] + fn test_gen_ratio_average() { + const NUM: u32 = 3; + const DENOM: u32 = 10; + const N: u32 = 100_000; + + let mut sum: u32 = 0; + let mut rng = rng(111); + for _ in 0..N { + if rng.gen_ratio(NUM, DENOM) { + sum += 1; + } + } + // Have Binomial(N, NUM/DENOM) distribution + let expected = (NUM * N) / DENOM; // exact integer + assert!(((sum - expected) as i32).abs() < 500); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/prelude.rs b/vendor/registry-40351f815f426200/rand/src/prelude.rs new file mode 100644 index 000000000..5d8a0e9b2 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/prelude.rs @@ -0,0 +1,27 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Convenience re-export of common members +//! +//! Like the standard library's prelude, this module simplifies importing of +//! common items. Unlike the standard prelude, the contents of this module must +//! be imported manually: +//! +//! ``` +//! use rand::prelude::*; +//! # let _ = StdRng::from_entropy(); +//! # let mut r = SmallRng::from_rng(thread_rng()).unwrap(); +//! # let _: f32 = r.gen(); +//! ``` + +#[doc(no_inline)] pub use distributions::Distribution; +#[doc(no_inline)] pub use rngs::{SmallRng, StdRng}; +#[doc(no_inline)] #[cfg(feature="std")] pub use rngs::ThreadRng; +#[doc(no_inline)] pub use {Rng, RngCore, CryptoRng, SeedableRng}; +#[doc(no_inline)] #[cfg(feature="std")] pub use {FromEntropy, random, thread_rng}; +#[doc(no_inline)] pub use seq::{SliceRandom, IteratorRandom}; diff --git a/vendor/registry-40351f815f426200/rand/src/prng/mod.rs b/vendor/registry-40351f815f426200/rand/src/prng/mod.rs new file mode 100644 index 000000000..3c0d27b2e --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/prng/mod.rs @@ -0,0 +1,37 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Pseudo-random number generators. +//! +//! This module is deprecated: +//! +//! - documentation has moved to +//! [The Book](https://rust-random.github.io/book/guide-rngs.html), +//! - PRNGs have moved to other `rand_*` crates. + +// Deprecations (to be removed in 0.7) +#[doc(hidden)] #[allow(deprecated)] +pub use deprecated::XorShiftRng; +#[doc(hidden)] pub mod isaac { + // Note: we miss `IsaacCore` here but probably unimportant. + #[allow(deprecated)] pub use deprecated::IsaacRng; +} +#[doc(hidden)] pub mod isaac64 { + #[allow(deprecated)] pub use deprecated::Isaac64Rng; +} +#[doc(hidden)] #[allow(deprecated)] pub use deprecated::{IsaacRng, Isaac64Rng}; +#[doc(hidden)] pub mod chacha { + // Note: we miss `ChaChaCore` here but probably unimportant. + #[allow(deprecated)] pub use deprecated::ChaChaRng; +} +#[doc(hidden)] #[allow(deprecated)] pub use deprecated::ChaChaRng; +#[doc(hidden)] pub mod hc128 { + // Note: we miss `Hc128Core` here but probably unimportant. + #[allow(deprecated)] pub use deprecated::Hc128Rng; +} +#[doc(hidden)] #[allow(deprecated)] pub use deprecated::Hc128Rng; diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/adapter/mod.rs b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/mod.rs new file mode 100644 index 000000000..60b832e9a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/mod.rs @@ -0,0 +1,15 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Wrappers / adapters forming RNGs + +#[cfg(feature="std")] #[doc(hidden)] pub mod read; +mod reseeding; + +#[cfg(feature="std")] pub use self::read::ReadRng; +pub use self::reseeding::ReseedingRng; diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/adapter/read.rs b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/read.rs new file mode 100644 index 000000000..9b9c18b3e --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/read.rs @@ -0,0 +1,136 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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 wrapper around any Read to treat it as an RNG. + +use std::io::Read; + +use rand_core::{RngCore, Error, ErrorKind, impls}; + + +/// An RNG that reads random bytes straight from any type supporting +/// [`std::io::Read`], for example files. +/// +/// This will work best with an infinite reader, but that is not required. +/// +/// This can be used with `/dev/urandom` on Unix but it is recommended to use +/// [`OsRng`] instead. +/// +/// # Panics +/// +/// `ReadRng` uses [`std::io::Read::read_exact`], which retries on interrupts. +/// All other errors from the underlying reader, including when it does not +/// have enough data, will only be reported through [`try_fill_bytes`]. +/// The other [`RngCore`] methods will panic in case of an error. +/// +/// # Example +/// +/// ``` +/// use rand::Rng; +/// use rand::rngs::adapter::ReadRng; +/// +/// let data = vec![1, 2, 3, 4, 5, 6, 7, 8]; +/// let mut rng = ReadRng::new(&data[..]); +/// println!("{:x}", rng.gen::()); +/// ``` +/// +/// [`OsRng`]: rand_os::OsRng +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Debug)] +pub struct ReadRng { + reader: R +} + +impl ReadRng { + /// Create a new `ReadRng` from a `Read`. + pub fn new(r: R) -> ReadRng { + ReadRng { + reader: r + } + } +} + +impl RngCore for ReadRng { + fn next_u32(&mut self) -> u32 { + impls::next_u32_via_fill(self) + } + + fn next_u64(&mut self) -> u64 { + impls::next_u64_via_fill(self) + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.try_fill_bytes(dest).unwrap_or_else(|err| + panic!("reading random bytes from Read implementation failed; error: {}", err)); + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + if dest.len() == 0 { return Ok(()); } + // Use `std::io::read_exact`, which retries on `ErrorKind::Interrupted`. + self.reader.read_exact(dest).map_err(|err| { + match err.kind() { + ::std::io::ErrorKind::UnexpectedEof => Error::with_cause( + ErrorKind::Unavailable, + "not enough bytes available, reached end of source", err), + _ => Error::with_cause(ErrorKind::Unavailable, + "error reading from Read source", err) + } + }) + } +} + +#[cfg(test)] +mod test { + use super::ReadRng; + use {RngCore, ErrorKind}; + + #[test] + fn test_reader_rng_u64() { + // transmute from the target to avoid endianness concerns. + let v = vec![0u8, 0, 0, 0, 0, 0, 0, 1, + 0 , 0, 0, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 3]; + let mut rng = ReadRng::new(&v[..]); + + assert_eq!(rng.next_u64(), 1_u64.to_be()); + assert_eq!(rng.next_u64(), 2_u64.to_be()); + assert_eq!(rng.next_u64(), 3_u64.to_be()); + } + + #[test] + fn test_reader_rng_u32() { + let v = vec![0u8, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 3]; + let mut rng = ReadRng::new(&v[..]); + + assert_eq!(rng.next_u32(), 1_u32.to_be()); + assert_eq!(rng.next_u32(), 2_u32.to_be()); + assert_eq!(rng.next_u32(), 3_u32.to_be()); + } + + #[test] + fn test_reader_rng_fill_bytes() { + let v = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let mut w = [0u8; 8]; + + let mut rng = ReadRng::new(&v[..]); + rng.fill_bytes(&mut w); + + assert!(v == w); + } + + #[test] + fn test_reader_rng_insufficient_bytes() { + let v = [1u8, 2, 3, 4, 5, 6, 7, 8]; + let mut w = [0u8; 9]; + + let mut rng = ReadRng::new(&v[..]); + + assert!(rng.try_fill_bytes(&mut w).err().unwrap().kind == ErrorKind::Unavailable); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/adapter/reseeding.rs b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/reseeding.rs new file mode 100644 index 000000000..ed2aab4cf --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/adapter/reseeding.rs @@ -0,0 +1,370 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013 The Rust Project 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 wrapper around another PRNG that reseeds it after it +//! generates a certain number of random bytes. + +use core::mem::size_of; + +use rand_core::{RngCore, CryptoRng, SeedableRng, Error, ErrorKind}; +use rand_core::block::{BlockRngCore, BlockRng}; + +/// A wrapper around any PRNG that implements [`BlockRngCore`], that adds the +/// ability to reseed it. +/// +/// `ReseedingRng` reseeds the underlying PRNG in the following cases: +/// +/// - On a manual call to [`reseed()`]. +/// - After `clone()`, the clone will be reseeded on first use. +/// - After a process is forked, the RNG in the child process is reseeded within +/// the next few generated values, depending on the block size of the +/// underlying PRNG. For [`ChaChaCore`] and [`Hc128Core`] this is a maximum of +/// 15 `u32` values before reseeding. +/// - After the PRNG has generated a configurable number of random bytes. +/// +/// # When should reseeding after a fixed number of generated bytes be used? +/// +/// Reseeding after a fixed number of generated bytes is never strictly +/// *necessary*. Cryptographic PRNGs don't have a limited number of bytes they +/// can output, or at least not a limit reachable in any practical way. There is +/// no such thing as 'running out of entropy'. +/// +/// Occasionally reseeding can be seen as some form of 'security in depth'. Even +/// if in the future a cryptographic weakness is found in the CSPRNG being used, +/// or a flaw in the implementation, occasionally reseeding should make +/// exploiting it much more difficult or even impossible. +/// +/// Use [`ReseedingRng::new`] with a `threshold` of `0` to disable reseeding +/// after a fixed number of generated bytes. +/// +/// # Error handling +/// +/// Although unlikely, reseeding the wrapped PRNG can fail. `ReseedingRng` will +/// never panic but try to handle the error intelligently through some +/// combination of retrying and delaying reseeding until later. +/// If handling the source error fails `ReseedingRng` will continue generating +/// data from the wrapped PRNG without reseeding. +/// +/// Manually calling [`reseed()`] will not have this retry or delay logic, but +/// reports the error. +/// +/// # Example +/// +/// ``` +/// # extern crate rand; +/// # extern crate rand_chacha; +/// # fn main() { +/// use rand::prelude::*; +/// use rand_chacha::ChaChaCore; // Internal part of ChaChaRng that +/// // implements BlockRngCore +/// use rand::rngs::OsRng; +/// use rand::rngs::adapter::ReseedingRng; +/// +/// let prng = ChaChaCore::from_entropy(); +// FIXME: it is better to use EntropyRng as reseeder, but that doesn't implement +// clone yet. +/// let reseeder = OsRng::new().unwrap(); +/// let mut reseeding_rng = ReseedingRng::new(prng, 0, reseeder); +/// +/// println!("{}", reseeding_rng.gen::()); +/// +/// let mut cloned_rng = reseeding_rng.clone(); +/// assert!(reseeding_rng.gen::() != cloned_rng.gen::()); +/// # } +/// ``` +/// +/// [`ChaChaCore`]: rand_chacha::ChaChaCore +/// [`Hc128Core`]: rand_hc::Hc128Core +/// [`BlockRngCore`]: rand_core::block::BlockRngCore +/// [`ReseedingRng::new`]: ReseedingRng::new +/// [`reseed()`]: ReseedingRng::reseed +#[derive(Debug)] +pub struct ReseedingRng(BlockRng>) +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore; + +impl ReseedingRng +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore +{ + /// Create a new `ReseedingRng` from an existing PRNG, combined with a RNG + /// to use as reseeder. + /// + /// `threshold` sets the number of generated bytes after which to reseed the + /// PRNG. Set it to zero to never reseed based on the number of generated + /// values. + pub fn new(rng: R, threshold: u64, reseeder: Rsdr) -> Self { + ReseedingRng(BlockRng::new(ReseedingCore::new(rng, threshold, reseeder))) + } + + /// Reseed the internal PRNG. + pub fn reseed(&mut self) -> Result<(), Error> { + self.0.core.reseed() + } +} + +// TODO: this should be implemented for any type where the inner type +// implements RngCore, but we can't specify that because ReseedingCore is private +impl RngCore for ReseedingRng +where R: BlockRngCore + SeedableRng, + ::Results: AsRef<[u32]> + AsMut<[u32]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl Clone for ReseedingRng +where R: BlockRngCore + SeedableRng + Clone, + Rsdr: RngCore + Clone +{ + fn clone(&self) -> ReseedingRng { + // Recreating `BlockRng` seems easier than cloning it and resetting + // the index. + ReseedingRng(BlockRng::new(self.0.core.clone())) + } +} + +impl CryptoRng for ReseedingRng +where R: BlockRngCore + SeedableRng + CryptoRng, + Rsdr: RngCore + CryptoRng {} + +#[derive(Debug)] +struct ReseedingCore { + inner: R, + reseeder: Rsdr, + threshold: i64, + bytes_until_reseed: i64, + fork_counter: usize, +} + +impl BlockRngCore for ReseedingCore +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore +{ + type Item = ::Item; + type Results = ::Results; + + fn generate(&mut self, results: &mut Self::Results) { + let global_fork_counter = fork::get_fork_counter(); + if self.bytes_until_reseed <= 0 || + self.is_forked(global_fork_counter) { + // We get better performance by not calling only `reseed` here + // and continuing with the rest of the function, but by directly + // returning from a non-inlined function. + return self.reseed_and_generate(results, global_fork_counter); + } + let num_bytes = results.as_ref().len() * size_of::(); + self.bytes_until_reseed -= num_bytes as i64; + self.inner.generate(results); + } +} + +impl ReseedingCore +where R: BlockRngCore + SeedableRng, + Rsdr: RngCore +{ + /// Create a new `ReseedingCore`. + fn new(rng: R, threshold: u64, reseeder: Rsdr) -> Self { + use ::core::i64::MAX; + fork::register_fork_handler(); + + // Because generating more values than `i64::MAX` takes centuries on + // current hardware, we just clamp to that value. + // Also we set a threshold of 0, which indicates no limit, to that + // value. + let threshold = + if threshold == 0 { MAX } + else if threshold <= MAX as u64 { threshold as i64 } + else { MAX }; + + ReseedingCore { + inner: rng, + reseeder, + threshold: threshold as i64, + bytes_until_reseed: threshold as i64, + fork_counter: 0, + } + } + + /// Reseed the internal PRNG. + fn reseed(&mut self) -> Result<(), Error> { + R::from_rng(&mut self.reseeder).map(|result| { + self.bytes_until_reseed = self.threshold; + self.inner = result + }) + } + + fn is_forked(&self, global_fork_counter: usize) -> bool { + // In theory, on 32-bit platforms, it is possible for + // `global_fork_counter` to wrap around after ~4e9 forks. + // + // This check will detect a fork in the normal case where + // `fork_counter < global_fork_counter`, and also when the difference + // between both is greater than `isize::MAX` (wrapped around). + // + // It will still fail to detect a fork if there have been more than + // `isize::MAX` forks, without any reseed in between. Seems unlikely + // enough. + (self.fork_counter.wrapping_sub(global_fork_counter) as isize) < 0 + } + + #[inline(never)] + fn reseed_and_generate(&mut self, + results: &mut ::Results, + global_fork_counter: usize) + { + if self.is_forked(global_fork_counter) { + info!("Fork detected, reseeding RNG"); + } else { + trace!("Reseeding RNG (periodic reseed)"); + } + + let num_bytes = + results.as_ref().len() * size_of::<::Item>(); + + let threshold = if let Err(e) = self.reseed() { + let delay = match e.kind { + ErrorKind::Transient => num_bytes as i64, + kind @ _ if kind.should_retry() => self.threshold >> 8, + _ => self.threshold, + }; + warn!("Reseeding RNG delayed reseeding by {} bytes due to \ + error from source: {}", delay, e); + delay + } else { + self.fork_counter = global_fork_counter; + self.threshold + }; + + self.bytes_until_reseed = threshold - num_bytes as i64; + self.inner.generate(results); + } +} + +impl Clone for ReseedingCore +where R: BlockRngCore + SeedableRng + Clone, + Rsdr: RngCore + Clone +{ + fn clone(&self) -> ReseedingCore { + ReseedingCore { + inner: self.inner.clone(), + reseeder: self.reseeder.clone(), + threshold: self.threshold, + bytes_until_reseed: 0, // reseed clone on first use + fork_counter: self.fork_counter, + } + } +} + +impl CryptoRng for ReseedingCore +where R: BlockRngCore + SeedableRng + CryptoRng, + Rsdr: RngCore + CryptoRng {} + + +#[cfg(all(feature="std", unix, not(target_os="emscripten")))] +mod fork { + extern crate libc; + + use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering}; + use std::sync::atomic::{AtomicBool, ATOMIC_BOOL_INIT}; + + // Fork protection + // + // We implement fork protection on Unix using `pthread_atfork`. + // When the process is forked, we increment `RESEEDING_RNG_FORK_COUNTER`. + // Every `ReseedingRng` stores the last known value of the static in + // `fork_counter`. If the cached `fork_counter` is less than + // `RESEEDING_RNG_FORK_COUNTER`, it is time to reseed this RNG. + // + // If reseeding fails, we don't deal with this by setting a delay, but just + // don't update `fork_counter`, so a reseed is attempted as soon as + // possible. + + static RESEEDING_RNG_FORK_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT; + + pub fn get_fork_counter() -> usize { + RESEEDING_RNG_FORK_COUNTER.load(Ordering::Relaxed) + } + + static FORK_HANDLER_REGISTERED: AtomicBool = ATOMIC_BOOL_INIT; + + extern fn fork_handler() { + // Note: fetch_add is defined to wrap on overflow + // (which is what we want). + RESEEDING_RNG_FORK_COUNTER.fetch_add(1, Ordering::Relaxed); + } + + pub fn register_fork_handler() { + if FORK_HANDLER_REGISTERED.load(Ordering::Relaxed) == false { + unsafe { libc::pthread_atfork(None, None, Some(fork_handler)) }; + FORK_HANDLER_REGISTERED.store(true, Ordering::Relaxed); + } + } +} + +#[cfg(not(all(feature="std", unix, not(target_os="emscripten"))))] +mod fork { + pub fn get_fork_counter() -> usize { 0 } + pub fn register_fork_handler() {} +} + + +#[cfg(test)] +mod test { + use {Rng, SeedableRng}; + use rand_chacha::ChaChaCore; + use rngs::mock::StepRng; + use super::ReseedingRng; + + #[test] + fn test_reseeding() { + let mut zero = StepRng::new(0, 0); + let rng = ChaChaCore::from_rng(&mut zero).unwrap(); + let mut reseeding = ReseedingRng::new(rng, 32*4, zero); + + // Currently we only support for arrays up to length 32. + // TODO: cannot generate seq via Rng::gen because it uses different alg + let mut buf = [0u32; 32]; // Needs to be a multiple of the RNGs result + // size to test exactly. + reseeding.fill(&mut buf); + let seq = buf; + for _ in 0..10 { + reseeding.fill(&mut buf); + assert_eq!(buf, seq); + } + } + + #[test] + fn test_clone_reseeding() { + let mut zero = StepRng::new(0, 0); + let rng = ChaChaCore::from_rng(&mut zero).unwrap(); + let mut rng1 = ReseedingRng::new(rng, 32*4, zero); + + let first: u32 = rng1.gen(); + for _ in 0..10 { let _ = rng1.gen::(); } + + let mut rng2 = rng1.clone(); + assert_eq!(first, rng2.gen::()); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/entropy.rs b/vendor/registry-40351f815f426200/rand/src/rngs/entropy.rs new file mode 100644 index 000000000..9a2affdff --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/entropy.rs @@ -0,0 +1,248 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Entropy generator, or wrapper around external generators + +use rand_core::{RngCore, CryptoRng, Error, ErrorKind, impls}; +#[allow(unused)] +use rngs; + +/// An interface returning random data from external source(s), provided +/// specifically for securely seeding algorithmic generators (PRNGs). +/// +/// Where possible, `EntropyRng` retrieves random data from the operating +/// system's interface for random numbers ([`OsRng`]); if that fails it will +/// fall back to the [`JitterRng`] entropy collector. In the latter case it will +/// still try to use [`OsRng`] on the next usage. +/// +/// If no secure source of entropy is available `EntropyRng` will panic on use; +/// i.e. it should never output predictable data. +/// +/// This is either a little slow ([`OsRng`] requires a system call) or extremely +/// slow ([`JitterRng`] must use significant CPU time to generate sufficient +/// jitter); for better performance it is common to seed a local PRNG from +/// external entropy then primarily use the local PRNG ([`thread_rng`] is +/// provided as a convenient, local, automatically-seeded CSPRNG). +/// +/// # Panics +/// +/// On most systems, like Windows, Linux, macOS and *BSD on common hardware, it +/// is highly unlikely for both [`OsRng`] and [`JitterRng`] to fail. But on +/// combinations like webassembly without Emscripten or stdweb both sources are +/// unavailable. If both sources fail, only [`try_fill_bytes`] is able to +/// report the error, and only the one from `OsRng`. The other [`RngCore`] +/// methods will panic in case of an error. +/// +/// [`OsRng`]: rand_os::OsRng +/// [`thread_rng`]: crate::thread_rng +/// [`JitterRng`]: crate::rngs::JitterRng +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Debug)] +pub struct EntropyRng { + source: Source, +} + +#[derive(Debug)] +enum Source { + Os(Os), + Custom(Custom), + Jitter(Jitter), + None, +} + +impl EntropyRng { + /// Create a new `EntropyRng`. + /// + /// This method will do no system calls or other initialization routines, + /// those are done on first use. This is done to make `new` infallible, + /// and `try_fill_bytes` the only place to report errors. + pub fn new() -> Self { + EntropyRng { source: Source::None } + } +} + +impl Default for EntropyRng { + fn default() -> Self { + EntropyRng::new() + } +} + +impl RngCore for EntropyRng { + fn next_u32(&mut self) -> u32 { + impls::next_u32_via_fill(self) + } + + fn next_u64(&mut self) -> u64 { + impls::next_u64_via_fill(self) + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.try_fill_bytes(dest).unwrap_or_else(|err| + panic!("all entropy sources failed; first error: {}", err)) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let mut reported_error = None; + + if let Source::Os(ref mut os_rng) = self.source { + match os_rng.fill(dest) { + Ok(()) => return Ok(()), + Err(err) => { + warn!("EntropyRng: OsRng failed \ + [trying other entropy sources]: {}", err); + reported_error = Some(err); + }, + } + } else if Os::is_supported() { + match Os::new_and_fill(dest) { + Ok(os_rng) => { + debug!("EntropyRng: using OsRng"); + self.source = Source::Os(os_rng); + return Ok(()); + }, + Err(err) => { reported_error = reported_error.or(Some(err)) }, + } + } + + if let Source::Custom(ref mut rng) = self.source { + match rng.fill(dest) { + Ok(()) => return Ok(()), + Err(err) => { + warn!("EntropyRng: custom entropy source failed \ + [trying other entropy sources]: {}", err); + reported_error = Some(err); + }, + } + } else if Custom::is_supported() { + match Custom::new_and_fill(dest) { + Ok(custom) => { + debug!("EntropyRng: using custom entropy source"); + self.source = Source::Custom(custom); + return Ok(()); + }, + Err(err) => { reported_error = reported_error.or(Some(err)) }, + } + } + + if let Source::Jitter(ref mut jitter_rng) = self.source { + match jitter_rng.fill(dest) { + Ok(()) => return Ok(()), + Err(err) => { + warn!("EntropyRng: JitterRng failed: {}", err); + reported_error = Some(err); + }, + } + } else if Jitter::is_supported() { + match Jitter::new_and_fill(dest) { + Ok(jitter_rng) => { + debug!("EntropyRng: using JitterRng"); + self.source = Source::Jitter(jitter_rng); + return Ok(()); + }, + Err(err) => { reported_error = reported_error.or(Some(err)) }, + } + } + + if let Some(err) = reported_error { + Err(Error::with_cause(ErrorKind::Unavailable, + "All entropy sources failed", + err)) + } else { + Err(Error::new(ErrorKind::Unavailable, + "No entropy sources available")) + } + } +} + +impl CryptoRng for EntropyRng {} + + + +trait EntropySource { + fn new_and_fill(dest: &mut [u8]) -> Result + where Self: Sized; + + fn fill(&mut self, dest: &mut [u8]) -> Result<(), Error>; + + fn is_supported() -> bool { true } +} + +#[allow(unused)] +#[derive(Clone, Debug)] +struct NoSource; + +#[allow(unused)] +impl EntropySource for NoSource { + fn new_and_fill(dest: &mut [u8]) -> Result { + Err(Error::new(ErrorKind::Unavailable, "Source not supported")) + } + + fn fill(&mut self, dest: &mut [u8]) -> Result<(), Error> { + unreachable!() + } + + fn is_supported() -> bool { false } +} + + +#[cfg(feature="rand_os")] +#[derive(Clone, Debug)] +pub struct Os(rngs::OsRng); + +#[cfg(feature="rand_os")] +impl EntropySource for Os { + fn new_and_fill(dest: &mut [u8]) -> Result { + let mut rng = rngs::OsRng::new()?; + rng.try_fill_bytes(dest)?; + Ok(Os(rng)) + } + + fn fill(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(not(feature="std"))] +type Os = NoSource; + + +type Custom = NoSource; + + +#[cfg(not(target_arch = "wasm32"))] +#[derive(Clone, Debug)] +pub struct Jitter(rngs::JitterRng); + +#[cfg(not(target_arch = "wasm32"))] +impl EntropySource for Jitter { + fn new_and_fill(dest: &mut [u8]) -> Result { + let mut rng = rngs::JitterRng::new()?; + rng.try_fill_bytes(dest)?; + Ok(Jitter(rng)) + } + + fn fill(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +#[cfg(target_arch = "wasm32")] +type Jitter = NoSource; + + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_entropy() { + let mut rng = EntropyRng::new(); + let n = (rng.next_u32() ^ rng.next_u32()).count_ones(); + assert!(n >= 2); // p(failure) approx 1e-7 + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/mock.rs b/vendor/registry-40351f815f426200/rand/src/rngs/mock.rs new file mode 100644 index 000000000..3c9a994eb --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/mock.rs @@ -0,0 +1,59 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Mock random number generator + +use rand_core::{RngCore, Error, impls}; + +/// A simple implementation of `RngCore` for testing purposes. +/// +/// This generates an arithmetic sequence (i.e. adds a constant each step) +/// over a `u64` number, using wrapping arithmetic. If the increment is 0 +/// the generator yields a constant. +/// +/// ``` +/// use rand::Rng; +/// use rand::rngs::mock::StepRng; +/// +/// let mut my_rng = StepRng::new(2, 1); +/// let sample: [u64; 3] = my_rng.gen(); +/// assert_eq!(sample, [2, 3, 4]); +/// ``` +#[derive(Debug, Clone)] +pub struct StepRng { + v: u64, + a: u64, +} + +impl StepRng { + /// Create a `StepRng`, yielding an arithmetic sequence starting with + /// `initial` and incremented by `increment` each time. + pub fn new(initial: u64, increment: u64) -> Self { + StepRng { v: initial, a: increment } + } +} + +impl RngCore for StepRng { + fn next_u32(&mut self) -> u32 { + self.next_u64() as u32 + } + + fn next_u64(&mut self) -> u64 { + let result = self.v; + self.v = self.v.wrapping_add(self.a); + result + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + impls::fill_bytes_via_next(self, dest); + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/mod.rs b/vendor/registry-40351f815f426200/rand/src/rngs/mod.rs new file mode 100644 index 000000000..b3f05a072 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/mod.rs @@ -0,0 +1,167 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Random number generators and adapters for common usage: +//! +//! - [`ThreadRng`], a fast, secure, auto-seeded thread-local generator +//! - [`StdRng`] and [`SmallRng`], algorithms to cover typical usage +//! - [`EntropyRng`], [`OsRng`] and [`JitterRng`] as entropy sources +//! - [`mock::StepRng`] as a simple counter for tests +//! - [`adapter::ReadRng`] to read from a file/stream +//! - [`adapter::ReseedingRng`] to reseed a PRNG on clone / process fork etc. +//! +//! # Background — Random number generators (RNGs) +//! +//! Computers are inherently deterministic, so to get *random* numbers one +//! either has to use a hardware generator or collect bits of *entropy* from +//! various sources (e.g. event timestamps, or jitter). This is a relatively +//! slow and complicated operation. +//! +//! Generally the operating system will collect some entropy, remove bias, and +//! use that to seed its own PRNG; [`OsRng`] provides an interface to this. +//! [`JitterRng`] is an entropy collector included with Rand that measures +//! jitter in the CPU execution time, and jitter in memory access time. +//! [`EntropyRng`] is a wrapper that uses the best entropy source that is +//! available. +//! +//! ## Pseudo-random number generators +//! +//! What is commonly used instead of "true" random number renerators, are +//! *pseudo-random number generators* (PRNGs), deterministic algorithms that +//! produce an infinite stream of pseudo-random numbers from a small random +//! seed. PRNGs are faster, and have better provable properties. The numbers +//! produced can be statistically of very high quality and can be impossible to +//! predict. (They can also have obvious correlations and be trivial to predict; +//! quality varies.) +//! +//! There are two different types of PRNGs: those developed for simulations +//! and statistics, and those developed for use in cryptography; the latter are +//! called Cryptographically Secure PRNGs (CSPRNG or CPRNG). Both types can +//! have good statistical quality but the latter also have to be impossible to +//! predict, even after seeing many previous output values. Rand provides a good +//! default algorithm from each class: +//! +//! - [`SmallRng`] is a PRNG chosen for low memory usage, high performance and +//! good statistical quality. +//! - [`StdRng`] is a CSPRNG chosen for good performance and trust of security +//! (based on reviews, maturity and usage). The current algorithm is HC-128, +//! which is one of the recommendations by ECRYPT's eSTREAM project. +//! +//! The above PRNGs do not cover all use-cases; more algorithms can be found in +//! the [`prng`][crate::prng] module, as well as in several other crates. For example, you +//! may wish a CSPRNG with significantly lower memory usage than [`StdRng`] +//! while being less concerned about performance, in which case [`ChaChaRng`] +//! is a good choice. +//! +//! One complexity is that the internal state of a PRNG must change with every +//! generated number. For APIs this generally means a mutable reference to the +//! state of the PRNG has to be passed around. +//! +//! A solution is [`ThreadRng`]. This is a thread-local implementation of +//! [`StdRng`] with automatic seeding on first use. It is the best choice if you +//! "just" want a convenient, secure, fast random number source. Use via the +//! [`thread_rng`] function, which gets a reference to the current thread's +//! local instance. +//! +//! ## Seeding +//! +//! As mentioned above, PRNGs require a random seed in order to produce random +//! output. This is especially important for CSPRNGs, which are still +//! deterministic algorithms, thus can only be secure if their seed value is +//! also secure. To seed a PRNG, use one of: +//! +//! - [`FromEntropy::from_entropy`]; this is the most convenient way to seed +//! with fresh, secure random data. +//! - [`SeedableRng::from_rng`]; this allows seeding from another PRNG or +//! from an entropy source such as [`EntropyRng`]. +//! - [`SeedableRng::from_seed`]; this is mostly useful if you wish to be able +//! to reproduce the output sequence by using a fixed seed. (Don't use +//! [`StdRng`] or [`SmallRng`] in this case since different algorithms may be +//! used by future versions of Rand; use an algorithm from the +//! [`prng`] module.) +//! +//! ## Conclusion +//! +//! - [`thread_rng`] is what you often want to use. +//! - If you want more control, flexibility, or better performance, use +//! [`StdRng`], [`SmallRng`] or an algorithm from the [`prng`] module. +//! - Use [`FromEntropy::from_entropy`] to seed new PRNGs. +//! - If you need reproducibility, use [`SeedableRng::from_seed`] combined with +//! a named PRNG. +//! +//! More information and notes on cryptographic security can be found +//! in the [`prng`] module. +//! +//! ## Examples +//! +//! Examples of seeding PRNGs: +//! +//! ``` +//! use rand::prelude::*; +//! # use rand::Error; +//! +//! // StdRng seeded securely by the OS or local entropy collector: +//! let mut rng = StdRng::from_entropy(); +//! # let v: u32 = rng.gen(); +//! +//! // SmallRng seeded from thread_rng: +//! # fn try_inner() -> Result<(), Error> { +//! let mut rng = SmallRng::from_rng(thread_rng())?; +//! # let v: u32 = rng.gen(); +//! # Ok(()) +//! # } +//! # try_inner().unwrap(); +//! +//! // SmallRng seeded by a constant, for deterministic results: +//! let seed = [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]; // byte array +//! let mut rng = SmallRng::from_seed(seed); +//! # let v: u32 = rng.gen(); +//! ``` +//! +//! +//! # Implementing custom RNGs +//! +//! If you want to implement custom RNG, see the [`rand_core`] crate. The RNG +//! will have to implement the [`RngCore`] trait, where the [`Rng`] trait is +//! build on top of. +//! +//! If the RNG needs seeding, also implement the [`SeedableRng`] trait. +//! +//! [`CryptoRng`] is a marker trait cryptographically secure PRNGs can +//! implement. +//! +//! [`OsRng`]: rand_os::OsRng +//! [`SmallRng`]: rngs::SmallRng +//! [`StdRng`]: rngs::StdRng +//! [`ThreadRng`]: rngs::ThreadRng +//! [`EntropyRng`]: rngs::EntropyRng +//! [`JitterRng`]: rngs::JitterRng +//! [`mock::StepRng`]: rngs::mock::StepRng +//! [`adapter::ReadRng`]: rngs::adapter::ReadRng +//! [`adapter::ReseedingRng`]: rngs::adapter::ReseedingRng +//! [`ChaChaRng`]: rand_chacha::ChaChaRng + +pub mod adapter; + +#[cfg(feature="std")] mod entropy; +pub mod mock; // Public so we don't export `StepRng` directly, making it a bit + // more clear it is intended for testing. +mod small; +mod std; +#[cfg(feature="std")] pub(crate) mod thread; + + +pub use rand_jitter::{JitterRng, TimerError}; +#[cfg(feature="std")] pub use self::entropy::EntropyRng; + +pub use self::small::SmallRng; +pub use self::std::StdRng; +#[cfg(feature="std")] pub use self::thread::ThreadRng; + +#[cfg(feature="rand_os")] +pub use rand_os::OsRng; diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/small.rs b/vendor/registry-40351f815f426200/rand/src/rngs/small.rs new file mode 100644 index 000000000..9874d2469 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/small.rs @@ -0,0 +1,106 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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 small fast RNG + +use {RngCore, SeedableRng, Error}; + +#[cfg(all(all(rustc_1_26, not(target_os = "emscripten")), target_pointer_width = "64"))] +type Rng = ::rand_pcg::Pcg64Mcg; +#[cfg(not(all(all(rustc_1_26, not(target_os = "emscripten")), target_pointer_width = "64")))] +type Rng = ::rand_pcg::Pcg32; + +/// An RNG recommended when small state, cheap initialization and good +/// performance are required. The PRNG algorithm in `SmallRng` is chosen to be +/// efficient on the current platform, **without consideration for cryptography +/// or security**. The size of its state is much smaller than for [`StdRng`]. +/// +/// Reproducibility of output from this generator is however not required, thus +/// future library versions may use a different internal generator with +/// different output. Further, this generator may not be portable and can +/// produce different output depending on the architecture. If you require +/// reproducible output, use a named RNG. +/// Refer to [The Book](https://rust-random.github.io/book/guide-rngs.html). +/// +/// +/// The current algorithm is [`Pcg64Mcg`][rand_pcg::Pcg64Mcg] on 64-bit platforms with Rust version +/// 1.26 and later, or [`Pcg32`][rand_pcg::Pcg32] otherwise. Both are found in +/// the [rand_pcg] crate. +/// +/// # Examples +/// +/// Initializing `SmallRng` with a random seed can be done using [`FromEntropy`]: +/// +/// ``` +/// # use rand::Rng; +/// use rand::FromEntropy; +/// use rand::rngs::SmallRng; +/// +/// // Create small, cheap to initialize and fast RNG with a random seed. +/// // The randomness is supplied by the operating system. +/// let mut small_rng = SmallRng::from_entropy(); +/// # let v: u32 = small_rng.gen(); +/// ``` +/// +/// When initializing a lot of `SmallRng`'s, using [`thread_rng`] can be more +/// efficient: +/// +/// ``` +/// use std::iter; +/// use rand::{SeedableRng, thread_rng}; +/// use rand::rngs::SmallRng; +/// +/// // Create a big, expensive to initialize and slower, but unpredictable RNG. +/// // This is cached and done only once per thread. +/// let mut thread_rng = thread_rng(); +/// // Create small, cheap to initialize and fast RNGs with random seeds. +/// // One can generally assume this won't fail. +/// let rngs: Vec = iter::repeat(()) +/// .map(|()| SmallRng::from_rng(&mut thread_rng).unwrap()) +/// .take(10) +/// .collect(); +/// ``` +/// +/// [`FromEntropy`]: crate::FromEntropy +/// [`StdRng`]: crate::rngs::StdRng +/// [`thread_rng`]: crate::thread_rng +/// [rand_pcg]: https://crates.io/crates/rand_pcg +#[derive(Clone, Debug)] +pub struct SmallRng(Rng); + +impl RngCore for SmallRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for SmallRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + SmallRng(Rng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + Rng::from_rng(rng).map(SmallRng) + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/std.rs b/vendor/registry-40351f815f426200/rand/src/rngs/std.rs new file mode 100644 index 000000000..e67a76da8 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/std.rs @@ -0,0 +1,85 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The standard RNG + +use {RngCore, CryptoRng, Error, SeedableRng}; +use rand_hc::Hc128Rng; + +/// The standard RNG. The PRNG algorithm in `StdRng` is chosen to be efficient +/// on the current platform, to be statistically strong and unpredictable +/// (meaning a cryptographically secure PRNG). +/// +/// The current algorithm used on all platforms is [HC-128], found in the +/// [rand_hc] crate. +/// +/// Reproducibility of output from this generator is however not required, thus +/// future library versions may use a different internal generator with +/// different output. Further, this generator may not be portable and can +/// produce different output depending on the architecture. If you require +/// reproducible output, use a named RNG, for example [`ChaChaRng`] from the +/// [rand_chacha] crate. +/// +/// [HC-128]: rand_hc::Hc128Rng +/// [`ChaChaRng`]: rand_chacha::ChaChaRng +/// [rand_hc]: https://crates.io/crates/rand_hc +/// [rand_chacha]: https://crates.io/crates/rand_chacha +#[derive(Clone, Debug)] +pub struct StdRng(Hc128Rng); + +impl RngCore for StdRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest); + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for StdRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + StdRng(Hc128Rng::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + Hc128Rng::from_rng(rng).map(StdRng) + } +} + +impl CryptoRng for StdRng {} + + +#[cfg(test)] +mod test { + use {RngCore, SeedableRng}; + use rngs::StdRng; + + #[test] + fn test_stdrng_construction() { + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng1 = StdRng::from_seed(seed); + assert_eq!(rng1.next_u64(), 15759097995037006553); + + let mut rng2 = StdRng::from_rng(rng1).unwrap(); + assert_eq!(rng2.next_u64(), 6766915756997287454); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/rngs/thread.rs b/vendor/registry-40351f815f426200/rand/src/rngs/thread.rs new file mode 100644 index 000000000..f1aa787dc --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/rngs/thread.rs @@ -0,0 +1,137 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Thread-local random number generator + +use std::cell::UnsafeCell; + +use {RngCore, CryptoRng, SeedableRng, Error}; +use rngs::adapter::ReseedingRng; +use rngs::EntropyRng; +use rand_hc::Hc128Core; + +// Rationale for using `UnsafeCell` in `ThreadRng`: +// +// Previously we used a `RefCell`, with an overhead of ~15%. There will only +// ever be one mutable reference to the interior of the `UnsafeCell`, because +// we only have such a reference inside `next_u32`, `next_u64`, etc. Within a +// single thread (which is the definition of `ThreadRng`), there will only ever +// be one of these methods active at a time. +// +// A possible scenario where there could be multiple mutable references is if +// `ThreadRng` is used inside `next_u32` and co. But the implementation is +// completely under our control. We just have to ensure none of them use +// `ThreadRng` internally, which is nonsensical anyway. We should also never run +// `ThreadRng` in destructors of its implementation, which is also nonsensical. +// +// The additional `Rc` is not strictly neccesary, and could be removed. For now +// it ensures `ThreadRng` stays `!Send` and `!Sync`, and implements `Clone`. + + +// Number of generated bytes after which to reseed `TreadRng`. +// +// The time it takes to reseed HC-128 is roughly equivalent to generating 7 KiB. +// We pick a treshold here that is large enough to not reduce the average +// performance too much, but also small enough to not make reseeding something +// that basically never happens. +const THREAD_RNG_RESEED_THRESHOLD: u64 = 32*1024*1024; // 32 MiB + +/// The type returned by [`thread_rng`], essentially just a reference to the +/// PRNG in thread-local memory. +/// +/// `ThreadRng` uses [`ReseedingRng`] wrapping the same PRNG as [`StdRng`], +/// which is reseeded after generating 32 MiB of random data. A single instance +/// is cached per thread and the returned `ThreadRng` is a reference to this +/// instance — hence `ThreadRng` is neither `Send` nor `Sync` but is safe to use +/// within a single thread. This RNG is seeded and reseeded via [`EntropyRng`] +/// as required. +/// +/// Note that the reseeding is done as an extra precaution against entropy +/// leaks and is in theory unnecessary — to predict `ThreadRng`'s output, an +/// attacker would have to either determine most of the RNG's seed or internal +/// state, or crack the algorithm used. +/// +/// Like [`StdRng`], `ThreadRng` is a cryptographically secure PRNG. The current +/// algorithm used is [HC-128], which is an array-based PRNG that trades memory +/// usage for better performance. This makes it similar to ISAAC, the algorithm +/// used in `ThreadRng` before rand 0.5. +/// +/// Cloning this handle just produces a new reference to the same thread-local +/// generator. +/// +/// [`ReseedingRng`]: crate::rngs::adapter::ReseedingRng +/// [`StdRng`]: crate::rngs::StdRng +/// [HC-128]: rand_hc::Hc128Rng +#[derive(Clone, Debug)] +pub struct ThreadRng { + // use of raw pointer implies type is neither Send nor Sync + rng: *mut ReseedingRng, +} + +thread_local!( + static THREAD_RNG_KEY: UnsafeCell> = { + let mut entropy_source = EntropyRng::new(); + let r = Hc128Core::from_rng(&mut entropy_source).unwrap_or_else(|err| + panic!("could not initialize thread_rng: {}", err)); + let rng = ReseedingRng::new(r, + THREAD_RNG_RESEED_THRESHOLD, + entropy_source); + UnsafeCell::new(rng) + } +); + +/// Retrieve the lazily-initialized thread-local random number generator, +/// seeded by the system. Intended to be used in method chaining style, +/// e.g. `thread_rng().gen::()`, or cached locally, e.g. +/// `let mut rng = thread_rng();`. Invoked by the `Default` trait, making +/// `ThreadRng::default()` equivelent. +/// +/// For more information see [`ThreadRng`]. +pub fn thread_rng() -> ThreadRng { + ThreadRng { rng: THREAD_RNG_KEY.with(|t| t.get()) } +} + +impl Default for ThreadRng { + fn default() -> ThreadRng { + ::prelude::thread_rng() + } +} + +impl RngCore for ThreadRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + unsafe { (*self.rng).next_u32() } + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + unsafe { (*self.rng).next_u64() } + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + unsafe { (*self.rng).fill_bytes(dest) } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + unsafe { (*self.rng).try_fill_bytes(dest) } + } +} + +impl CryptoRng for ThreadRng {} + + +#[cfg(test)] +mod test { + #[test] + fn test_thread_rng() { + use Rng; + let mut r = ::thread_rng(); + r.gen::(); + assert_eq!(r.gen_range(0, 1), 0); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/seq/index.rs b/vendor/registry-40351f815f426200/rand/src/seq/index.rs new file mode 100644 index 000000000..a70c7367f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/seq/index.rs @@ -0,0 +1,378 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Index sampling + +#[cfg(feature="alloc")] use core::slice; + +#[cfg(feature="std")] use std::vec; +#[cfg(all(feature="alloc", not(feature="std")))] use alloc::vec::{self, Vec}; +// BTreeMap is not as fast in tests, but better than nothing. +#[cfg(feature="std")] use std::collections::{HashSet}; +#[cfg(all(feature="alloc", not(feature="std")))] use alloc::collections::BTreeSet; + +#[cfg(feature="alloc")] use distributions::{Distribution, Uniform}; +use Rng; + +/// A vector of indices. +/// +/// Multiple internal representations are possible. +#[derive(Clone, Debug)] +pub enum IndexVec { + #[doc(hidden)] U32(Vec), + #[doc(hidden)] USize(Vec), +} + +impl IndexVec { + /// Returns the number of indices + pub fn len(&self) -> usize { + match self { + &IndexVec::U32(ref v) => v.len(), + &IndexVec::USize(ref v) => v.len(), + } + } + + /// Return the value at the given `index`. + /// + /// (Note: we cannot implement [`std::ops::Index`] because of lifetime + /// restrictions.) + pub fn index(&self, index: usize) -> usize { + match self { + &IndexVec::U32(ref v) => v[index] as usize, + &IndexVec::USize(ref v) => v[index], + } + } + + /// Return result as a `Vec`. Conversion may or may not be trivial. + pub fn into_vec(self) -> Vec { + match self { + IndexVec::U32(v) => v.into_iter().map(|i| i as usize).collect(), + IndexVec::USize(v) => v, + } + } + + /// Iterate over the indices as a sequence of `usize` values + pub fn iter<'a>(&'a self) -> IndexVecIter<'a> { + match self { + &IndexVec::U32(ref v) => IndexVecIter::U32(v.iter()), + &IndexVec::USize(ref v) => IndexVecIter::USize(v.iter()), + } + } + + /// Convert into an iterator over the indices as a sequence of `usize` values + pub fn into_iter(self) -> IndexVecIntoIter { + match self { + IndexVec::U32(v) => IndexVecIntoIter::U32(v.into_iter()), + IndexVec::USize(v) => IndexVecIntoIter::USize(v.into_iter()), + } + } +} + +impl PartialEq for IndexVec { + fn eq(&self, other: &IndexVec) -> bool { + use self::IndexVec::*; + match (self, other) { + (&U32(ref v1), &U32(ref v2)) => v1 == v2, + (&USize(ref v1), &USize(ref v2)) => v1 == v2, + (&U32(ref v1), &USize(ref v2)) => (v1.len() == v2.len()) + && (v1.iter().zip(v2.iter()).all(|(x, y)| *x as usize == *y)), + (&USize(ref v1), &U32(ref v2)) => (v1.len() == v2.len()) + && (v1.iter().zip(v2.iter()).all(|(x, y)| *x == *y as usize)), + } + } +} + +impl From> for IndexVec { + fn from(v: Vec) -> Self { + IndexVec::U32(v) + } +} + +impl From> for IndexVec { + fn from(v: Vec) -> Self { + IndexVec::USize(v) + } +} + +/// Return type of `IndexVec::iter`. +#[derive(Debug)] +pub enum IndexVecIter<'a> { + #[doc(hidden)] U32(slice::Iter<'a, u32>), + #[doc(hidden)] USize(slice::Iter<'a, usize>), +} + +impl<'a> Iterator for IndexVecIter<'a> { + type Item = usize; + fn next(&mut self) -> Option { + use self::IndexVecIter::*; + match self { + &mut U32(ref mut iter) => iter.next().map(|i| *i as usize), + &mut USize(ref mut iter) => iter.next().cloned(), + } + } + + fn size_hint(&self) -> (usize, Option) { + match self { + &IndexVecIter::U32(ref v) => v.size_hint(), + &IndexVecIter::USize(ref v) => v.size_hint(), + } + } +} + +impl<'a> ExactSizeIterator for IndexVecIter<'a> {} + +/// Return type of `IndexVec::into_iter`. +#[derive(Clone, Debug)] +pub enum IndexVecIntoIter { + #[doc(hidden)] U32(vec::IntoIter), + #[doc(hidden)] USize(vec::IntoIter), +} + +impl Iterator for IndexVecIntoIter { + type Item = usize; + + fn next(&mut self) -> Option { + use self::IndexVecIntoIter::*; + match self { + &mut U32(ref mut v) => v.next().map(|i| i as usize), + &mut USize(ref mut v) => v.next(), + } + } + + fn size_hint(&self) -> (usize, Option) { + use self::IndexVecIntoIter::*; + match self { + &U32(ref v) => v.size_hint(), + &USize(ref v) => v.size_hint(), + } + } +} + +impl ExactSizeIterator for IndexVecIntoIter {} + + +/// Randomly sample exactly `amount` distinct indices from `0..length`, and +/// return them in random order (fully shuffled). +/// +/// This method is used internally by the slice sampling methods, but it can +/// sometimes be useful to have the indices themselves so this is provided as +/// an alternative. +/// +/// The implementation used is not specified; we automatically select the +/// fastest available algorithm for the `length` and `amount` parameters +/// (based on detailed profiling on an Intel Haswell CPU). Roughly speaking, +/// complexity is `O(amount)`, except that when `amount` is small, performance +/// is closer to `O(amount^2)`, and when `length` is close to `amount` then +/// `O(length)`. +/// +/// Note that performance is significantly better over `u32` indices than over +/// `u64` indices. Because of this we hide the underlying type behind an +/// abstraction, `IndexVec`. +/// +/// If an allocation-free `no_std` function is required, it is suggested +/// to adapt the internal `sample_floyd` implementation. +/// +/// Panics if `amount > length`. +pub fn sample(rng: &mut R, length: usize, amount: usize) -> IndexVec + where R: Rng + ?Sized, +{ + if amount > length { + panic!("`amount` of samples must be less than or equal to `length`"); + } + if length > (::core::u32::MAX as usize) { + // We never want to use inplace here, but could use floyd's alg + // Lazy version: always use the cache alg. + return sample_rejection(rng, length, amount); + } + let amount = amount as u32; + let length = length as u32; + + // Choice of algorithm here depends on both length and amount. See: + // https://github.com/rust-random/rand/pull/479 + // We do some calculations with f32. Accuracy is not very important. + + if amount < 163 { + const C: [[f32; 2]; 2] = [[1.6, 8.0/45.0], [10.0, 70.0/9.0]]; + let j = if length < 500_000 { 0 } else { 1 }; + let amount_fp = amount as f32; + let m4 = C[0][j] * amount_fp; + // Short-cut: when amount < 12, floyd's is always faster + if amount > 11 && (length as f32) < (C[1][j] + m4) * amount_fp { + sample_inplace(rng, length, amount) + } else { + sample_floyd(rng, length, amount) + } + } else { + const C: [f32; 2] = [270.0, 330.0/9.0]; + let j = if length < 500_000 { 0 } else { 1 }; + if (length as f32) < C[j] * (amount as f32) { + sample_inplace(rng, length, amount) + } else { + // note: could have a specific u32 impl, but I'm lazy and + // generics don't have usable conversions + sample_rejection(rng, length as usize, amount as usize) + } + } +} + +/// Randomly sample exactly `amount` indices from `0..length`, using Floyd's +/// combination algorithm. +/// +/// The output values are fully shuffled. (Overhead is under 50%.) +/// +/// This implementation uses `O(amount)` memory and `O(amount^2)` time. +fn sample_floyd(rng: &mut R, length: u32, amount: u32) -> IndexVec + where R: Rng + ?Sized, +{ + // For small amount we use Floyd's fully-shuffled variant. For larger + // amounts this is slow due to Vec::insert performance, so we shuffle + // afterwards. Benchmarks show little overhead from extra logic. + let floyd_shuffle = amount < 50; + + debug_assert!(amount <= length); + let mut indices = Vec::with_capacity(amount as usize); + for j in length - amount .. length { + let t = rng.gen_range(0, j + 1); + if floyd_shuffle { + if let Some(pos) = indices.iter().position(|&x| x == t) { + indices.insert(pos, j); + continue; + } + } else { + if indices.contains(&t) { + indices.push(j); + continue; + } + } + indices.push(t); + } + if !floyd_shuffle { + // Reimplement SliceRandom::shuffle with smaller indices + for i in (1..amount).rev() { + // invariant: elements with index > i have been locked in place. + indices.swap(i as usize, rng.gen_range(0, i + 1) as usize); + } + } + IndexVec::from(indices) +} + +/// Randomly sample exactly `amount` indices from `0..length`, using an inplace +/// partial Fisher-Yates method. +/// Sample an amount of indices using an inplace partial fisher yates method. +/// +/// This allocates the entire `length` of indices and randomizes only the first `amount`. +/// It then truncates to `amount` and returns. +/// +/// This method is not appropriate for large `length` and potentially uses a lot +/// of memory; because of this we only implement for `u32` index (which improves +/// performance in all cases). +/// +/// Set-up is `O(length)` time and memory and shuffling is `O(amount)` time. +fn sample_inplace(rng: &mut R, length: u32, amount: u32) -> IndexVec + where R: Rng + ?Sized, +{ + debug_assert!(amount <= length); + let mut indices: Vec = Vec::with_capacity(length as usize); + indices.extend(0..length); + for i in 0..amount { + let j: u32 = rng.gen_range(i, length); + indices.swap(i as usize, j as usize); + } + indices.truncate(amount as usize); + debug_assert_eq!(indices.len(), amount as usize); + IndexVec::from(indices) +} + +/// Randomly sample exactly `amount` indices from `0..length`, using rejection +/// sampling. +/// +/// Since `amount <<< length` there is a low chance of a random sample in +/// `0..length` being a duplicate. We test for duplicates and resample where +/// necessary. The algorithm is `O(amount)` time and memory. +fn sample_rejection(rng: &mut R, length: usize, amount: usize) -> IndexVec + where R: Rng + ?Sized, +{ + debug_assert!(amount < length); + #[cfg(feature="std")] let mut cache = HashSet::with_capacity(amount); + #[cfg(not(feature="std"))] let mut cache = BTreeSet::new(); + let distr = Uniform::new(0, length); + let mut indices = Vec::with_capacity(amount); + for _ in 0..amount { + let mut pos = distr.sample(rng); + while !cache.insert(pos) { + pos = distr.sample(rng); + } + indices.push(pos); + } + + debug_assert_eq!(indices.len(), amount); + IndexVec::from(indices) +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_sample_boundaries() { + let mut r = ::test::rng(404); + + assert_eq!(sample_inplace(&mut r, 0, 0).len(), 0); + assert_eq!(sample_inplace(&mut r, 1, 0).len(), 0); + assert_eq!(sample_inplace(&mut r, 1, 1).into_vec(), vec![0]); + + assert_eq!(sample_rejection(&mut r, 1, 0).len(), 0); + + assert_eq!(sample_floyd(&mut r, 0, 0).len(), 0); + assert_eq!(sample_floyd(&mut r, 1, 0).len(), 0); + assert_eq!(sample_floyd(&mut r, 1, 1).into_vec(), vec![0]); + + // These algorithms should be fast with big numbers. Test average. + let sum: usize = sample_rejection(&mut r, 1 << 25, 10) + .into_iter().sum(); + assert!(1 << 25 < sum && sum < (1 << 25) * 25); + + let sum: usize = sample_floyd(&mut r, 1 << 25, 10) + .into_iter().sum(); + assert!(1 << 25 < sum && sum < (1 << 25) * 25); + } + + #[test] + fn test_sample_alg() { + let seed_rng = ::test::rng; + + // We can't test which algorithm is used directly, but Floyd's alg + // should produce different results from the others. (Also, `inplace` + // and `cached` currently use different sizes thus produce different results.) + + // A small length and relatively large amount should use inplace + let (length, amount): (usize, usize) = (100, 50); + let v1 = sample(&mut seed_rng(420), length, amount); + let v2 = sample_inplace(&mut seed_rng(420), length as u32, amount as u32); + assert!(v1.iter().all(|e| e < length)); + assert_eq!(v1, v2); + + // Test Floyd's alg does produce different results + let v3 = sample_floyd(&mut seed_rng(420), length as u32, amount as u32); + assert!(v1 != v3); + + // A large length and small amount should use Floyd + let (length, amount): (usize, usize) = (1<<20, 50); + let v1 = sample(&mut seed_rng(421), length, amount); + let v2 = sample_floyd(&mut seed_rng(421), length as u32, amount as u32); + assert!(v1.iter().all(|e| e < length)); + assert_eq!(v1, v2); + + // A large length and larger amount should use cache + let (length, amount): (usize, usize) = (1<<20, 600); + let v1 = sample(&mut seed_rng(422), length, amount); + let v2 = sample_rejection(&mut seed_rng(422), length, amount); + assert!(v1.iter().all(|e| e < length)); + assert_eq!(v1, v2); + } +} diff --git a/vendor/registry-40351f815f426200/rand/src/seq/mod.rs b/vendor/registry-40351f815f426200/rand/src/seq/mod.rs new file mode 100644 index 000000000..d0f83084a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/src/seq/mod.rs @@ -0,0 +1,829 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Functions for randomly accessing and sampling sequences. +//! +//! TODO: module doc + + +#[cfg(feature="alloc")] pub mod index; + +#[cfg(feature="alloc")] use core::ops::Index; + +#[cfg(all(feature="alloc", not(feature="std")))] use alloc::vec::Vec; + +use Rng; +#[cfg(feature="alloc")] use distributions::WeightedError; +#[cfg(feature="alloc")] use distributions::uniform::{SampleUniform, SampleBorrow}; + +/// Extension trait on slices, providing random mutation and sampling methods. +/// +/// An implementation is provided for slices. This may also be implementable for +/// other types. +pub trait SliceRandom { + /// The element type. + type Item; + + /// Returns a reference to one random element of the slice, or `None` if the + /// slice is empty. + /// + /// Depending on the implementation, complexity is expected to be `O(1)`. + /// + /// # Example + /// + /// ``` + /// use rand::thread_rng; + /// use rand::seq::SliceRandom; + /// + /// let choices = [1, 2, 4, 8, 16, 32]; + /// let mut rng = thread_rng(); + /// println!("{:?}", choices.choose(&mut rng)); + /// assert_eq!(choices[..0].choose(&mut rng), None); + /// ``` + fn choose(&self, rng: &mut R) -> Option<&Self::Item> + where R: Rng + ?Sized; + + /// Returns a mutable reference to one random element of the slice, or + /// `None` if the slice is empty. + /// + /// Depending on the implementation, complexity is expected to be `O(1)`. + fn choose_mut(&mut self, rng: &mut R) -> Option<&mut Self::Item> + where R: Rng + ?Sized; + + /// Produces an iterator that chooses `amount` elements from the slice at + /// random without repeating any, and returns them in random order. + /// + /// In case this API is not sufficiently flexible, use `index::sample` then + /// apply the indices to the slice. + /// + /// Complexity is expected to be the same as `index::sample`. + /// + /// # Example + /// ``` + /// use rand::seq::SliceRandom; + /// + /// let mut rng = &mut rand::thread_rng(); + /// let sample = "Hello, audience!".as_bytes(); + /// + /// // collect the results into a vector: + /// let v: Vec = sample.choose_multiple(&mut rng, 3).cloned().collect(); + /// + /// // store in a buffer: + /// let mut buf = [0u8; 5]; + /// for (b, slot) in sample.choose_multiple(&mut rng, buf.len()).zip(buf.iter_mut()) { + /// *slot = *b; + /// } + /// ``` + #[cfg(feature = "alloc")] + fn choose_multiple(&self, rng: &mut R, amount: usize) -> SliceChooseIter + where R: Rng + ?Sized; + + /// Similar to [`choose`], where the likelihood of each outcome may be + /// specified. The specified function `weight` maps items `x` to a relative + /// likelihood `weight(x)`. The probability of each item being selected is + /// therefore `weight(x) / s`, where `s` is the sum of all `weight(x)`. + /// + /// # Example + /// + /// ``` + /// use rand::prelude::*; + /// + /// let choices = [('a', 2), ('b', 1), ('c', 1)]; + /// let mut rng = thread_rng(); + /// // 50% chance to print 'a', 25% chance to print 'b', 25% chance to print 'c' + /// println!("{:?}", choices.choose_weighted(&mut rng, |item| item.1).unwrap().0); + /// ``` + /// [`choose`]: SliceRandom::choose + #[cfg(feature = "alloc")] + fn choose_weighted(&self, rng: &mut R, weight: F) -> Result<&Self::Item, WeightedError> + where R: Rng + ?Sized, + F: Fn(&Self::Item) -> B, + B: SampleBorrow, + X: SampleUniform + + for<'a> ::core::ops::AddAssign<&'a X> + + ::core::cmp::PartialOrd + + Clone + + Default; + + /// Similar to [`choose_mut`], where the likelihood of each outcome may be + /// specified. The specified function `weight` maps items `x` to a relative + /// likelihood `weight(x)`. The probability of each item being selected is + /// therefore `weight(x) / s`, where `s` is the sum of all `weight(x)`. + /// + /// See also [`choose_weighted`]. + /// + /// [`choose_mut`]: SliceRandom::choose_mut + /// [`choose_weighted`]: SliceRandom::choose_weighted + #[cfg(feature = "alloc")] + fn choose_weighted_mut(&mut self, rng: &mut R, weight: F) -> Result<&mut Self::Item, WeightedError> + where R: Rng + ?Sized, + F: Fn(&Self::Item) -> B, + B: SampleBorrow, + X: SampleUniform + + for<'a> ::core::ops::AddAssign<&'a X> + + ::core::cmp::PartialOrd + + Clone + + Default; + + /// Shuffle a mutable slice in place. + /// + /// Depending on the implementation, complexity is expected to be `O(1)`. + /// + /// # Example + /// + /// ``` + /// use rand::thread_rng; + /// use rand::seq::SliceRandom; + /// + /// let mut rng = thread_rng(); + /// let mut y = [1, 2, 3, 4, 5]; + /// println!("Unshuffled: {:?}", y); + /// y.shuffle(&mut rng); + /// println!("Shuffled: {:?}", y); + /// ``` + fn shuffle(&mut self, rng: &mut R) where R: Rng + ?Sized; + + /// Shuffle a slice in place, but exit early. + /// + /// Returns two mutable slices from the source slice. The first contains + /// `amount` elements randomly permuted. The second has the remaining + /// elements that are not fully shuffled. + /// + /// This is an efficient method to select `amount` elements at random from + /// the slice, provided the slice may be mutated. + /// + /// If you only need to choose elements randomly and `amount > self.len()/2` + /// then you may improve performance by taking + /// `amount = values.len() - amount` and using only the second slice. + /// + /// If `amount` is greater than the number of elements in the slice, this + /// will perform a full shuffle. + /// + /// Complexity is expected to be `O(m)` where `m = amount`. + fn partial_shuffle(&mut self, rng: &mut R, amount: usize) + -> (&mut [Self::Item], &mut [Self::Item]) where R: Rng + ?Sized; +} + +/// Extension trait on iterators, providing random sampling methods. +pub trait IteratorRandom: Iterator + Sized { + /// Choose one element at random from the iterator. If you have a slice, + /// it's significantly faster to call the [`choose`] or [`choose_mut`] + /// functions using the slice instead. + /// + /// Returns `None` if and only if the iterator is empty. + /// + /// Complexity is `O(n)`, where `n` is the length of the iterator. + /// This likely consumes multiple random numbers, but the exact number + /// is unspecified. + /// + /// [`choose`]: SliceRandom::method.choose + /// [`choose_mut`]: SliceRandom::choose_mut + fn choose(mut self, rng: &mut R) -> Option + where R: Rng + ?Sized + { + let (mut lower, mut upper) = self.size_hint(); + let mut consumed = 0; + let mut result = None; + + if upper == Some(lower) { + return if lower == 0 { None } else { self.nth(rng.gen_range(0, lower)) }; + } + + // Continue until the iterator is exhausted + loop { + if lower > 1 { + let ix = rng.gen_range(0, lower + consumed); + let skip; + if ix < lower { + result = self.nth(ix); + skip = lower - (ix + 1); + } else { + skip = lower; + } + if upper == Some(lower) { + return result; + } + consumed += lower; + if skip > 0 { + self.nth(skip - 1); + } + } else { + let elem = self.next(); + if elem.is_none() { + return result; + } + consumed += 1; + let denom = consumed as f64; // accurate to 2^53 elements + if rng.gen_bool(1.0 / denom) { + result = elem; + } + } + + let hint = self.size_hint(); + lower = hint.0; + upper = hint.1; + } + } + + /// Collects `amount` values at random from the iterator into a supplied + /// buffer. + /// + /// Although the elements are selected randomly, the order of elements in + /// the buffer is neither stable nor fully random. If random ordering is + /// desired, shuffle the result. + /// + /// Returns the number of elements added to the buffer. This equals `amount` + /// unless the iterator contains insufficient elements, in which case this + /// equals the number of elements available. + /// + /// Complexity is `O(n)` where `n` is the length of the iterator. + fn choose_multiple_fill(mut self, rng: &mut R, buf: &mut [Self::Item]) + -> usize where R: Rng + ?Sized + { + let amount = buf.len(); + let mut len = 0; + while len < amount { + if let Some(elem) = self.next() { + buf[len] = elem; + len += 1; + } else { + // Iterator exhausted; stop early + return len; + } + } + + // Continue, since the iterator was not exhausted + for (i, elem) in self.enumerate() { + let k = rng.gen_range(0, i + 1 + amount); + if let Some(slot) = buf.get_mut(k) { + *slot = elem; + } + } + len + } + + /// Collects `amount` values at random from the iterator into a vector. + /// + /// This is equivalent to `choose_multiple_fill` except for the result type. + /// + /// Although the elements are selected randomly, the order of elements in + /// the buffer is neither stable nor fully random. If random ordering is + /// desired, shuffle the result. + /// + /// The length of the returned vector equals `amount` unless the iterator + /// contains insufficient elements, in which case it equals the number of + /// elements available. + /// + /// Complexity is `O(n)` where `n` is the length of the iterator. + #[cfg(feature = "alloc")] + fn choose_multiple(mut self, rng: &mut R, amount: usize) -> Vec + where R: Rng + ?Sized + { + let mut reservoir = Vec::with_capacity(amount); + reservoir.extend(self.by_ref().take(amount)); + + // Continue unless the iterator was exhausted + // + // note: this prevents iterators that "restart" from causing problems. + // If the iterator stops once, then so do we. + if reservoir.len() == amount { + for (i, elem) in self.enumerate() { + let k = rng.gen_range(0, i + 1 + amount); + if let Some(slot) = reservoir.get_mut(k) { + *slot = elem; + } + } + } else { + // Don't hang onto extra memory. There is a corner case where + // `amount` was much less than `self.len()`. + reservoir.shrink_to_fit(); + } + reservoir + } +} + + +impl SliceRandom for [T] { + type Item = T; + + fn choose(&self, rng: &mut R) -> Option<&Self::Item> + where R: Rng + ?Sized + { + if self.is_empty() { + None + } else { + Some(&self[rng.gen_range(0, self.len())]) + } + } + + fn choose_mut(&mut self, rng: &mut R) -> Option<&mut Self::Item> + where R: Rng + ?Sized + { + if self.is_empty() { + None + } else { + let len = self.len(); + Some(&mut self[rng.gen_range(0, len)]) + } + } + + #[cfg(feature = "alloc")] + fn choose_multiple(&self, rng: &mut R, amount: usize) + -> SliceChooseIter + where R: Rng + ?Sized + { + let amount = ::core::cmp::min(amount, self.len()); + SliceChooseIter { + slice: self, + _phantom: Default::default(), + indices: index::sample(rng, self.len(), amount).into_iter(), + } + } + + #[cfg(feature = "alloc")] + fn choose_weighted(&self, rng: &mut R, weight: F) -> Result<&Self::Item, WeightedError> + where R: Rng + ?Sized, + F: Fn(&Self::Item) -> B, + B: SampleBorrow, + X: SampleUniform + + for<'a> ::core::ops::AddAssign<&'a X> + + ::core::cmp::PartialOrd + + Clone + + Default { + use distributions::{Distribution, WeightedIndex}; + let distr = WeightedIndex::new(self.iter().map(weight))?; + Ok(&self[distr.sample(rng)]) + } + + #[cfg(feature = "alloc")] + fn choose_weighted_mut(&mut self, rng: &mut R, weight: F) -> Result<&mut Self::Item, WeightedError> + where R: Rng + ?Sized, + F: Fn(&Self::Item) -> B, + B: SampleBorrow, + X: SampleUniform + + for<'a> ::core::ops::AddAssign<&'a X> + + ::core::cmp::PartialOrd + + Clone + + Default { + use distributions::{Distribution, WeightedIndex}; + let distr = WeightedIndex::new(self.iter().map(weight))?; + Ok(&mut self[distr.sample(rng)]) + } + + fn shuffle(&mut self, rng: &mut R) where R: Rng + ?Sized + { + for i in (1..self.len()).rev() { + // invariant: elements with index > i have been locked in place. + self.swap(i, rng.gen_range(0, i + 1)); + } + } + + fn partial_shuffle(&mut self, rng: &mut R, amount: usize) + -> (&mut [Self::Item], &mut [Self::Item]) where R: Rng + ?Sized + { + // This applies Durstenfeld's algorithm for the + // [Fisher–Yates shuffle](https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm) + // for an unbiased permutation, but exits early after choosing `amount` + // elements. + + let len = self.len(); + let end = if amount >= len { 0 } else { len - amount }; + + for i in (end..len).rev() { + // invariant: elements with index > i have been locked in place. + self.swap(i, rng.gen_range(0, i + 1)); + } + let r = self.split_at_mut(end); + (r.1, r.0) + } +} + +impl IteratorRandom for I where I: Iterator + Sized {} + + +/// Iterator over multiple choices, as returned by [`SliceRandom::choose_multiple] +#[cfg(feature = "alloc")] +#[derive(Debug)] +pub struct SliceChooseIter<'a, S: ?Sized + 'a, T: 'a> { + slice: &'a S, + _phantom: ::core::marker::PhantomData, + indices: index::IndexVecIntoIter, +} + +#[cfg(feature = "alloc")] +impl<'a, S: Index + ?Sized + 'a, T: 'a> Iterator for SliceChooseIter<'a, S, T> { + type Item = &'a T; + + fn next(&mut self) -> Option { + // TODO: investigate using SliceIndex::get_unchecked when stable + self.indices.next().map(|i| &self.slice[i as usize]) + } + + fn size_hint(&self) -> (usize, Option) { + (self.indices.len(), Some(self.indices.len())) + } +} + +#[cfg(feature = "alloc")] +impl<'a, S: Index + ?Sized + 'a, T: 'a> ExactSizeIterator + for SliceChooseIter<'a, S, T> +{ + fn len(&self) -> usize { + self.indices.len() + } +} + + +/// Randomly sample `amount` elements from a finite iterator. +/// +/// Deprecated: use [`IteratorRandom::choose_multiple`] instead. +#[cfg(feature = "alloc")] +#[deprecated(since="0.6.0", note="use IteratorRandom::choose_multiple instead")] +pub fn sample_iter(rng: &mut R, iterable: I, amount: usize) -> Result, Vec> + where I: IntoIterator, + R: Rng + ?Sized, +{ + use seq::IteratorRandom; + let iter = iterable.into_iter(); + let result = iter.choose_multiple(rng, amount); + if result.len() == amount { + Ok(result) + } else { + Err(result) + } +} + +/// Randomly sample exactly `amount` values from `slice`. +/// +/// The values are non-repeating and in random order. +/// +/// This implementation uses `O(amount)` time and memory. +/// +/// Panics if `amount > slice.len()` +/// +/// Deprecated: use [`SliceRandom::choose_multiple`] instead. +#[cfg(feature = "alloc")] +#[deprecated(since="0.6.0", note="use SliceRandom::choose_multiple instead")] +pub fn sample_slice(rng: &mut R, slice: &[T], amount: usize) -> Vec + where R: Rng + ?Sized, + T: Clone +{ + let indices = index::sample(rng, slice.len(), amount).into_iter(); + + let mut out = Vec::with_capacity(amount); + out.extend(indices.map(|i| slice[i].clone())); + out +} + +/// Randomly sample exactly `amount` references from `slice`. +/// +/// The references are non-repeating and in random order. +/// +/// This implementation uses `O(amount)` time and memory. +/// +/// Panics if `amount > slice.len()` +/// +/// Deprecated: use [`SliceRandom::choose_multiple`] instead. +#[cfg(feature = "alloc")] +#[deprecated(since="0.6.0", note="use SliceRandom::choose_multiple instead")] +pub fn sample_slice_ref<'a, R, T>(rng: &mut R, slice: &'a [T], amount: usize) -> Vec<&'a T> + where R: Rng + ?Sized +{ + let indices = index::sample(rng, slice.len(), amount).into_iter(); + + let mut out = Vec::with_capacity(amount); + out.extend(indices.map(|i| &slice[i])); + out +} + +#[cfg(test)] +mod test { + use super::*; + #[cfg(feature = "alloc")] use {Rng, SeedableRng}; + #[cfg(feature = "alloc")] use rngs::SmallRng; + #[cfg(all(feature="alloc", not(feature="std")))] + use alloc::vec::Vec; + + #[test] + fn test_slice_choose() { + let mut r = ::test::rng(107); + let chars = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n']; + let mut chosen = [0i32; 14]; + for _ in 0..1000 { + let picked = *chars.choose(&mut r).unwrap(); + chosen[(picked as usize) - ('a' as usize)] += 1; + } + for count in chosen.iter() { + let err = *count - (1000 / (chars.len() as i32)); + assert!(-20 <= err && err <= 20); + } + + chosen.iter_mut().for_each(|x| *x = 0); + for _ in 0..1000 { + *chosen.choose_mut(&mut r).unwrap() += 1; + } + for count in chosen.iter() { + let err = *count - (1000 / (chosen.len() as i32)); + assert!(-20 <= err && err <= 20); + } + + let mut v: [isize; 0] = []; + assert_eq!(v.choose(&mut r), None); + assert_eq!(v.choose_mut(&mut r), None); + } + + #[derive(Clone)] + struct UnhintedIterator { + iter: I, + } + impl Iterator for UnhintedIterator { + type Item = I::Item; + fn next(&mut self) -> Option { + self.iter.next() + } + } + + #[derive(Clone)] + struct ChunkHintedIterator { + iter: I, + chunk_remaining: usize, + chunk_size: usize, + hint_total_size: bool, + } + impl Iterator for ChunkHintedIterator { + type Item = I::Item; + fn next(&mut self) -> Option { + if self.chunk_remaining == 0 { + self.chunk_remaining = ::core::cmp::min(self.chunk_size, + self.iter.len()); + } + self.chunk_remaining = self.chunk_remaining.saturating_sub(1); + + self.iter.next() + } + fn size_hint(&self) -> (usize, Option) { + (self.chunk_remaining, + if self.hint_total_size { Some(self.iter.len()) } else { None }) + } + } + + #[derive(Clone)] + struct WindowHintedIterator { + iter: I, + window_size: usize, + hint_total_size: bool, + } + impl Iterator for WindowHintedIterator { + type Item = I::Item; + fn next(&mut self) -> Option { + self.iter.next() + } + fn size_hint(&self) -> (usize, Option) { + (::core::cmp::min(self.iter.len(), self.window_size), + if self.hint_total_size { Some(self.iter.len()) } else { None }) + } + } + + #[test] + fn test_iterator_choose() { + let r = &mut ::test::rng(109); + fn test_iter + Clone>(r: &mut R, iter: Iter) { + let mut chosen = [0i32; 9]; + for _ in 0..1000 { + let picked = iter.clone().choose(r).unwrap(); + chosen[picked] += 1; + } + for count in chosen.iter() { + // Samples should follow Binomial(1000, 1/9) + // Octave: binopdf(x, 1000, 1/9) gives the prob of *count == x + // Note: have seen 153, which is unlikely but not impossible. + assert!(72 < *count && *count < 154, "count not close to 1000/9: {}", count); + } + } + + test_iter(r, 0..9); + test_iter(r, [0, 1, 2, 3, 4, 5, 6, 7, 8].iter().cloned()); + #[cfg(feature = "alloc")] + test_iter(r, (0..9).collect::>().into_iter()); + test_iter(r, UnhintedIterator { iter: 0..9 }); + test_iter(r, ChunkHintedIterator { iter: 0..9, chunk_size: 4, chunk_remaining: 4, hint_total_size: false }); + test_iter(r, ChunkHintedIterator { iter: 0..9, chunk_size: 4, chunk_remaining: 4, hint_total_size: true }); + test_iter(r, WindowHintedIterator { iter: 0..9, window_size: 2, hint_total_size: false }); + test_iter(r, WindowHintedIterator { iter: 0..9, window_size: 2, hint_total_size: true }); + + assert_eq!((0..0).choose(r), None); + assert_eq!(UnhintedIterator{ iter: 0..0 }.choose(r), None); + } + + #[test] + fn test_shuffle() { + let mut r = ::test::rng(108); + let empty: &mut [isize] = &mut []; + empty.shuffle(&mut r); + let mut one = [1]; + one.shuffle(&mut r); + let b: &[_] = &[1]; + assert_eq!(one, b); + + let mut two = [1, 2]; + two.shuffle(&mut r); + assert!(two == [1, 2] || two == [2, 1]); + + fn move_last(slice: &mut [usize], pos: usize) { + // use slice[pos..].rotate_left(1); once we can use that + let last_val = slice[pos]; + for i in pos..slice.len() - 1 { + slice[i] = slice[i + 1]; + } + *slice.last_mut().unwrap() = last_val; + } + let mut counts = [0i32; 24]; + for _ in 0..10000 { + let mut arr: [usize; 4] = [0, 1, 2, 3]; + arr.shuffle(&mut r); + let mut permutation = 0usize; + let mut pos_value = counts.len(); + for i in 0..4 { + pos_value /= 4 - i; + let pos = arr.iter().position(|&x| x == i).unwrap(); + assert!(pos < (4 - i)); + permutation += pos * pos_value; + move_last(&mut arr, pos); + assert_eq!(arr[3], i); + } + for i in 0..4 { + assert_eq!(arr[i], i); + } + counts[permutation] += 1; + } + for count in counts.iter() { + let err = *count - 10000i32 / 24; + assert!(-50 <= err && err <= 50); + } + } + + #[test] + fn test_partial_shuffle() { + let mut r = ::test::rng(118); + + let mut empty: [u32; 0] = []; + let res = empty.partial_shuffle(&mut r, 10); + assert_eq!((res.0.len(), res.1.len()), (0, 0)); + + let mut v = [1, 2, 3, 4, 5]; + let res = v.partial_shuffle(&mut r, 2); + assert_eq!((res.0.len(), res.1.len()), (2, 3)); + assert!(res.0[0] != res.0[1]); + // First elements are only modified if selected, so at least one isn't modified: + assert!(res.1[0] == 1 || res.1[1] == 2 || res.1[2] == 3); + } + + #[test] + #[cfg(feature = "alloc")] + fn test_sample_iter() { + let min_val = 1; + let max_val = 100; + + let mut r = ::test::rng(401); + let vals = (min_val..max_val).collect::>(); + let small_sample = vals.iter().choose_multiple(&mut r, 5); + let large_sample = vals.iter().choose_multiple(&mut r, vals.len() + 5); + + assert_eq!(small_sample.len(), 5); + assert_eq!(large_sample.len(), vals.len()); + // no randomization happens when amount >= len + assert_eq!(large_sample, vals.iter().collect::>()); + + assert!(small_sample.iter().all(|e| { + **e >= min_val && **e <= max_val + })); + } + + #[test] + #[cfg(feature = "alloc")] + #[allow(deprecated)] + fn test_sample_slice_boundaries() { + let empty: &[u8] = &[]; + + let mut r = ::test::rng(402); + + // sample 0 items + assert_eq!(&sample_slice(&mut r, empty, 0)[..], [0u8; 0]); + assert_eq!(&sample_slice(&mut r, &[42, 2, 42], 0)[..], [0u8; 0]); + + // sample 1 item + assert_eq!(&sample_slice(&mut r, &[42], 1)[..], [42]); + let v = sample_slice(&mut r, &[1, 42], 1)[0]; + assert!(v == 1 || v == 42); + + // sample "all" the items + let v = sample_slice(&mut r, &[42, 133], 2); + assert!(&v[..] == [42, 133] || v[..] == [133, 42]); + + // Make sure lucky 777's aren't lucky + let slice = &[42, 777]; + let mut num_42 = 0; + let total = 1000; + for _ in 0..total { + let v = sample_slice(&mut r, slice, 1); + assert_eq!(v.len(), 1); + let v = v[0]; + assert!(v == 42 || v == 777); + if v == 42 { + num_42 += 1; + } + } + let ratio_42 = num_42 as f64 / 1000 as f64; + assert!(0.4 <= ratio_42 || ratio_42 <= 0.6, "{}", ratio_42); + } + + #[test] + #[cfg(feature = "alloc")] + #[allow(deprecated)] + fn test_sample_slice() { + let seeded_rng = SmallRng::from_seed; + + let mut r = ::test::rng(403); + + for n in 1..20 { + let length = 5*n - 4; // 1, 6, ... + let amount = r.gen_range(0, length); + let mut seed = [0u8; 16]; + r.fill(&mut seed); + + // assert the basics work + let regular = index::sample(&mut seeded_rng(seed), length, amount); + assert_eq!(regular.len(), amount); + assert!(regular.iter().all(|e| e < length)); + + // also test that sampling the slice works + let vec: Vec = (0..(length as u32)).collect(); + let result = sample_slice(&mut seeded_rng(seed), &vec, amount); + assert_eq!(result, regular.iter().map(|i| i as u32).collect::>()); + + let result = sample_slice_ref(&mut seeded_rng(seed), &vec, amount); + assert!(result.iter().zip(regular.iter()).all(|(i,j)| **i == j as u32)); + } + } + + #[test] + #[cfg(feature = "alloc")] + fn test_weighted() { + let mut r = ::test::rng(406); + const N_REPS: u32 = 3000; + let weights = [1u32, 2, 3, 0, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7]; + let total_weight = weights.iter().sum::() as f32; + + let verify = |result: [i32; 14]| { + for (i, count) in result.iter().enumerate() { + let exp = (weights[i] * N_REPS) as f32 / total_weight; + let mut err = (*count as f32 - exp).abs(); + if err != 0.0 { + err /= exp; + } + assert!(err <= 0.25); + } + }; + + // choose_weighted + fn get_weight(item: &(u32, T)) -> u32 { + item.0 + } + let mut chosen = [0i32; 14]; + let mut items = [(0u32, 0usize); 14]; // (weight, index) + for (i, item) in items.iter_mut().enumerate() { + *item = (weights[i], i); + } + for _ in 0..N_REPS { + let item = items.choose_weighted(&mut r, get_weight).unwrap(); + chosen[item.1] += 1; + } + verify(chosen); + + // choose_weighted_mut + let mut items = [(0u32, 0i32); 14]; // (weight, count) + for (i, item) in items.iter_mut().enumerate() { + *item = (weights[i], 0); + } + for _ in 0..N_REPS { + items.choose_weighted_mut(&mut r, get_weight).unwrap().1 += 1; + } + for (ch, item) in chosen.iter_mut().zip(items.iter()) { + *ch = item.1; + } + verify(chosen); + + // Check error cases + let empty_slice = &mut [10][0..0]; + assert_eq!(empty_slice.choose_weighted(&mut r, |_| 1), Err(WeightedError::NoItem)); + assert_eq!(empty_slice.choose_weighted_mut(&mut r, |_| 1), Err(WeightedError::NoItem)); + assert_eq!(['x'].choose_weighted_mut(&mut r, |_| 0), Err(WeightedError::AllWeightsZero)); + assert_eq!([0, -1].choose_weighted_mut(&mut r, |x| *x), Err(WeightedError::NegativeWeight)); + assert_eq!([-1, 0].choose_weighted_mut(&mut r, |x| *x), Err(WeightedError::NegativeWeight)); + } +} diff --git a/vendor/registry-40351f815f426200/rand/tests/uniformity.rs b/vendor/registry-40351f815f426200/rand/tests/uniformity.rs new file mode 100644 index 000000000..b8f74a62e --- /dev/null +++ b/vendor/registry-40351f815f426200/rand/tests/uniformity.rs @@ -0,0 +1,67 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +#![cfg(feature = "std")] + +#[macro_use] +extern crate average; +extern crate rand; + +use std as core; +use rand::FromEntropy; +use rand::distributions::Distribution; +use average::Histogram; + +const N_BINS: usize = 100; +const N_SAMPLES: u32 = 1_000_000; +const TOL: f64 = 1e-3; +define_histogram!(hist, 100); +use hist::Histogram as Histogram100; + +#[test] +fn unit_sphere() { + const N_DIM: usize = 3; + let h = Histogram100::with_const_width(-1., 1.); + let mut histograms = [h.clone(), h.clone(), h]; + let dist = rand::distributions::UnitSphereSurface::new(); + let mut rng = rand::rngs::SmallRng::from_entropy(); + for _ in 0..N_SAMPLES { + let v = dist.sample(&mut rng); + for i in 0..N_DIM { + histograms[i].add(v[i]).map_err( + |e| { println!("v: {}", v[i]); e } + ).unwrap(); + } + } + for h in &histograms { + let sum: u64 = h.bins().iter().sum(); + println!("{:?}", h); + for &b in h.bins() { + let p = (b as f64) / (sum as f64); + assert!((p - 1.0 / (N_BINS as f64)).abs() < TOL, "{}", p); + } + } +} + +#[test] +fn unit_circle() { + use ::std::f64::consts::PI; + let mut h = Histogram100::with_const_width(-PI, PI); + let dist = rand::distributions::UnitCircle::new(); + let mut rng = rand::rngs::SmallRng::from_entropy(); + for _ in 0..N_SAMPLES { + let v = dist.sample(&mut rng); + h.add(v[0].atan2(v[1])).unwrap(); + } + let sum: u64 = h.bins().iter().sum(); + println!("{:?}", h); + for &b in h.bins() { + let p = (b as f64) / (sum as f64); + assert!((p - 1.0 / (N_BINS as f64)).abs() < TOL, "{}", p); + } +} diff --git a/vendor/registry-40351f815f426200/rand_chacha/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_chacha/.cargo-checksum.json new file mode 100644 index 000000000..42ac0826a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"66b938cf98ad5c5305ef4cc07886b0f64d9985189f6b32630bf32712a0395e5d","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"020a747006ee14a2faae021077d5f2d1b41c90a79f97a79bd33a6fc2b256206f","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"2c4782326824e620912d671f1903722c60ada94c440817ff5e6f83e784f472bf","build.rs":"003108281c4f4bd7a40a93529012acc9d2555c7a4f4b3bfc3ab81d0ed92b8864","src/chacha.rs":"ea9bc97d0fec99d627fcd5ee57f3e187571efdea752ef4b514d1ae0c00476801","src/lib.rs":"ff1162b8836ccc23763cf7f64fa92c2d91b09d1b9ac80960a1486dca6d8a23ca"},"package":"556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_chacha/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_chacha/CHANGELOG.md new file mode 100644 index 000000000..a1979f601 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.1] - 2019-01-04 +- Disable `i128` and `u128` if the `target_os` is `emscripten` (#671: work-around Emscripten limitation) +- Update readme and doc links + +## [0.1.0] - 2018-10-17 +- Pulled out of the Rand crate diff --git a/vendor/registry-40351f815f426200/rand_chacha/COPYRIGHT b/vendor/registry-40351f815f426200/rand_chacha/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_chacha/Cargo.toml b/vendor/registry-40351f815f426200/rand_chacha/Cargo.toml new file mode 100644 index 000000000..e6d552302 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/Cargo.toml @@ -0,0 +1,35 @@ +# 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 = "rand_chacha" +version = "0.1.1" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +build = "build.rs" +description = "ChaCha random number generator\n" +homepage = "https://crates.io/crates/rand_chacha" +documentation = "https://rust-random.github.io/rand/rand_chacha" +readme = "README.md" +keywords = ["random", "rng", "chacha"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = ">=0.2, <0.4" +default-features = false +[build-dependencies.autocfg] +version = "0.1" +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_chacha/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_chacha/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_chacha/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_chacha/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_chacha/README.md b/vendor/registry-40351f815f426200/rand_chacha/README.md new file mode 100644 index 000000000..5a1dbac8a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/README.md @@ -0,0 +1,45 @@ +# rand_chacha + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_chacha.svg)](https://crates.io/crates/rand_chacha) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_chacha) +[![API](https://docs.rs/rand_chacha/badge.svg)](https://docs.rs/rand_chacha) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +A cryptographically secure random number generator that uses the ChaCha +algorithm. + +ChaCha is a stream cipher designed by Daniel J. Bernstein[^1], that we use +as an RNG. It is an improved variant of the Salsa20 cipher family, which was +selected as one of the "stream ciphers suitable for widespread adoption" by +eSTREAM[^2]. + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_chacha) +- [API documentation (docs.rs)](https://docs.rs/rand_chacha) +- [Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand +[^1]: D. J. Bernstein, [*ChaCha, a variant of Salsa20*]( + https://cr.yp.to/chacha.html) + +[^2]: [eSTREAM: the ECRYPT Stream Cipher Project]( + http://www.ecrypt.eu.org/stream/) + + +## Crate Features + +`rand_chacha` is `no_std` compatible. It does not require any functionality +outside of the `core` lib, thus there are no features to configure. + + +# License + +`rand_chacha` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_chacha/build.rs b/vendor/registry-40351f815f426200/rand_chacha/build.rs new file mode 100644 index 000000000..06e12a47b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/build.rs @@ -0,0 +1,7 @@ +extern crate autocfg; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let ac = autocfg::new(); + ac.emit_rustc_version(1, 26); +} diff --git a/vendor/registry-40351f815f426200/rand_chacha/src/chacha.rs b/vendor/registry-40351f815f426200/rand_chacha/src/chacha.rs new file mode 100644 index 000000000..86f191e49 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/src/chacha.rs @@ -0,0 +1,449 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2014 The Rust Project 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. + +//! The ChaCha random number generator. + +use core::fmt; +use rand_core::{CryptoRng, RngCore, SeedableRng, Error, le}; +use rand_core::block::{BlockRngCore, BlockRng}; + +const SEED_WORDS: usize = 8; // 8 words for the 256-bit key +const STATE_WORDS: usize = 16; + +/// A cryptographically secure random number generator that uses the ChaCha +/// algorithm. +/// +/// ChaCha is a stream cipher designed by Daniel J. Bernstein[^1], that we use +/// as an RNG. It is an improved variant of the Salsa20 cipher family, which was +/// selected as one of the "stream ciphers suitable for widespread adoption" by +/// eSTREAM[^2]. +/// +/// ChaCha uses add-rotate-xor (ARX) operations as its basis. These are safe +/// against timing attacks, although that is mostly a concern for ciphers and +/// not for RNGs. Also it is very suitable for SIMD implementation. +/// Here we do not provide a SIMD implementation yet, except for what is +/// provided by auto-vectorisation. +/// +/// With the ChaCha algorithm it is possible to choose the number of rounds the +/// core algorithm should run. The number of rounds is a tradeoff between +/// performance and security, where 8 rounds is the minimum potentially +/// secure configuration, and 20 rounds is widely used as a conservative choice. +/// We use 20 rounds in this implementation, but hope to allow type-level +/// configuration in the future. +/// +/// We use a 64-bit counter and 64-bit stream identifier as in Bernstein's +/// implementation[^1] except that we use a stream identifier in place of a +/// nonce. A 64-bit counter over 64-byte (16 word) blocks allows 1 ZiB of output +/// before cycling, and the stream identifier allows 264 unique +/// streams of output per seed. Both counter and stream are initialized to zero +/// but may be set via [`set_word_pos`] and [`set_stream`]. +/// +/// The word layout is: +/// +/// ```text +/// constant constant constant constant +/// seed seed seed seed +/// seed seed seed seed +/// counter counter stream_id stream_id +/// ``` +/// +/// This implementation uses an output buffer of sixteen `u32` words, and uses +/// [`BlockRng`] to implement the [`RngCore`] methods. +/// +/// [^1]: D. J. Bernstein, [*ChaCha, a variant of Salsa20*]( +/// https://cr.yp.to/chacha.html) +/// +/// [^2]: [eSTREAM: the ECRYPT Stream Cipher Project]( +/// http://www.ecrypt.eu.org/stream/) +/// +/// [`set_word_pos`]: #method.set_word_pos +/// [`set_stream`]: #method.set_stream +/// [`BlockRng`]: ../rand_core/block/struct.BlockRng.html +/// [`RngCore`]: ../rand_core/trait.RngCore.html +#[derive(Clone, Debug)] +pub struct ChaChaRng(BlockRng); + +impl RngCore for ChaChaRng { + #[inline] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + #[inline] + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + #[inline] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for ChaChaRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + ChaChaRng(BlockRng::::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + BlockRng::::from_rng(rng).map(ChaChaRng) + } +} + +impl CryptoRng for ChaChaRng {} + +impl ChaChaRng { + /// Get the offset from the start of the stream, in 32-bit words. + /// + /// Since the generated blocks are 16 words (24) long and the + /// counter is 64-bits, the offset is a 68-bit number. Sub-word offsets are + /// not supported, hence the result can simply be multiplied by 4 to get a + /// byte-offset. + /// + /// Note: this function is currently only available with Rust 1.26 or later. + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + pub fn get_word_pos(&self) -> u128 { + let mut c = (self.0.core.state[13] as u64) << 32 + | (self.0.core.state[12] as u64); + let mut index = self.0.index(); + // c is the end of the last block generated, unless index is at end + if index >= STATE_WORDS { + index = 0; + } else { + c = c.wrapping_sub(1); + } + ((c as u128) << 4) | (index as u128) + } + + /// Set the offset from the start of the stream, in 32-bit words. + /// + /// As with `get_word_pos`, we use a 68-bit number. Since the generator + /// simply cycles at the end of its period (1 ZiB), we ignore the upper + /// 60 bits. + /// + /// Note: this function is currently only available with Rust 1.26 or later. + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + pub fn set_word_pos(&mut self, word_offset: u128) { + let index = (word_offset as usize) & 0xF; + let counter = (word_offset >> 4) as u64; + self.0.core.state[12] = counter as u32; + self.0.core.state[13] = (counter >> 32) as u32; + if index != 0 { + self.0.generate_and_set(index); // also increments counter + } else { + self.0.reset(); + } + } + + /// Set the stream number. + /// + /// This is initialized to zero; 264 unique streams of output + /// are available per seed/key. + /// + /// Note that in order to reproduce ChaCha output with a specific 64-bit + /// nonce, one can convert that nonce to a `u64` in little-endian fashion + /// and pass to this function. In theory a 96-bit nonce can be used by + /// passing the last 64-bits to this function and using the first 32-bits as + /// the most significant half of the 64-bit counter (which may be set + /// indirectly via `set_word_pos`), but this is not directly supported. + pub fn set_stream(&mut self, stream: u64) { + let index = self.0.index(); + self.0.core.state[14] = stream as u32; + self.0.core.state[15] = (stream >> 32) as u32; + if index < STATE_WORDS { + // we need to regenerate a partial result buffer + { + // reverse of counter adjustment in generate() + if self.0.core.state[12] == 0 { + self.0.core.state[13] = self.0.core.state[13].wrapping_sub(1); + } + self.0.core.state[12] = self.0.core.state[12].wrapping_sub(1); + } + self.0.generate_and_set(index); + } + } +} + +/// The core of `ChaChaRng`, used with `BlockRng`. +#[derive(Clone)] +pub struct ChaChaCore { + state: [u32; STATE_WORDS], +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for ChaChaCore { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "ChaChaCore {{}}") + } +} + +macro_rules! quarter_round{ + ($a: expr, $b: expr, $c: expr, $d: expr) => {{ + $a = $a.wrapping_add($b); $d ^= $a; $d = $d.rotate_left(16); + $c = $c.wrapping_add($d); $b ^= $c; $b = $b.rotate_left(12); + $a = $a.wrapping_add($b); $d ^= $a; $d = $d.rotate_left( 8); + $c = $c.wrapping_add($d); $b ^= $c; $b = $b.rotate_left( 7); + }} +} + +macro_rules! double_round{ + ($x: expr) => {{ + // Column round + quarter_round!($x[ 0], $x[ 4], $x[ 8], $x[12]); + quarter_round!($x[ 1], $x[ 5], $x[ 9], $x[13]); + quarter_round!($x[ 2], $x[ 6], $x[10], $x[14]); + quarter_round!($x[ 3], $x[ 7], $x[11], $x[15]); + // Diagonal round + quarter_round!($x[ 0], $x[ 5], $x[10], $x[15]); + quarter_round!($x[ 1], $x[ 6], $x[11], $x[12]); + quarter_round!($x[ 2], $x[ 7], $x[ 8], $x[13]); + quarter_round!($x[ 3], $x[ 4], $x[ 9], $x[14]); + }} +} + +impl BlockRngCore for ChaChaCore { + type Item = u32; + type Results = [u32; STATE_WORDS]; + + fn generate(&mut self, results: &mut Self::Results) { + // For some reason extracting this part into a separate function + // improves performance by 50%. + fn core(results: &mut [u32; STATE_WORDS], + state: &[u32; STATE_WORDS]) + { + let mut tmp = *state; + let rounds = 20; + for _ in 0..rounds / 2 { + double_round!(tmp); + } + for i in 0..STATE_WORDS { + results[i] = tmp[i].wrapping_add(state[i]); + } + } + + core(results, &self.state); + + // update 64-bit counter + self.state[12] = self.state[12].wrapping_add(1); + if self.state[12] != 0 { return; }; + self.state[13] = self.state[13].wrapping_add(1); + } +} + +impl SeedableRng for ChaChaCore { + type Seed = [u8; SEED_WORDS*4]; + + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_le = [0u32; SEED_WORDS]; + le::read_u32_into(&seed, &mut seed_le); + Self { + state: [0x61707865, 0x3320646E, 0x79622D32, 0x6B206574, // constants + seed_le[0], seed_le[1], seed_le[2], seed_le[3], // seed + seed_le[4], seed_le[5], seed_le[6], seed_le[7], // seed + 0, 0, 0, 0], // counter + } + } +} + +impl CryptoRng for ChaChaCore {} + +impl From for ChaChaRng { + fn from(core: ChaChaCore) -> Self { + ChaChaRng(BlockRng::new(core)) + } +} + +#[cfg(test)] +mod test { + use ::rand_core::{RngCore, SeedableRng}; + use super::ChaChaRng; + + #[test] + fn test_chacha_construction() { + let seed = [0,0,0,0,0,0,0,0, + 1,0,0,0,0,0,0,0, + 2,0,0,0,0,0,0,0, + 3,0,0,0,0,0,0,0]; + let mut rng1 = ChaChaRng::from_seed(seed); + assert_eq!(rng1.next_u32(), 137206642); + + let mut rng2 = ChaChaRng::from_rng(rng1).unwrap(); + assert_eq!(rng2.next_u32(), 1325750369); + } + + #[test] + fn test_chacha_true_values_a() { + // Test vectors 1 and 2 from + // https://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305-04 + let seed = [0u8; 32]; + let mut rng = ChaChaRng::from_seed(seed); + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0xade0b876, 0x903df1a0, 0xe56a5d40, 0x28bd8653, + 0xb819d2bd, 0x1aed8da0, 0xccef36a8, 0xc70d778b, + 0x7c5941da, 0x8d485751, 0x3fe02477, 0x374ad8b8, + 0xf4b8436a, 0x1ca11815, 0x69b687c3, 0x8665eeb2]; + assert_eq!(results, expected); + + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0xbee7079f, 0x7a385155, 0x7c97ba98, 0x0d082d73, + 0xa0290fcb, 0x6965e348, 0x3e53c612, 0xed7aee32, + 0x7621b729, 0x434ee69c, 0xb03371d5, 0xd539d874, + 0x281fed31, 0x45fb0a51, 0x1f0ae1ac, 0x6f4d794b]; + assert_eq!(results, expected); + } + + #[test] + fn test_chacha_true_values_b() { + // Test vector 3 from + // https://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305-04 + let seed = [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, 1]; + let mut rng = ChaChaRng::from_seed(seed); + + // Skip block 0 + for _ in 0..16 { rng.next_u32(); } + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0x2452eb3a, 0x9249f8ec, 0x8d829d9b, 0xddd4ceb1, + 0xe8252083, 0x60818b01, 0xf38422b8, 0x5aaa49c9, + 0xbb00ca8e, 0xda3ba7b4, 0xc4b592d1, 0xfdf2732f, + 0x4436274e, 0x2561b3c8, 0xebdd4aa6, 0xa0136c00]; + assert_eq!(results, expected); + } + + #[test] + #[cfg(all(rustc_1_26, not(target_os = "emscripten")))] + fn test_chacha_true_values_c() { + // Test vector 4 from + // https://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305-04 + let seed = [0, 0xff, 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]; + let expected = [0xfb4dd572, 0x4bc42ef1, 0xdf922636, 0x327f1394, + 0xa78dea8f, 0x5e269039, 0xa1bebbc1, 0xcaf09aae, + 0xa25ab213, 0x48a6b46c, 0x1b9d9bcb, 0x092c5be6, + 0x546ca624, 0x1bec45d5, 0x87f47473, 0x96f0992e]; + let expected_end = 3 * 16; + let mut results = [0u32; 16]; + + // Test block 2 by skipping block 0 and 1 + let mut rng1 = ChaChaRng::from_seed(seed); + for _ in 0..32 { rng1.next_u32(); } + for i in results.iter_mut() { *i = rng1.next_u32(); } + assert_eq!(results, expected); + assert_eq!(rng1.get_word_pos(), expected_end); + + // Test block 2 by using `set_word_pos` + let mut rng2 = ChaChaRng::from_seed(seed); + rng2.set_word_pos(2 * 16); + for i in results.iter_mut() { *i = rng2.next_u32(); } + assert_eq!(results, expected); + assert_eq!(rng2.get_word_pos(), expected_end); + + // Test skipping behaviour with other types + let mut buf = [0u8; 32]; + rng2.fill_bytes(&mut buf[..]); + assert_eq!(rng2.get_word_pos(), expected_end + 8); + rng2.fill_bytes(&mut buf[0..25]); + assert_eq!(rng2.get_word_pos(), expected_end + 15); + rng2.next_u64(); + assert_eq!(rng2.get_word_pos(), expected_end + 17); + rng2.next_u32(); + rng2.next_u64(); + assert_eq!(rng2.get_word_pos(), expected_end + 20); + rng2.fill_bytes(&mut buf[0..1]); + assert_eq!(rng2.get_word_pos(), expected_end + 21); + } + + #[test] + fn test_chacha_multiple_blocks() { + let seed = [0,0,0,0, 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0, 5,0,0,0, 6,0,0,0, 7,0,0,0]; + let mut rng = ChaChaRng::from_seed(seed); + + // Store the 17*i-th 32-bit word, + // i.e., the i-th word of the i-th 16-word block + let mut results = [0u32; 16]; + for i in results.iter_mut() { + *i = rng.next_u32(); + for _ in 0..16 { + rng.next_u32(); + } + } + let expected = [0xf225c81a, 0x6ab1be57, 0x04d42951, 0x70858036, + 0x49884684, 0x64efec72, 0x4be2d186, 0x3615b384, + 0x11cfa18e, 0xd3c50049, 0x75c775f6, 0x434c6530, + 0x2c5bad8f, 0x898881dc, 0x5f1c86d9, 0xc1f8e7f4]; + assert_eq!(results, expected); + } + + #[test] + fn test_chacha_true_bytes() { + let seed = [0u8; 32]; + let mut rng = ChaChaRng::from_seed(seed); + let mut results = [0u8; 32]; + rng.fill_bytes(&mut results); + let expected = [118, 184, 224, 173, 160, 241, 61, 144, + 64, 93, 106, 229, 83, 134, 189, 40, + 189, 210, 25, 184, 160, 141, 237, 26, + 168, 54, 239, 204, 139, 119, 13, 199]; + assert_eq!(results, expected); + } + + #[test] + fn test_chacha_nonce() { + // Test vector 5 from + // https://tools.ietf.org/html/draft-nir-cfrg-chacha20-poly1305-04 + // Although we do not support setting a nonce, we try it here anyway so + // we can use this test vector. + let seed = [0u8; 32]; + let mut rng = ChaChaRng::from_seed(seed); + // 96-bit nonce in LE order is: 0,0,0,0, 0,0,0,0, 0,0,0,2 + rng.set_stream(2u64 << (24 + 32)); + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0x374dc6c2, 0x3736d58c, 0xb904e24a, 0xcd3f93ef, + 0x88228b1a, 0x96a4dfb3, 0x5b76ab72, 0xc727ee54, + 0x0e0e978a, 0xf3145c95, 0x1b748ea8, 0xf786c297, + 0x99c28f5f, 0x628314e8, 0x398a19fa, 0x6ded1b53]; + assert_eq!(results, expected); + } + + #[test] + fn test_chacha_clone_streams() { + let seed = [0,0,0,0, 1,0,0,0, 2,0,0,0, 3,0,0,0, 4,0,0,0, 5,0,0,0, 6,0,0,0, 7,0,0,0]; + let mut rng = ChaChaRng::from_seed(seed); + let mut clone = rng.clone(); + for _ in 0..16 { + assert_eq!(rng.next_u64(), clone.next_u64()); + } + + rng.set_stream(51); + for _ in 0..7 { + assert!(rng.next_u32() != clone.next_u32()); + } + clone.set_stream(51); // switch part way through block + for _ in 7..16 { + assert_eq!(rng.next_u32(), clone.next_u32()); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_chacha/src/lib.rs b/vendor/registry-40351f815f426200/rand_chacha/src/lib.rs new file mode 100644 index 000000000..8cff03ac0 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_chacha/src/lib.rs @@ -0,0 +1,25 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The ChaCha random number generator. + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![no_std] + +extern crate rand_core; + +mod chacha; + +pub use chacha::{ChaChaRng, ChaChaCore}; diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_core-0.3.1/.cargo-checksum.json new file mode 100644 index 000000000..1fd20d476 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"35b32c8dc19610e66f7c6967e93f5a0f49e5a021c633da72e7219571cfb7b457","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"38f22c1be27541f74b322a721c95aaacd622cddfa02cfa22f7976d613453dc78","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"2781af9ae12e434bb3f43c5a3b16b330eea7a8c80065e28e967333a82be7a507","src/block.rs":"43778ab70f0b650c3203a6da70b40bc33afa845a5e14ef88dd26c18a07b70f88","src/error.rs":"8403a968d7c9bd95cc9f23d9dc5cc4771ede8e81dda5a8fdd59d347590345d14","src/impls.rs":"c248ddd04a65c974768baaec028fa0d2a6117525fa27bce8a98f2ba2f352700a","src/le.rs":"cb187f58f7514877918f7f47633397e08e20392dcf072bc245d62c9e5238198c","src/lib.rs":"4452ea591ce26f69e6a3dd1341795faeec5c14af35eb4a17aaf2b5d342753cf0"},"package":"7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_core-0.3.1/CHANGELOG.md new file mode 100644 index 000000000..e3755364d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.3.1] - 2019-01-25 +- Compatibility shim around version 0.4 + +## [0.3.0] - 2018-09-24 +- Add `SeedableRng::seed_from_u64` for convenient seeding. (#537) + +## [0.2.1] - 2018-06-08 +- References to a `CryptoRng` now also implement `CryptoRng`. (#470) + +## [0.2.0] - 2018-05-21 +- Enable the `std` feature by default. (#409) +- Remove `BlockRng{64}::inner` and `BlockRng::inner_mut`; instead making `core` public +- Add `BlockRng{64}::index` and `BlockRng{64}::generate_and_set`. (#374, #419) +- Change `BlockRngCore::Results` bound to also require `AsMut<[Self::Item]>`. (#419) +- Implement `std::io::Read` for RngCore. (#434) + +## [0.1.0] - 2018-04-17 +(Split out of the Rand crate, changes here are relative to rand 0.4.2) +- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288) +- Add modules to help implementing RNGs `impl` and `le`. (#209, #228) +- Add `Error` and `ErrorKind`. (#225) +- Add `CryptoRng` marker trait. (#273) +- Add `BlockRngCore` trait. (#281) +- Add `BlockRng` and `BlockRng64` wrappers to help implementations. (#281, #325) +- Revise the `SeedableRng` trait. (#233) +- Remove default implementations for `RngCore::next_u64` and `RngCore::fill_bytes`. (#288) +- Add `RngCore::try_fill_bytes`. (#225) + +## [0.0.1] - 2017-09-14 (yanked) +Experimental version as part of the rand crate refactor. diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/COPYRIGHT b/vendor/registry-40351f815f426200/rand_core-0.3.1/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/Cargo.toml b/vendor/registry-40351f815f426200/rand_core-0.3.1/Cargo.toml new file mode 100644 index 000000000..439b7d174 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/Cargo.toml @@ -0,0 +1,37 @@ +# 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 = "rand_core" +version = "0.3.1" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +description = "Core random number generator traits and tools for implementation.\n" +homepage = "https://crates.io/crates/rand_core" +documentation = "https://rust-random.github.io/rand/rand_core" +readme = "README.md" +keywords = ["random", "rng"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = "0.4" + +[features] +alloc = ["rand_core/alloc"] +default = ["std"] +serde1 = ["rand_core/serde1"] +std = ["rand_core/std"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_core-0.3.1/README.md b/vendor/registry-40351f815f426200/rand_core-0.3.1/README.md new file mode 100644 index 000000000..dee650482 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/README.md @@ -0,0 +1,65 @@ +# rand_core + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_core.svg)](https://crates.io/crates/rand_core) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_core) +[![API](https://docs.rs/rand_core/badge.svg)](https://docs.rs/rand_core) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Core traits and error types of the [rand] library, plus tools for implementing +RNGs. + +This crate is intended for use when implementing the core trait, `RngCore`; it +defines the core traits to be implemented as well as several small functions to +aid in their implementation and types required for error handling. + +The main [rand] crate re-exports most items defined in this crate, along with +tools to convert the integer samples generated by `RngCore` to many different +applications (including sampling from restricted ranges, conversion to floating +point, list permutations and secure initialisation of RNGs). Most users should +prefer to use the main [rand] crate. + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_core) +- [API documentation (docs.rs)](https://docs.rs/rand_core) +- [Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand + + +## Functionality + +The `rand_core` crate provides: + +- base random number generator traits +- error-reporting types +- functionality to aid implementation of RNGs + +The traits and error types are also available via `rand`. + +## Crate Features + +`rand_core` supports `no_std` and `alloc`-only configurations, as well as full +`std` functionality. The differences between `no_std` and full `std` are small, +comprising `RngCore` support for `Box` types where `R: RngCore`, as well as +extensions to the `Error` type's functionality. + +Due to [rust-lang/cargo#1596](https://github.com/rust-lang/cargo/issues/1596), +`rand_core` is built without `std` support by default. Since features are +unioned across the whole dependency tree, any crate using `rand` with its +default features will also enable `std` support in `rand_core`. + +The `serde1` feature can be used to derive `Serialize` and `Deserialize` for RNG +implementations that use the `BlockRng` or `BlockRng64` wrappers. + + +# License + +`rand_core` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/src/block.rs b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/block.rs new file mode 100644 index 000000000..3045b9482 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/block.rs @@ -0,0 +1,499 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The `BlockRngCore` trait and implementation helpers +//! +//! The [`BlockRngCore`] trait exists to assist in the implementation of RNGs +//! which generate a block of data in a cache instead of returning generated +//! values directly. +//! +//! Usage of this trait is optional, but provides two advantages: +//! implementations only need to concern themselves with generation of the +//! block, not the various [`RngCore`] methods (especially [`fill_bytes`], where +//! the optimal implementations are not trivial), and this allows +//! `ReseedingRng` (see [`rand`](https://docs.rs/rand) crate) perform periodic +//! reseeding with very low overhead. +//! +//! # Example +//! +//! ```norun +//! use rand_core::block::{BlockRngCore, BlockRng}; +//! +//! struct MyRngCore; +//! +//! impl BlockRngCore for MyRngCore { +//! type Results = [u32; 16]; +//! +//! fn generate(&mut self, results: &mut Self::Results) { +//! unimplemented!() +//! } +//! } +//! +//! impl SeedableRng for MyRngCore { +//! type Seed = unimplemented!(); +//! fn from_seed(seed: Self::Seed) -> Self { +//! unimplemented!() +//! } +//! } +//! +//! // optionally, also implement CryptoRng for MyRngCore +//! +//! // Final RNG. +//! type MyRng = BlockRng; +//! ``` +//! +//! [`BlockRngCore`]: crate::block::BlockRngCore +//! [`fill_bytes`]: RngCore::fill_bytes + +use core::convert::AsRef; +use core::fmt; +use {RngCore, CryptoRng, SeedableRng, Error}; +use impls::{fill_via_u32_chunks, fill_via_u64_chunks}; + +/// A trait for RNGs which do not generate random numbers individually, but in +/// blocks (typically `[u32; N]`). This technique is commonly used by +/// cryptographic RNGs to improve performance. +/// +/// See the [module][crate::block] documentation for details. +pub trait BlockRngCore { + /// Results element type, e.g. `u32`. + type Item; + + /// Results type. This is the 'block' an RNG implementing `BlockRngCore` + /// generates, which will usually be an array like `[u32; 16]`. + type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default; + + /// Generate a new block of results. + fn generate(&mut self, results: &mut Self::Results); +} + + +/// A wrapper type implementing [`RngCore`] for some type implementing +/// [`BlockRngCore`] with `u32` array buffer; i.e. this can be used to implement +/// a full RNG from just a `generate` function. +/// +/// The `core` field may be accessed directly but the results buffer may not. +/// PRNG implementations can simply use a type alias +/// (`pub type MyRng = BlockRng;`) but might prefer to use a +/// wrapper type (`pub struct MyRng(BlockRng);`); the latter must +/// re-implement `RngCore` but hides the implementation details and allows +/// extra functionality to be defined on the RNG +/// (e.g. `impl MyRng { fn set_stream(...){...} }`). +/// +/// `BlockRng` has heavily optimized implementations of the [`RngCore`] methods +/// reading values from the results buffer, as well as +/// calling [`BlockRngCore::generate`] directly on the output array when +/// [`fill_bytes`] / [`try_fill_bytes`] is called on a large array. These methods +/// also handle the bookkeeping of when to generate a new batch of values. +/// +/// No whole generated `u32` values are thown away and all values are consumed +/// in-order. [`next_u32`] simply takes the next available `u32` value. +/// [`next_u64`] is implemented by combining two `u32` values, least +/// significant first. [`fill_bytes`] and [`try_fill_bytes`] consume a whole +/// number of `u32` values, converting each `u32` to a byte slice in +/// little-endian order. If the requested byte length is not a multiple of 4, +/// some bytes will be discarded. +/// +/// See also [`BlockRng64`] which uses `u64` array buffers. Currently there is +/// no direct support for other buffer types. +/// +/// For easy initialization `BlockRng` also implements [`SeedableRng`]. +/// +/// [`next_u32`]: RngCore::next_u32 +/// [`next_u64`]: RngCore::next_u64 +/// [`fill_bytes`]: RngCore::fill_bytes +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct BlockRng { + results: R::Results, + index: usize, + /// The *core* part of the RNG, implementing the `generate` function. + pub core: R, +} + +// Custom Debug implementation that does not expose the contents of `results`. +impl fmt::Debug for BlockRng { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("BlockRng") + .field("core", &self.core) + .field("result_len", &self.results.as_ref().len()) + .field("index", &self.index) + .finish() + } +} + +impl BlockRng { + /// Create a new `BlockRng` from an existing RNG implementing + /// `BlockRngCore`. Results will be generated on first use. + pub fn new(core: R) -> BlockRng{ + let results_empty = R::Results::default(); + BlockRng { + core, + index: results_empty.as_ref().len(), + results: results_empty, + } + } + + /// Get the index into the result buffer. + /// + /// If this is equal to or larger than the size of the result buffer then + /// the buffer is "empty" and `generate()` must be called to produce new + /// results. + pub fn index(&self) -> usize { + self.index + } + + /// Reset the number of available results. + /// This will force a new set of results to be generated on next use. + pub fn reset(&mut self) { + self.index = self.results.as_ref().len(); + } + + /// Generate a new set of results immediately, setting the index to the + /// given value. + pub fn generate_and_set(&mut self, index: usize) { + assert!(index < self.results.as_ref().len()); + self.core.generate(&mut self.results); + self.index = index; + } +} + +impl> RngCore for BlockRng +where ::Results: AsRef<[u32]> + AsMut<[u32]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + if self.index >= self.results.as_ref().len() { + self.generate_and_set(0); + } + + let value = self.results.as_ref()[self.index]; + self.index += 1; + value + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + let read_u64 = |results: &[u32], index| { + if cfg!(any(target_arch = "x86", target_arch = "x86_64")) { + // requires little-endian CPU supporting unaligned reads: + unsafe { *(&results[index] as *const u32 as *const u64) } + } else { + let x = u64::from(results[index]); + let y = u64::from(results[index + 1]); + (y << 32) | x + } + }; + + let len = self.results.as_ref().len(); + + let index = self.index; + if index < len-1 { + self.index += 2; + // Read an u64 from the current index + read_u64(self.results.as_ref(), index) + } else if index >= len { + self.generate_and_set(2); + read_u64(self.results.as_ref(), 0) + } else { + let x = u64::from(self.results.as_ref()[len-1]); + self.generate_and_set(1); + let y = u64::from(self.results.as_ref()[0]); + (y << 32) | x + } + } + + // As an optimization we try to write directly into the output buffer. + // This is only enabled for little-endian platforms where unaligned writes + // are known to be safe and fast. + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut filled = 0; + + // Continue filling from the current set of results + if self.index < self.results.as_ref().len() { + let (consumed_u32, filled_u8) = + fill_via_u32_chunks(&self.results.as_ref()[self.index..], + dest); + + self.index += consumed_u32; + filled += filled_u8; + } + + let len_remainder = + (dest.len() - filled) % (self.results.as_ref().len() * 4); + let end_direct = dest.len() - len_remainder; + + while filled < end_direct { + let dest_u32: &mut R::Results = unsafe { + &mut *(dest[filled..].as_mut_ptr() as + *mut ::Results) + }; + self.core.generate(dest_u32); + filled += self.results.as_ref().len() * 4; + self.index = self.results.as_ref().len(); + } + + if len_remainder > 0 { + self.core.generate(&mut self.results); + let (consumed_u32, _) = + fill_via_u32_chunks(self.results.as_ref(), + &mut dest[filled..]); + + self.index = consumed_u32; + } + } + + #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut read_len = 0; + while read_len < dest.len() { + if self.index >= self.results.as_ref().len() { + self.generate_and_set(0); + } + let (consumed_u32, filled_u8) = + fill_via_u32_chunks(&self.results.as_ref()[self.index..], + &mut dest[read_len..]); + + self.index += consumed_u32; + read_len += filled_u8; + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.fill_bytes(dest); + Ok(()) + } +} + +impl SeedableRng for BlockRng { + type Seed = R::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Self::new(R::from_seed(seed)) + } + + fn seed_from_u64(seed: u64) -> Self { + Self::new(R::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + Ok(Self::new(R::from_rng(rng)?)) + } +} + + + +/// A wrapper type implementing [`RngCore`] for some type implementing +/// [`BlockRngCore`] with `u64` array buffer; i.e. this can be used to implement +/// a full RNG from just a `generate` function. +/// +/// This is similar to [`BlockRng`], but specialized for algorithms that operate +/// on `u64` values. +/// +/// No whole generated `u64` values are thrown away and all values are consumed +/// in-order. [`next_u64`] simply takes the next available `u64` value. +/// [`next_u32`] is however a bit special: half of a `u64` is consumed, leaving +/// the other half in the buffer. If the next function called is [`next_u32`] +/// then the other half is then consumed, however both [`next_u64`] and +/// [`fill_bytes`] discard the rest of any half-consumed `u64`s when called. +/// +/// [`fill_bytes`] and [`try_fill_bytes`] consume a whole number of `u64` +/// values. If the requested length is not a multiple of 8, some bytes will be +/// discarded. +/// +/// [`next_u32`]: RngCore::next_u32 +/// [`next_u64`]: RngCore::next_u64 +/// [`fill_bytes`]: RngCore::fill_bytes +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct BlockRng64 { + results: R::Results, + index: usize, + half_used: bool, // true if only half of the previous result is used + /// The *core* part of the RNG, implementing the `generate` function. + pub core: R, +} + +// Custom Debug implementation that does not expose the contents of `results`. +impl fmt::Debug for BlockRng64 { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("BlockRng64") + .field("core", &self.core) + .field("result_len", &self.results.as_ref().len()) + .field("index", &self.index) + .field("half_used", &self.half_used) + .finish() + } +} + +impl BlockRng64 { + /// Create a new `BlockRng` from an existing RNG implementing + /// `BlockRngCore`. Results will be generated on first use. + pub fn new(core: R) -> BlockRng64{ + let results_empty = R::Results::default(); + BlockRng64 { + core, + index: results_empty.as_ref().len(), + half_used: false, + results: results_empty, + } + } + + /// Get the index into the result buffer. + /// + /// If this is equal to or larger than the size of the result buffer then + /// the buffer is "empty" and `generate()` must be called to produce new + /// results. + pub fn index(&self) -> usize { + self.index + } + + /// Reset the number of available results. + /// This will force a new set of results to be generated on next use. + pub fn reset(&mut self) { + self.index = self.results.as_ref().len(); + self.half_used = false; + } + + /// Generate a new set of results immediately, setting the index to the + /// given value. + pub fn generate_and_set(&mut self, index: usize) { + assert!(index < self.results.as_ref().len()); + self.core.generate(&mut self.results); + self.index = index; + self.half_used = false; + } +} + +impl> RngCore for BlockRng64 +where ::Results: AsRef<[u64]> + AsMut<[u64]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + let mut index = self.index * 2 - self.half_used as usize; + if index >= self.results.as_ref().len() * 2 { + self.core.generate(&mut self.results); + self.index = 0; + // `self.half_used` is by definition `false` + self.half_used = false; + index = 0; + } + + self.half_used = !self.half_used; + self.index += self.half_used as usize; + + // Index as if this is a u32 slice. + unsafe { + let results = + &*(self.results.as_ref() as *const [u64] as *const [u32]); + if cfg!(target_endian = "little") { + *results.get_unchecked(index) + } else { + *results.get_unchecked(index ^ 1) + } + } + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + if self.index >= self.results.as_ref().len() { + self.core.generate(&mut self.results); + self.index = 0; + } + + let value = self.results.as_ref()[self.index]; + self.index += 1; + self.half_used = false; + value + } + + // As an optimization we try to write directly into the output buffer. + // This is only enabled for little-endian platforms where unaligned writes + // are known to be safe and fast. + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut filled = 0; + self.half_used = false; + + // Continue filling from the current set of results + if self.index < self.results.as_ref().len() { + let (consumed_u64, filled_u8) = + fill_via_u64_chunks(&self.results.as_ref()[self.index..], + dest); + + self.index += consumed_u64; + filled += filled_u8; + } + + let len_remainder = + (dest.len() - filled) % (self.results.as_ref().len() * 8); + let end_direct = dest.len() - len_remainder; + + while filled < end_direct { + let dest_u64: &mut R::Results = unsafe { + ::core::mem::transmute(dest[filled..].as_mut_ptr()) + }; + self.core.generate(dest_u64); + filled += self.results.as_ref().len() * 8; + self.index = self.results.as_ref().len(); + } + + if len_remainder > 0 { + self.core.generate(&mut self.results); + let (consumed_u64, _) = + fill_via_u64_chunks(&mut self.results.as_ref(), + &mut dest[filled..]); + + self.index = consumed_u64; + } + } + + #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut read_len = 0; + self.half_used = false; + while read_len < dest.len() { + if self.index as usize >= self.results.as_ref().len() { + self.core.generate(&mut self.results); + self.index = 0; + } + + let (consumed_u64, filled_u8) = + fill_via_u64_chunks(&self.results.as_ref()[self.index as usize..], + &mut dest[read_len..]); + + self.index += consumed_u64; + read_len += filled_u8; + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} + +impl SeedableRng for BlockRng64 { + type Seed = R::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Self::new(R::from_seed(seed)) + } + + fn seed_from_u64(seed: u64) -> Self { + Self::new(R::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + Ok(Self::new(R::from_rng(rng)?)) + } +} + +impl CryptoRng for BlockRng {} diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/src/error.rs b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/error.rs new file mode 100644 index 000000000..5a8459ea8 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/error.rs @@ -0,0 +1,177 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Error types + +use core::fmt; + +#[cfg(feature="std")] +use std::error::Error as stdError; +#[cfg(feature="std")] +use std::io; + +/// Error kind which can be matched over. +#[derive(PartialEq, Eq, Debug, Copy, Clone)] +pub enum ErrorKind { + /// Feature is not available; not recoverable. + /// + /// This is the most permanent failure type and implies the error cannot be + /// resolved simply by retrying (e.g. the feature may not exist in this + /// build of the application or on the current platform). + Unavailable, + /// General failure; there may be a chance of recovery on retry. + /// + /// This is the catch-all kind for errors from known and unknown sources + /// which do not have a more specific kind / handling method. + /// + /// It is suggested to retry a couple of times or retry later when + /// handling; some error sources may be able to resolve themselves, + /// although this is not likely. + Unexpected, + /// A transient failure which likely can be resolved or worked around. + /// + /// This error kind exists for a few specific cases where it is known that + /// the error likely can be resolved internally, but is reported anyway. + Transient, + /// Not ready yet: recommended to try again a little later. + /// + /// This error kind implies the generator needs more time or needs some + /// other part of the application to do something else first before it is + /// ready for use; for example this may be used by external generators + /// which require time for initialization. + NotReady, + #[doc(hidden)] + __Nonexhaustive, +} + +impl ErrorKind { + /// True if this kind of error may resolve itself on retry. + /// + /// See also `should_wait()`. + pub fn should_retry(self) -> bool { + self != ErrorKind::Unavailable + } + + /// True if we should retry but wait before retrying + /// + /// This implies `should_retry()` is true. + pub fn should_wait(self) -> bool { + self == ErrorKind::NotReady + } + + /// A description of this error kind + pub fn description(self) -> &'static str { + match self { + ErrorKind::Unavailable => "permanently unavailable", + ErrorKind::Unexpected => "unexpected failure", + ErrorKind::Transient => "transient failure", + ErrorKind::NotReady => "not ready yet", + ErrorKind::__Nonexhaustive => unreachable!(), + } + } +} + + +/// Error type of random number generators +/// +/// This is a relatively simple error type, designed for compatibility with and +/// without the Rust `std` library. It embeds a "kind" code, a message (static +/// string only), and an optional chained cause (`std` only). The `kind` and +/// `msg` fields can be accessed directly; cause can be accessed via +/// `std::error::Error::cause` or `Error::take_cause`. Construction can only be +/// done via `Error::new` or `Error::with_cause`. +#[derive(Debug)] +pub struct Error { + /// The error kind + pub kind: ErrorKind, + /// The error message + pub msg: &'static str, + #[cfg(feature="std")] + cause: Option>, +} + +impl Error { + /// Create a new instance, with specified kind and a message. + pub fn new(kind: ErrorKind, msg: &'static str) -> Self { + #[cfg(feature="std")] { + Error { kind, msg, cause: None } + } + #[cfg(not(feature="std"))] { + Error { kind, msg } + } + } + + /// Create a new instance, with specified kind, message, and a + /// chained cause. + /// + /// Note: `stdError` is an alias for `std::error::Error`. + /// + /// If not targetting `std` (i.e. `no_std`), this function is replaced by + /// another with the same prototype, except that there are no bounds on the + /// type `E` (because both `Box` and `stdError` are unavailable), and the + /// `cause` is ignored. + #[cfg(feature="std")] + pub fn with_cause(kind: ErrorKind, msg: &'static str, cause: E) -> Self + where E: Into> + { + Error { kind, msg, cause: Some(cause.into()) } + } + + /// Create a new instance, with specified kind, message, and a + /// chained cause. + /// + /// In `no_std` mode the *cause* is ignored. + #[cfg(not(feature="std"))] + pub fn with_cause(kind: ErrorKind, msg: &'static str, _cause: E) -> Self { + Error { kind, msg } + } + + /// Take the cause, if any. This allows the embedded cause to be extracted. + /// This uses `Option::take`, leaving `self` with no cause. + #[cfg(feature="std")] + pub fn take_cause(&mut self) -> Option> { + self.cause.take() + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + #[cfg(feature="std")] { + if let Some(ref cause) = self.cause { + return write!(f, "{} ({}); cause: {}", + self.msg, self.kind.description(), cause); + } + } + write!(f, "{} ({})", self.msg, self.kind.description()) + } +} + +#[cfg(feature="std")] +impl stdError for Error { + fn description(&self) -> &str { + self.msg + } + + fn cause(&self) -> Option<&stdError> { + self.cause.as_ref().map(|e| e.as_ref() as &stdError) + } +} + +#[cfg(feature="std")] +impl From for io::Error { + fn from(error: Error) -> Self { + use std::io::ErrorKind::*; + match error.kind { + ErrorKind::Unavailable => io::Error::new(NotFound, error), + ErrorKind::Unexpected | + ErrorKind::Transient => io::Error::new(Other, error), + ErrorKind::NotReady => io::Error::new(WouldBlock, error), + ErrorKind::__Nonexhaustive => unreachable!(), + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/src/impls.rs b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/impls.rs new file mode 100644 index 000000000..57bdd070d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/impls.rs @@ -0,0 +1,165 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Helper functions for implementing `RngCore` functions. +//! +//! For cross-platform reproducibility, these functions all use Little Endian: +//! least-significant part first. For example, `next_u64_via_u32` takes `u32` +//! values `x, y`, then outputs `(y << 32) | x`. To implement `next_u32` +//! from `next_u64` in little-endian order, one should use `next_u64() as u32`. +//! +//! Byte-swapping (like the std `to_le` functions) is only needed to convert +//! to/from byte sequences, and since its purpose is reproducibility, +//! non-reproducible sources (e.g. `OsRng`) need not bother with it. + +use core::intrinsics::transmute; +use core::ptr::copy_nonoverlapping; +use core::slice; +use core::cmp::min; +use core::mem::size_of; +use RngCore; + + +/// Implement `next_u64` via `next_u32`, little-endian order. +pub fn next_u64_via_u32(rng: &mut R) -> u64 { + // Use LE; we explicitly generate one value before the next. + let x = u64::from(rng.next_u32()); + let y = u64::from(rng.next_u32()); + (y << 32) | x +} + +/// Implement `fill_bytes` via `next_u64` and `next_u32`, little-endian order. +/// +/// The fastest way to fill a slice is usually to work as long as possible with +/// integers. That is why this method mostly uses `next_u64`, and only when +/// there are 4 or less bytes remaining at the end of the slice it uses +/// `next_u32` once. +pub fn fill_bytes_via_next(rng: &mut R, dest: &mut [u8]) { + let mut left = dest; + while left.len() >= 8 { + let (l, r) = {left}.split_at_mut(8); + left = r; + let chunk: [u8; 8] = unsafe { + transmute(rng.next_u64().to_le()) + }; + l.copy_from_slice(&chunk); + } + let n = left.len(); + if n > 4 { + let chunk: [u8; 8] = unsafe { + transmute(rng.next_u64().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } else if n > 0 { + let chunk: [u8; 4] = unsafe { + transmute(rng.next_u32().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } +} + +macro_rules! impl_uint_from_fill { + ($rng:expr, $ty:ty, $N:expr) => ({ + debug_assert!($N == size_of::<$ty>()); + + let mut int: $ty = 0; + unsafe { + let ptr = &mut int as *mut $ty as *mut u8; + let slice = slice::from_raw_parts_mut(ptr, $N); + $rng.fill_bytes(slice); + } + int + }); +} + +macro_rules! fill_via_chunks { + ($src:expr, $dst:expr, $ty:ty, $size:expr) => ({ + let chunk_size_u8 = min($src.len() * $size, $dst.len()); + let chunk_size = (chunk_size_u8 + $size - 1) / $size; + if cfg!(target_endian="little") { + unsafe { + copy_nonoverlapping( + $src.as_ptr() as *const u8, + $dst.as_mut_ptr(), + chunk_size_u8); + } + } else { + for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) { + let tmp = n.to_le(); + let src_ptr = &tmp as *const $ty as *const u8; + unsafe { + copy_nonoverlapping(src_ptr, + chunk.as_mut_ptr(), + chunk.len()); + } + } + } + + (chunk_size, chunk_size_u8) + }); +} + +/// Implement `fill_bytes` by reading chunks from the output buffer of a block +/// based RNG. +/// +/// The return values are `(consumed_u32, filled_u8)`. +/// +/// `filled_u8` is the number of filled bytes in `dest`, which may be less than +/// the length of `dest`. +/// `consumed_u32` is the number of words consumed from `src`, which is the same +/// as `filled_u8 / 4` rounded up. +/// +/// # Example +/// (from `IsaacRng`) +/// +/// ```ignore +/// fn fill_bytes(&mut self, dest: &mut [u8]) { +/// let mut read_len = 0; +/// while read_len < dest.len() { +/// if self.index >= self.rsl.len() { +/// self.isaac(); +/// } +/// +/// let (consumed_u32, filled_u8) = +/// impls::fill_via_u32_chunks(&mut self.rsl[self.index..], +/// &mut dest[read_len..]); +/// +/// self.index += consumed_u32; +/// read_len += filled_u8; +/// } +/// } +/// ``` +pub fn fill_via_u32_chunks(src: &[u32], dest: &mut [u8]) -> (usize, usize) { + fill_via_chunks!(src, dest, u32, 4) +} + +/// Implement `fill_bytes` by reading chunks from the output buffer of a block +/// based RNG. +/// +/// The return values are `(consumed_u64, filled_u8)`. +/// `filled_u8` is the number of filled bytes in `dest`, which may be less than +/// the length of `dest`. +/// `consumed_u64` is the number of words consumed from `src`, which is the same +/// as `filled_u8 / 8` rounded up. +/// +/// See `fill_via_u32_chunks` for an example. +pub fn fill_via_u64_chunks(src: &[u64], dest: &mut [u8]) -> (usize, usize) { + fill_via_chunks!(src, dest, u64, 8) +} + +/// Implement `next_u32` via `fill_bytes`, little-endian order. +pub fn next_u32_via_fill(rng: &mut R) -> u32 { + impl_uint_from_fill!(rng, u32, 4) +} + +/// Implement `next_u64` via `fill_bytes`, little-endian order. +pub fn next_u64_via_fill(rng: &mut R) -> u64 { + impl_uint_from_fill!(rng, u64, 8) +} + +// TODO: implement tests for the above diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/src/le.rs b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/le.rs new file mode 100644 index 000000000..266651f10 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/le.rs @@ -0,0 +1,68 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Little-Endian utilities +//! +//! Little-Endian order has been chosen for internal usage; this makes some +//! useful functions available. + +use core::ptr; + +macro_rules! read_slice { + ($src:expr, $dst:expr, $size:expr, $which:ident) => {{ + assert_eq!($src.len(), $size * $dst.len()); + + unsafe { + ptr::copy_nonoverlapping( + $src.as_ptr(), + $dst.as_mut_ptr() as *mut u8, + $src.len()); + } + for v in $dst.iter_mut() { + *v = v.$which(); + } + }}; +} + +/// Reads unsigned 32 bit integers from `src` into `dst`. +/// Borrowed from the `byteorder` crate. +#[inline] +pub fn read_u32_into(src: &[u8], dst: &mut [u32]) { + read_slice!(src, dst, 4, to_le); +} + +/// Reads unsigned 64 bit integers from `src` into `dst`. +/// Borrowed from the `byteorder` crate. +#[inline] +pub fn read_u64_into(src: &[u8], dst: &mut [u64]) { + read_slice!(src, dst, 8, to_le); +} + +#[test] +fn test_read() { + let bytes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + + let mut buf = [0u32; 4]; + read_u32_into(&bytes, &mut buf); + assert_eq!(buf[0], 0x04030201); + assert_eq!(buf[3], 0x100F0E0D); + + let mut buf = [0u32; 3]; + read_u32_into(&bytes[1..13], &mut buf); // unaligned + assert_eq!(buf[0], 0x05040302); + assert_eq!(buf[2], 0x0D0C0B0A); + + let mut buf = [0u64; 2]; + read_u64_into(&bytes, &mut buf); + assert_eq!(buf[0], 0x0807060504030201); + assert_eq!(buf[1], 0x100F0E0D0C0B0A09); + + let mut buf = [0u64; 1]; + read_u64_into(&bytes[7..15], &mut buf); // unaligned + assert_eq!(buf[0], 0x0F0E0D0C0B0A0908); +} diff --git a/vendor/registry-40351f815f426200/rand_core-0.3.1/src/lib.rs b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/lib.rs new file mode 100644 index 000000000..892314225 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core-0.3.1/src/lib.rs @@ -0,0 +1,46 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017-2018 The Rust Project 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. + +//! Random number generation traits +//! +//! This version of `rand_core` is a compatibility shim around version 0.3. +//! +//! This crate is mainly of interest to crates publishing implementations of +//! [`RngCore`]. Other users are encouraged to use the [`rand`] crate instead +//! which re-exports the main traits and error types. +//! +//! [`RngCore`] is the core trait implemented by algorithmic pseudo-random number +//! generators and external random-number sources. +//! +//! [`SeedableRng`] is an extension trait for construction from fixed seeds and +//! other random number generators. +//! +//! [`Error`] is provided for error-handling. It is safe to use in `no_std` +//! environments. +//! +//! The [`impls`] and [`le`] sub-modules include a few small functions to assist +//! implementation of [`RngCore`]. +//! +//! [`rand`]: https://docs.rs/rand + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![no_std] + +extern crate rand_core as core4; + +pub use core4::{ErrorKind, Error}; +pub use core4::{block, impls, le}; +pub use core4::{RngCore, CryptoRng, SeedableRng}; diff --git a/vendor/registry-40351f815f426200/rand_core/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_core/.cargo-checksum.json new file mode 100644 index 000000000..2979fb265 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"93b4744c0355f232107547993a0d771bd276962c9233d4ea1cd4771d7c2f7f92","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"faab1bf947b13c78f97d87f0bd1ab5611b5fd9e128106282c50f03077b22cd2c","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"26d2c4a2f9c2c3016b76f27eed164adfffcc359b395ed8ec6df255c42eb9a117","src/block.rs":"43778ab70f0b650c3203a6da70b40bc33afa845a5e14ef88dd26c18a07b70f88","src/error.rs":"8403a968d7c9bd95cc9f23d9dc5cc4771ede8e81dda5a8fdd59d347590345d14","src/impls.rs":"c248ddd04a65c974768baaec028fa0d2a6117525fa27bce8a98f2ba2f352700a","src/le.rs":"cb187f58f7514877918f7f47633397e08e20392dcf072bc245d62c9e5238198c","src/lib.rs":"5b3d95e405bed6dc1e4525cc010f0afb2c9f0fc9fe8533f6a02e70ea112c22be"},"package":"d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_core/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_core/CHANGELOG.md new file mode 100644 index 000000000..7f2d7978f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/CHANGELOG.md @@ -0,0 +1,36 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.4.0] - 2019-01-24 +- Disable the `std` feature by default (#702) + +## [0.3.0] - 2018-09-24 +- Add `SeedableRng::seed_from_u64` for convenient seeding. (#537) + +## [0.2.1] - 2018-06-08 +- References to a `CryptoRng` now also implement `CryptoRng`. (#470) + +## [0.2.0] - 2018-05-21 +- Enable the `std` feature by default. (#409) +- Remove `BlockRng{64}::inner` and `BlockRng::inner_mut`; instead making `core` public +- Add `BlockRng{64}::index` and `BlockRng{64}::generate_and_set`. (#374, #419) +- Change `BlockRngCore::Results` bound to also require `AsMut<[Self::Item]>`. (#419) +- Implement `std::io::Read` for RngCore. (#434) + +## [0.1.0] - 2018-04-17 +(Split out of the Rand crate, changes here are relative to rand 0.4.2) +- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288) +- Add modules to help implementing RNGs `impl` and `le`. (#209, #228) +- Add `Error` and `ErrorKind`. (#225) +- Add `CryptoRng` marker trait. (#273) +- Add `BlockRngCore` trait. (#281) +- Add `BlockRng` and `BlockRng64` wrappers to help implementations. (#281, #325) +- Revise the `SeedableRng` trait. (#233) +- Remove default implementations for `RngCore::next_u64` and `RngCore::fill_bytes`. (#288) +- Add `RngCore::try_fill_bytes`. (#225) + +## [0.0.1] - 2017-09-14 (yanked) +Experimental version as part of the rand crate refactor. diff --git a/vendor/registry-40351f815f426200/rand_core/COPYRIGHT b/vendor/registry-40351f815f426200/rand_core/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_core/Cargo.toml b/vendor/registry-40351f815f426200/rand_core/Cargo.toml new file mode 100644 index 000000000..aee2ec0b6 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/Cargo.toml @@ -0,0 +1,41 @@ +# 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 = "rand_core" +version = "0.4.0" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +description = "Core random number generator traits and tools for implementation.\n" +homepage = "https://crates.io/crates/rand_core" +documentation = "https://rust-random.github.io/rand/rand_core" +readme = "README.md" +keywords = ["random", "rng"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.serde] +version = "1" +optional = true + +[dependencies.serde_derive] +version = "^1.0.38" +optional = true + +[features] +alloc = [] +serde1 = ["serde", "serde_derive"] +std = ["alloc"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_core/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_core/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_core/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_core/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_core/README.md b/vendor/registry-40351f815f426200/rand_core/README.md new file mode 100644 index 000000000..ef076b99d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/README.md @@ -0,0 +1,66 @@ +# rand_core + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_core.svg)](https://crates.io/crates/rand_core) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_core) +[![API](https://docs.rs/rand_core/badge.svg)](https://docs.rs/rand_core) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Core traits and error types of the [rand] library, plus tools for implementing +RNGs. + +This crate is intended for use when implementing the core trait, `RngCore`; it +defines the core traits to be implemented as well as several small functions to +aid in their implementation and types required for error handling. + +The main [rand] crate re-exports most items defined in this crate, along with +tools to convert the integer samples generated by `RngCore` to many different +applications (including sampling from restricted ranges, conversion to floating +point, list permutations and secure initialisation of RNGs). Most users should +prefer to use the main [rand] crate. + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_core) +- [API documentation (docs.rs)](https://docs.rs/rand_core) +- [Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand + + +## Functionality + +The `rand_core` crate provides: + +- base random number generator traits +- error-reporting types +- functionality to aid implementation of RNGs + +The traits and error types are also available via `rand`. + +## Crate Features + +`rand_core` supports `no_std` and `alloc`-only configurations, as well as full +`std` functionality. The differences between `no_std` and full `std` are small, +comprising `RngCore` support for `Box` types where `R: RngCore`, +`std::io::Read` support for types supporting `RngCore`, and +extensions to the `Error` type's functionality. + +The `std` feature is *not enabled by default*. This is primarily to avoid build +problems where one crate implicitly requires `rand_core` with `std` support and +another crate requires `rand` *without* `std` support. However, the `rand` crate +continues to enable `std` support by default, both for itself and `rand_core`. + +The `serde1` feature can be used to derive `Serialize` and `Deserialize` for RNG +implementations that use the `BlockRng` or `BlockRng64` wrappers. + + +# License + +`rand_core` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_core/src/block.rs b/vendor/registry-40351f815f426200/rand_core/src/block.rs new file mode 100644 index 000000000..3045b9482 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/src/block.rs @@ -0,0 +1,499 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The `BlockRngCore` trait and implementation helpers +//! +//! The [`BlockRngCore`] trait exists to assist in the implementation of RNGs +//! which generate a block of data in a cache instead of returning generated +//! values directly. +//! +//! Usage of this trait is optional, but provides two advantages: +//! implementations only need to concern themselves with generation of the +//! block, not the various [`RngCore`] methods (especially [`fill_bytes`], where +//! the optimal implementations are not trivial), and this allows +//! `ReseedingRng` (see [`rand`](https://docs.rs/rand) crate) perform periodic +//! reseeding with very low overhead. +//! +//! # Example +//! +//! ```norun +//! use rand_core::block::{BlockRngCore, BlockRng}; +//! +//! struct MyRngCore; +//! +//! impl BlockRngCore for MyRngCore { +//! type Results = [u32; 16]; +//! +//! fn generate(&mut self, results: &mut Self::Results) { +//! unimplemented!() +//! } +//! } +//! +//! impl SeedableRng for MyRngCore { +//! type Seed = unimplemented!(); +//! fn from_seed(seed: Self::Seed) -> Self { +//! unimplemented!() +//! } +//! } +//! +//! // optionally, also implement CryptoRng for MyRngCore +//! +//! // Final RNG. +//! type MyRng = BlockRng; +//! ``` +//! +//! [`BlockRngCore`]: crate::block::BlockRngCore +//! [`fill_bytes`]: RngCore::fill_bytes + +use core::convert::AsRef; +use core::fmt; +use {RngCore, CryptoRng, SeedableRng, Error}; +use impls::{fill_via_u32_chunks, fill_via_u64_chunks}; + +/// A trait for RNGs which do not generate random numbers individually, but in +/// blocks (typically `[u32; N]`). This technique is commonly used by +/// cryptographic RNGs to improve performance. +/// +/// See the [module][crate::block] documentation for details. +pub trait BlockRngCore { + /// Results element type, e.g. `u32`. + type Item; + + /// Results type. This is the 'block' an RNG implementing `BlockRngCore` + /// generates, which will usually be an array like `[u32; 16]`. + type Results: AsRef<[Self::Item]> + AsMut<[Self::Item]> + Default; + + /// Generate a new block of results. + fn generate(&mut self, results: &mut Self::Results); +} + + +/// A wrapper type implementing [`RngCore`] for some type implementing +/// [`BlockRngCore`] with `u32` array buffer; i.e. this can be used to implement +/// a full RNG from just a `generate` function. +/// +/// The `core` field may be accessed directly but the results buffer may not. +/// PRNG implementations can simply use a type alias +/// (`pub type MyRng = BlockRng;`) but might prefer to use a +/// wrapper type (`pub struct MyRng(BlockRng);`); the latter must +/// re-implement `RngCore` but hides the implementation details and allows +/// extra functionality to be defined on the RNG +/// (e.g. `impl MyRng { fn set_stream(...){...} }`). +/// +/// `BlockRng` has heavily optimized implementations of the [`RngCore`] methods +/// reading values from the results buffer, as well as +/// calling [`BlockRngCore::generate`] directly on the output array when +/// [`fill_bytes`] / [`try_fill_bytes`] is called on a large array. These methods +/// also handle the bookkeeping of when to generate a new batch of values. +/// +/// No whole generated `u32` values are thown away and all values are consumed +/// in-order. [`next_u32`] simply takes the next available `u32` value. +/// [`next_u64`] is implemented by combining two `u32` values, least +/// significant first. [`fill_bytes`] and [`try_fill_bytes`] consume a whole +/// number of `u32` values, converting each `u32` to a byte slice in +/// little-endian order. If the requested byte length is not a multiple of 4, +/// some bytes will be discarded. +/// +/// See also [`BlockRng64`] which uses `u64` array buffers. Currently there is +/// no direct support for other buffer types. +/// +/// For easy initialization `BlockRng` also implements [`SeedableRng`]. +/// +/// [`next_u32`]: RngCore::next_u32 +/// [`next_u64`]: RngCore::next_u64 +/// [`fill_bytes`]: RngCore::fill_bytes +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct BlockRng { + results: R::Results, + index: usize, + /// The *core* part of the RNG, implementing the `generate` function. + pub core: R, +} + +// Custom Debug implementation that does not expose the contents of `results`. +impl fmt::Debug for BlockRng { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("BlockRng") + .field("core", &self.core) + .field("result_len", &self.results.as_ref().len()) + .field("index", &self.index) + .finish() + } +} + +impl BlockRng { + /// Create a new `BlockRng` from an existing RNG implementing + /// `BlockRngCore`. Results will be generated on first use. + pub fn new(core: R) -> BlockRng{ + let results_empty = R::Results::default(); + BlockRng { + core, + index: results_empty.as_ref().len(), + results: results_empty, + } + } + + /// Get the index into the result buffer. + /// + /// If this is equal to or larger than the size of the result buffer then + /// the buffer is "empty" and `generate()` must be called to produce new + /// results. + pub fn index(&self) -> usize { + self.index + } + + /// Reset the number of available results. + /// This will force a new set of results to be generated on next use. + pub fn reset(&mut self) { + self.index = self.results.as_ref().len(); + } + + /// Generate a new set of results immediately, setting the index to the + /// given value. + pub fn generate_and_set(&mut self, index: usize) { + assert!(index < self.results.as_ref().len()); + self.core.generate(&mut self.results); + self.index = index; + } +} + +impl> RngCore for BlockRng +where ::Results: AsRef<[u32]> + AsMut<[u32]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + if self.index >= self.results.as_ref().len() { + self.generate_and_set(0); + } + + let value = self.results.as_ref()[self.index]; + self.index += 1; + value + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + let read_u64 = |results: &[u32], index| { + if cfg!(any(target_arch = "x86", target_arch = "x86_64")) { + // requires little-endian CPU supporting unaligned reads: + unsafe { *(&results[index] as *const u32 as *const u64) } + } else { + let x = u64::from(results[index]); + let y = u64::from(results[index + 1]); + (y << 32) | x + } + }; + + let len = self.results.as_ref().len(); + + let index = self.index; + if index < len-1 { + self.index += 2; + // Read an u64 from the current index + read_u64(self.results.as_ref(), index) + } else if index >= len { + self.generate_and_set(2); + read_u64(self.results.as_ref(), 0) + } else { + let x = u64::from(self.results.as_ref()[len-1]); + self.generate_and_set(1); + let y = u64::from(self.results.as_ref()[0]); + (y << 32) | x + } + } + + // As an optimization we try to write directly into the output buffer. + // This is only enabled for little-endian platforms where unaligned writes + // are known to be safe and fast. + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut filled = 0; + + // Continue filling from the current set of results + if self.index < self.results.as_ref().len() { + let (consumed_u32, filled_u8) = + fill_via_u32_chunks(&self.results.as_ref()[self.index..], + dest); + + self.index += consumed_u32; + filled += filled_u8; + } + + let len_remainder = + (dest.len() - filled) % (self.results.as_ref().len() * 4); + let end_direct = dest.len() - len_remainder; + + while filled < end_direct { + let dest_u32: &mut R::Results = unsafe { + &mut *(dest[filled..].as_mut_ptr() as + *mut ::Results) + }; + self.core.generate(dest_u32); + filled += self.results.as_ref().len() * 4; + self.index = self.results.as_ref().len(); + } + + if len_remainder > 0 { + self.core.generate(&mut self.results); + let (consumed_u32, _) = + fill_via_u32_chunks(self.results.as_ref(), + &mut dest[filled..]); + + self.index = consumed_u32; + } + } + + #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut read_len = 0; + while read_len < dest.len() { + if self.index >= self.results.as_ref().len() { + self.generate_and_set(0); + } + let (consumed_u32, filled_u8) = + fill_via_u32_chunks(&self.results.as_ref()[self.index..], + &mut dest[read_len..]); + + self.index += consumed_u32; + read_len += filled_u8; + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.fill_bytes(dest); + Ok(()) + } +} + +impl SeedableRng for BlockRng { + type Seed = R::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Self::new(R::from_seed(seed)) + } + + fn seed_from_u64(seed: u64) -> Self { + Self::new(R::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + Ok(Self::new(R::from_rng(rng)?)) + } +} + + + +/// A wrapper type implementing [`RngCore`] for some type implementing +/// [`BlockRngCore`] with `u64` array buffer; i.e. this can be used to implement +/// a full RNG from just a `generate` function. +/// +/// This is similar to [`BlockRng`], but specialized for algorithms that operate +/// on `u64` values. +/// +/// No whole generated `u64` values are thrown away and all values are consumed +/// in-order. [`next_u64`] simply takes the next available `u64` value. +/// [`next_u32`] is however a bit special: half of a `u64` is consumed, leaving +/// the other half in the buffer. If the next function called is [`next_u32`] +/// then the other half is then consumed, however both [`next_u64`] and +/// [`fill_bytes`] discard the rest of any half-consumed `u64`s when called. +/// +/// [`fill_bytes`] and [`try_fill_bytes`] consume a whole number of `u64` +/// values. If the requested length is not a multiple of 8, some bytes will be +/// discarded. +/// +/// [`next_u32`]: RngCore::next_u32 +/// [`next_u64`]: RngCore::next_u64 +/// [`fill_bytes`]: RngCore::fill_bytes +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct BlockRng64 { + results: R::Results, + index: usize, + half_used: bool, // true if only half of the previous result is used + /// The *core* part of the RNG, implementing the `generate` function. + pub core: R, +} + +// Custom Debug implementation that does not expose the contents of `results`. +impl fmt::Debug for BlockRng64 { + fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.debug_struct("BlockRng64") + .field("core", &self.core) + .field("result_len", &self.results.as_ref().len()) + .field("index", &self.index) + .field("half_used", &self.half_used) + .finish() + } +} + +impl BlockRng64 { + /// Create a new `BlockRng` from an existing RNG implementing + /// `BlockRngCore`. Results will be generated on first use. + pub fn new(core: R) -> BlockRng64{ + let results_empty = R::Results::default(); + BlockRng64 { + core, + index: results_empty.as_ref().len(), + half_used: false, + results: results_empty, + } + } + + /// Get the index into the result buffer. + /// + /// If this is equal to or larger than the size of the result buffer then + /// the buffer is "empty" and `generate()` must be called to produce new + /// results. + pub fn index(&self) -> usize { + self.index + } + + /// Reset the number of available results. + /// This will force a new set of results to be generated on next use. + pub fn reset(&mut self) { + self.index = self.results.as_ref().len(); + self.half_used = false; + } + + /// Generate a new set of results immediately, setting the index to the + /// given value. + pub fn generate_and_set(&mut self, index: usize) { + assert!(index < self.results.as_ref().len()); + self.core.generate(&mut self.results); + self.index = index; + self.half_used = false; + } +} + +impl> RngCore for BlockRng64 +where ::Results: AsRef<[u64]> + AsMut<[u64]> +{ + #[inline(always)] + fn next_u32(&mut self) -> u32 { + let mut index = self.index * 2 - self.half_used as usize; + if index >= self.results.as_ref().len() * 2 { + self.core.generate(&mut self.results); + self.index = 0; + // `self.half_used` is by definition `false` + self.half_used = false; + index = 0; + } + + self.half_used = !self.half_used; + self.index += self.half_used as usize; + + // Index as if this is a u32 slice. + unsafe { + let results = + &*(self.results.as_ref() as *const [u64] as *const [u32]); + if cfg!(target_endian = "little") { + *results.get_unchecked(index) + } else { + *results.get_unchecked(index ^ 1) + } + } + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + if self.index >= self.results.as_ref().len() { + self.core.generate(&mut self.results); + self.index = 0; + } + + let value = self.results.as_ref()[self.index]; + self.index += 1; + self.half_used = false; + value + } + + // As an optimization we try to write directly into the output buffer. + // This is only enabled for little-endian platforms where unaligned writes + // are known to be safe and fast. + #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut filled = 0; + self.half_used = false; + + // Continue filling from the current set of results + if self.index < self.results.as_ref().len() { + let (consumed_u64, filled_u8) = + fill_via_u64_chunks(&self.results.as_ref()[self.index..], + dest); + + self.index += consumed_u64; + filled += filled_u8; + } + + let len_remainder = + (dest.len() - filled) % (self.results.as_ref().len() * 8); + let end_direct = dest.len() - len_remainder; + + while filled < end_direct { + let dest_u64: &mut R::Results = unsafe { + ::core::mem::transmute(dest[filled..].as_mut_ptr()) + }; + self.core.generate(dest_u64); + filled += self.results.as_ref().len() * 8; + self.index = self.results.as_ref().len(); + } + + if len_remainder > 0 { + self.core.generate(&mut self.results); + let (consumed_u64, _) = + fill_via_u64_chunks(&mut self.results.as_ref(), + &mut dest[filled..]); + + self.index = consumed_u64; + } + } + + #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))] + fn fill_bytes(&mut self, dest: &mut [u8]) { + let mut read_len = 0; + self.half_used = false; + while read_len < dest.len() { + if self.index as usize >= self.results.as_ref().len() { + self.core.generate(&mut self.results); + self.index = 0; + } + + let (consumed_u64, filled_u8) = + fill_via_u64_chunks(&self.results.as_ref()[self.index as usize..], + &mut dest[read_len..]); + + self.index += consumed_u64; + read_len += filled_u8; + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} + +impl SeedableRng for BlockRng64 { + type Seed = R::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Self::new(R::from_seed(seed)) + } + + fn seed_from_u64(seed: u64) -> Self { + Self::new(R::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + Ok(Self::new(R::from_rng(rng)?)) + } +} + +impl CryptoRng for BlockRng {} diff --git a/vendor/registry-40351f815f426200/rand_core/src/error.rs b/vendor/registry-40351f815f426200/rand_core/src/error.rs new file mode 100644 index 000000000..5a8459ea8 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/src/error.rs @@ -0,0 +1,177 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Error types + +use core::fmt; + +#[cfg(feature="std")] +use std::error::Error as stdError; +#[cfg(feature="std")] +use std::io; + +/// Error kind which can be matched over. +#[derive(PartialEq, Eq, Debug, Copy, Clone)] +pub enum ErrorKind { + /// Feature is not available; not recoverable. + /// + /// This is the most permanent failure type and implies the error cannot be + /// resolved simply by retrying (e.g. the feature may not exist in this + /// build of the application or on the current platform). + Unavailable, + /// General failure; there may be a chance of recovery on retry. + /// + /// This is the catch-all kind for errors from known and unknown sources + /// which do not have a more specific kind / handling method. + /// + /// It is suggested to retry a couple of times or retry later when + /// handling; some error sources may be able to resolve themselves, + /// although this is not likely. + Unexpected, + /// A transient failure which likely can be resolved or worked around. + /// + /// This error kind exists for a few specific cases where it is known that + /// the error likely can be resolved internally, but is reported anyway. + Transient, + /// Not ready yet: recommended to try again a little later. + /// + /// This error kind implies the generator needs more time or needs some + /// other part of the application to do something else first before it is + /// ready for use; for example this may be used by external generators + /// which require time for initialization. + NotReady, + #[doc(hidden)] + __Nonexhaustive, +} + +impl ErrorKind { + /// True if this kind of error may resolve itself on retry. + /// + /// See also `should_wait()`. + pub fn should_retry(self) -> bool { + self != ErrorKind::Unavailable + } + + /// True if we should retry but wait before retrying + /// + /// This implies `should_retry()` is true. + pub fn should_wait(self) -> bool { + self == ErrorKind::NotReady + } + + /// A description of this error kind + pub fn description(self) -> &'static str { + match self { + ErrorKind::Unavailable => "permanently unavailable", + ErrorKind::Unexpected => "unexpected failure", + ErrorKind::Transient => "transient failure", + ErrorKind::NotReady => "not ready yet", + ErrorKind::__Nonexhaustive => unreachable!(), + } + } +} + + +/// Error type of random number generators +/// +/// This is a relatively simple error type, designed for compatibility with and +/// without the Rust `std` library. It embeds a "kind" code, a message (static +/// string only), and an optional chained cause (`std` only). The `kind` and +/// `msg` fields can be accessed directly; cause can be accessed via +/// `std::error::Error::cause` or `Error::take_cause`. Construction can only be +/// done via `Error::new` or `Error::with_cause`. +#[derive(Debug)] +pub struct Error { + /// The error kind + pub kind: ErrorKind, + /// The error message + pub msg: &'static str, + #[cfg(feature="std")] + cause: Option>, +} + +impl Error { + /// Create a new instance, with specified kind and a message. + pub fn new(kind: ErrorKind, msg: &'static str) -> Self { + #[cfg(feature="std")] { + Error { kind, msg, cause: None } + } + #[cfg(not(feature="std"))] { + Error { kind, msg } + } + } + + /// Create a new instance, with specified kind, message, and a + /// chained cause. + /// + /// Note: `stdError` is an alias for `std::error::Error`. + /// + /// If not targetting `std` (i.e. `no_std`), this function is replaced by + /// another with the same prototype, except that there are no bounds on the + /// type `E` (because both `Box` and `stdError` are unavailable), and the + /// `cause` is ignored. + #[cfg(feature="std")] + pub fn with_cause(kind: ErrorKind, msg: &'static str, cause: E) -> Self + where E: Into> + { + Error { kind, msg, cause: Some(cause.into()) } + } + + /// Create a new instance, with specified kind, message, and a + /// chained cause. + /// + /// In `no_std` mode the *cause* is ignored. + #[cfg(not(feature="std"))] + pub fn with_cause(kind: ErrorKind, msg: &'static str, _cause: E) -> Self { + Error { kind, msg } + } + + /// Take the cause, if any. This allows the embedded cause to be extracted. + /// This uses `Option::take`, leaving `self` with no cause. + #[cfg(feature="std")] + pub fn take_cause(&mut self) -> Option> { + self.cause.take() + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + #[cfg(feature="std")] { + if let Some(ref cause) = self.cause { + return write!(f, "{} ({}); cause: {}", + self.msg, self.kind.description(), cause); + } + } + write!(f, "{} ({})", self.msg, self.kind.description()) + } +} + +#[cfg(feature="std")] +impl stdError for Error { + fn description(&self) -> &str { + self.msg + } + + fn cause(&self) -> Option<&stdError> { + self.cause.as_ref().map(|e| e.as_ref() as &stdError) + } +} + +#[cfg(feature="std")] +impl From for io::Error { + fn from(error: Error) -> Self { + use std::io::ErrorKind::*; + match error.kind { + ErrorKind::Unavailable => io::Error::new(NotFound, error), + ErrorKind::Unexpected | + ErrorKind::Transient => io::Error::new(Other, error), + ErrorKind::NotReady => io::Error::new(WouldBlock, error), + ErrorKind::__Nonexhaustive => unreachable!(), + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_core/src/impls.rs b/vendor/registry-40351f815f426200/rand_core/src/impls.rs new file mode 100644 index 000000000..57bdd070d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/src/impls.rs @@ -0,0 +1,165 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Helper functions for implementing `RngCore` functions. +//! +//! For cross-platform reproducibility, these functions all use Little Endian: +//! least-significant part first. For example, `next_u64_via_u32` takes `u32` +//! values `x, y`, then outputs `(y << 32) | x`. To implement `next_u32` +//! from `next_u64` in little-endian order, one should use `next_u64() as u32`. +//! +//! Byte-swapping (like the std `to_le` functions) is only needed to convert +//! to/from byte sequences, and since its purpose is reproducibility, +//! non-reproducible sources (e.g. `OsRng`) need not bother with it. + +use core::intrinsics::transmute; +use core::ptr::copy_nonoverlapping; +use core::slice; +use core::cmp::min; +use core::mem::size_of; +use RngCore; + + +/// Implement `next_u64` via `next_u32`, little-endian order. +pub fn next_u64_via_u32(rng: &mut R) -> u64 { + // Use LE; we explicitly generate one value before the next. + let x = u64::from(rng.next_u32()); + let y = u64::from(rng.next_u32()); + (y << 32) | x +} + +/// Implement `fill_bytes` via `next_u64` and `next_u32`, little-endian order. +/// +/// The fastest way to fill a slice is usually to work as long as possible with +/// integers. That is why this method mostly uses `next_u64`, and only when +/// there are 4 or less bytes remaining at the end of the slice it uses +/// `next_u32` once. +pub fn fill_bytes_via_next(rng: &mut R, dest: &mut [u8]) { + let mut left = dest; + while left.len() >= 8 { + let (l, r) = {left}.split_at_mut(8); + left = r; + let chunk: [u8; 8] = unsafe { + transmute(rng.next_u64().to_le()) + }; + l.copy_from_slice(&chunk); + } + let n = left.len(); + if n > 4 { + let chunk: [u8; 8] = unsafe { + transmute(rng.next_u64().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } else if n > 0 { + let chunk: [u8; 4] = unsafe { + transmute(rng.next_u32().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } +} + +macro_rules! impl_uint_from_fill { + ($rng:expr, $ty:ty, $N:expr) => ({ + debug_assert!($N == size_of::<$ty>()); + + let mut int: $ty = 0; + unsafe { + let ptr = &mut int as *mut $ty as *mut u8; + let slice = slice::from_raw_parts_mut(ptr, $N); + $rng.fill_bytes(slice); + } + int + }); +} + +macro_rules! fill_via_chunks { + ($src:expr, $dst:expr, $ty:ty, $size:expr) => ({ + let chunk_size_u8 = min($src.len() * $size, $dst.len()); + let chunk_size = (chunk_size_u8 + $size - 1) / $size; + if cfg!(target_endian="little") { + unsafe { + copy_nonoverlapping( + $src.as_ptr() as *const u8, + $dst.as_mut_ptr(), + chunk_size_u8); + } + } else { + for (&n, chunk) in $src.iter().zip($dst.chunks_mut($size)) { + let tmp = n.to_le(); + let src_ptr = &tmp as *const $ty as *const u8; + unsafe { + copy_nonoverlapping(src_ptr, + chunk.as_mut_ptr(), + chunk.len()); + } + } + } + + (chunk_size, chunk_size_u8) + }); +} + +/// Implement `fill_bytes` by reading chunks from the output buffer of a block +/// based RNG. +/// +/// The return values are `(consumed_u32, filled_u8)`. +/// +/// `filled_u8` is the number of filled bytes in `dest`, which may be less than +/// the length of `dest`. +/// `consumed_u32` is the number of words consumed from `src`, which is the same +/// as `filled_u8 / 4` rounded up. +/// +/// # Example +/// (from `IsaacRng`) +/// +/// ```ignore +/// fn fill_bytes(&mut self, dest: &mut [u8]) { +/// let mut read_len = 0; +/// while read_len < dest.len() { +/// if self.index >= self.rsl.len() { +/// self.isaac(); +/// } +/// +/// let (consumed_u32, filled_u8) = +/// impls::fill_via_u32_chunks(&mut self.rsl[self.index..], +/// &mut dest[read_len..]); +/// +/// self.index += consumed_u32; +/// read_len += filled_u8; +/// } +/// } +/// ``` +pub fn fill_via_u32_chunks(src: &[u32], dest: &mut [u8]) -> (usize, usize) { + fill_via_chunks!(src, dest, u32, 4) +} + +/// Implement `fill_bytes` by reading chunks from the output buffer of a block +/// based RNG. +/// +/// The return values are `(consumed_u64, filled_u8)`. +/// `filled_u8` is the number of filled bytes in `dest`, which may be less than +/// the length of `dest`. +/// `consumed_u64` is the number of words consumed from `src`, which is the same +/// as `filled_u8 / 8` rounded up. +/// +/// See `fill_via_u32_chunks` for an example. +pub fn fill_via_u64_chunks(src: &[u64], dest: &mut [u8]) -> (usize, usize) { + fill_via_chunks!(src, dest, u64, 8) +} + +/// Implement `next_u32` via `fill_bytes`, little-endian order. +pub fn next_u32_via_fill(rng: &mut R) -> u32 { + impl_uint_from_fill!(rng, u32, 4) +} + +/// Implement `next_u64` via `fill_bytes`, little-endian order. +pub fn next_u64_via_fill(rng: &mut R) -> u64 { + impl_uint_from_fill!(rng, u64, 8) +} + +// TODO: implement tests for the above diff --git a/vendor/registry-40351f815f426200/rand_core/src/le.rs b/vendor/registry-40351f815f426200/rand_core/src/le.rs new file mode 100644 index 000000000..266651f10 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/src/le.rs @@ -0,0 +1,68 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Little-Endian utilities +//! +//! Little-Endian order has been chosen for internal usage; this makes some +//! useful functions available. + +use core::ptr; + +macro_rules! read_slice { + ($src:expr, $dst:expr, $size:expr, $which:ident) => {{ + assert_eq!($src.len(), $size * $dst.len()); + + unsafe { + ptr::copy_nonoverlapping( + $src.as_ptr(), + $dst.as_mut_ptr() as *mut u8, + $src.len()); + } + for v in $dst.iter_mut() { + *v = v.$which(); + } + }}; +} + +/// Reads unsigned 32 bit integers from `src` into `dst`. +/// Borrowed from the `byteorder` crate. +#[inline] +pub fn read_u32_into(src: &[u8], dst: &mut [u32]) { + read_slice!(src, dst, 4, to_le); +} + +/// Reads unsigned 64 bit integers from `src` into `dst`. +/// Borrowed from the `byteorder` crate. +#[inline] +pub fn read_u64_into(src: &[u8], dst: &mut [u64]) { + read_slice!(src, dst, 8, to_le); +} + +#[test] +fn test_read() { + let bytes = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]; + + let mut buf = [0u32; 4]; + read_u32_into(&bytes, &mut buf); + assert_eq!(buf[0], 0x04030201); + assert_eq!(buf[3], 0x100F0E0D); + + let mut buf = [0u32; 3]; + read_u32_into(&bytes[1..13], &mut buf); // unaligned + assert_eq!(buf[0], 0x05040302); + assert_eq!(buf[2], 0x0D0C0B0A); + + let mut buf = [0u64; 2]; + read_u64_into(&bytes, &mut buf); + assert_eq!(buf[0], 0x0807060504030201); + assert_eq!(buf[1], 0x100F0E0D0C0B0A09); + + let mut buf = [0u64; 1]; + read_u64_into(&bytes[7..15], &mut buf); // unaligned + assert_eq!(buf[0], 0x0F0E0D0C0B0A0908); +} diff --git a/vendor/registry-40351f815f426200/rand_core/src/lib.rs b/vendor/registry-40351f815f426200/rand_core/src/lib.rs new file mode 100644 index 000000000..4b0e6e48b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_core/src/lib.rs @@ -0,0 +1,477 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017-2018 The Rust Project 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. + +//! Random number generation traits +//! +//! This crate is mainly of interest to crates publishing implementations of +//! [`RngCore`]. Other users are encouraged to use the [`rand`] crate instead +//! which re-exports the main traits and error types. +//! +//! [`RngCore`] is the core trait implemented by algorithmic pseudo-random number +//! generators and external random-number sources. +//! +//! [`SeedableRng`] is an extension trait for construction from fixed seeds and +//! other random number generators. +//! +//! [`Error`] is provided for error-handling. It is safe to use in `no_std` +//! environments. +//! +//! The [`impls`] and [`le`] sub-modules include a few small functions to assist +//! implementation of [`RngCore`]. +//! +//! [`rand`]: https://docs.rs/rand + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![cfg_attr(not(feature="std"), no_std)] +#![cfg_attr(all(feature="alloc", not(feature="std")), feature(alloc))] + +#[cfg(feature="std")] extern crate core; +#[cfg(all(feature = "alloc", not(feature="std")))] extern crate alloc; +#[cfg(feature="serde1")] extern crate serde; +#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; + + +use core::default::Default; +use core::convert::AsMut; +use core::ptr::copy_nonoverlapping; + +#[cfg(all(feature="alloc", not(feature="std")))] use alloc::boxed::Box; + +pub use error::{ErrorKind, Error}; + + +mod error; +pub mod block; +pub mod impls; +pub mod le; + + +/// The core of a random number generator. +/// +/// This trait encapsulates the low-level functionality common to all +/// generators, and is the "back end", to be implemented by generators. +/// End users should normally use the `Rng` trait from the [`rand`] crate, +/// which is automatically implemented for every type implementing `RngCore`. +/// +/// Three different methods for generating random data are provided since the +/// optimal implementation of each is dependent on the type of generator. There +/// is no required relationship between the output of each; e.g. many +/// implementations of [`fill_bytes`] consume a whole number of `u32` or `u64` +/// values and drop any remaining unused bytes. +/// +/// The [`try_fill_bytes`] method is a variant of [`fill_bytes`] allowing error +/// handling; it is not deemed sufficiently useful to add equivalents for +/// [`next_u32`] or [`next_u64`] since the latter methods are almost always used +/// with algorithmic generators (PRNGs), which are normally infallible. +/// +/// Algorithmic generators implementing [`SeedableRng`] should normally have +/// *portable, reproducible* output, i.e. fix Endianness when converting values +/// to avoid platform differences, and avoid making any changes which affect +/// output (except by communicating that the release has breaking changes). +/// +/// Typically implementators will implement only one of the methods available +/// in this trait directly, then use the helper functions from the +/// [`impls`] module to implement the other methods. +/// +/// It is recommended that implementations also implement: +/// +/// - `Debug` with a custom implementation which *does not* print any internal +/// state (at least, [`CryptoRng`]s should not risk leaking state through +/// `Debug`). +/// - `Serialize` and `Deserialize` (from Serde), preferably making Serde +/// support optional at the crate level in PRNG libs. +/// - `Clone`, if possible. +/// - *never* implement `Copy` (accidental copies may cause repeated values). +/// - *do not* implement `Default` for pseudorandom generators, but instead +/// implement [`SeedableRng`], to guide users towards proper seeding. +/// External / hardware RNGs can choose to implement `Default`. +/// - `Eq` and `PartialEq` could be implemented, but are probably not useful. +/// +/// # Example +/// +/// A simple example, obviously not generating very *random* output: +/// +/// ``` +/// #![allow(dead_code)] +/// use rand_core::{RngCore, Error, impls}; +/// +/// struct CountingRng(u64); +/// +/// impl RngCore for CountingRng { +/// fn next_u32(&mut self) -> u32 { +/// self.next_u64() as u32 +/// } +/// +/// fn next_u64(&mut self) -> u64 { +/// self.0 += 1; +/// self.0 +/// } +/// +/// fn fill_bytes(&mut self, dest: &mut [u8]) { +/// impls::fill_bytes_via_next(self, dest) +/// } +/// +/// fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { +/// Ok(self.fill_bytes(dest)) +/// } +/// } +/// ``` +/// +/// [`rand`]: https://docs.rs/rand +/// [`try_fill_bytes`]: RngCore::try_fill_bytes +/// [`fill_bytes`]: RngCore::fill_bytes +/// [`next_u32`]: RngCore::next_u32 +/// [`next_u64`]: RngCore::next_u64 +pub trait RngCore { + /// Return the next random `u32`. + /// + /// RNGs must implement at least one method from this trait directly. In + /// the case this method is not implemented directly, it can be implemented + /// using `self.next_u64() as u32` or via + /// [`fill_bytes`][impls::next_u32_via_fill]. + fn next_u32(&mut self) -> u32; + + /// Return the next random `u64`. + /// + /// RNGs must implement at least one method from this trait directly. In + /// the case this method is not implemented directly, it can be implemented + /// via [`next_u32`][impls::next_u64_via_u32] or via + /// [`fill_bytes`][impls::next_u64_via_fill]. + fn next_u64(&mut self) -> u64; + + /// Fill `dest` with random data. + /// + /// RNGs must implement at least one method from this trait directly. In + /// the case this method is not implemented directly, it can be implemented + /// via [`next_u*`][impls::fill_bytes_via_next] or + /// via [`try_fill_bytes`][RngCore::try_fill_bytes]; if this generator can + /// fail the implementation must choose how best to handle errors here + /// (e.g. panic with a descriptive message or log a warning and retry a few + /// times). + /// + /// This method should guarantee that `dest` is entirely filled + /// with new data, and may panic if this is impossible + /// (e.g. reading past the end of a file that is being used as the + /// source of randomness). + fn fill_bytes(&mut self, dest: &mut [u8]); + + /// Fill `dest` entirely with random data. + /// + /// This is the only method which allows an RNG to report errors while + /// generating random data thus making this the primary method implemented + /// by external (true) RNGs (e.g. `OsRng`) which can fail. It may be used + /// directly to generate keys and to seed (infallible) PRNGs. + /// + /// Other than error handling, this method is identical to [`fill_bytes`]; + /// thus this may be implemented using `Ok(self.fill_bytes(dest))` or + /// `fill_bytes` may be implemented with + /// `self.try_fill_bytes(dest).unwrap()` or more specific error handling. + /// + /// [`fill_bytes`]: RngCore::fill_bytes + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error>; +} + +/// A marker trait used to indicate that an [`RngCore`] or [`BlockRngCore`] +/// implementation is supposed to be cryptographically secure. +/// +/// *Cryptographically secure generators*, also known as *CSPRNGs*, should +/// satisfy an additional properties over other generators: given the first +/// *k* bits of an algorithm's output +/// sequence, it should not be possible using polynomial-time algorithms to +/// predict the next bit with probability significantly greater than 50%. +/// +/// Some generators may satisfy an additional property, however this is not +/// required by this trait: if the CSPRNG's state is revealed, it should not be +/// computationally-feasible to reconstruct output prior to this. Some other +/// generators allow backwards-computation and are consided *reversible*. +/// +/// Note that this trait is provided for guidance only and cannot guarantee +/// suitability for cryptographic applications. In general it should only be +/// implemented for well-reviewed code implementing well-regarded algorithms. +/// +/// Note also that use of a `CryptoRng` does not protect against other +/// weaknesses such as seeding from a weak entropy source or leaking state. +/// +/// [`BlockRngCore`]: block::BlockRngCore +pub trait CryptoRng {} + +/// A random number generator that can be explicitly seeded. +/// +/// This trait encapsulates the low-level functionality common to all +/// pseudo-random number generators (PRNGs, or algorithmic generators). +/// +/// The `FromEntropy` trait from the [`rand`] crate is automatically +/// implemented for every type implementing `SeedableRng`, providing +/// a convenient `from_entropy()` constructor. +/// +/// [`rand`]: https://docs.rs/rand +pub trait SeedableRng: Sized { + /// Seed type, which is restricted to types mutably-dereferencable as `u8` + /// arrays (we recommend `[u8; N]` for some `N`). + /// + /// It is recommended to seed PRNGs with a seed of at least circa 100 bits, + /// which means an array of `[u8; 12]` or greater to avoid picking RNGs with + /// partially overlapping periods. + /// + /// For cryptographic RNG's a seed of 256 bits is recommended, `[u8; 32]`. + /// + /// + /// # Implementing `SeedableRng` for RNGs with large seeds + /// + /// Note that the required traits `core::default::Default` and + /// `core::convert::AsMut` are not implemented for large arrays + /// `[u8; N]` with `N` > 32. To be able to implement the traits required by + /// `SeedableRng` for RNGs with such large seeds, the newtype pattern can be + /// used: + /// + /// ``` + /// use rand_core::SeedableRng; + /// + /// const N: usize = 64; + /// pub struct MyRngSeed(pub [u8; N]); + /// pub struct MyRng(MyRngSeed); + /// + /// impl Default for MyRngSeed { + /// fn default() -> MyRngSeed { + /// MyRngSeed([0; N]) + /// } + /// } + /// + /// impl AsMut<[u8]> for MyRngSeed { + /// fn as_mut(&mut self) -> &mut [u8] { + /// &mut self.0 + /// } + /// } + /// + /// impl SeedableRng for MyRng { + /// type Seed = MyRngSeed; + /// + /// fn from_seed(seed: MyRngSeed) -> MyRng { + /// MyRng(seed) + /// } + /// } + /// ``` + type Seed: Sized + Default + AsMut<[u8]>; + + /// Create a new PRNG using the given seed. + /// + /// PRNG implementations are allowed to assume that bits in the seed are + /// well distributed. That means usually that the number of one and zero + /// bits are about equal, and values like 0, 1 and (size - 1) are unlikely. + /// + /// PRNG implementations are recommended to be reproducible. A PRNG seeded + /// using this function with a fixed seed should produce the same sequence + /// of output in the future and on different architectures (with for example + /// different endianness). + /// + /// It is however not required that this function yield the same state as a + /// reference implementation of the PRNG given equivalent seed; if necessary + /// another constructor replicating behaviour from a reference + /// implementation can be added. + /// + /// PRNG implementations should make sure `from_seed` never panics. In the + /// case that some special values (like an all zero seed) are not viable + /// seeds it is preferable to map these to alternative constant value(s), + /// for example `0xBAD5EEDu32` or `0x0DDB1A5E5BAD5EEDu64` ("odd biases? bad + /// seed"). This is assuming only a small number of values must be rejected. + fn from_seed(seed: Self::Seed) -> Self; + + /// Create a new PRNG using a `u64` seed. + /// + /// This is a convenience-wrapper around `from_seed` to allow construction + /// of any `SeedableRng` from a simple `u64` value. It is designed such that + /// low Hamming Weight numbers like 0 and 1 can be used and should still + /// result in good, independent seeds to the PRNG which is returned. + /// + /// This **is not suitable for cryptography**, as should be clear given that + /// the input size is only 64 bits. + /// + /// Implementations for PRNGs *may* provide their own implementations of + /// this function, but the default implementation should be good enough for + /// all purposes. *Changing* the implementation of this function should be + /// considered a value-breaking change. + fn seed_from_u64(mut state: u64) -> Self { + // We use PCG32 to generate a u32 sequence, and copy to the seed + const MUL: u64 = 6364136223846793005; + const INC: u64 = 11634580027462260723; + + let mut seed = Self::Seed::default(); + for chunk in seed.as_mut().chunks_mut(4) { + // We advance the state first (to get away from the input value, + // in case it has low Hamming Weight). + state = state.wrapping_mul(MUL).wrapping_add(INC); + + // Use PCG output function with to_le to generate x: + let xorshifted = (((state >> 18) ^ state) >> 27) as u32; + let rot = (state >> 59) as u32; + let x = xorshifted.rotate_right(rot).to_le(); + + unsafe { + let p = &x as *const u32 as *const u8; + copy_nonoverlapping(p, chunk.as_mut_ptr(), chunk.len()); + } + } + + Self::from_seed(seed) + } + + /// Create a new PRNG seeded from another `Rng`. + /// + /// This is the recommended way to initialize PRNGs with fresh entropy. The + /// `FromEntropy` trait from the [`rand`] crate provides a convenient + /// `from_entropy` method based on `from_rng`. + /// + /// Usage of this method is not recommended when reproducibility is required + /// since implementing PRNGs are not required to fix Endianness and are + /// allowed to modify implementations in new releases. + /// + /// It is important to use a good source of randomness to initialize the + /// PRNG. Cryptographic PRNG may be rendered insecure when seeded from a + /// non-cryptographic PRNG or with insufficient entropy. + /// Many non-cryptographic PRNGs will show statistical bias in their first + /// results if their seed numbers are small or if there is a simple pattern + /// between them. + /// + /// Prefer to seed from a strong external entropy source like `OsRng` from + /// the [`rand_os`] crate or from a cryptographic PRNG; if creating a new + /// generator for cryptographic uses you *must* seed from a strong source. + /// + /// Seeding a small PRNG from another small PRNG is possible, but + /// something to be careful with. An extreme example of how this can go + /// wrong is seeding an Xorshift RNG from another Xorshift RNG, which + /// will effectively clone the generator. In general seeding from a + /// generator which is hard to predict is probably okay. + /// + /// PRNG implementations are allowed to assume that a good RNG is provided + /// for seeding, and that it is cryptographically secure when appropriate. + /// + /// [`rand`]: https://docs.rs/rand + /// [`rand_os`]: https://docs.rs/rand_os + fn from_rng(mut rng: R) -> Result { + let mut seed = Self::Seed::default(); + rng.try_fill_bytes(seed.as_mut())?; + Ok(Self::from_seed(seed)) + } +} + +// Implement `RngCore` for references to an `RngCore`. +// Force inlining all functions, so that it is up to the `RngCore` +// implementation and the optimizer to decide on inlining. +impl<'a, R: RngCore + ?Sized> RngCore for &'a mut R { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + (**self).next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + (**self).next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + (**self).fill_bytes(dest) + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + (**self).try_fill_bytes(dest) + } +} + +// Implement `RngCore` for boxed references to an `RngCore`. +// Force inlining all functions, so that it is up to the `RngCore` +// implementation and the optimizer to decide on inlining. +#[cfg(feature="alloc")] +impl RngCore for Box { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + (**self).next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + (**self).next_u64() + } + + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + (**self).fill_bytes(dest) + } + + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + (**self).try_fill_bytes(dest) + } +} + +#[cfg(feature="std")] +impl std::io::Read for RngCore { + fn read(&mut self, buf: &mut [u8]) -> Result { + self.try_fill_bytes(buf)?; + Ok(buf.len()) + } +} + +// Implement `CryptoRng` for references to an `CryptoRng`. +impl<'a, R: CryptoRng + ?Sized> CryptoRng for &'a mut R {} + +// Implement `CryptoRng` for boxed references to an `CryptoRng`. +#[cfg(feature="alloc")] +impl CryptoRng for Box {} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_seed_from_u64() { + struct SeedableNum(u64); + impl SeedableRng for SeedableNum { + type Seed = [u8; 8]; + fn from_seed(seed: Self::Seed) -> Self { + let mut x = [0u64; 1]; + le::read_u64_into(&seed, &mut x); + SeedableNum(x[0]) + } + } + + const N: usize = 8; + const SEEDS: [u64; N] = [0u64, 1, 2, 3, 4, 8, 16, -1i64 as u64]; + let mut results = [0u64; N]; + for (i, seed) in SEEDS.iter().enumerate() { + let SeedableNum(x) = SeedableNum::seed_from_u64(*seed); + results[i] = x; + } + + for (i1, r1) in results.iter().enumerate() { + let weight = r1.count_ones(); + // This is the binomial distribution B(64, 0.5), so chance of + // weight < 20 is binocdf(19, 64, 0.5) = 7.8e-4, and same for + // weight > 44. + assert!(weight >= 20 && weight <= 44); + + for (i2, r2) in results.iter().enumerate() { + if i1 == i2 { continue; } + let diff_weight = (r1 ^ r2).count_ones(); + assert!(diff_weight >= 20); + } + } + + // value-breakage test: + assert_eq!(results[0], 5029875928683246316); + } +} diff --git a/vendor/registry-40351f815f426200/rand_hc/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_hc/.cargo-checksum.json new file mode 100644 index 000000000..562cce313 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"f6dd960de06e087466066cd3e05bfd51288d144f917a62c591238697d7db1f49","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"467a2ecd73f7b32471fe00fe8042ef4dff756c05e6e4e6dd3a2e48d25867ef07","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"a771e4354f6b3ad4c92da1a5c9a239b6c291527db869632ecea4f20e24ca1135","README.md":"98a46c583c11b36bf3cc30ba646c9598a7d051b22c10e6d408aa0b1aefc6062d","src/hc128.rs":"ec8a1122eff5d1b79efa721d97d8aabaadd3f9af504336ecd928c082a9a40b45","src/lib.rs":"959f8d7280fac5683e4d2bf1713b3742a0a3685bb0b7e19d06875d254751cffb"},"package":"7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_hc/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_hc/CHANGELOG.md new file mode 100644 index 000000000..d0c4a2fcb --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] - 2018-10-17 +- Pulled out of the Rand crate diff --git a/vendor/registry-40351f815f426200/rand_hc/COPYRIGHT b/vendor/registry-40351f815f426200/rand_hc/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_hc/Cargo.toml b/vendor/registry-40351f815f426200/rand_hc/Cargo.toml new file mode 100644 index 000000000..e08027473 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/Cargo.toml @@ -0,0 +1,32 @@ +# 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 = "rand_hc" +version = "0.1.0" +authors = ["The Rand Project Developers"] +description = "HC128 random number generator\n" +homepage = "https://crates.io/crates/rand_hc" +documentation = "https://docs.rs/rand_hc" +readme = "README.md" +keywords = ["random", "rng", "hc128"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = ">=0.2, <0.4" +default-features = false +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_hc/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_hc/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_hc/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_hc/LICENSE-MIT new file mode 100644 index 000000000..cf656074c --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright 2018 Developers of the Rand project + +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/vendor/registry-40351f815f426200/rand_hc/README.md b/vendor/registry-40351f815f426200/rand_hc/README.md new file mode 100644 index 000000000..9c1f5e122 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/README.md @@ -0,0 +1,44 @@ +# rand_hc + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_hc.svg)](https://crates.io/crates/rand_hc) +[![Documentation](https://docs.rs/rand_hc/badge.svg)](https://docs.rs/rand_hc) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-yellow.svg)](https://github.com/rust-random/rand#rust-version-requirements) +[![License](https://img.shields.io/crates/l/rand_hc.svg)](https://github.com/rust-random/rand/tree/master/rand_hc#license) + +A cryptographically secure random number generator that uses the HC-128 +algorithm. + +HC-128 is a stream cipher designed by Hongjun Wu[^1], that we use as an +RNG. It is selected as one of the "stream ciphers suitable for widespread +adoption" by eSTREAM[^2]. + +Documentation: +[master branch](https://rust-random.github.io/rand/rand_hc/index.html), +[by release](https://docs.rs/rand_hc) + +[Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand +[^1]: Hongjun Wu (2008). ["The Stream Cipher HC-128"]( + http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf). + *The eSTREAM Finalists*, LNCS 4986, pp. 39–47, Springer-Verlag. + +[^2]: [eSTREAM: the ECRYPT Stream Cipher Project]( + http://www.ecrypt.eu.org/stream/) + + +## Crate Features + +`rand_hc` is `no_std` compatible. It does not require any functionality +outside of the `core` lib, thus there are no features to configure. + + +# License + +`rand_hc` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_hc/src/hc128.rs b/vendor/registry-40351f815f426200/rand_hc/src/hc128.rs new file mode 100644 index 000000000..d1dadcc90 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/src/hc128.rs @@ -0,0 +1,462 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The HC-128 random number generator. + +use core::fmt; +use rand_core::{CryptoRng, RngCore, SeedableRng, Error, le}; +use rand_core::block::{BlockRngCore, BlockRng}; + +const SEED_WORDS: usize = 8; // 128 bit key followed by 128 bit iv + +/// A cryptographically secure random number generator that uses the HC-128 +/// algorithm. +/// +/// HC-128 is a stream cipher designed by Hongjun Wu[^1], that we use as an +/// RNG. It is selected as one of the "stream ciphers suitable for widespread +/// adoption" by eSTREAM[^2]. +/// +/// HC-128 is an array based RNG. In this it is similar to RC-4 and ISAAC before +/// it, but those have never been proven cryptographically secure (or have even +/// been significantly compromised, as in the case of RC-4[^5]). +/// +/// Because HC-128 works with simple indexing into a large array and with a few +/// operations that parallelize well, it has very good performance. The size of +/// the array it needs, 4kb, can however be a disadvantage. +/// +/// This implementation is not based on the version of HC-128 submitted to the +/// eSTREAM contest, but on a later version by the author with a few small +/// improvements from December 15, 2009[^3]. +/// +/// HC-128 has no known weaknesses that are easier to exploit than doing a +/// brute-force search of 2128. A very comprehensive analysis of the +/// current state of known attacks / weaknesses of HC-128 is given in *Some +/// Results On Analysis And Implementation Of HC-128 Stream Cipher*[^4]. +/// +/// The average cycle length is expected to be +/// 21024*32+10-1 = 232777. +/// We support seeding with a 256-bit array, which matches the 128-bit key +/// concatenated with a 128-bit IV from the stream cipher. +/// +/// This implementation uses an output buffer of sixteen `u32` words, and uses +/// [`BlockRng`] to implement the [`RngCore`] methods. +/// +/// ## References +/// [^1]: Hongjun Wu (2008). ["The Stream Cipher HC-128"]( +/// http://www.ecrypt.eu.org/stream/p3ciphers/hc/hc128_p3.pdf). +/// *The eSTREAM Finalists*, LNCS 4986, pp. 39–47, Springer-Verlag. +/// +/// [^2]: [eSTREAM: the ECRYPT Stream Cipher Project]( +/// http://www.ecrypt.eu.org/stream/) +/// +/// [^3]: Hongjun Wu, [Stream Ciphers HC-128 and HC-256]( +/// https://www.ntu.edu.sg/home/wuhj/research/hc/index.html) +/// +/// [^4]: Shashwat Raizada (January 2015),["Some Results On Analysis And +/// Implementation Of HC-128 Stream Cipher"]( +/// http://library.isical.ac.in:8080/jspui/bitstream/123456789/6636/1/TH431.pdf). +/// +/// [^5]: Internet Engineering Task Force (February 2015), +/// ["Prohibiting RC4 Cipher Suites"](https://tools.ietf.org/html/rfc7465). +/// +/// [`BlockRng`]: ../rand_core/block/struct.BlockRng.html +/// [`RngCore`]: ../rand_core/trait.RngCore.html +#[derive(Clone, Debug)] +pub struct Hc128Rng(BlockRng); + +impl RngCore for Hc128Rng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for Hc128Rng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Hc128Rng(BlockRng::::from_seed(seed)) + } + + fn from_rng(rng: R) -> Result { + BlockRng::::from_rng(rng).map(Hc128Rng) + } +} + +impl CryptoRng for Hc128Rng {} + +/// The core of `Hc128Rng`, used with `BlockRng`. +#[derive(Clone)] +pub struct Hc128Core { + t: [u32; 1024], + counter1024: usize, +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for Hc128Core { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Hc128Core {{}}") + } +} + +impl BlockRngCore for Hc128Core { + type Item = u32; + type Results = [u32; 16]; + + fn generate(&mut self, results: &mut Self::Results) { + assert!(self.counter1024 % 16 == 0); + + let cc = self.counter1024 % 512; + let dd = (cc + 16) % 512; + let ee = cc.wrapping_sub(16) % 512; + + if self.counter1024 & 512 == 0 { + // P block + results[0] = self.step_p(cc+0, cc+1, ee+13, ee+6, ee+4); + results[1] = self.step_p(cc+1, cc+2, ee+14, ee+7, ee+5); + results[2] = self.step_p(cc+2, cc+3, ee+15, ee+8, ee+6); + results[3] = self.step_p(cc+3, cc+4, cc+0, ee+9, ee+7); + results[4] = self.step_p(cc+4, cc+5, cc+1, ee+10, ee+8); + results[5] = self.step_p(cc+5, cc+6, cc+2, ee+11, ee+9); + results[6] = self.step_p(cc+6, cc+7, cc+3, ee+12, ee+10); + results[7] = self.step_p(cc+7, cc+8, cc+4, ee+13, ee+11); + results[8] = self.step_p(cc+8, cc+9, cc+5, ee+14, ee+12); + results[9] = self.step_p(cc+9, cc+10, cc+6, ee+15, ee+13); + results[10] = self.step_p(cc+10, cc+11, cc+7, cc+0, ee+14); + results[11] = self.step_p(cc+11, cc+12, cc+8, cc+1, ee+15); + results[12] = self.step_p(cc+12, cc+13, cc+9, cc+2, cc+0); + results[13] = self.step_p(cc+13, cc+14, cc+10, cc+3, cc+1); + results[14] = self.step_p(cc+14, cc+15, cc+11, cc+4, cc+2); + results[15] = self.step_p(cc+15, dd+0, cc+12, cc+5, cc+3); + } else { + // Q block + results[0] = self.step_q(cc+0, cc+1, ee+13, ee+6, ee+4); + results[1] = self.step_q(cc+1, cc+2, ee+14, ee+7, ee+5); + results[2] = self.step_q(cc+2, cc+3, ee+15, ee+8, ee+6); + results[3] = self.step_q(cc+3, cc+4, cc+0, ee+9, ee+7); + results[4] = self.step_q(cc+4, cc+5, cc+1, ee+10, ee+8); + results[5] = self.step_q(cc+5, cc+6, cc+2, ee+11, ee+9); + results[6] = self.step_q(cc+6, cc+7, cc+3, ee+12, ee+10); + results[7] = self.step_q(cc+7, cc+8, cc+4, ee+13, ee+11); + results[8] = self.step_q(cc+8, cc+9, cc+5, ee+14, ee+12); + results[9] = self.step_q(cc+9, cc+10, cc+6, ee+15, ee+13); + results[10] = self.step_q(cc+10, cc+11, cc+7, cc+0, ee+14); + results[11] = self.step_q(cc+11, cc+12, cc+8, cc+1, ee+15); + results[12] = self.step_q(cc+12, cc+13, cc+9, cc+2, cc+0); + results[13] = self.step_q(cc+13, cc+14, cc+10, cc+3, cc+1); + results[14] = self.step_q(cc+14, cc+15, cc+11, cc+4, cc+2); + results[15] = self.step_q(cc+15, dd+0, cc+12, cc+5, cc+3); + } + self.counter1024 = self.counter1024.wrapping_add(16); + } +} + +impl Hc128Core { + // One step of HC-128, update P and generate 32 bits keystream + #[inline(always)] + fn step_p(&mut self, i: usize, i511: usize, i3: usize, i10: usize, i12: usize) + -> u32 + { + let (p, q) = self.t.split_at_mut(512); + // FIXME: it would be great if we the bounds checks here could be + // optimized out, and we would not need unsafe. + // This improves performance by about 7%. + unsafe { + let temp0 = p.get_unchecked(i511).rotate_right(23); + let temp1 = p.get_unchecked(i3).rotate_right(10); + let temp2 = p.get_unchecked(i10).rotate_right(8); + *p.get_unchecked_mut(i) = p.get_unchecked(i) + .wrapping_add(temp2) + .wrapping_add(temp0 ^ temp1); + let temp3 = { + // The h1 function in HC-128 + let a = *p.get_unchecked(i12) as u8; + let c = (p.get_unchecked(i12) >> 16) as u8; + q[a as usize].wrapping_add(q[256 + c as usize]) + }; + temp3 ^ p.get_unchecked(i) + } + } + + // One step of HC-128, update Q and generate 32 bits keystream + // Similar to `step_p`, but `p` and `q` are swapped, and the rotates are to + // the left instead of to the right. + #[inline(always)] + fn step_q(&mut self, i: usize, i511: usize, i3: usize, i10: usize, i12: usize) + -> u32 + { + let (p, q) = self.t.split_at_mut(512); + unsafe { + let temp0 = q.get_unchecked(i511).rotate_left(23); + let temp1 = q.get_unchecked(i3).rotate_left(10); + let temp2 = q.get_unchecked(i10).rotate_left(8); + *q.get_unchecked_mut(i) = q.get_unchecked(i) + .wrapping_add(temp2) + .wrapping_add(temp0 ^ temp1); + let temp3 = { + // The h2 function in HC-128 + let a = *q.get_unchecked(i12) as u8; + let c = (q.get_unchecked(i12) >> 16) as u8; + p[a as usize].wrapping_add(p[256 + c as usize]) + }; + temp3 ^ q.get_unchecked(i) + } + } + + fn sixteen_steps(&mut self) { + assert!(self.counter1024 % 16 == 0); + + let cc = self.counter1024 % 512; + let dd = (cc + 16) % 512; + let ee = cc.wrapping_sub(16) % 512; + + if self.counter1024 < 512 { + // P block + self.t[cc+0] = self.step_p(cc+0, cc+1, ee+13, ee+6, ee+4); + self.t[cc+1] = self.step_p(cc+1, cc+2, ee+14, ee+7, ee+5); + self.t[cc+2] = self.step_p(cc+2, cc+3, ee+15, ee+8, ee+6); + self.t[cc+3] = self.step_p(cc+3, cc+4, cc+0, ee+9, ee+7); + self.t[cc+4] = self.step_p(cc+4, cc+5, cc+1, ee+10, ee+8); + self.t[cc+5] = self.step_p(cc+5, cc+6, cc+2, ee+11, ee+9); + self.t[cc+6] = self.step_p(cc+6, cc+7, cc+3, ee+12, ee+10); + self.t[cc+7] = self.step_p(cc+7, cc+8, cc+4, ee+13, ee+11); + self.t[cc+8] = self.step_p(cc+8, cc+9, cc+5, ee+14, ee+12); + self.t[cc+9] = self.step_p(cc+9, cc+10, cc+6, ee+15, ee+13); + self.t[cc+10] = self.step_p(cc+10, cc+11, cc+7, cc+0, ee+14); + self.t[cc+11] = self.step_p(cc+11, cc+12, cc+8, cc+1, ee+15); + self.t[cc+12] = self.step_p(cc+12, cc+13, cc+9, cc+2, cc+0); + self.t[cc+13] = self.step_p(cc+13, cc+14, cc+10, cc+3, cc+1); + self.t[cc+14] = self.step_p(cc+14, cc+15, cc+11, cc+4, cc+2); + self.t[cc+15] = self.step_p(cc+15, dd+0, cc+12, cc+5, cc+3); + } else { + // Q block + self.t[cc+512+0] = self.step_q(cc+0, cc+1, ee+13, ee+6, ee+4); + self.t[cc+512+1] = self.step_q(cc+1, cc+2, ee+14, ee+7, ee+5); + self.t[cc+512+2] = self.step_q(cc+2, cc+3, ee+15, ee+8, ee+6); + self.t[cc+512+3] = self.step_q(cc+3, cc+4, cc+0, ee+9, ee+7); + self.t[cc+512+4] = self.step_q(cc+4, cc+5, cc+1, ee+10, ee+8); + self.t[cc+512+5] = self.step_q(cc+5, cc+6, cc+2, ee+11, ee+9); + self.t[cc+512+6] = self.step_q(cc+6, cc+7, cc+3, ee+12, ee+10); + self.t[cc+512+7] = self.step_q(cc+7, cc+8, cc+4, ee+13, ee+11); + self.t[cc+512+8] = self.step_q(cc+8, cc+9, cc+5, ee+14, ee+12); + self.t[cc+512+9] = self.step_q(cc+9, cc+10, cc+6, ee+15, ee+13); + self.t[cc+512+10] = self.step_q(cc+10, cc+11, cc+7, cc+0, ee+14); + self.t[cc+512+11] = self.step_q(cc+11, cc+12, cc+8, cc+1, ee+15); + self.t[cc+512+12] = self.step_q(cc+12, cc+13, cc+9, cc+2, cc+0); + self.t[cc+512+13] = self.step_q(cc+13, cc+14, cc+10, cc+3, cc+1); + self.t[cc+512+14] = self.step_q(cc+14, cc+15, cc+11, cc+4, cc+2); + self.t[cc+512+15] = self.step_q(cc+15, dd+0, cc+12, cc+5, cc+3); + } + self.counter1024 += 16; + } + + // Initialize an HC-128 random number generator. The seed has to be + // 256 bits in length (`[u32; 8]`), matching the 128 bit `key` followed by + // 128 bit `iv` when HC-128 where to be used as a stream cipher. + fn init(seed: [u32; SEED_WORDS]) -> Self { + #[inline] + fn f1(x: u32) -> u32 { + x.rotate_right(7) ^ x.rotate_right(18) ^ (x >> 3) + } + + #[inline] + fn f2(x: u32) -> u32 { + x.rotate_right(17) ^ x.rotate_right(19) ^ (x >> 10) + } + + let mut t = [0u32; 1024]; + + // Expand the key and iv into P and Q + let (key, iv) = seed.split_at(4); + t[..4].copy_from_slice(key); + t[4..8].copy_from_slice(key); + t[8..12].copy_from_slice(iv); + t[12..16].copy_from_slice(iv); + + // Generate the 256 intermediate values W[16] ... W[256+16-1], and + // copy the last 16 generated values to the start op P. + for i in 16..256+16 { + t[i] = f2(t[i-2]).wrapping_add(t[i-7]).wrapping_add(f1(t[i-15])) + .wrapping_add(t[i-16]).wrapping_add(i as u32); + } + { + let (p1, p2) = t.split_at_mut(256); + p1[0..16].copy_from_slice(&p2[0..16]); + } + + // Generate both the P and Q tables + for i in 16..1024 { + t[i] = f2(t[i-2]).wrapping_add(t[i-7]).wrapping_add(f1(t[i-15])) + .wrapping_add(t[i-16]).wrapping_add(256 + i as u32); + } + + let mut core = Self { t, counter1024: 0 }; + + // run the cipher 1024 steps + for _ in 0..64 { core.sixteen_steps() }; + core.counter1024 = 0; + core + } +} + +impl SeedableRng for Hc128Core { + type Seed = [u8; SEED_WORDS*4]; + + /// Create an HC-128 random number generator with a seed. The seed has to be + /// 256 bits in length, matching the 128 bit `key` followed by 128 bit `iv` + /// when HC-128 where to be used as a stream cipher. + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_u32 = [0u32; SEED_WORDS]; + le::read_u32_into(&seed, &mut seed_u32); + Self::init(seed_u32) + } +} + +impl CryptoRng for Hc128Core {} + +#[cfg(test)] +mod test { + use ::rand_core::{RngCore, SeedableRng}; + use super::Hc128Rng; + + #[test] + // Test vector 1 from the paper "The Stream Cipher HC-128" + fn test_hc128_true_values_a() { + let seed = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng = Hc128Rng::from_seed(seed); + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0x73150082, 0x3bfd03a0, 0xfb2fd77f, 0xaa63af0e, + 0xde122fc6, 0xa7dc29b6, 0x62a68527, 0x8b75ec68, + 0x9036db1e, 0x81896005, 0x00ade078, 0x491fbf9a, + 0x1cdc3013, 0x6c3d6e24, 0x90f664b2, 0x9cd57102]; + assert_eq!(results, expected); + } + + #[test] + // Test vector 2 from the paper "The Stream Cipher HC-128" + fn test_hc128_true_values_b() { + let seed = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng = Hc128Rng::from_seed(seed); + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0xc01893d5, 0xb7dbe958, 0x8f65ec98, 0x64176604, + 0x36fc6724, 0xc82c6eec, 0x1b1c38a7, 0xc9b42a95, + 0x323ef123, 0x0a6a908b, 0xce757b68, 0x9f14f7bb, + 0xe4cde011, 0xaeb5173f, 0x89608c94, 0xb5cf46ca]; + assert_eq!(results, expected); + } + + #[test] + // Test vector 3 from the paper "The Stream Cipher HC-128" + fn test_hc128_true_values_c() { + let seed = [0x55,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng = Hc128Rng::from_seed(seed); + + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected = [0x518251a4, 0x04b4930a, 0xb02af931, 0x0639f032, + 0xbcb4a47a, 0x5722480b, 0x2bf99f72, 0xcdc0e566, + 0x310f0c56, 0xd3cc83e8, 0x663db8ef, 0x62dfe07f, + 0x593e1790, 0xc5ceaa9c, 0xab03806f, 0xc9a6e5a0]; + assert_eq!(results, expected); + } + + #[test] + fn test_hc128_true_values_u64() { + let seed = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng = Hc128Rng::from_seed(seed); + + let mut results = [0u64; 8]; + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected = [0x3bfd03a073150082, 0xaa63af0efb2fd77f, + 0xa7dc29b6de122fc6, 0x8b75ec6862a68527, + 0x818960059036db1e, 0x491fbf9a00ade078, + 0x6c3d6e241cdc3013, 0x9cd5710290f664b2]; + assert_eq!(results, expected); + + // The RNG operates in a P block of 512 results and next a Q block. + // After skipping 2*800 u32 results we end up somewhere in the Q block + // of the second round + for _ in 0..800 { rng.next_u64(); } + + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected = [0xd8c4d6ca84d0fc10, 0xf16a5d91dc66e8e7, + 0xd800de5bc37a8653, 0x7bae1f88c0dfbb4c, + 0x3bfe1f374e6d4d14, 0x424b55676be3fa06, + 0xe3a1e8758cbff579, 0x417f7198c5652bcd]; + assert_eq!(results, expected); + } + + #[test] + fn test_hc128_true_values_bytes() { + let seed = [0x55,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng = Hc128Rng::from_seed(seed); + let expected = [0x31, 0xf9, 0x2a, 0xb0, 0x32, 0xf0, 0x39, 0x06, + 0x7a, 0xa4, 0xb4, 0xbc, 0x0b, 0x48, 0x22, 0x57, + 0x72, 0x9f, 0xf9, 0x2b, 0x66, 0xe5, 0xc0, 0xcd, + 0x56, 0x0c, 0x0f, 0x31, 0xe8, 0x83, 0xcc, 0xd3, + 0xef, 0xb8, 0x3d, 0x66, 0x7f, 0xe0, 0xdf, 0x62, + 0x90, 0x17, 0x3e, 0x59, 0x9c, 0xaa, 0xce, 0xc5, + 0x6f, 0x80, 0x03, 0xab, 0xa0, 0xe5, 0xa6, 0xc9, + 0x60, 0x95, 0x84, 0x7a, 0xa5, 0x68, 0x5a, 0x84, + 0xea, 0xd5, 0xf3, 0xea, 0x73, 0xa9, 0xad, 0x01, + 0x79, 0x7d, 0xbe, 0x9f, 0xea, 0xe3, 0xf9, 0x74, + 0x0e, 0xda, 0x2f, 0xa0, 0xe4, 0x7b, 0x4b, 0x1b, + 0xdd, 0x17, 0x69, 0x4a, 0xfe, 0x9f, 0x56, 0x95, + 0xad, 0x83, 0x6b, 0x9d, 0x60, 0xa1, 0x99, 0x96, + 0x90, 0x00, 0x66, 0x7f, 0xfa, 0x7e, 0x65, 0xe9, + 0xac, 0x8b, 0x92, 0x34, 0x77, 0xb4, 0x23, 0xd0, + 0xb9, 0xab, 0xb1, 0x47, 0x7d, 0x4a, 0x13, 0x0a]; + + // Pick a somewhat large buffer so we can test filling with the + // remainder from `state.results`, directly filling the buffer, and + // filling the remainder of the buffer. + let mut buffer = [0u8; 16*4*2]; + // Consume a value so that we have a remainder. + assert!(rng.next_u64() == 0x04b4930a518251a4); + rng.fill_bytes(&mut buffer); + + // [u8; 128] doesn't implement PartialEq + assert_eq!(buffer.len(), expected.len()); + for (b, e) in buffer.iter().zip(expected.iter()) { + assert_eq!(b, e); + } + } + + #[test] + fn test_hc128_clone() { + let seed = [0x55,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, // key + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; // iv + let mut rng1 = Hc128Rng::from_seed(seed); + let mut rng2 = rng1.clone(); + for _ in 0..16 { + assert_eq!(rng1.next_u32(), rng2.next_u32()); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_hc/src/lib.rs b/vendor/registry-40351f815f426200/rand_hc/src/lib.rs new file mode 100644 index 000000000..15ca34ebe --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_hc/src/lib.rs @@ -0,0 +1,25 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The HC128 random number generator. + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://docs.rs/rand_hc/0.1.0")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![no_std] + +extern crate rand_core; + +mod hc128; + +pub use hc128::{Hc128Rng, Hc128Core}; diff --git a/vendor/registry-40351f815f426200/rand_isaac/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_isaac/.cargo-checksum.json new file mode 100644 index 000000000..c5527188f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"1f98689d52278352079e5235ffe00537bd3b64c1807a87d5707e3e74c7fce1d8","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"c3fb66104a60aa0dd91b83645be897023e7eb001aa6be108a1948999e86d2512","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"9a1c416b5930337e94fe559673a32a136d3ddd513f19dbd1b37039f8fc3501a1","src/isaac.rs":"40b00c02dc1ce29786c2e5e4c4d642588709397d6bf276a1610743b9b76ab9c6","src/isaac64.rs":"61a11f4a34dc2f009771d41c8d200c1c4815cdc23dfbe96aec03219cfeee4daa","src/isaac_array.rs":"89d20f07eb4dacd42f4cdc25b59796d51bca708f218e6e6dd4a445113b5123d6","src/lib.rs":"840a9c5a5ef2150cc4fb4a3edf34bda7e48bfaa49a3ee7ef8b182743aeaf73dd"},"package":"ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_isaac/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_isaac/CHANGELOG.md new file mode 100644 index 000000000..fb1ab3f3c --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.1] - 2018-11-26 +- Fix `rand_core` version requirement +- Fix doc links + +## [0.1.0] - 2018-10-17 +- Pulled out of the Rand crate diff --git a/vendor/registry-40351f815f426200/rand_isaac/COPYRIGHT b/vendor/registry-40351f815f426200/rand_isaac/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_isaac/Cargo.toml b/vendor/registry-40351f815f426200/rand_isaac/Cargo.toml new file mode 100644 index 000000000..79a541dec --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/Cargo.toml @@ -0,0 +1,45 @@ +# 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 = "rand_isaac" +version = "0.1.1" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +description = "ISAAC random number generator\n" +homepage = "https://crates.io/crates/rand_isaac" +documentation = "https://rust-random.github.io/rand/rand_isaac" +readme = "README.md" +keywords = ["random", "rng", "isaac"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = "0.3" +default-features = false + +[dependencies.serde] +version = "1" +optional = true + +[dependencies.serde_derive] +version = "^1.0.38" +optional = true +[dev-dependencies.bincode] +version = "1" + +[features] +serde1 = ["serde", "serde_derive", "rand_core/serde1"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_isaac/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_isaac/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_isaac/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_isaac/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_isaac/README.md b/vendor/registry-40351f815f426200/rand_isaac/README.md new file mode 100644 index 000000000..02d123033 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/README.md @@ -0,0 +1,47 @@ +# rand_isaac + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_isaac.svg)](https://crates.io/crates/rand_isaac) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_isaac) +[![API](https://docs.rs/rand_isaac/badge.svg)](https://docs.rs/rand_isaac) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Implements the ISAAC and ISAAC-64 random number generators. + +ISAAC stands for "Indirection, Shift, Accumulate, Add, and Count" which are +the principal bitwise operations employed. It is the most advanced of a +series of array based random number generator designed by Robert Jenkins +in 1996[^1][^2]. + +ISAAC is notably fast and produces excellent quality random numbers for +non-cryptographic applications. + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_isaac) +- [API documentation (docs.rs)](https://docs.rs/rand_isaac) +- [Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand +[^1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number generator*](http://burtleburtle.net/bob/rand/isaacafa.html) +[^2]: Bob Jenkins, [*ISAAC and RC4*](http://burtleburtle.net/bob/rand/isaac.html) + + +## Crate Features + +`rand_isaac` is `no_std` compatible. It does not require any functionality +outside of the `core` lib, thus there are no features to configure. + +The `serde1` feature includes implementations of `Serialize` and `Deserialize` +for the included RNGs. + + +# License + +`rand_isaac` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_isaac/src/isaac.rs b/vendor/registry-40351f815f426200/rand_isaac/src/isaac.rs new file mode 100644 index 000000000..2bfdd9435 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/src/isaac.rs @@ -0,0 +1,484 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2018 The Rust Project 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. + +//! The ISAAC random number generator. + +use core::{fmt, slice}; +use core::num::Wrapping as w; +use rand_core::{RngCore, SeedableRng, Error, le}; +use rand_core::block::{BlockRngCore, BlockRng}; +use isaac_array::IsaacArray; + +#[allow(non_camel_case_types)] +type w32 = w; + +const RAND_SIZE_LEN: usize = 8; +const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; + +/// A random number generator that uses the ISAAC algorithm. +/// +/// ISAAC stands for "Indirection, Shift, Accumulate, Add, and Count" which are +/// the principal bitwise operations employed. It is the most advanced of a +/// series of array based random number generator designed by Robert Jenkins +/// in 1996[^1][^2]. +/// +/// ISAAC is notably fast and produces excellent quality random numbers for +/// non-cryptographic applications. +/// +/// In spite of being designed with cryptographic security in mind, ISAAC hasn't +/// been stringently cryptanalyzed and thus cryptographers do not not +/// consensually trust it to be secure. When looking for a secure RNG, prefer +/// [`Hc128Rng`] instead, which, like ISAAC, is an array-based RNG and one of +/// the stream-ciphers selected the by eSTREAM contest. +/// +/// In 2006 an improvement to ISAAC was suggested by Jean-Philippe Aumasson, +/// named ISAAC+[^3]. But because the specification is not complete, because +/// there is no good implementation, and because the suggested bias may not +/// exist, it is not implemented here. +/// +/// ## Overview of the ISAAC algorithm: +/// (in pseudo-code) +/// +/// ```text +/// Input: a, b, c, s[256] // state +/// Output: r[256] // results +/// +/// mix(a,i) = a ^ a << 13 if i = 0 mod 4 +/// a ^ a >> 6 if i = 1 mod 4 +/// a ^ a << 2 if i = 2 mod 4 +/// a ^ a >> 16 if i = 3 mod 4 +/// +/// c = c + 1 +/// b = b + c +/// +/// for i in 0..256 { +/// x = s_[i] +/// a = f(a,i) + s[i+128 mod 256] +/// y = a + b + s[x>>2 mod 256] +/// s[i] = y +/// b = x + s[y>>10 mod 256] +/// r[i] = b +/// } +/// ``` +/// +/// Numbers are generated in blocks of 256. This means the function above only +/// runs once every 256 times you ask for a next random number. In all other +/// circumstances the last element of the results array is returned. +/// +/// ISAAC therefore needs a lot of memory, relative to other non-crypto RNGs. +/// 2 * 256 * 4 = 2 kb to hold the state and results. +/// +/// This implementation uses [`BlockRng`] to implement the [`RngCore`] methods. +/// +/// ## References +/// [^1]: Bob Jenkins, [*ISAAC: A fast cryptographic random number generator*]( +/// http://burtleburtle.net/bob/rand/isaacafa.html) +/// +/// [^2]: Bob Jenkins, [*ISAAC and RC4*]( +/// http://burtleburtle.net/bob/rand/isaac.html) +/// +/// [^3]: Jean-Philippe Aumasson, [*On the pseudo-random generator ISAAC*]( +/// https://eprint.iacr.org/2006/438) +/// +/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html +/// [`BlockRng`]: ../../rand_core/block/struct.BlockRng.html +/// [`RngCore`]: ../../rand_core/trait.RngCore.html +#[derive(Clone, Debug)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct IsaacRng(BlockRng); + +impl RngCore for IsaacRng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for IsaacRng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + IsaacRng(BlockRng::::from_seed(seed)) + } + + /// Create an ISAAC random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + fn seed_from_u64(seed: u64) -> Self { + IsaacRng(BlockRng::::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + BlockRng::::from_rng(rng).map(|rng| IsaacRng(rng)) + } +} + +impl IsaacRng { + /// Create an ISAAC random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] + pub fn new_from_u64(seed: u64) -> Self { + Self::seed_from_u64(seed) + } +} + +/// The core of `IsaacRng`, used with `BlockRng`. +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct IsaacCore { + #[cfg_attr(feature="serde1",serde(with="super::isaac_array::isaac_array_serde"))] + mem: [w32; RAND_SIZE], + a: w32, + b: w32, + c: w32, +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for IsaacCore { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "IsaacCore {{}}") + } +} + +impl BlockRngCore for IsaacCore { + type Item = u32; + type Results = IsaacArray; + + /// Refills the output buffer, `results`. See also the pseudocode desciption + /// of the algorithm in the [`IsaacRng`] documentation. + /// + /// Optimisations used (similar to the reference implementation): + /// + /// - The loop is unrolled 4 times, once for every constant of mix(). + /// - The contents of the main loop are moved to a function `rngstep`, to + /// reduce code duplication. + /// - We use local variables for a and b, which helps with optimisations. + /// - We split the main loop in two, one that operates over 0..128 and one + /// over 128..256. This way we can optimise out the addition and modulus + /// from `s[i+128 mod 256]`. + /// - We maintain one index `i` and add `m` or `m2` as base (m2 for the + /// `s[i+128 mod 256]`), relying on the optimizer to turn it into pointer + /// arithmetic. + /// - We fill `results` backwards. The reference implementation reads values + /// from `results` in reverse. We read them in the normal direction, to + /// make `fill_bytes` a memcopy. To maintain compatibility we fill in + /// reverse. + /// + /// [`IsaacRng`]: struct.IsaacRng.html + fn generate(&mut self, results: &mut IsaacArray) { + self.c += w(1); + // abbreviations + let mut a = self.a; + let mut b = self.b + self.c; + const MIDPOINT: usize = RAND_SIZE / 2; + + #[inline] + fn ind(mem:&[w32; RAND_SIZE], v: w32, amount: usize) -> w32 { + let index = (v >> amount).0 as usize % RAND_SIZE; + mem[index] + } + + #[inline] + fn rngstep(mem: &mut [w32; RAND_SIZE], + results: &mut [u32; RAND_SIZE], + mix: w32, + a: &mut w32, + b: &mut w32, + base: usize, + m: usize, + m2: usize) { + let x = mem[base + m]; + *a = mix + mem[base + m2]; + let y = *a + *b + ind(&mem, x, 2); + mem[base + m] = y; + *b = x + ind(&mem, y, 2 + RAND_SIZE_LEN); + results[RAND_SIZE - 1 - base - m] = (*b).0; + } + + let mut m = 0; + let mut m2 = MIDPOINT; + for i in (0..MIDPOINT/4).map(|i| i * 4) { + rngstep(&mut self.mem, results, a ^ (a << 13), &mut a, &mut b, i + 0, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 6 ), &mut a, &mut b, i + 1, m, m2); + rngstep(&mut self.mem, results, a ^ (a << 2 ), &mut a, &mut b, i + 2, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 16), &mut a, &mut b, i + 3, m, m2); + } + + m = MIDPOINT; + m2 = 0; + for i in (0..MIDPOINT/4).map(|i| i * 4) { + rngstep(&mut self.mem, results, a ^ (a << 13), &mut a, &mut b, i + 0, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 6 ), &mut a, &mut b, i + 1, m, m2); + rngstep(&mut self.mem, results, a ^ (a << 2 ), &mut a, &mut b, i + 2, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 16), &mut a, &mut b, i + 3, m, m2); + } + + self.a = a; + self.b = b; + } +} + +impl IsaacCore { + /// Create a new ISAAC random number generator. + /// + /// The author Bob Jenkins describes how to best initialize ISAAC here: + /// + /// The answer is included here just in case: + /// + /// "No, you don't need a full 8192 bits of seed data. Normal key sizes will + /// do fine, and they should have their expected strength (eg a 40-bit key + /// will take as much time to brute force as 40-bit keys usually will). You + /// could fill the remainder with 0, but set the last array element to the + /// length of the key provided (to distinguish keys that differ only by + /// different amounts of 0 padding). You do still need to call `randinit()` + /// to make sure the initial state isn't uniform-looking." + /// "After publishing ISAAC, I wanted to limit the key to half the size of + /// `r[]`, and repeat it twice. That would have made it hard to provide a + /// key that sets the whole internal state to anything convenient. But I'd + /// already published it." + /// + /// And his answer to the question "For my code, would repeating the key + /// over and over to fill 256 integers be a better solution than + /// zero-filling, or would they essentially be the same?": + /// "If the seed is under 32 bytes, they're essentially the same, otherwise + /// repeating the seed would be stronger. randinit() takes a chunk of 32 + /// bytes, mixes it, and combines that with the next 32 bytes, et cetera. + /// Then loops over all the elements the same way a second time." + #[inline] + fn init(mut mem: [w32; RAND_SIZE], rounds: u32) -> Self { + fn mix(a: &mut w32, b: &mut w32, c: &mut w32, d: &mut w32, + e: &mut w32, f: &mut w32, g: &mut w32, h: &mut w32) { + *a ^= *b << 11; *d += *a; *b += *c; + *b ^= *c >> 2; *e += *b; *c += *d; + *c ^= *d << 8; *f += *c; *d += *e; + *d ^= *e >> 16; *g += *d; *e += *f; + *e ^= *f << 10; *h += *e; *f += *g; + *f ^= *g >> 4; *a += *f; *g += *h; + *g ^= *h << 8; *b += *g; *h += *a; + *h ^= *a >> 9; *c += *h; *a += *b; + } + + // These numbers are the result of initializing a...h with the + // fractional part of the golden ratio in binary (0x9e3779b9) + // and applying mix() 4 times. + let mut a = w(0x1367df5a); + let mut b = w(0x95d90059); + let mut c = w(0xc3163e4b); + let mut d = w(0x0f421ad8); + let mut e = w(0xd92a4a78); + let mut f = w(0xa51a3c49); + let mut g = w(0xc4efea1b); + let mut h = w(0x30609119); + + // Normally this should do two passes, to make all of the seed effect + // all of `mem` + for _ in 0..rounds { + for i in (0..RAND_SIZE/8).map(|i| i * 8) { + a += mem[i ]; b += mem[i+1]; + c += mem[i+2]; d += mem[i+3]; + e += mem[i+4]; f += mem[i+5]; + g += mem[i+6]; h += mem[i+7]; + mix(&mut a, &mut b, &mut c, &mut d, + &mut e, &mut f, &mut g, &mut h); + mem[i ] = a; mem[i+1] = b; + mem[i+2] = c; mem[i+3] = d; + mem[i+4] = e; mem[i+5] = f; + mem[i+6] = g; mem[i+7] = h; + } + } + + Self { mem, a: w(0), b: w(0), c: w(0) } + } +} + +impl SeedableRng for IsaacCore { + type Seed = [u8; 32]; + + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_u32 = [0u32; 8]; + le::read_u32_into(&seed, &mut seed_u32); + // Convert the seed to `Wrapping` and zero-extend to `RAND_SIZE`. + let mut seed_extended = [w(0); RAND_SIZE]; + for (x, y) in seed_extended.iter_mut().zip(seed_u32.iter()) { + *x = w(*y); + } + Self::init(seed_extended, 2) + } + + /// Create an ISAAC random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + fn seed_from_u64(seed: u64) -> Self { + let mut key = [w(0); RAND_SIZE]; + key[0] = w(seed as u32); + key[1] = w((seed >> 32) as u32); + // Initialize with only one pass. + // A second pass does not improve the quality here, because all of the + // seed was already available in the first round. + // Not doing the second pass has the small advantage that if + // `seed == 0` this method produces exactly the same state as the + // reference implementation when used unseeded. + Self::init(key, 1) + } + + fn from_rng(mut rng: R) -> Result { + // Custom `from_rng` implementation that fills a seed with the same size + // as the entire state. + let mut seed = [w(0u32); RAND_SIZE]; + unsafe { + let ptr = seed.as_mut_ptr() as *mut u8; + + let slice = slice::from_raw_parts_mut(ptr, RAND_SIZE * 4); + rng.try_fill_bytes(slice)?; + } + for i in seed.iter_mut() { + *i = w(i.0.to_le()); + } + + Ok(Self::init(seed, 2)) + } +} + +#[cfg(test)] +mod test { + use rand_core::{RngCore, SeedableRng}; + use super::IsaacRng; + + #[test] + fn test_isaac_construction() { + // Test that various construction techniques produce a working RNG. + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng1 = IsaacRng::from_seed(seed); + assert_eq!(rng1.next_u32(), 2869442790); + + let mut rng2 = IsaacRng::from_rng(rng1).unwrap(); + assert_eq!(rng2.next_u32(), 3094074039); + } + + #[test] + fn test_isaac_true_values_32() { + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng1 = IsaacRng::from_seed(seed); + let mut results = [0u32; 10]; + for i in results.iter_mut() { *i = rng1.next_u32(); } + let expected = [ + 2558573138, 873787463, 263499565, 2103644246, 3595684709, + 4203127393, 264982119, 2765226902, 2737944514, 3900253796]; + assert_eq!(results, expected); + + let seed = [57,48,0,0, 50,9,1,0, 49,212,0,0, 148,38,0,0, + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng2 = IsaacRng::from_seed(seed); + // skip forward to the 10000th number + for _ in 0..10000 { rng2.next_u32(); } + + for i in results.iter_mut() { *i = rng2.next_u32(); } + let expected = [ + 3676831399, 3183332890, 2834741178, 3854698763, 2717568474, + 1576568959, 3507990155, 179069555, 141456972, 2478885421]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac_true_values_64() { + // As above, using little-endian versions of above values + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng = IsaacRng::from_seed(seed); + let mut results = [0u64; 5]; + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected = [ + 3752888579798383186, 9035083239252078381,18052294697452424037, + 11876559110374379111, 16751462502657800130]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac_true_bytes() { + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng = IsaacRng::from_seed(seed); + let mut results = [0u8; 32]; + rng.fill_bytes(&mut results); + // Same as first values in test_isaac_true_values as bytes in LE order + let expected = [82, 186, 128, 152, 71, 240, 20, 52, + 45, 175, 180, 15, 86, 16, 99, 125, + 101, 203, 81, 214, 97, 162, 134, 250, + 103, 78, 203, 15, 150, 3, 210, 164]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac_new_uninitialized() { + // Compare the results from initializing `IsaacRng` with + // `seed_from_u64(0)`, to make sure it is the same as the reference + // implementation when used uninitialized. + // Note: We only test the first 16 integers, not the full 256 of the + // first block. + let mut rng = IsaacRng::seed_from_u64(0); + let mut results = [0u32; 16]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected: [u32; 16] = [ + 0x71D71FD2, 0xB54ADAE7, 0xD4788559, 0xC36129FA, + 0x21DC1EA9, 0x3CB879CA, 0xD83B237F, 0xFA3CE5BD, + 0x8D048509, 0xD82E9489, 0xDB452848, 0xCA20E846, + 0x500F972E, 0x0EEFF940, 0x00D6B993, 0xBC12C17F]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac_clone() { + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng1 = IsaacRng::from_seed(seed); + let mut rng2 = rng1.clone(); + for _ in 0..16 { + assert_eq!(rng1.next_u32(), rng2.next_u32()); + } + } + + #[test] + #[cfg(feature="serde1")] + fn test_isaac_serde() { + use bincode; + use std::io::{BufWriter, BufReader}; + + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng = IsaacRng::from_seed(seed); + + let buf: Vec = Vec::new(); + let mut buf = BufWriter::new(buf); + bincode::serialize_into(&mut buf, &rng).expect("Could not serialize"); + + let buf = buf.into_inner().unwrap(); + let mut read = BufReader::new(&buf[..]); + let mut deserialized: IsaacRng = bincode::deserialize_from(&mut read).expect("Could not deserialize"); + + for _ in 0..300 { // more than the 256 buffered results + assert_eq!(rng.next_u32(), deserialized.next_u32()); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_isaac/src/isaac64.rs b/vendor/registry-40351f815f426200/rand_isaac/src/isaac64.rs new file mode 100644 index 000000000..2712762ab --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/src/isaac64.rs @@ -0,0 +1,481 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2018 The Rust Project 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. + +//! The ISAAC-64 random number generator. + +use core::{fmt, slice}; +use core::num::Wrapping as w; +use rand_core::{RngCore, SeedableRng, Error, le}; +use rand_core::block::{BlockRngCore, BlockRng64}; +use isaac_array::IsaacArray; + +#[allow(non_camel_case_types)] +type w64 = w; + +const RAND_SIZE_LEN: usize = 8; +const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; + +/// A random number generator that uses ISAAC-64, the 64-bit variant of the +/// ISAAC algorithm. +/// +/// ISAAC stands for "Indirection, Shift, Accumulate, Add, and Count" which are +/// the principal bitwise operations employed. It is the most advanced of a +/// series of array based random number generator designed by Robert Jenkins +/// in 1996[^1]. +/// +/// ISAAC-64 is mostly similar to ISAAC. Because it operates on 64-bit integers +/// instead of 32-bit, it uses twice as much memory to hold its state and +/// results. Also it uses different constants for shifts and indirect indexing, +/// optimized to give good results for 64bit arithmetic. +/// +/// ISAAC-64 is notably fast and produces excellent quality random numbers for +/// non-cryptographic applications. +/// +/// In spite of being designed with cryptographic security in mind, ISAAC hasn't +/// been stringently cryptanalyzed and thus cryptographers do not not +/// consensually trust it to be secure. When looking for a secure RNG, prefer +/// [`Hc128Rng`] instead, which, like ISAAC, is an array-based RNG and one of +/// the stream-ciphers selected the by eSTREAM contest. +/// +/// ## Overview of the ISAAC-64 algorithm: +/// (in pseudo-code) +/// +/// ```text +/// Input: a, b, c, s[256] // state +/// Output: r[256] // results +/// +/// mix(a,i) = !(a ^ a << 21) if i = 0 mod 4 +/// a ^ a >> 5 if i = 1 mod 4 +/// a ^ a << 12 if i = 2 mod 4 +/// a ^ a >> 33 if i = 3 mod 4 +/// +/// c = c + 1 +/// b = b + c +/// +/// for i in 0..256 { +/// x = s_[i] +/// a = mix(a,i) + s[i+128 mod 256] +/// y = a + b + s[x>>3 mod 256] +/// s[i] = y +/// b = x + s[y>>11 mod 256] +/// r[i] = b +/// } +/// ``` +/// +/// This implementation uses [`BlockRng64`] to implement the [`RngCore`] methods. +/// +/// See for more information the documentation of [`IsaacRng`]. +/// +/// [^1]: Bob Jenkins, [*ISAAC and RC4*]( +/// http://burtleburtle.net/bob/rand/isaac.html) +/// +/// [`IsaacRng`]: ../isaac/struct.IsaacRng.html +/// [`Hc128Rng`]: ../../rand_hc/struct.Hc128Rng.html +/// [`BlockRng64`]: ../../rand_core/block/struct.BlockRng64.html +/// [`RngCore`]: ../../rand_core/trait.RngCore.html +#[derive(Clone, Debug)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct Isaac64Rng(BlockRng64); + +impl RngCore for Isaac64Rng { + #[inline(always)] + fn next_u32(&mut self) -> u32 { + self.0.next_u32() + } + + #[inline(always)] + fn next_u64(&mut self) -> u64 { + self.0.next_u64() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + self.0.fill_bytes(dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.0.try_fill_bytes(dest) + } +} + +impl SeedableRng for Isaac64Rng { + type Seed = ::Seed; + + fn from_seed(seed: Self::Seed) -> Self { + Isaac64Rng(BlockRng64::::from_seed(seed)) + } + + /// Create an ISAAC random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + fn seed_from_u64(seed: u64) -> Self { + Isaac64Rng(BlockRng64::::seed_from_u64(seed)) + } + + fn from_rng(rng: S) -> Result { + BlockRng64::::from_rng(rng).map(|rng| Isaac64Rng(rng)) + } +} + +impl Isaac64Rng { + /// Create an ISAAC-64 random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] + pub fn new_from_u64(seed: u64) -> Self { + Self::seed_from_u64(seed) + } +} + +/// The core of `Isaac64Rng`, used with `BlockRng`. +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct Isaac64Core { + #[cfg_attr(feature="serde1",serde(with="super::isaac_array::isaac_array_serde"))] + mem: [w64; RAND_SIZE], + a: w64, + b: w64, + c: w64, +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for Isaac64Core { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Isaac64Core {{}}") + } +} + +impl BlockRngCore for Isaac64Core { + type Item = u64; + type Results = IsaacArray; + + /// Refills the output buffer, `results`. See also the pseudocode desciption + /// of the algorithm in the [`Isaac64Rng`] documentation. + /// + /// Optimisations used (similar to the reference implementation): + /// + /// - The loop is unrolled 4 times, once for every constant of mix(). + /// - The contents of the main loop are moved to a function `rngstep`, to + /// reduce code duplication. + /// - We use local variables for a and b, which helps with optimisations. + /// - We split the main loop in two, one that operates over 0..128 and one + /// over 128..256. This way we can optimise out the addition and modulus + /// from `s[i+128 mod 256]`. + /// - We maintain one index `i` and add `m` or `m2` as base (m2 for the + /// `s[i+128 mod 256]`), relying on the optimizer to turn it into pointer + /// arithmetic. + /// - We fill `results` backwards. The reference implementation reads values + /// from `results` in reverse. We read them in the normal direction, to + /// make `fill_bytes` a memcopy. To maintain compatibility we fill in + /// reverse. + /// + /// [`Isaac64Rng`]: struct.Isaac64Rng.html + fn generate(&mut self, results: &mut IsaacArray) { + self.c += w(1); + // abbreviations + let mut a = self.a; + let mut b = self.b + self.c; + const MIDPOINT: usize = RAND_SIZE / 2; + + #[inline] + fn ind(mem:&[w64; RAND_SIZE], v: w64, amount: usize) -> w64 { + let index = (v >> amount).0 as usize % RAND_SIZE; + mem[index] + } + + #[inline] + fn rngstep(mem: &mut [w64; RAND_SIZE], + results: &mut [u64; RAND_SIZE], + mix: w64, + a: &mut w64, + b: &mut w64, + base: usize, + m: usize, + m2: usize) { + let x = mem[base + m]; + *a = mix + mem[base + m2]; + let y = *a + *b + ind(&mem, x, 3); + mem[base + m] = y; + *b = x + ind(&mem, y, 3 + RAND_SIZE_LEN); + results[RAND_SIZE - 1 - base - m] = (*b).0; + } + + let mut m = 0; + let mut m2 = MIDPOINT; + for i in (0..MIDPOINT/4).map(|i| i * 4) { + rngstep(&mut self.mem, results, !(a ^ (a << 21)), &mut a, &mut b, i + 0, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 5 ), &mut a, &mut b, i + 1, m, m2); + rngstep(&mut self.mem, results, a ^ (a << 12), &mut a, &mut b, i + 2, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 33), &mut a, &mut b, i + 3, m, m2); + } + + m = MIDPOINT; + m2 = 0; + for i in (0..MIDPOINT/4).map(|i| i * 4) { + rngstep(&mut self.mem, results, !(a ^ (a << 21)), &mut a, &mut b, i + 0, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 5 ), &mut a, &mut b, i + 1, m, m2); + rngstep(&mut self.mem, results, a ^ (a << 12), &mut a, &mut b, i + 2, m, m2); + rngstep(&mut self.mem, results, a ^ (a >> 33), &mut a, &mut b, i + 3, m, m2); + } + + self.a = a; + self.b = b; + } +} + +impl Isaac64Core { + /// Create a new ISAAC-64 random number generator. + fn init(mut mem: [w64; RAND_SIZE], rounds: u32) -> Self { + fn mix(a: &mut w64, b: &mut w64, c: &mut w64, d: &mut w64, + e: &mut w64, f: &mut w64, g: &mut w64, h: &mut w64) { + *a -= *e; *f ^= *h >> 9; *h += *a; + *b -= *f; *g ^= *a << 9; *a += *b; + *c -= *g; *h ^= *b >> 23; *b += *c; + *d -= *h; *a ^= *c << 15; *c += *d; + *e -= *a; *b ^= *d >> 14; *d += *e; + *f -= *b; *c ^= *e << 20; *e += *f; + *g -= *c; *d ^= *f >> 17; *f += *g; + *h -= *d; *e ^= *g << 14; *g += *h; + } + + // These numbers are the result of initializing a...h with the + // fractional part of the golden ratio in binary (0x9e3779b97f4a7c13) + // and applying mix() 4 times. + let mut a = w(0x647c4677a2884b7c); + let mut b = w(0xb9f8b322c73ac862); + let mut c = w(0x8c0ea5053d4712a0); + let mut d = w(0xb29b2e824a595524); + let mut e = w(0x82f053db8355e0ce); + let mut f = w(0x48fe4a0fa5a09315); + let mut g = w(0xae985bf2cbfc89ed); + let mut h = w(0x98f5704f6c44c0ab); + + // Normally this should do two passes, to make all of the seed effect + // all of `mem` + for _ in 0..rounds { + for i in (0..RAND_SIZE/8).map(|i| i * 8) { + a += mem[i ]; b += mem[i+1]; + c += mem[i+2]; d += mem[i+3]; + e += mem[i+4]; f += mem[i+5]; + g += mem[i+6]; h += mem[i+7]; + mix(&mut a, &mut b, &mut c, &mut d, + &mut e, &mut f, &mut g, &mut h); + mem[i ] = a; mem[i+1] = b; + mem[i+2] = c; mem[i+3] = d; + mem[i+4] = e; mem[i+5] = f; + mem[i+6] = g; mem[i+7] = h; + } + } + + Self { mem, a: w(0), b: w(0), c: w(0) } + } + + /// Create an ISAAC-64 random number generator using an `u64` as seed. + /// If `seed == 0` this will produce the same stream of random numbers as + /// the reference implementation when used unseeded. + #[deprecated(since="0.6.0", note="use SeedableRng::seed_from_u64 instead")] + pub fn new_from_u64(seed: u64) -> Self { + Self::seed_from_u64(seed) + } +} + +impl SeedableRng for Isaac64Core { + type Seed = [u8; 32]; + + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_u64 = [0u64; 4]; + le::read_u64_into(&seed, &mut seed_u64); + // Convert the seed to `Wrapping` and zero-extend to `RAND_SIZE`. + let mut seed_extended = [w(0); RAND_SIZE]; + for (x, y) in seed_extended.iter_mut().zip(seed_u64.iter()) { + *x = w(*y); + } + Self::init(seed_extended, 2) + } + + fn seed_from_u64(seed: u64) -> Self { + let mut key = [w(0); RAND_SIZE]; + key[0] = w(seed); + // Initialize with only one pass. + // A second pass does not improve the quality here, because all of the + // seed was already available in the first round. + // Not doing the second pass has the small advantage that if + // `seed == 0` this method produces exactly the same state as the + // reference implementation when used unseeded. + Self::init(key, 1) + } + + fn from_rng(mut rng: R) -> Result { + // Custom `from_rng` implementation that fills a seed with the same size + // as the entire state. + let mut seed = [w(0u64); RAND_SIZE]; + unsafe { + let ptr = seed.as_mut_ptr() as *mut u8; + let slice = slice::from_raw_parts_mut(ptr, RAND_SIZE * 8); + rng.try_fill_bytes(slice)?; + } + for i in seed.iter_mut() { + *i = w(i.0.to_le()); + } + + Ok(Self::init(seed, 2)) + } +} + +#[cfg(test)] +mod test { + use rand_core::{RngCore, SeedableRng}; + use super::Isaac64Rng; + + #[test] + fn test_isaac64_construction() { + // Test that various construction techniques produce a working RNG. + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng1 = Isaac64Rng::from_seed(seed); + assert_eq!(rng1.next_u64(), 14964555543728284049); + + let mut rng2 = Isaac64Rng::from_rng(rng1).unwrap(); + assert_eq!(rng2.next_u64(), 919595328260451758); + } + + #[test] + fn test_isaac64_true_values_64() { + let seed = [1,0,0,0, 0,0,0,0, 23,0,0,0, 0,0,0,0, + 200,1,0,0, 0,0,0,0, 210,30,0,0, 0,0,0,0]; + let mut rng1 = Isaac64Rng::from_seed(seed); + let mut results = [0u64; 10]; + for i in results.iter_mut() { *i = rng1.next_u64(); } + let expected = [ + 15071495833797886820, 7720185633435529318, + 10836773366498097981, 5414053799617603544, + 12890513357046278984, 17001051845652595546, + 9240803642279356310, 12558996012687158051, + 14673053937227185542, 1677046725350116783]; + assert_eq!(results, expected); + + let seed = [57,48,0,0, 0,0,0,0, 50,9,1,0, 0,0,0,0, + 49,212,0,0, 0,0,0,0, 148,38,0,0, 0,0,0,0]; + let mut rng2 = Isaac64Rng::from_seed(seed); + // skip forward to the 10000th number + for _ in 0..10000 { rng2.next_u64(); } + + for i in results.iter_mut() { *i = rng2.next_u64(); } + let expected = [ + 18143823860592706164, 8491801882678285927, 2699425367717515619, + 17196852593171130876, 2606123525235546165, 15790932315217671084, + 596345674630742204, 9947027391921273664, 11788097613744130851, + 10391409374914919106]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac64_true_values_32() { + let seed = [1,0,0,0, 0,0,0,0, 23,0,0,0, 0,0,0,0, + 200,1,0,0, 0,0,0,0, 210,30,0,0, 0,0,0,0]; + let mut rng = Isaac64Rng::from_seed(seed); + let mut results = [0u32; 12]; + for i in results.iter_mut() { *i = rng.next_u32(); } + // Subset of above values, as an LE u32 sequence + let expected = [ + 3477963620, 3509106075, + 687845478, 1797495790, + 227048253, 2523132918, + 4044335064, 1260557630, + 4079741768, 3001306521, + 69157722, 3958365844]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac64_true_values_mixed() { + let seed = [1,0,0,0, 0,0,0,0, 23,0,0,0, 0,0,0,0, + 200,1,0,0, 0,0,0,0, 210,30,0,0, 0,0,0,0]; + let mut rng = Isaac64Rng::from_seed(seed); + // Test alternating between `next_u64` and `next_u32` works as expected. + // Values are the same as `test_isaac64_true_values` and + // `test_isaac64_true_values_32`. + assert_eq!(rng.next_u64(), 15071495833797886820); + assert_eq!(rng.next_u32(), 687845478); + assert_eq!(rng.next_u32(), 1797495790); + assert_eq!(rng.next_u64(), 10836773366498097981); + assert_eq!(rng.next_u32(), 4044335064); + // Skip one u32 + assert_eq!(rng.next_u64(), 12890513357046278984); + assert_eq!(rng.next_u32(), 69157722); + } + + #[test] + fn test_isaac64_true_bytes() { + let seed = [1,0,0,0, 0,0,0,0, 23,0,0,0, 0,0,0,0, + 200,1,0,0, 0,0,0,0, 210,30,0,0, 0,0,0,0]; + let mut rng = Isaac64Rng::from_seed(seed); + let mut results = [0u8; 32]; + rng.fill_bytes(&mut results); + // Same as first values in test_isaac64_true_values as bytes in LE order + let expected = [100, 131, 77, 207, 155, 181, 40, 209, + 102, 176, 255, 40, 238, 155, 35, 107, + 61, 123, 136, 13, 246, 243, 99, 150, + 216, 167, 15, 241, 62, 149, 34, 75]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac64_new_uninitialized() { + // Compare the results from initializing `IsaacRng` with + // `seed_from_u64(0)`, to make sure it is the same as the reference + // implementation when used uninitialized. + // Note: We only test the first 16 integers, not the full 256 of the + // first block. + let mut rng = Isaac64Rng::seed_from_u64(0); + let mut results = [0u64; 16]; + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected: [u64; 16] = [ + 0xF67DFBA498E4937C, 0x84A5066A9204F380, 0xFEE34BD5F5514DBB, + 0x4D1664739B8F80D6, 0x8607459AB52A14AA, 0x0E78BC5A98529E49, + 0xFE5332822AD13777, 0x556C27525E33D01A, 0x08643CA615F3149F, + 0xD0771FAF3CB04714, 0x30E86F68A37B008D, 0x3074EBC0488A3ADF, + 0x270645EA7A2790BC, 0x5601A0A8D3763C6A, 0x2F83071F53F325DD, + 0xB9090F3D42D2D2EA]; + assert_eq!(results, expected); + } + + #[test] + fn test_isaac64_clone() { + let seed = [1,0,0,0, 0,0,0,0, 23,0,0,0, 0,0,0,0, + 200,1,0,0, 0,0,0,0, 210,30,0,0, 0,0,0,0]; + let mut rng1 = Isaac64Rng::from_seed(seed); + let mut rng2 = rng1.clone(); + for _ in 0..16 { + assert_eq!(rng1.next_u64(), rng2.next_u64()); + } + } + + #[test] + #[cfg(feature="serde1")] + fn test_isaac64_serde() { + use bincode; + use std::io::{BufWriter, BufReader}; + + let seed = [1,0,0,0, 23,0,0,0, 200,1,0,0, 210,30,0,0, + 57,48,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng = Isaac64Rng::from_seed(seed); + + let buf: Vec = Vec::new(); + let mut buf = BufWriter::new(buf); + bincode::serialize_into(&mut buf, &rng).expect("Could not serialize"); + + let buf = buf.into_inner().unwrap(); + let mut read = BufReader::new(&buf[..]); + let mut deserialized: Isaac64Rng = bincode::deserialize_from(&mut read).expect("Could not deserialize"); + + for _ in 0..300 { // more than the 256 buffered results + assert_eq!(rng.next_u64(), deserialized.next_u64()); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_isaac/src/isaac_array.rs b/vendor/registry-40351f815f426200/rand_isaac/src/isaac_array.rs new file mode 100644 index 000000000..0fa614707 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/src/isaac_array.rs @@ -0,0 +1,136 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017-2018 The Rust Project 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. + +//! ISAAC helper functions for 256-element arrays. + +// Terrible workaround because arrays with more than 32 elements do not +// implement `AsRef`, `Default`, `Serialize`, `Deserialize`, or any other +// traits for that matter. + +#[cfg(feature="serde1")] use serde::{Serialize, Deserialize}; + +const RAND_SIZE_LEN: usize = 8; +const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; + + +#[derive(Copy, Clone)] +#[allow(missing_debug_implementations)] +#[cfg_attr(feature="serde1", derive(Serialize, Deserialize))] +pub struct IsaacArray { + #[cfg_attr(feature="serde1",serde(with="isaac_array_serde"))] + #[cfg_attr(feature="serde1", serde(bound( + serialize = "T: Serialize", + deserialize = "T: Deserialize<'de> + Copy + Default")))] + inner: [T; RAND_SIZE] +} + +impl ::core::convert::AsRef<[T]> for IsaacArray { + #[inline(always)] + fn as_ref(&self) -> &[T] { + &self.inner[..] + } +} + +impl ::core::convert::AsMut<[T]> for IsaacArray { + #[inline(always)] + fn as_mut(&mut self) -> &mut [T] { + &mut self.inner[..] + } +} + +impl ::core::ops::Deref for IsaacArray { + type Target = [T; RAND_SIZE]; + #[inline(always)] + fn deref(&self) -> &Self::Target { + &self.inner + } +} + +impl ::core::ops::DerefMut for IsaacArray { + #[inline(always)] + fn deref_mut(&mut self) -> &mut [T; RAND_SIZE] { + &mut self.inner + } +} + +impl ::core::default::Default for IsaacArray where T: Copy + Default { + fn default() -> IsaacArray { + IsaacArray { inner: [T::default(); RAND_SIZE] } + } +} + + +#[cfg(feature="serde1")] +pub(super) mod isaac_array_serde { + const RAND_SIZE_LEN: usize = 8; + const RAND_SIZE: usize = 1 << RAND_SIZE_LEN; + + use serde::{Deserialize, Deserializer, Serialize, Serializer}; + use serde::de::{Visitor,SeqAccess}; + use serde::de; + + use core::fmt; + + pub fn serialize(arr: &[T;RAND_SIZE], ser: S) -> Result + where + T: Serialize, + S: Serializer + { + use serde::ser::SerializeTuple; + + let mut seq = ser.serialize_tuple(RAND_SIZE)?; + + for e in arr.iter() { + seq.serialize_element(&e)?; + } + + seq.end() + } + + #[inline] + pub fn deserialize<'de, T, D>(de: D) -> Result<[T;RAND_SIZE], D::Error> + where + T: Deserialize<'de>+Default+Copy, + D: Deserializer<'de>, + { + use core::marker::PhantomData; + struct ArrayVisitor { + _pd: PhantomData, + }; + impl<'de,T> Visitor<'de> for ArrayVisitor + where + T: Deserialize<'de>+Default+Copy + { + type Value = [T; RAND_SIZE]; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("Isaac state array") + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result<[T; RAND_SIZE], A::Error> + where + A: SeqAccess<'de>, + { + let mut out = [Default::default();RAND_SIZE]; + + for i in 0..RAND_SIZE { + match seq.next_element()? { + Some(val) => out[i] = val, + None => return Err(de::Error::invalid_length(i, &self)), + }; + } + + Ok(out) + } + } + + de.deserialize_tuple(RAND_SIZE, ArrayVisitor{_pd: PhantomData}) + } +} diff --git a/vendor/registry-40351f815f426200/rand_isaac/src/lib.rs b/vendor/registry-40351f815f426200/rand_isaac/src/lib.rs new file mode 100644 index 000000000..ec82d8e7b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_isaac/src/lib.rs @@ -0,0 +1,36 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The ISAAC and ISAAC-64 random number generators. + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![cfg_attr(not(all(feature="serde1", test)), no_std)] + +extern crate rand_core; + +#[cfg(feature="serde1")] extern crate serde; +#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; + +// To test serialization we need bincode and the standard library +#[cfg(all(feature="serde1", test))] extern crate bincode; +#[cfg(all(feature="serde1", test))] extern crate std as core; + +pub mod isaac; +pub mod isaac64; + +mod isaac_array; + +pub use self::isaac::IsaacRng; +pub use self::isaac64::Isaac64Rng; diff --git a/vendor/registry-40351f815f426200/rand_jitter/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_jitter/.cargo-checksum.json new file mode 100644 index 000000000..bf9633612 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"dd1714225c7cca47c349ddbca2b5ab8a546e0c7b1c52cf05cafca1e05c48f2b0","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"d524ddfe62a9ca58ff86d9ad37532081bae35bfcca2a1e68ca0ffaf0e981d477","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"7b685b3204fc1bb9a09b40eb586bf55358f076b276866c1c2afb20f57e8357b2","benches/mod.rs":"caea9aa8c327d4af18eeabe798cf7919d5f64225c3e5f4685814592a1595b9bf","src/dummy_log.rs":"4e26589c18de568b7da7f0ccc9b77bb430961739a6510c2b043a43dee300c6fa","src/error.rs":"e632a67e30528bed8c2a74b04b04e4e67f6c184d21234d74cc28f5f292e47666","src/lib.rs":"6655eb8d1fba653dda788c885ae380b017e6482baa6e2885019d33dbd829b0e6","src/platform.rs":"8c7b75567a28391176de17a3df2a8c6b3517f2c1f044b792db50de19844e9660","tests/mod.rs":"f3f99c64b250b2ddea43e724c47497de3d68cbaf05a0a8a255d360861cd979ec"},"package":"1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_jitter/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_jitter/CHANGELOG.md new file mode 100644 index 000000000..bbb21dcbf --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/CHANGELOG.md @@ -0,0 +1,21 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.4] - 2019-05-02 +- Change error conversion code to partially fix #738 + +## [0.1.3] - 2019-02-05 +- Use libc in `no_std` mode to fix #723 + +## [0.1.2] - 2019-01-31 +- Fix for older rustc compilers on Windows (#722) + +## [0.1.1] - 2019-01-29 +- Fix for older rustc compilers on Mac OSX / iOS (#720) +- Misc. doc fixes + +## [0.1.0] - 2019-01-24 +Initial release. diff --git a/vendor/registry-40351f815f426200/rand_jitter/COPYRIGHT b/vendor/registry-40351f815f426200/rand_jitter/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_jitter/Cargo.toml b/vendor/registry-40351f815f426200/rand_jitter/Cargo.toml new file mode 100644 index 000000000..387b8073f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/Cargo.toml @@ -0,0 +1,42 @@ +# 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 = "rand_jitter" +version = "0.1.4" +authors = ["The Rand Project Developers"] +description = "Random number generator based on timing jitter" +documentation = "https://docs.rs/rand_jitter" +readme = "README.md" +keywords = ["random", "rng", "os"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.log] +version = "0.4" +optional = true + +[dependencies.rand_core] +version = "0.4" + +[features] +std = ["rand_core/std"] +[target."cfg(any(target_os = \"macos\", target_os = \"ios\"))".dependencies.libc] +version = "0.2" +default_features = false +[target."cfg(target_os = \"windows\")".dependencies.winapi] +version = "0.3" +features = ["profileapi"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_jitter/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_jitter/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_jitter/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_jitter/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_jitter/README.md b/vendor/registry-40351f815f426200/rand_jitter/README.md new file mode 100644 index 000000000..8e0805fae --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/README.md @@ -0,0 +1,104 @@ +# rand_jitter +[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_jitter.svg)](https://crates.io/crates/rand_jitter) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_jitter) +[![API](https://docs.rs/rand_jitter/badge.svg)](https://docs.rs/rand_jitter) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.32+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Non-physical true random number generator based on timing jitter. + +This crate depends on [rand_core](https://crates.io/crates/rand_core) and is +part of the [Rand project](https://github.com/rust-random/rand). + +This crate aims to support all of Rust's `std` platforms with a system-provided +entropy source. Unlike other Rand crates, this crate does not support `no_std` +(handling this gracefully is a current discussion topic). + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_jitter) +- [API documentation (docs.rs)](https://docs.rs/rand_jitter) +- [Changelog](CHANGELOG.md) + +## Features + +This crate has optional `std` support which is *disabled by default*; +this feature is required to provide the `JitterRng::new` function; +without `std` support a timer must be supplied via `JitterRng::new_with_timer`. + +## Quality testing + +`JitterRng::new()` has build-in, but limited, quality testing, however +before using `JitterRng` on untested hardware, or after changes that could +effect how the code is optimized (such as a new LLVM version), it is +recommend to run the much more stringent +[NIST SP 800-90B Entropy Estimation Suite](https://github.com/usnistgov/SP800-90B_EntropyAssessment). + +Use the following code using `timer_stats` to collect the data: + +```rust +use rand_jitter::JitterRng; + +use std::error::Error; +use std::fs::File; +use std::io::Write; + +fn main() -> Result<(), Box> { + let mut rng = JitterRng::new()?; + + // 1_000_000 results are required for the + // NIST SP 800-90B Entropy Estimation Suite + const ROUNDS: usize = 1_000_000; + let mut deltas_variable: Vec = Vec::with_capacity(ROUNDS); + let mut deltas_minimal: Vec = Vec::with_capacity(ROUNDS); + + for _ in 0..ROUNDS { + deltas_variable.push(rng.timer_stats(true) as u8); + deltas_minimal.push(rng.timer_stats(false) as u8); + } + + // Write out after the statistics collection loop, to not disturb the + // test results. + File::create("jitter_rng_var.bin")?.write(&deltas_variable)?; + File::create("jitter_rng_min.bin")?.write(&deltas_minimal)?; + Ok(()) +} +``` + +This will produce two files: `jitter_rng_var.bin` and `jitter_rng_min.bin`. +Run the Entropy Estimation Suite in three configurations, as outlined below. +Every run has two steps. One step to produce an estimation, another to +validate the estimation. + +1. Estimate the expected amount of entropy that is at least available with + each round of the entropy collector. This number should be greater than + the amount estimated with `64 / test_timer()`. + ```sh + python noniid_main.py -v jitter_rng_var.bin 8 + restart.py -v jitter_rng_var.bin 8 + ``` +2. Estimate the expected amount of entropy that is available in the last 4 + bits of the timer delta after running noice sources. Note that a value of + `3.70` is the minimum estimated entropy for true randomness. + ```sh + python noniid_main.py -v -u 4 jitter_rng_var.bin 4 + restart.py -v -u 4 jitter_rng_var.bin 4 + ``` +3. Estimate the expected amount of entropy that is available to the entropy + collector if both noise sources only run their minimal number of times. + This measures the absolute worst-case, and gives a lower bound for the + available entropy. + ```sh + python noniid_main.py -v -u 4 jitter_rng_min.bin 4 + restart.py -v -u 4 jitter_rng_min.bin 4 + ``` + +## License + +`rand_jitter` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_jitter/benches/mod.rs b/vendor/registry-40351f815f426200/rand_jitter/benches/mod.rs new file mode 100644 index 000000000..23b34472b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/benches/mod.rs @@ -0,0 +1,18 @@ +#![feature(test)] +extern crate test; +extern crate rand_jitter; + +use test::Bencher; +use rand_jitter::rand_core::RngCore; + +#[bench] +fn bench_add_two(b: &mut Bencher) { + let mut rng = rand_jitter::JitterRng::new().unwrap(); + let mut buf = [0u8; 1024]; + b.iter(|| { + rng.fill_bytes(&mut buf[..]); + test::black_box(&buf); + }); + b.bytes = buf.len() as u64; +} + diff --git a/vendor/registry-40351f815f426200/rand_jitter/src/dummy_log.rs b/vendor/registry-40351f815f426200/rand_jitter/src/dummy_log.rs new file mode 100644 index 000000000..ccfe4baef --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/src/dummy_log.rs @@ -0,0 +1,10 @@ +#[allow(unused)] +macro_rules! trace { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! debug { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! info { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! warn { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! error { ($($x:tt)*) => () } diff --git a/vendor/registry-40351f815f426200/rand_jitter/src/error.rs b/vendor/registry-40351f815f426200/rand_jitter/src/error.rs new file mode 100644 index 000000000..a3483e84d --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/src/error.rs @@ -0,0 +1,70 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2015 The Rust Project 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. + +use rand_core::{Error, ErrorKind}; +use core::fmt; + +/// An error that can occur when [`JitterRng::test_timer`] fails. +/// +/// [`JitterRng::test_timer`]: crate::JitterRng::test_timer +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum TimerError { + /// No timer available. + NoTimer, + /// Timer too coarse to use as an entropy source. + CoarseTimer, + /// Timer is not monotonically increasing. + NotMonotonic, + /// Variations of deltas of time too small. + TinyVariantions, + /// Too many stuck results (indicating no added entropy). + TooManyStuck, + #[doc(hidden)] + __Nonexhaustive, +} + +impl TimerError { + fn description(&self) -> &'static str { + match *self { + TimerError::NoTimer => "no timer available", + TimerError::CoarseTimer => "coarse timer", + TimerError::NotMonotonic => "timer not monotonic", + TimerError::TinyVariantions => "time delta variations too small", + TimerError::TooManyStuck => "too many stuck results", + TimerError::__Nonexhaustive => unreachable!(), + } + } +} + +impl fmt::Display for TimerError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", self.description()) + } +} + +#[cfg(feature = "std")] +impl ::std::error::Error for TimerError { + fn description(&self) -> &str { + self.description() + } +} + +impl From for Error { + fn from(err: TimerError) -> Error { + // Timer check is already quite permissive of failures so we don't + // expect false-positive failures, i.e. any error is irrecoverable. + #[cfg(feature = "std")] { + Error::with_cause(ErrorKind::Unavailable, "timer jitter failed basic quality tests", err) + } + #[cfg(not(feature = "std"))] { + Error::new(ErrorKind::Unavailable, "timer jitter failed basic quality tests") + } + } +} + diff --git a/vendor/registry-40351f815f426200/rand_jitter/src/lib.rs b/vendor/registry-40351f815f426200/rand_jitter/src/lib.rs new file mode 100644 index 000000000..338a6b966 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/src/lib.rs @@ -0,0 +1,718 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. +// +// Based on jitterentropy-library, http://www.chronox.de/jent.html. +// Copyright Stephan Mueller , 2014 - 2017. +// +// With permission from Stephan Mueller to relicense the Rust translation under +// the MIT license. + +//! Non-physical true random number generator based on timing jitter. +//! +//! This is a true random number generator, as opposed to pseudo-random +//! generators. Random numbers generated by `JitterRng` can be seen as fresh +//! entropy. A consequence is that it is orders of magnitude slower than `OsRng` +//! and PRNGs (about 103..106 slower). +//! +//! There are very few situations where using this RNG is appropriate. Only very +//! few applications require true entropy. A normal PRNG can be statistically +//! indistinguishable, and a cryptographic PRNG should also be as impossible to +//! predict. +//! +//! Use of `JitterRng` is recommended for initializing cryptographic PRNGs when +//! `OsRng` is not available. +//! +//! `JitterRng` can be used without the standard library, but not conveniently, +//! you must provide a high-precision timer and carefully have to follow the +//! instructions of [`JitterRng::new_with_timer`]. +//! +//! This implementation is based on [Jitterentropy] version 2.1.0. +//! +//! Note: There is no accurate timer available on WASM platforms, to help +//! prevent fingerprinting or timing side-channel attacks. Therefore +//! [`JitterRng::new()`] is not available on WASM. It is also unavailable +//! with disabled `std` feature. +//! +//! [Jitterentropy]: http://www.chronox.de/jent.html + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +// Note: the C implementation of `Jitterentropy` relies on being compiled +// without optimizations. This implementation goes through lengths to make the +// compiler not optimize out code which does influence timing jitter, but is +// technically dead code. +#![no_std] +pub extern crate rand_core; +#[cfg(feature = "std")] +extern crate std; +#[cfg(feature = "log")] +#[macro_use] extern crate log; +#[cfg(any(target_os = "macos", target_os = "ios"))] +extern crate libc; +#[cfg(target_os = "windows")] +extern crate winapi; + + +#[cfg(not(feature = "log"))] +#[macro_use] mod dummy_log; +#[cfg(feature = "std")] +mod platform; +mod error; + +use rand_core::{RngCore, CryptoRng, Error, impls}; +pub use error::TimerError; + +use core::{fmt, mem, ptr}; +#[cfg(feature = "std")] +use std::sync::atomic::{AtomicUsize, Ordering}; +#[cfg(feature = "std")] +#[allow(deprecated)] // Required for compatibility with Rust < 1.24. +use std::sync::atomic::ATOMIC_USIZE_INIT; + +const MEMORY_BLOCKS: usize = 64; +const MEMORY_BLOCKSIZE: usize = 32; +const MEMORY_SIZE: usize = MEMORY_BLOCKS * MEMORY_BLOCKSIZE; + +/// A true random number generator based on jitter in the CPU execution time, +/// and jitter in memory access time. +pub struct JitterRng { + data: u64, // Actual random number + // Number of rounds to run the entropy collector per 64 bits + rounds: u8, + // Timer used by `measure_jitter` + timer: fn() -> u64, + // Memory for the Memory Access noise source + mem_prev_index: u16, + // Make `next_u32` not waste 32 bits + data_half_used: bool, +} + +// Note: `JitterRng` maintains a small 64-bit entropy pool. With every +// `generate` 64 new bits should be integrated in the pool. If a round of +// `generate` were to collect less than the expected 64 bit, then the returned +// value, and the new state of the entropy pool, would be in some way related to +// the initial state. It is therefore better if the initial state of the entropy +// pool is different on each call to `generate`. This has a few implications: +// - `generate` should be called once before using `JitterRng` to produce the +// first usable value (this is done by default in `new`); +// - We do not zero the entropy pool after generating a result. The reference +// implementation also does not support zeroing, but recommends generating a +// new value without using it if you want to protect a previously generated +// 'secret' value from someone inspecting the memory; +// - Implementing `Clone` seems acceptable, as it would not cause the systematic +// bias a constant might cause. Only instead of one value that could be +// potentially related to the same initial state, there are now two. + +// Entropy collector state. +// These values are not necessary to preserve across runs. +struct EcState { + // Previous time stamp to determine the timer delta + prev_time: u64, + // Deltas used for the stuck test + last_delta: i32, + last_delta2: i32, + // Memory for the Memory Access noise source + mem: [u8; MEMORY_SIZE], +} + +impl EcState { + // Stuck test by checking the: + // - 1st derivation of the jitter measurement (time delta) + // - 2nd derivation of the jitter measurement (delta of time deltas) + // - 3rd derivation of the jitter measurement (delta of delta of time + // deltas) + // + // All values must always be non-zero. + // This test is a heuristic to see whether the last measurement holds + // entropy. + fn stuck(&mut self, current_delta: i32) -> bool { + let delta2 = self.last_delta - current_delta; + let delta3 = delta2 - self.last_delta2; + + self.last_delta = current_delta; + self.last_delta2 = delta2; + + current_delta == 0 || delta2 == 0 || delta3 == 0 + } +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for JitterRng { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "JitterRng {{}}") + } +} + +impl Clone for JitterRng { + fn clone(&self) -> JitterRng { + JitterRng { + data: self.data, + rounds: self.rounds, + timer: self.timer, + mem_prev_index: self.mem_prev_index, + // The 32 bits that may still be unused from the previous round are + // for the original to use, not for the clone. + data_half_used: false, + } + } +} + +// Initialise to zero; must be positive +#[cfg(all(feature = "std", not(target_arch = "wasm32")))] +#[allow(deprecated)] +static JITTER_ROUNDS: AtomicUsize = ATOMIC_USIZE_INIT; + +impl JitterRng { + /// Create a new `JitterRng`. Makes use of `std::time` for a timer, or a + /// platform-specific function with higher accuracy if necessary and + /// available. + /// + /// During initialization CPU execution timing jitter is measured a few + /// hundred times. If this does not pass basic quality tests, an error is + /// returned. The test result is cached to make subsequent calls faster. + #[cfg(all(feature = "std", not(target_arch = "wasm32")))] + pub fn new() -> Result { + if cfg!(target_arch = "wasm32") { + return Err(TimerError::NoTimer); + } + let mut state = JitterRng::new_with_timer(platform::get_nstime); + let mut rounds = JITTER_ROUNDS.load(Ordering::Relaxed) as u8; + if rounds == 0 { + // No result yet: run test. + // This allows the timer test to run multiple times; we don't care. + rounds = state.test_timer()?; + JITTER_ROUNDS.store(rounds as usize, Ordering::Relaxed); + info!("JitterRng: using {} rounds per u64 output", rounds); + } + state.set_rounds(rounds); + + // Fill `data` with a non-zero value. + state.gen_entropy(); + Ok(state) + } + + /// Create a new `JitterRng`. + /// A custom timer can be supplied, making it possible to use `JitterRng` in + /// `no_std` environments. + /// + /// The timer must have nanosecond precision. + /// + /// This method is more low-level than `new()`. It is the responsibility of + /// the caller to run [`test_timer`] before using any numbers generated with + /// `JitterRng`, and optionally call [`set_rounds`]. Also it is important to + /// consume at least one `u64` before using the first result to initialize + /// the entropy collection pool. + /// + /// # Example + /// + /// ``` + /// # use rand_jitter::rand_core::{RngCore, Error}; + /// use rand_jitter::JitterRng; + /// + /// # fn try_inner() -> Result<(), Error> { + /// fn get_nstime() -> u64 { + /// use std::time::{SystemTime, UNIX_EPOCH}; + /// + /// let dur = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); + /// // The correct way to calculate the current time is + /// // `dur.as_secs() * 1_000_000_000 + dur.subsec_nanos() as u64` + /// // But this is faster, and the difference in terms of entropy is + /// // negligible (log2(10^9) == 29.9). + /// dur.as_secs() << 30 | dur.subsec_nanos() as u64 + /// } + /// + /// let mut rng = JitterRng::new_with_timer(get_nstime); + /// let rounds = rng.test_timer()?; + /// rng.set_rounds(rounds); // optional + /// let _ = rng.next_u64(); + /// + /// // Ready for use + /// let v: u64 = rng.next_u64(); + /// # Ok(()) + /// # } + /// + /// # let _ = try_inner(); + /// ``` + /// + /// [`test_timer`]: JitterRng::test_timer + /// [`set_rounds`]: JitterRng::set_rounds + pub fn new_with_timer(timer: fn() -> u64) -> JitterRng { + JitterRng { + data: 0, + rounds: 64, + timer, + mem_prev_index: 0, + data_half_used: false, + } + } + + /// Configures how many rounds are used to generate each 64-bit value. + /// This must be greater than zero, and has a big impact on performance + /// and output quality. + /// + /// [`new_with_timer`] conservatively uses 64 rounds, but often less rounds + /// can be used. The `test_timer()` function returns the minimum number of + /// rounds required for full strength (platform dependent), so one may use + /// `rng.set_rounds(rng.test_timer()?);` or cache the value. + /// + /// [`new_with_timer`]: JitterRng::new_with_timer + pub fn set_rounds(&mut self, rounds: u8) { + assert!(rounds > 0); + self.rounds = rounds; + } + + // Calculate a random loop count used for the next round of an entropy + // collection, based on bits from a fresh value from the timer. + // + // The timer is folded to produce a number that contains at most `n_bits` + // bits. + // + // Note: A constant should be added to the resulting random loop count to + // prevent loops that run 0 times. + #[inline(never)] + fn random_loop_cnt(&mut self, n_bits: u32) -> u32 { + let mut rounds = 0; + + let mut time = (self.timer)(); + // Mix with the current state of the random number balance the random + // loop counter a bit more. + time ^= self.data; + + // We fold the time value as much as possible to ensure that as many + // bits of the time stamp are included as possible. + let folds = (64 + n_bits - 1) / n_bits; + let mask = (1 << n_bits) - 1; + for _ in 0..folds { + rounds ^= time & mask; + time >>= n_bits; + } + + rounds as u32 + } + + // CPU jitter noise source + // Noise source based on the CPU execution time jitter + // + // This function injects the individual bits of the time value into the + // entropy pool using an LFSR. + // + // The code is deliberately inefficient with respect to the bit shifting. + // This function not only acts as folding operation, but this function's + // execution is used to measure the CPU execution time jitter. Any change to + // the loop in this function implies that careful retesting must be done. + #[inline(never)] + fn lfsr_time(&mut self, time: u64, var_rounds: bool) { + fn lfsr(mut data: u64, time: u64) -> u64{ + for i in 1..65 { + let mut tmp = time << (64 - i); + tmp >>= 64 - 1; + + // Fibonacci LSFR with polynomial of + // x^64 + x^61 + x^56 + x^31 + x^28 + x^23 + 1 which is + // primitive according to + // http://poincare.matf.bg.ac.rs/~ezivkovm/publications/primpol1.pdf + // (the shift values are the polynomial values minus one + // due to counting bits from 0 to 63). As the current + // position is always the LSB, the polynomial only needs + // to shift data in from the left without wrap. + data ^= tmp; + data ^= (data >> 63) & 1; + data ^= (data >> 60) & 1; + data ^= (data >> 55) & 1; + data ^= (data >> 30) & 1; + data ^= (data >> 27) & 1; + data ^= (data >> 22) & 1; + data = data.rotate_left(1); + } + data + } + + // Note: in the reference implementation only the last round effects + // `self.data`, all the other results are ignored. To make sure the + // other rounds are not optimised out, we first run all but the last + // round on a throw-away value instead of the real `self.data`. + let mut lfsr_loop_cnt = 0; + if var_rounds { lfsr_loop_cnt = self.random_loop_cnt(4) }; + + let mut throw_away: u64 = 0; + for _ in 0..lfsr_loop_cnt { + throw_away = lfsr(throw_away, time); + } + black_box(throw_away); + + self.data = lfsr(self.data, time); + } + + // Memory Access noise source + // This is a noise source based on variations in memory access times + // + // This function performs memory accesses which will add to the timing + // variations due to an unknown amount of CPU wait states that need to be + // added when accessing memory. The memory size should be larger than the L1 + // caches as outlined in the documentation and the associated testing. + // + // The L1 cache has a very high bandwidth, albeit its access rate is usually + // slower than accessing CPU registers. Therefore, L1 accesses only add + // minimal variations as the CPU has hardly to wait. Starting with L2, + // significant variations are added because L2 typically does not belong to + // the CPU any more and therefore a wider range of CPU wait states is + // necessary for accesses. L3 and real memory accesses have even a wider + // range of wait states. However, to reliably access either L3 or memory, + // the `self.mem` memory must be quite large which is usually not desirable. + #[inline(never)] + fn memaccess(&mut self, mem: &mut [u8; MEMORY_SIZE], var_rounds: bool) { + let mut acc_loop_cnt = 128; + if var_rounds { acc_loop_cnt += self.random_loop_cnt(4) }; + + let mut index = self.mem_prev_index as usize; + for _ in 0..acc_loop_cnt { + // Addition of memblocksize - 1 to index with wrap around logic to + // ensure that every memory location is hit evenly. + // The modulus also allows the compiler to remove the indexing + // bounds check. + index = (index + MEMORY_BLOCKSIZE - 1) % MEMORY_SIZE; + + // memory access: just add 1 to one byte + // memory access implies read from and write to memory location + mem[index] = mem[index].wrapping_add(1); + } + self.mem_prev_index = index as u16; + } + + // This is the heart of the entropy generation: calculate time deltas and + // use the CPU jitter in the time deltas. The jitter is injected into the + // entropy pool. + // + // Ensure that `ec.prev_time` is primed before using the output of this + // function. This can be done by calling this function and not using its + // result. + fn measure_jitter(&mut self, ec: &mut EcState) -> Option<()> { + // Invoke one noise source before time measurement to add variations + self.memaccess(&mut ec.mem, true); + + // Get time stamp and calculate time delta to previous + // invocation to measure the timing variations + let time = (self.timer)(); + // Note: wrapping_sub combined with a cast to `i64` generates a correct + // delta, even in the unlikely case this is a timer that is not strictly + // monotonic. + let current_delta = time.wrapping_sub(ec.prev_time) as i64 as i32; + ec.prev_time = time; + + // Call the next noise source which also injects the data + self.lfsr_time(current_delta as u64, true); + + // Check whether we have a stuck measurement (i.e. does the last + // measurement holds entropy?). + if ec.stuck(current_delta) { return None }; + + // Rotate the data buffer by a prime number (any odd number would + // do) to ensure that every bit position of the input time stamp + // has an even chance of being merged with a bit position in the + // entropy pool. We do not use one here as the adjacent bits in + // successive time deltas may have some form of dependency. The + // chosen value of 7 implies that the low 7 bits of the next + // time delta value is concatenated with the current time delta. + self.data = self.data.rotate_left(7); + + Some(()) + } + + // Shuffle the pool a bit by mixing some value with a bijective function + // (XOR) into the pool. + // + // The function generates a mixer value that depends on the bits set and + // the location of the set bits in the random number generated by the + // entropy source. Therefore, based on the generated random number, this + // mixer value can have 2^64 different values. That mixer value is + // initialized with the first two SHA-1 constants. After obtaining the + // mixer value, it is XORed into the random number. + // + // The mixer value is not assumed to contain any entropy. But due to the + // XOR operation, it can also not destroy any entropy present in the + // entropy pool. + #[inline(never)] + fn stir_pool(&mut self) { + // This constant is derived from the first two 32 bit initialization + // vectors of SHA-1 as defined in FIPS 180-4 section 5.3.1 + // The order does not really matter as we do not rely on the specific + // numbers. We just pick the SHA-1 constants as they have a good mix of + // bit set and unset. + const CONSTANT: u64 = 0x67452301efcdab89; + + // The start value of the mixer variable is derived from the third + // and fourth 32 bit initialization vector of SHA-1 as defined in + // FIPS 180-4 section 5.3.1 + let mut mixer = 0x98badcfe10325476; + + // This is a constant time function to prevent leaking timing + // information about the random number. + // The normal code is: + // ``` + // for i in 0..64 { + // if ((self.data >> i) & 1) == 1 { mixer ^= CONSTANT; } + // } + // ``` + // This is a bit fragile, as LLVM really wants to use branches here, and + // we rely on it to not recognise the opportunity. + for i in 0..64 { + let apply = (self.data >> i) & 1; + let mask = !apply.wrapping_sub(1); + mixer ^= CONSTANT & mask; + mixer = mixer.rotate_left(1); + } + + self.data ^= mixer; + } + + fn gen_entropy(&mut self) -> u64 { + trace!("JitterRng: collecting entropy"); + + // Prime `ec.prev_time`, and run the noice sources to make sure the + // first loop round collects the expected entropy. + let mut ec = EcState { + prev_time: (self.timer)(), + last_delta: 0, + last_delta2: 0, + mem: [0; MEMORY_SIZE], + }; + let _ = self.measure_jitter(&mut ec); + + for _ in 0..self.rounds { + // If a stuck measurement is received, repeat measurement + // Note: we do not guard against an infinite loop, that would mean + // the timer suddenly became broken. + while self.measure_jitter(&mut ec).is_none() {} + } + + // Do a single read from `self.mem` to make sure the Memory Access noise + // source is not optimised out. + black_box(ec.mem[0]); + + self.stir_pool(); + self.data + } + + /// Basic quality tests on the timer, by measuring CPU timing jitter a few + /// hundred times. + /// + /// If successful, this will return the estimated number of rounds necessary + /// to collect 64 bits of entropy. Otherwise a [`TimerError`] with the cause + /// of the failure will be returned. + pub fn test_timer(&mut self) -> Result { + debug!("JitterRng: testing timer ..."); + // We could add a check for system capabilities such as `clock_getres` + // or check for `CONFIG_X86_TSC`, but it does not make much sense as the + // following sanity checks verify that we have a high-resolution timer. + + let mut delta_sum = 0; + let mut old_delta = 0; + + let mut time_backwards = 0; + let mut count_mod = 0; + let mut count_stuck = 0; + + let mut ec = EcState { + prev_time: (self.timer)(), + last_delta: 0, + last_delta2: 0, + mem: [0; MEMORY_SIZE], + }; + + // TESTLOOPCOUNT needs some loops to identify edge systems. + // 100 is definitely too little. + const TESTLOOPCOUNT: u64 = 300; + const CLEARCACHE: u64 = 100; + + for i in 0..(CLEARCACHE + TESTLOOPCOUNT) { + // Measure time delta of core entropy collection logic + let time = (self.timer)(); + self.memaccess(&mut ec.mem, true); + self.lfsr_time(time, true); + let time2 = (self.timer)(); + + // Test whether timer works + if time == 0 || time2 == 0 { + return Err(TimerError::NoTimer); + } + let delta = time2.wrapping_sub(time) as i64 as i32; + + // Test whether timer is fine grained enough to provide delta even + // when called shortly after each other -- this implies that we also + // have a high resolution timer + if delta == 0 { + return Err(TimerError::CoarseTimer); + } + + // Up to here we did not modify any variable that will be + // evaluated later, but we already performed some work. Thus we + // already have had an impact on the caches, branch prediction, + // etc. with the goal to clear it to get the worst case + // measurements. + if i < CLEARCACHE { continue; } + + if ec.stuck(delta) { count_stuck += 1; } + + // Test whether we have an increasing timer. + if !(time2 > time) { time_backwards += 1; } + + // Count the number of times the counter increases in steps of 100ns + // or greater. + if (delta % 100) == 0 { count_mod += 1; } + + // Ensure that we have a varying delta timer which is necessary for + // the calculation of entropy -- perform this check only after the + // first loop is executed as we need to prime the old_delta value + delta_sum += (delta - old_delta).abs() as u64; + old_delta = delta; + } + + // Do a single read from `self.mem` to make sure the Memory Access noise + // source is not optimised out. + black_box(ec.mem[0]); + + // We allow the time to run backwards for up to three times. + // This can happen if the clock is being adjusted by NTP operations. + // If such an operation just happens to interfere with our test, it + // should not fail. The value of 3 should cover the NTP case being + // performed during our test run. + if time_backwards > 3 { + return Err(TimerError::NotMonotonic); + } + + // Test that the available amount of entropy per round does not get to + // low. We expect 1 bit of entropy per round as a reasonable minimum + // (although less is possible, it means the collector loop has to run + // much more often). + // `assert!(delta_average >= log2(1))` + // `assert!(delta_sum / TESTLOOPCOUNT >= 1)` + // `assert!(delta_sum >= TESTLOOPCOUNT)` + if delta_sum < TESTLOOPCOUNT { + return Err(TimerError::TinyVariantions); + } + + // Ensure that we have variations in the time stamp below 100 for at + // least 10% of all checks -- on some platforms, the counter increments + // in multiples of 100, but not always + if count_mod > (TESTLOOPCOUNT * 9 / 10) { + return Err(TimerError::CoarseTimer); + } + + // If we have more than 90% stuck results, then this Jitter RNG is + // likely to not work well. + if count_stuck > (TESTLOOPCOUNT * 9 / 10) { + return Err(TimerError::TooManyStuck); + } + + // Estimate the number of `measure_jitter` rounds necessary for 64 bits + // of entropy. + // + // We don't try very hard to come up with a good estimate of the + // available bits of entropy per round here for two reasons: + // 1. Simple estimates of the available bits (like Shannon entropy) are + // too optimistic. + // 2. Unless we want to waste a lot of time during intialization, there + // only a small number of samples are available. + // + // Therefore we use a very simple and conservative estimate: + // `let bits_of_entropy = log2(delta_average) / 2`. + // + // The number of rounds `measure_jitter` should run to collect 64 bits + // of entropy is `64 / bits_of_entropy`. + let delta_average = delta_sum / TESTLOOPCOUNT; + + if delta_average >= 16 { + let log2 = 64 - delta_average.leading_zeros(); + // Do something similar to roundup(64/(log2/2)): + Ok( ((64u32 * 2 + log2 - 1) / log2) as u8) + } else { + // For values < 16 the rounding error becomes too large, use a + // lookup table. + // Values 0 and 1 are invalid, and filtered out by the + // `delta_sum < TESTLOOPCOUNT` test above. + let log2_lookup = [0, 0, 128, 81, 64, 56, 50, 46, + 43, 41, 39, 38, 36, 35, 34, 33]; + Ok(log2_lookup[delta_average as usize]) + } + } + + /// Statistical test: return the timer delta of one normal run of the + /// `JitterRng` entropy collector. + /// + /// Setting `var_rounds` to `true` will execute the memory access and the + /// CPU jitter noice sources a variable amount of times (just like a real + /// `JitterRng` round). + /// + /// Setting `var_rounds` to `false` will execute the noice sources the + /// minimal number of times. This can be used to measure the minimum amount + /// of entropy one round of the entropy collector can collect in the worst + /// case. + /// + /// See this crate's README on how to use `timer_stats` to test the quality + /// of `JitterRng`. + pub fn timer_stats(&mut self, var_rounds: bool) -> i64 { + let mut mem = [0; MEMORY_SIZE]; + + let time = (self.timer)(); + self.memaccess(&mut mem, var_rounds); + self.lfsr_time(time, var_rounds); + let time2 = (self.timer)(); + time2.wrapping_sub(time) as i64 + } +} + +// A function that is opaque to the optimizer to assist in avoiding dead-code +// elimination. Taken from `bencher`. +fn black_box(dummy: T) -> T { + unsafe { + let ret = ptr::read_volatile(&dummy); + mem::forget(dummy); + ret + } +} + +impl RngCore for JitterRng { + fn next_u32(&mut self) -> u32 { + // We want to use both parts of the generated entropy + if self.data_half_used { + self.data_half_used = false; + (self.data >> 32) as u32 + } else { + self.data = self.next_u64(); + self.data_half_used = true; + self.data as u32 + } + } + + fn next_u64(&mut self) -> u64 { + self.data_half_used = false; + self.gen_entropy() + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + // Fill using `next_u32`. This is faster for filling small slices (four + // bytes or less), while the overhead is negligible. + // + // This is done especially for wrappers that implement `next_u32` + // themselves via `fill_bytes`. + impls::fill_bytes_via_next(self, dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} + +impl CryptoRng for JitterRng {} + diff --git a/vendor/registry-40351f815f426200/rand_jitter/src/platform.rs b/vendor/registry-40351f815f426200/rand_jitter/src/platform.rs new file mode 100644 index 000000000..8e3d0fb22 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/src/platform.rs @@ -0,0 +1,44 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2015 The Rust Project 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. + +#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "windows")))] +pub fn get_nstime() -> u64 { + use std::time::{SystemTime, UNIX_EPOCH}; + + let dur = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); + // The correct way to calculate the current time is + // `dur.as_secs() * 1_000_000_000 + dur.subsec_nanos() as u64` + // But this is faster, and the difference in terms of entropy is + // negligible (log2(10^9) == 29.9). + dur.as_secs() << 30 | dur.subsec_nanos() as u64 +} + +#[cfg(any(target_os = "macos", target_os = "ios"))] +pub fn get_nstime() -> u64 { + use libc; + + // On Mac OS and iOS std::time::SystemTime only has 1000ns resolution. + // We use `mach_absolute_time` instead. This provides a CPU dependent + // unit, to get real nanoseconds the result should by multiplied by + // numer/denom from `mach_timebase_info`. + // But we are not interested in the exact nanoseconds, just entropy. So + // we use the raw result. + unsafe { libc::mach_absolute_time() } +} + +#[cfg(target_os = "windows")] +pub fn get_nstime() -> u64 { + use winapi; + + unsafe { + let mut t = super::mem::zeroed(); + winapi::um::profileapi::QueryPerformanceCounter(&mut t); + *t.QuadPart() as u64 + } +} diff --git a/vendor/registry-40351f815f426200/rand_jitter/tests/mod.rs b/vendor/registry-40351f815f426200/rand_jitter/tests/mod.rs new file mode 100644 index 000000000..6820c2080 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_jitter/tests/mod.rs @@ -0,0 +1,31 @@ +extern crate rand_jitter; +extern crate rand_core; + +use rand_jitter::JitterRng; +#[cfg(feature = "std")] +use rand_core::RngCore; + +#[cfg(feature = "std")] +#[test] +fn test_jitter_init() { + // Because this is a debug build, measurements here are not representive + // of the final release build. + // Don't fail this test if initializing `JitterRng` fails because of a + // bad timer (the timer from the standard library may not have enough + // accuracy on all platforms). + match JitterRng::new() { + Ok(ref mut rng) => { + // false positives are possible, but extremely unlikely + assert!(rng.next_u32() | rng.next_u32() != 0); + }, + Err(_) => {}, + } +} + +#[test] +fn test_jitter_bad_timer() { + fn bad_timer() -> u64 { 0 } + let mut rng = JitterRng::new_with_timer(bad_timer); + assert!(rng.test_timer().is_err()); +} + diff --git a/vendor/registry-40351f815f426200/rand_os/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_os/.cargo-checksum.json new file mode 100644 index 000000000..6adb38d12 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"b109ac9f2501be2151402585c5278ba9db30d1b880139f0f67aadcd7a9f85506","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"cb81ac6d2ae3ccec84cb897d1c2c4fe53986065424b46fea3ca4e15bca47db05","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"91ccce04b8ea75d26b78f155b578b92be283b2e740d94192ade9eaa3d59c8c27","src/cloudabi.rs":"4f9f9991a1ef7dc330e81ee5208fcc23ad6acc2c73c257b019a3aa488f3a1291","src/dragonfly_haiku_emscripten.rs":"8e693952f38b2576ce7c454cc51d0209917ec40f2a3224ff0f138f798d2c82b3","src/dummy_log.rs":"4e26589c18de568b7da7f0ccc9b77bb430961739a6510c2b043a43dee300c6fa","src/freebsd.rs":"6b1e0a3735d798d8297a9426721e01672424cc289707dae86e336a207cd43436","src/fuchsia.rs":"61159ae3fa469a40214b7ad2f9b0445ed952944c0d5738cd3b7c045eb3e5034a","src/lib.rs":"7d5bd0b5565f7dff4dc352608ab2fb95737dba9b5576fe70b57dcd90e1f11411","src/linux_android.rs":"24b113ef388a2b734ac7a47e045527edac4fe5f29e5ca7948c9a6edf3f69a111","src/macos.rs":"17ccfd5a69068db0580480f680398e20d9ed5219abd726c90e5d9db509539608","src/netbsd.rs":"1b00923bd48673e709cc3f4efd47111093d5bfb86643c8647dd30aeaf5aa6fce","src/openbsd_bitrig.rs":"b9601aa0c6cc0129913341adba838aa0fadd698563eca7f0b046e31c97f0ac92","src/random_device.rs":"bc9cf2470619a90bb8444a632a873e431f801cc3230977851e20d54d86093321","src/redox.rs":"c3fd6f418f085d3b5ffaa6ff4540380cf437cbd65c8b87f89c1dbe16222539e4","src/sgx.rs":"140cf6529ebbf28a19c112e6f325ecd9d84427cc962895795e427cb5b1fa8500","src/solarish.rs":"2c39d2b28a4b9568a378b78b2021bf633fef505d9c5fed2e0a50e90ed9711359","src/wasm32_bindgen.rs":"befe5b8a90ed23c2b3adf40281651966a5ee15ae520101704b68890ec4fb4529","src/wasm32_stdweb.rs":"8684b8ce392941c9d7864d45f82e5a4577fc63b0f0bb709fa627f8b9c9e154a6","src/windows.rs":"d72d555013440aeffe764d961a0a095f8a11417d28a13c2a8882abce2dc000f0","tests/mod.rs":"b8a6caeb5aafd13de775488168b0b46592336568ded37be713e422f724f6f086"},"package":"7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_os/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_os/CHANGELOG.md new file mode 100644 index 000000000..1ce36fc6c --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/CHANGELOG.md @@ -0,0 +1,22 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + + +## [0.1.3] - 2019-03-05 +### Changes +- Fix support for Illumos (#730) +- Fix deprecation warnings from atomic init (#739) + +## [0.1.2] - 2019-01-28 +### Changes +- Fuchsia: Replaced fuchsia-zircon with fuchsia-cprng + +## [0.1.1] - 2019-01-08 +### Additions +- Add support for x86_64-fortanix-unknown-sgx target (#670) + +## [0.1.0] - 2019-01-04 +Initial release. diff --git a/vendor/registry-40351f815f426200/rand_os/COPYRIGHT b/vendor/registry-40351f815f426200/rand_os/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_os/Cargo.toml b/vendor/registry-40351f815f426200/rand_os/Cargo.toml new file mode 100644 index 000000000..d0f1dfe7a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/Cargo.toml @@ -0,0 +1,53 @@ +# 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 = "rand_os" +version = "0.1.3" +authors = ["The Rand Project Developers"] +description = "OS backed Random Number Generator" +homepage = "https://crates.io/crates/rand_os" +documentation = "https://docs.rs/rand_os" +readme = "README.md" +keywords = ["random", "rng", "os"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.log] +version = "0.4" +optional = true + +[dependencies.rand_core] +version = "0.4" +features = ["std"] +[target."cfg(target_env = \"sgx\")".dependencies.rdrand] +version = "0.4.0" +[target."cfg(target_os = \"cloudabi\")".dependencies.cloudabi] +version = "0.0.3" +[target."cfg(target_os = \"fuchsia\")".dependencies.fuchsia-cprng] +version = "0.1.0" +[target."cfg(unix)".dependencies.libc] +version = "0.2" +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["minwindef", "ntsecapi", "winnt"] +[target.wasm32-unknown-unknown.dependencies.stdweb] +version = "0.4" +optional = true + +[target.wasm32-unknown-unknown.dependencies.wasm-bindgen] +version = "0.2.12" +optional = true +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_os/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_os/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_os/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_os/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_os/README.md b/vendor/registry-40351f815f426200/rand_os/README.md new file mode 100644 index 000000000..4f48b63de --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/README.md @@ -0,0 +1,33 @@ +# rand_os + +[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_os.svg)](https://crates.io/crates/rand_os) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_os) +[![API](https://docs.rs/rand_os/badge.svg)](https://docs.rs/rand_os) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +A random number generator that retrieves randomness straight from the +operating system. + +This crate depends on [rand_core](https://crates.io/crates/rand_core) and is +part of the [Rand project](https://github.com/rust-random/rand). + +This crate aims to support all of Rust's `std` platforms with a system-provided +entropy source. Unlike other Rand crates, this crate does not support `no_std` +(handling this gracefully is a current discussion topic). + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_os) +- [API documentation (docs.rs)](https://docs.rs/rand_os) +- [Changelog](CHANGELOG.md) + +## License + +`rand_os` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_os/src/cloudabi.rs b/vendor/registry-40351f815f426200/rand_os/src/cloudabi.rs new file mode 100644 index 000000000..8b96a2bc9 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/cloudabi.rs @@ -0,0 +1,39 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for CloudABI + +extern crate cloudabi; + +use std::io; +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +#[derive(Clone, Debug)] +pub struct OsRng; + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let errno = unsafe { cloudabi::random_get(dest) }; + if errno == cloudabi::errno::SUCCESS { + Ok(()) + } else { + // Cloudlibc provides its own `strerror` implementation so we + // can use `from_raw_os_error` here. + Err(Error::with_cause( + ErrorKind::Unavailable, + "random_get() system call failed", + io::Error::from_raw_os_error(errno as i32), + )) + } + } + + fn method_str(&self) -> &'static str { "cloudabi::random_get" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/dragonfly_haiku_emscripten.rs b/vendor/registry-40351f815f426200/rand_os/src/dragonfly_haiku_emscripten.rs new file mode 100644 index 000000000..6132d7ac3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/dragonfly_haiku_emscripten.rs @@ -0,0 +1,39 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for DragonFly / Haiku / Emscripten + +use rand_core::Error; +use super::random_device; +use super::OsRngImpl; +use std::fs::File; + +#[derive(Clone, Debug)] +pub struct OsRng(); + +impl OsRngImpl for OsRng { + fn new() -> Result { + random_device::open("/dev/random", &|p| File::open(p))?; + Ok(OsRng()) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + random_device::read(dest) + } + + #[cfg(target_os = "emscripten")] + fn max_chunk_size(&self) -> usize { + // `Crypto.getRandomValues` documents `dest` should be at most 65536 + // bytes. `crypto.randomBytes` documents: "To minimize threadpool + // task length variation, partition large randomBytes requests when + // doing so as part of fulfilling a client request. + 65536 + } + + fn method_str(&self) -> &'static str { "/dev/random" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/dummy_log.rs b/vendor/registry-40351f815f426200/rand_os/src/dummy_log.rs new file mode 100644 index 000000000..ccfe4baef --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/dummy_log.rs @@ -0,0 +1,10 @@ +#[allow(unused)] +macro_rules! trace { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! debug { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! info { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! warn { ($($x:tt)*) => () } +#[allow(unused)] +macro_rules! error { ($($x:tt)*) => () } diff --git a/vendor/registry-40351f815f426200/rand_os/src/freebsd.rs b/vendor/registry-40351f815f426200/rand_os/src/freebsd.rs new file mode 100644 index 000000000..6b8e6728a --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/freebsd.rs @@ -0,0 +1,45 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for FreeBSD + +extern crate libc; + +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +use std::ptr; +use std::io; + +#[derive(Clone, Debug)] +pub struct OsRng; + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let mib = [libc::CTL_KERN, libc::KERN_ARND]; + let mut len = dest.len(); + let ret = unsafe { + libc::sysctl(mib.as_ptr(), mib.len() as libc::c_uint, + dest.as_mut_ptr() as *mut _, &mut len, + ptr::null(), 0) + }; + if ret == -1 || len != dest.len() { + return Err(Error::with_cause( + ErrorKind::Unavailable, + "kern.arandom sysctl failed", + io::Error::last_os_error())); + } + Ok(()) + } + + fn max_chunk_size(&self) -> usize { 256 } + + fn method_str(&self) -> &'static str { "kern.arandom" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/fuchsia.rs b/vendor/registry-40351f815f426200/rand_os/src/fuchsia.rs new file mode 100644 index 000000000..ada367761 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/fuchsia.rs @@ -0,0 +1,28 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for Fuchsia Zircon + +extern crate fuchsia_cprng; + +use rand_core::Error; +use super::OsRngImpl; + +#[derive(Clone, Debug)] +pub struct OsRng; + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + fuchsia_cprng::cprng_draw(dest); + Ok(()) + } + + fn method_str(&self) -> &'static str { "cprng_draw" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/lib.rs b/vendor/registry-40351f815f426200/rand_os/src/lib.rs new file mode 100644 index 000000000..1b9cb2548 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/lib.rs @@ -0,0 +1,440 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2013-2015 The Rust Project 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. + +//! Interface to the random number generator of the operating system. +//! +//! [`OsRng`] is the preferred external source of entropy for most applications. +//! Commonly it is used to initialize a user-space RNG, which can then be used +//! to generate random values with much less overhead than `OsRng`. +//! +//! You may prefer to use [`EntropyRng`] instead of `OsRng`. It is unlikely, but +//! not entirely theoretical, for `OsRng` to fail. In such cases [`EntropyRng`] +//! falls back on a good alternative entropy source. +//! +//! [`OsRng::new()`] is guaranteed to be very cheap (after the first successful +//! call), and will never consume more than one file handle per process. +//! +//! # Usage example +//! ``` +//! use rand_os::OsRng; +//! use rand_os::rand_core::RngCore; +//! +//! let mut os_rng = OsRng::new().unwrap(); +//! let mut key = [0u8; 16]; +//! os_rng.fill_bytes(&mut key); +//! let random_u64 = os_rng.next_u64(); +//! ``` +//! +//! # Platform sources +//! +//! | OS | interface +//! |------------------|--------------------------------------------------------- +//! | Linux, Android | [`getrandom`][1] system call if available, otherwise [`/dev/urandom`][2] after reading from `/dev/random` once +//! | Windows | [`RtlGenRandom`][3] +//! | macOS, iOS | [`SecRandomCopyBytes`][4] +//! | FreeBSD | [`kern.arandom`][5] +//! | OpenBSD, Bitrig | [`getentropy`][6] +//! | NetBSD | [`/dev/urandom`][7] after reading from `/dev/random` once +//! | Dragonfly BSD | [`/dev/random`][8] +//! | Solaris, illumos | [`getrandom`][9] system call if available, otherwise [`/dev/random`][10] +//! | Fuchsia OS | [`cprng_draw`][11] +//! | Redox | [`rand:`][12] +//! | CloudABI | [`random_get`][13] +//! | Haiku | `/dev/random` (identical to `/dev/urandom`) +//! | Web browsers | [`Crypto.getRandomValues`][14] (see [Support for WebAssembly and ams.js][14]) +//! | Node.js | [`crypto.randomBytes`][15] (see [Support for WebAssembly and ams.js][16]) +//! +//! Rand doesn't have a blanket implementation for all Unix-like operating +//! systems that reads from `/dev/urandom`. This ensures all supported operating +//! systems are using the recommended interface and respect maximum buffer +//! sizes. +//! +//! ## Support for WebAssembly and ams.js +//! +//! The three Emscripten targets `asmjs-unknown-emscripten`, +//! `wasm32-unknown-emscripten` and `wasm32-experimental-emscripten` use +//! Emscripten's emulation of `/dev/random` on web browsers and Node.js. +//! +//! The bare WASM target `wasm32-unknown-unknown` tries to call the javascript +//! methods directly, using either `stdweb` or `wasm-bindgen` depending on what +//! features are activated for this crate. Note that if both features are +//! enabled `wasm-bindgen` will be used. +//! +//! ## Early boot +//! +//! It is possible that early in the boot process the OS hasn't had enough time +//! yet to collect entropy to securely seed its RNG, especially on virtual +//! machines. +//! +//! Some operating systems always block the thread until the RNG is securely +//! seeded. This can take anywhere from a few seconds to more than a minute. +//! Others make a best effort to use a seed from before the shutdown and don't +//! document much. +//! +//! A few, Linux, NetBSD and Solaris, offer a choice between blocking, and +//! getting an error. With `try_fill_bytes` we choose to get the error +//! ([`ErrorKind::NotReady`]), while the other methods use a blocking interface. +//! +//! On Linux (when the `genrandom` system call is not available) and on NetBSD +//! reading from `/dev/urandom` never blocks, even when the OS hasn't collected +//! enough entropy yet. As a countermeasure we try to do a single read from +//! `/dev/random` until we know the OS RNG is initialized (and store this in a +//! global static). +//! +//! # Panics and error handling +//! +//! We cannot guarantee that `OsRng` will fail, but if it does, it will likely +//! be either when `OsRng::new()` is first called or when data is first read. +//! If you wish to catch errors early, then test reading of at least one byte +//! from `OsRng` via [`try_fill_bytes`]. If this succeeds, it is extremely +//! unlikely that any further errors will occur. +//! +//! Only [`try_fill_bytes`] is able to report the cause of an error; the other +//! [`RngCore`] methods may (depending on the error kind) retry several times, +//! but must eventually panic if the error persists. +//! +//! [`EntropyRng`]: ../rand/rngs/struct.EntropyRng.html +//! [`try_fill_bytes`]: RngCore::try_fill_bytes +//! [`ErrorKind::NotReady`]: rand_core::ErrorKind +//! +//! [1]: http://man7.org/linux/man-pages/man2/getrandom.2.html +//! [2]: http://man7.org/linux/man-pages/man4/urandom.4.html +//! [3]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387694.aspx +//! [4]: https://developer.apple.com/documentation/security/1399291-secrandomcopybytes?language=objc +//! [5]: https://www.freebsd.org/cgi/man.cgi?query=random&sektion=4 +//! [6]: https://man.openbsd.org/getentropy.2 +//! [7]: http://netbsd.gw.com/cgi-bin/man-cgi?random+4+NetBSD-current +//! [8]: https://leaf.dragonflybsd.org/cgi/web-man?command=random§ion=4 +//! [9]: https://docs.oracle.com/cd/E88353_01/html/E37841/getrandom-2.html +//! [10]: https://docs.oracle.com/cd/E86824_01/html/E54777/random-7d.html +//! [11]: https://fuchsia.googlesource.com/zircon/+/HEAD/docs/syscalls/cprng_draw.md +//! [12]: https://github.com/redox-os/randd/blob/master/src/main.rs +//! [13]: https://github.com/NuxiNL/cloudabi/blob/v0.20/cloudabi.txt#L1826 +//! [14]: https://www.w3.org/TR/WebCryptoAPI/#Crypto-method-getRandomValues +//! [15]: https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback +//! [16]: #support-for-webassembly-and-amsjs +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] +#![doc(test(attr(allow(unused_variables), deny(warnings))))] + +#![cfg_attr(feature = "stdweb", recursion_limit="128")] + +pub extern crate rand_core; +#[cfg(feature = "log")] +#[macro_use] extern crate log; + +// We have to do it here because we load macros +#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten"), + feature = "wasm-bindgen"))] +extern crate wasm_bindgen; +#[cfg(all(target_arch = "wasm32", not(target_os = "emscripten"), + not(feature = "wasm-bindgen"), + feature = "stdweb"))] +#[macro_use] extern crate stdweb; + +#[cfg(target_env = "sgx")] +extern crate rdrand; + +#[cfg(not(feature = "log"))] +#[macro_use] +mod dummy_log; + +use std::fmt; +use rand_core::{CryptoRng, RngCore, Error, impls}; + +/// A random number generator that retrieves randomness straight from the +/// operating system. +#[derive(Clone)] +pub struct OsRng(imp::OsRng); + +impl fmt::Debug for OsRng { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +impl OsRng { + /// Create a new `OsRng`. + pub fn new() -> Result { + imp::OsRng::new().map(OsRng) + } +} + +impl CryptoRng for OsRng {} + +impl RngCore for OsRng { + fn next_u32(&mut self) -> u32 { + impls::next_u32_via_fill(self) + } + + fn next_u64(&mut self) -> u64 { + impls::next_u64_via_fill(self) + } + + fn fill_bytes(&mut self, dest: &mut [u8]) { + use std::{time, thread}; + + // We cannot return Err(..), so we try to handle before panicking. + const MAX_RETRY_PERIOD: u32 = 10; // max 10s + const WAIT_DUR_MS: u32 = 100; // retry every 100ms + let wait_dur = time::Duration::from_millis(WAIT_DUR_MS as u64); + const RETRY_LIMIT: u32 = (MAX_RETRY_PERIOD * 1000) / WAIT_DUR_MS; + const TRANSIENT_RETRIES: u32 = 8; + let mut err_count = 0; + let mut error_logged = false; + + // Maybe block until the OS RNG is initialized + let mut read = 0; + if let Ok(n) = self.0.test_initialized(dest, true) { read = n }; + let dest = &mut dest[read..]; + + loop { + if let Err(e) = self.try_fill_bytes(dest) { + if err_count >= RETRY_LIMIT { + error!("OsRng failed too many times; last error: {}", e); + panic!("OsRng failed too many times; last error: {}", e); + } + + if e.kind.should_wait() { + if !error_logged { + warn!("OsRng failed; waiting up to {}s and retrying. Error: {}", + MAX_RETRY_PERIOD, e); + error_logged = true; + } + err_count += 1; + thread::sleep(wait_dur); + continue; + } else if e.kind.should_retry() { + if !error_logged { + warn!("OsRng failed; retrying up to {} times. Error: {}", + TRANSIENT_RETRIES, e); + error_logged = true; + } + err_count += (RETRY_LIMIT + TRANSIENT_RETRIES - 1) + / TRANSIENT_RETRIES; // round up + continue; + } else { + error!("OsRng failed: {}", e); + panic!("OsRng fatal error: {}", e); + } + } + + break; + } + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + // Some systems do not support reading 0 random bytes. + // (And why waste a system call?) + if dest.len() == 0 { return Ok(()); } + + let read = self.0.test_initialized(dest, false)?; + let dest = &mut dest[read..]; + + let max = self.0.max_chunk_size(); + if dest.len() <= max { + trace!("OsRng: reading {} bytes via {}", + dest.len(), self.0.method_str()); + } else { + trace!("OsRng: reading {} bytes via {} in {} chunks of {} bytes", + dest.len(), self.0.method_str(), (dest.len() + max) / max, max); + } + for slice in dest.chunks_mut(max) { + self.0.fill_chunk(slice)?; + } + Ok(()) + } +} + +trait OsRngImpl where Self: Sized { + // Create a new `OsRng` platform interface. + fn new() -> Result; + + // Fill a chunk with random bytes. + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error>; + + // Test whether the OS RNG is initialized. This method may not be possible + // to support cheaply (or at all) on all operating systems. + // + // If `blocking` is set, this will cause the OS the block execution until + // its RNG is initialized. + // + // Random values that are read while this are stored in `dest`, the amount + // of read bytes is returned. + fn test_initialized(&mut self, _dest: &mut [u8], _blocking: bool) + -> Result { Ok(0) } + + // Maximum chunk size supported. + fn max_chunk_size(&self) -> usize { ::std::usize::MAX } + + // Name of the OS interface (used for logging). + fn method_str(&self) -> &'static str; +} + +#[cfg(any(target_os = "linux", target_os = "android", + target_os = "netbsd", target_os = "dragonfly", + target_os = "solaris", target_os = "redox", + target_os = "haiku", target_os = "emscripten", + target_os = "illumos"))] +mod random_device; + +macro_rules! mod_use { + ($cond:meta, $module:ident) => { + #[$cond] + mod $module; + #[$cond] + use $module as imp; + } +} + +mod_use!(cfg(target_os = "android"), linux_android); +mod_use!(cfg(target_os = "bitrig"), openbsd_bitrig); +mod_use!(cfg(target_os = "cloudabi"), cloudabi); +mod_use!(cfg(target_os = "dragonfly"), dragonfly_haiku_emscripten); +mod_use!(cfg(target_os = "emscripten"), dragonfly_haiku_emscripten); +mod_use!(cfg(target_os = "freebsd"), freebsd); +mod_use!(cfg(target_os = "fuchsia"), fuchsia); +mod_use!(cfg(target_os = "haiku"), dragonfly_haiku_emscripten); +mod_use!(cfg(target_os = "ios"), macos); +mod_use!(cfg(target_os = "linux"), linux_android); +mod_use!(cfg(target_os = "macos"), macos); +mod_use!(cfg(target_os = "netbsd"), netbsd); +mod_use!(cfg(target_os = "openbsd"), openbsd_bitrig); +mod_use!(cfg(target_os = "redox"), redox); +mod_use!(cfg(any(target_os = "solaris", target_os = "illumos")), solarish); +mod_use!(cfg(windows), windows); +mod_use!(cfg(target_env = "sgx"), sgx); + +mod_use!( + cfg(all( + target_arch = "wasm32", + not(target_os = "emscripten"), + feature = "wasm-bindgen" + )), + wasm32_bindgen +); + +mod_use!( + cfg(all( + target_arch = "wasm32", + not(target_os = "emscripten"), + not(feature = "wasm-bindgen"), + feature = "stdweb", + )), + wasm32_stdweb +); + +/// Per #678 we use run-time failure where WASM bindings are missing +#[cfg(all( + target_arch = "wasm32", + not(target_os = "emscripten"), + not(feature = "wasm-bindgen"), + not(feature = "stdweb"), +))] +mod imp { + use rand_core::{Error, ErrorKind}; + use super::OsRngImpl; + + #[derive(Clone, Debug)] + pub struct OsRng; + + impl OsRngImpl for OsRng { + fn new() -> Result { + Err(Error::new(ErrorKind::Unavailable, + "OsRng: support for wasm32 requires emscripten, stdweb or wasm-bindgen")) + } + + fn fill_chunk(&mut self, _dest: &mut [u8]) -> Result<(), Error> { + unimplemented!() + } + + fn method_str(&self) -> &'static str { unimplemented!() } + } +} + +#[cfg(not(any( + target_os = "android", + target_os = "bitrig", + target_os = "cloudabi", + target_os = "dragonfly", + target_os = "emscripten", + target_os = "freebsd", + target_os = "fuchsia", + target_os = "haiku", + target_os = "ios", + target_os = "linux", + target_os = "macos", + target_os = "netbsd", + target_os = "openbsd", + target_os = "redox", + target_os = "solaris", + target_os = "illumos", + windows, + target_arch = "wasm32", + target_env = "sgx" +)))] +compile_error!("OS RNG support is not available for this platform"); + +// Due to rustwasm/wasm-bindgen#201 this can't be defined in the inner os +// modules, so hack around it for now and place it at the root. +#[cfg(all(feature = "wasm-bindgen", target_arch = "wasm32"))] +#[doc(hidden)] +#[allow(missing_debug_implementations)] +pub mod __wbg_shims { + + // `extern { type Foo; }` isn't supported on 1.22 syntactically, so use a + // macro to work around that. + macro_rules! rust_122_compat { + ($($t:tt)*) => ($($t)*) + } + + rust_122_compat! { + extern crate wasm_bindgen; + + pub use wasm_bindgen::prelude::*; + + #[wasm_bindgen] + extern "C" { + pub type Function; + #[wasm_bindgen(constructor)] + pub fn new(s: &str) -> Function; + #[wasm_bindgen(method)] + pub fn call(this: &Function, self_: &JsValue) -> JsValue; + + pub type This; + #[wasm_bindgen(method, getter, structural, js_name = self)] + pub fn self_(me: &This) -> JsValue; + #[wasm_bindgen(method, getter, structural)] + pub fn crypto(me: &This) -> JsValue; + + #[derive(Clone, Debug)] + pub type BrowserCrypto; + + // TODO: these `structural` annotations here ideally wouldn't be here to + // avoid a JS shim, but for now with feature detection they're + // unavoidable. + #[wasm_bindgen(method, js_name = getRandomValues, structural, getter)] + pub fn get_random_values_fn(me: &BrowserCrypto) -> JsValue; + #[wasm_bindgen(method, js_name = getRandomValues, structural)] + pub fn get_random_values(me: &BrowserCrypto, buf: &mut [u8]); + + #[wasm_bindgen(js_name = require)] + pub fn node_require(s: &str) -> NodeCrypto; + + #[derive(Clone, Debug)] + pub type NodeCrypto; + + #[wasm_bindgen(method, js_name = randomFillSync, structural)] + pub fn random_fill_sync(me: &NodeCrypto, buf: &mut [u8]); + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/linux_android.rs b/vendor/registry-40351f815f426200/rand_os/src/linux_android.rs new file mode 100644 index 000000000..255c22002 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/linux_android.rs @@ -0,0 +1,186 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for Linux / Android + +extern crate libc; + +use rand_core::{Error, ErrorKind}; +use super::random_device; +use super::OsRngImpl; + +use std::io; +use std::io::Read; +use std::fs::{File, OpenOptions}; +use std::os::unix::fs::OpenOptionsExt; +use std::sync::atomic::{AtomicBool, Ordering}; +#[allow(deprecated)] // Required for compatibility with Rust < 1.24. +use std::sync::atomic::ATOMIC_BOOL_INIT; +use std::sync::{Once, ONCE_INIT}; + +#[derive(Clone, Debug)] +pub struct OsRng { + method: OsRngMethod, + initialized: bool, +} + +#[derive(Clone, Debug)] +enum OsRngMethod { + GetRandom, + RandomDevice, +} + +impl OsRngImpl for OsRng { + fn new() -> Result { + if is_getrandom_available() { + return Ok(OsRng { method: OsRngMethod::GetRandom, + initialized: false }); + } + random_device::open("/dev/urandom", &|p| File::open(p))?; + Ok(OsRng { method: OsRngMethod::RandomDevice, initialized: false }) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + match self.method { + OsRngMethod::GetRandom => getrandom_try_fill(dest, false), + OsRngMethod::RandomDevice => random_device::read(dest), + } + } + + fn test_initialized(&mut self, dest: &mut [u8], blocking: bool) + -> Result + { + #[allow(deprecated)] + static OS_RNG_INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT; + if !self.initialized { + self.initialized = OS_RNG_INITIALIZED.load(Ordering::Relaxed); + } + if self.initialized { return Ok(0); } + + let result = match self.method { + OsRngMethod::GetRandom => { + getrandom_try_fill(dest, blocking)?; + Ok(dest.len()) + } + OsRngMethod::RandomDevice => { + info!("OsRng: testing random device /dev/random"); + let mut file = OpenOptions::new() + .read(true) + .custom_flags(if blocking { 0 } else { libc::O_NONBLOCK }) + .open("/dev/random") + .map_err(random_device::map_err)?; + file.read(&mut dest[..1]).map_err(random_device::map_err)?; + Ok(1) + } + }; + OS_RNG_INITIALIZED.store(true, Ordering::Relaxed); + self.initialized = true; + result + } + + fn method_str(&self) -> &'static str { + match self.method { + OsRngMethod::GetRandom => "getrandom", + OsRngMethod::RandomDevice => "/dev/urandom", + } + } +} + +#[cfg(target_arch = "x86_64")] +const NR_GETRANDOM: libc::c_long = 318; +#[cfg(target_arch = "x86")] +const NR_GETRANDOM: libc::c_long = 355; +#[cfg(target_arch = "arm")] +const NR_GETRANDOM: libc::c_long = 384; +#[cfg(target_arch = "aarch64")] +const NR_GETRANDOM: libc::c_long = 278; + #[cfg(target_arch = "s390x")] +const NR_GETRANDOM: libc::c_long = 349; +#[cfg(target_arch = "powerpc")] +const NR_GETRANDOM: libc::c_long = 359; +#[cfg(target_arch = "powerpc64")] +const NR_GETRANDOM: libc::c_long = 359; +#[cfg(target_arch = "mips")] // old ABI +const NR_GETRANDOM: libc::c_long = 4353; +#[cfg(target_arch = "mips64")] +const NR_GETRANDOM: libc::c_long = 5313; +#[cfg(target_arch = "sparc")] +const NR_GETRANDOM: libc::c_long = 347; +#[cfg(target_arch = "sparc64")] +const NR_GETRANDOM: libc::c_long = 347; +#[cfg(not(any(target_arch = "x86_64", target_arch = "x86", + target_arch = "arm", target_arch = "aarch64", + target_arch = "s390x", target_arch = "powerpc", + target_arch = "powerpc64", target_arch = "mips", + target_arch = "mips64", target_arch = "sparc", + target_arch = "sparc64")))] +const NR_GETRANDOM: libc::c_long = 0; + +fn getrandom(buf: &mut [u8], blocking: bool) -> libc::c_long { + const GRND_NONBLOCK: libc::c_uint = 0x0001; + + if NR_GETRANDOM == 0 { return -1 }; + + unsafe { + libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), + if blocking { 0 } else { GRND_NONBLOCK }) + } +} + +fn getrandom_try_fill(dest: &mut [u8], blocking: bool) -> Result<(), Error> { + let mut read = 0; + while read < dest.len() { + let result = getrandom(&mut dest[read..], blocking); + if result == -1 { + let err = io::Error::last_os_error(); + let kind = err.kind(); + if kind == io::ErrorKind::Interrupted { + continue; + } else if kind == io::ErrorKind::WouldBlock { + return Err(Error::with_cause( + ErrorKind::NotReady, + "getrandom not ready", + err, + )); + } else { + return Err(Error::with_cause( + ErrorKind::Unavailable, + "unexpected getrandom error", + err, + )); + } + } else { + read += result as usize; + } + } + Ok(()) +} + +fn is_getrandom_available() -> bool { + static CHECKER: Once = ONCE_INIT; + #[allow(deprecated)] + static AVAILABLE: AtomicBool = ATOMIC_BOOL_INIT; + + if NR_GETRANDOM == 0 { return false }; + + CHECKER.call_once(|| { + debug!("OsRng: testing getrandom"); + let mut buf: [u8; 0] = []; + let result = getrandom(&mut buf, false); + let available = if result == -1 { + let err = io::Error::last_os_error().raw_os_error(); + err != Some(libc::ENOSYS) + } else { + true + }; + AVAILABLE.store(available, Ordering::Relaxed); + info!("OsRng: using {}", if available { "getrandom" } else { "/dev/urandom" }); + }); + + AVAILABLE.load(Ordering::Relaxed) +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/macos.rs b/vendor/registry-40351f815f426200/rand_os/src/macos.rs new file mode 100644 index 000000000..6c67251c0 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/macos.rs @@ -0,0 +1,53 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for MacOS / iOS + +extern crate libc; + +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +use std::io; +use self::libc::{c_int, size_t}; + +#[derive(Clone, Debug)] +pub struct OsRng; + +enum SecRandom {} + +#[allow(non_upper_case_globals)] +const kSecRandomDefault: *const SecRandom = 0 as *const SecRandom; + +#[link(name = "Security", kind = "framework")] +extern { + fn SecRandomCopyBytes(rnd: *const SecRandom, + count: size_t, bytes: *mut u8) -> c_int; +} + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let ret = unsafe { + SecRandomCopyBytes(kSecRandomDefault, + dest.len() as size_t, + dest.as_mut_ptr()) + }; + if ret == -1 { + Err(Error::with_cause( + ErrorKind::Unavailable, + "couldn't generate random bytes", + io::Error::last_os_error())) + } else { + Ok(()) + } + } + + fn method_str(&self) -> &'static str { "SecRandomCopyBytes" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/netbsd.rs b/vendor/registry-40351f815f426200/rand_os/src/netbsd.rs new file mode 100644 index 000000000..34517bfeb --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/netbsd.rs @@ -0,0 +1,57 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for NetBSD + +use rand_core::Error; +use super::random_device; +use super::OsRngImpl; + +use std::fs::File; +use std::io::Read; +use std::sync::atomic::{AtomicBool, Ordering}; +#[allow(deprecated)] // Required for compatibility with Rust < 1.24. +use std::sync::atomic::ATOMIC_BOOL_INIT; + +#[derive(Clone, Debug)] +pub struct OsRng { initialized: bool } + +impl OsRngImpl for OsRng { + fn new() -> Result { + random_device::open("/dev/urandom", &|p| File::open(p))?; + Ok(OsRng { initialized: false }) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + random_device::read(dest) + } + + // Read a single byte from `/dev/random` to determine if the OS RNG is + // already seeded. NetBSD always blocks if not yet ready. + fn test_initialized(&mut self, dest: &mut [u8], _blocking: bool) + -> Result + { + #[allow(deprecated)] + static OS_RNG_INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT; + if !self.initialized { + self.initialized = OS_RNG_INITIALIZED.load(Ordering::Relaxed); + } + if self.initialized { return Ok(0); } + + info!("OsRng: testing random device /dev/random"); + let mut file = + File::open("/dev/random").map_err(random_device::map_err)?; + file.read(&mut dest[..1]).map_err(random_device::map_err)?; + + OS_RNG_INITIALIZED.store(true, Ordering::Relaxed); + self.initialized = true; + Ok(1) + } + + fn method_str(&self) -> &'static str { "/dev/urandom" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/openbsd_bitrig.rs b/vendor/registry-40351f815f426200/rand_os/src/openbsd_bitrig.rs new file mode 100644 index 000000000..c9b35a6c5 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/openbsd_bitrig.rs @@ -0,0 +1,40 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for OpenBSD / Bitrig + +extern crate libc; + +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +use std::io; + +#[derive(Clone, Debug)] +pub struct OsRng; + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let ret = unsafe { + libc::getentropy(dest.as_mut_ptr() as *mut libc::c_void, dest.len()) + }; + if ret == -1 { + return Err(Error::with_cause( + ErrorKind::Unavailable, + "getentropy failed", + io::Error::last_os_error())); + } + Ok(()) + } + + fn max_chunk_size(&self) -> usize { 256 } + + fn method_str(&self) -> &'static str { "getentropy" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/random_device.rs b/vendor/registry-40351f815f426200/rand_os/src/random_device.rs new file mode 100644 index 000000000..5da91940f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/random_device.rs @@ -0,0 +1,70 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Helper functions to read from a random device such as `/dev/urandom`. +//! +//! All instances use a single internal file handle, to prevent possible +//! exhaustion of file descriptors. +use rand_core::{Error, ErrorKind}; +use std::fs::File; +use std::io; +use std::io::Read; +use std::sync::{Once, Mutex, ONCE_INIT}; + +// TODO: remove outer Option when `Mutex::new(None)` is a constant expression +static mut READ_RNG_FILE: Option>> = None; +static READ_RNG_ONCE: Once = ONCE_INIT; + +#[allow(unused)] +pub fn open(path: &'static str, open_fn: F) -> Result<(), Error> + where F: Fn(&'static str) -> Result +{ + READ_RNG_ONCE.call_once(|| { + unsafe { READ_RNG_FILE = Some(Mutex::new(None)) } + }); + + // We try opening the file outside the `call_once` fn because we cannot + // clone the error, thus we must retry on failure. + + let mutex = unsafe { READ_RNG_FILE.as_ref().unwrap() }; + let mut guard = mutex.lock().unwrap(); + if (*guard).is_none() { + info!("OsRng: opening random device {}", path); + let file = open_fn(path).map_err(map_err)?; + *guard = Some(file); + }; + Ok(()) +} + +pub fn read(dest: &mut [u8]) -> Result<(), Error> { + // We expect this function only to be used after `random_device::open` + // was succesful. Therefore we can assume that our memory was set with a + // valid object. + let mutex = unsafe { READ_RNG_FILE.as_ref().unwrap() }; + let mut guard = mutex.lock().unwrap(); + let file = (*guard).as_mut().unwrap(); + + // Use `std::io::read_exact`, which retries on `ErrorKind::Interrupted`. + file.read_exact(dest).map_err(|err| { + Error::with_cause(ErrorKind::Unavailable, + "error reading random device", err) + }) + +} + +pub fn map_err(err: io::Error) -> Error { + match err.kind() { + io::ErrorKind::Interrupted => + Error::new(ErrorKind::Transient, "interrupted"), + io::ErrorKind::WouldBlock => + Error::with_cause(ErrorKind::NotReady, + "OS RNG not yet seeded", err), + _ => Error::with_cause(ErrorKind::Unavailable, + "error while opening random device", err) + } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/redox.rs b/vendor/registry-40351f815f426200/rand_os/src/redox.rs new file mode 100644 index 000000000..36fae2666 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/redox.rs @@ -0,0 +1,30 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for Redox + +use rand_core::Error; +use super::random_device; +use super::OsRngImpl; +use std::fs::File; + +#[derive(Clone, Debug)] +pub struct OsRng(); + +impl OsRngImpl for OsRng { + fn new() -> Result { + random_device::open("rand:", &|p| File::open(p))?; + Ok(OsRng()) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + random_device::read(dest) + } + + fn method_str(&self) -> &'static str { "'rand:'" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/sgx.rs b/vendor/registry-40351f815f426200/rand_os/src/sgx.rs new file mode 100644 index 000000000..43ae0ef79 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/sgx.rs @@ -0,0 +1,38 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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 super::OsRngImpl; +use Error; +use rdrand::RdRand; +use rand_core::RngCore; +use std::fmt::{Debug, Formatter, Result as FmtResult}; + +#[derive(Clone)] +pub struct OsRng{ + gen: RdRand +} + +impl OsRngImpl for OsRng { + fn new() -> Result { + let rng = RdRand::new()?; + Ok(OsRng{ gen: rng }) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + self.gen.try_fill_bytes(dest) + } + + fn method_str(&self) -> &'static str { "RDRAND" } +} + +impl Debug for OsRng { + fn fmt(&self, f: &mut Formatter) -> FmtResult { + f.debug_struct("OsRng") + .finish() + } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/solarish.rs b/vendor/registry-40351f815f426200/rand_os/src/solarish.rs new file mode 100644 index 000000000..471768adc --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/solarish.rs @@ -0,0 +1,195 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for the Solaris family +//! +//! Read from `/dev/random`, with chunks of limited size (1040 bytes). +//! `/dev/random` uses the Hash_DRBG with SHA512 algorithm from NIST SP 800-90A. +//! `/dev/urandom` uses the FIPS 186-2 algorithm, which is considered less +//! secure. We choose to read from `/dev/random`. +//! +//! Since Solaris 11.3 the `getrandom` syscall is available. To make sure we can +//! compile on both Solaris and on OpenSolaris derivatives, that do not have the +//! function, we do a direct syscall instead of calling a library function. +//! +//! We have no way to differentiate between Solaris, illumos, SmartOS, etc. +extern crate libc; + +use rand_core::{Error, ErrorKind}; +use super::random_device; +use super::OsRngImpl; + +use std::io; +use std::io::Read; +use std::fs::{File, OpenOptions}; +use std::os::unix::fs::OpenOptionsExt; +use std::sync::atomic::{AtomicBool, Ordering, AtomicUsize}; +#[allow(deprecated)] // Required for compatibility with Rust < 1.24. +use std::sync::atomic::ATOMIC_BOOL_INIT; +use std::cmp; +use std::mem; + +#[derive(Clone, Debug)] +pub struct OsRng { + method: OsRngMethod, + initialized: bool, +} + +#[derive(Clone, Debug)] +enum OsRngMethod { + GetRandom, + RandomDevice, +} + +impl OsRngImpl for OsRng { + fn new() -> Result { + if is_getrandom_available() { + return Ok(OsRng { method: OsRngMethod::GetRandom, + initialized: false }); + } + let open = |p| OpenOptions::new() + .read(true) + .custom_flags(libc::O_NONBLOCK) + .open(p); + random_device::open("/dev/random", &open)?; + Ok(OsRng { method: OsRngMethod::RandomDevice, initialized: false }) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + match self.method { + OsRngMethod::GetRandom => getrandom_try_fill(dest, false), + OsRngMethod::RandomDevice => random_device::read(dest), + } + } + + fn test_initialized(&mut self, dest: &mut [u8], blocking: bool) + -> Result + { + #[allow(deprecated)] + static OS_RNG_INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT; + if !self.initialized { + self.initialized = OS_RNG_INITIALIZED.load(Ordering::Relaxed); + } + if self.initialized { return Ok(0); } + + let chunk_len = cmp::min(1024, dest.len()); + let dest = &mut dest[..chunk_len]; + + match self.method { + OsRngMethod::GetRandom => getrandom_try_fill(dest, blocking)?, + OsRngMethod::RandomDevice => { + if blocking { + info!("OsRng: testing random device /dev/random"); + // We already have a non-blocking handle, but now need a + // blocking one. Not much choice except opening it twice + let mut file = File::open("/dev/random") + .map_err(random_device::map_err)?; + file.read(dest).map_err(random_device::map_err)?; + } else { + self.fill_chunk(dest)?; + } + } + }; + OS_RNG_INITIALIZED.store(true, Ordering::Relaxed); + self.initialized = true; + Ok(chunk_len) + } + + fn max_chunk_size(&self) -> usize { + // This is the largest size that's guaranteed to not block across + // all the Solarish platforms, though some may allow for larger + // sizes. + 256 + } + + fn method_str(&self) -> &'static str { + match self.method { + OsRngMethod::GetRandom => "getrandom", + OsRngMethod::RandomDevice => "/dev/random", + } + } +} + +#[cfg(target_os = "illumos")] +type GetRandomFn = unsafe extern fn(*mut u8, libc::size_t, libc::c_uint) + -> libc::ssize_t; +#[cfg(target_os = "solaris")] +type GetRandomFn = unsafe extern fn(*mut u8, libc::size_t, libc::c_uint) + -> libc::c_int; + +// Use dlsym to determine if getrandom(2) is present in libc. On Solarish +// systems, the syscall interface is not stable and can change between +// updates. Even worse, issuing unsupported syscalls will cause the system +// to generate a SIGSYS signal (usually terminating the program). +// Instead the stable APIs are exposed via libc. Cache the result of the +// lookup for future calls. This is loosely modeled after the +// libstd::sys::unix::weak macro which unfortunately is not exported. +fn fetch() -> Option { + static FPTR: AtomicUsize = AtomicUsize::new(1); + + if FPTR.load(Ordering::SeqCst) == 1 { + let name = "getrandom\0"; + let addr = unsafe { + libc::dlsym(libc::RTLD_DEFAULT, name.as_ptr() as *const _) as usize + }; + FPTR.store(addr, Ordering::SeqCst); + } + + let ptr = FPTR.load(Ordering::SeqCst); + unsafe { + mem::transmute::>(ptr) + } +} + +fn getrandom(buf: &mut [u8], blocking: bool) -> libc::ssize_t { + const GRND_NONBLOCK: libc::c_uint = 0x0001; + const GRND_RANDOM: libc::c_uint = 0x0002; + + if let Some(rand) = fetch() { + let flag = if blocking { 0 } else { GRND_NONBLOCK } | GRND_RANDOM; + unsafe { + rand(buf.as_mut_ptr(), buf.len(), flag) as libc::ssize_t + } + } else { + -1 + } +} + +fn getrandom_try_fill(dest: &mut [u8], blocking: bool) -> Result<(), Error> { + let result = getrandom(dest, blocking); + if result == -1 || result == 0 { + let err = io::Error::last_os_error(); + let kind = err.kind(); + if kind == io::ErrorKind::WouldBlock { + return Err(Error::with_cause( + ErrorKind::NotReady, + "getrandom not ready", + err, + )); + } else { + return Err(Error::with_cause( + ErrorKind::Unavailable, + "unexpected getrandom error", + err, + )); + } + } else if result != dest.len() as libc::ssize_t { + return Err(Error::new(ErrorKind::Unavailable, + "unexpected getrandom error")); + } + Ok(()) +} + +fn is_getrandom_available() -> bool { + let available = match fetch() { + Some(_) => true, + None => false, + }; + info!("OsRng: using {}", if available { "getrandom" } else { "/dev/random" }); + available +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/wasm32_bindgen.rs b/vendor/registry-40351f815f426200/rand_os/src/wasm32_bindgen.rs new file mode 100644 index 000000000..5ab2d8417 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/wasm32_bindgen.rs @@ -0,0 +1,92 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for WASM via wasm-bindgen + +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; +use super::__wbg_shims::*; + +use wasm_bindgen::prelude::*; + + +#[derive(Clone, Debug)] +pub enum OsRng { + Node(NodeCrypto), + Browser(BrowserCrypto), +} + +impl OsRngImpl for OsRng { + fn new() -> Result { + // First up we need to detect if we're running in node.js or a + // browser. To do this we get ahold of the `this` object (in a bit + // of a roundabout fashion). + // + // Once we have `this` we look at its `self` property, which is + // only defined on the web (either a main window or web worker). + let this = Function::new("return this").call(&JsValue::undefined()); + assert!(this != JsValue::undefined()); + let this = This::from(this); + let is_browser = this.self_() != JsValue::undefined(); + + if !is_browser { + return Ok(OsRng::Node(node_require("crypto"))) + } + + // If `self` is defined then we're in a browser somehow (main window + // or web worker). Here we want to try to use + // `crypto.getRandomValues`, but if `crypto` isn't defined we assume + // we're in an older web browser and the OS RNG isn't available. + let crypto = this.crypto(); + if crypto.is_undefined() { + let msg = "self.crypto is undefined"; + return Err(Error::new(ErrorKind::Unavailable, msg)) + } + + // Test if `crypto.getRandomValues` is undefined as well + let crypto: BrowserCrypto = crypto.into(); + if crypto.get_random_values_fn().is_undefined() { + let msg = "crypto.getRandomValues is undefined"; + return Err(Error::new(ErrorKind::Unavailable, msg)) + } + + // Ok! `self.crypto.getRandomValues` is a defined value, so let's + // assume we can do browser crypto. + Ok(OsRng::Browser(crypto)) + } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + match *self { + OsRng::Node(ref n) => n.random_fill_sync(dest), + OsRng::Browser(ref n) => n.get_random_values(dest), + } + Ok(()) + } + + fn max_chunk_size(&self) -> usize { + match *self { + OsRng::Node(_) => usize::max_value(), + OsRng::Browser(_) => { + // see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues + // + // where it says: + // + // > A QuotaExceededError DOMException is thrown if the + // > requested length is greater than 65536 bytes. + 65536 + } + } + } + + fn method_str(&self) -> &'static str { + match *self { + OsRng::Node(_) => "crypto.randomFillSync", + OsRng::Browser(_) => "crypto.getRandomValues", + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/wasm32_stdweb.rs b/vendor/registry-40351f815f426200/rand_os/src/wasm32_stdweb.rs new file mode 100644 index 000000000..3be0ce6a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/wasm32_stdweb.rs @@ -0,0 +1,107 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for WASM via stdweb + +use std::mem; +use stdweb::unstable::TryInto; +use stdweb::web::error::Error as WebError; +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +#[derive(Clone, Debug)] +enum OsRngMethod { + Browser, + Node +} + +#[derive(Clone, Debug)] +pub struct OsRng(OsRngMethod); + +impl OsRngImpl for OsRng { + fn new() -> Result { + let result = js! { + try { + if ( + typeof self === "object" && + typeof self.crypto === "object" && + typeof self.crypto.getRandomValues === "function" + ) { + return { success: true, ty: 1 }; + } + + if (typeof require("crypto").randomBytes === "function") { + return { success: true, ty: 2 }; + } + + return { success: false, error: new Error("not supported") }; + } catch(err) { + return { success: false, error: err }; + } + }; + + if js!{ return @{ result.as_ref() }.success } == true { + let ty = js!{ return @{ result }.ty }; + + if ty == 1 { Ok(OsRng(OsRngMethod::Browser)) } + else if ty == 2 { Ok(OsRng(OsRngMethod::Node)) } + else { unreachable!() } + } else { + let err: WebError = js!{ return @{ result }.error }.try_into().unwrap(); + Err(Error::with_cause(ErrorKind::Unavailable, "WASM Error", err)) + } + } + + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + assert_eq!(mem::size_of::(), 4); + + let len = dest.len() as u32; + let ptr = dest.as_mut_ptr() as i32; + + let result = match self.0 { + OsRngMethod::Browser => js! { + try { + let array = new Uint8Array(@{ len }); + self.crypto.getRandomValues(array); + HEAPU8.set(array, @{ ptr }); + + return { success: true }; + } catch(err) { + return { success: false, error: err }; + } + }, + OsRngMethod::Node => js! { + try { + let bytes = require("crypto").randomBytes(@{ len }); + HEAPU8.set(new Uint8Array(bytes), @{ ptr }); + + return { success: true }; + } catch(err) { + return { success: false, error: err }; + } + } + }; + + if js!{ return @{ result.as_ref() }.success } == true { + Ok(()) + } else { + let err: WebError = js!{ return @{ result }.error }.try_into().unwrap(); + Err(Error::with_cause(ErrorKind::Unexpected, "WASM Error", err)) + } + } + + fn max_chunk_size(&self) -> usize { 65536 } + + fn method_str(&self) -> &'static str { + match self.0 { + OsRngMethod::Browser => "Crypto.getRandomValues", + OsRngMethod::Node => "crypto.randomBytes", + } + } +} diff --git a/vendor/registry-40351f815f426200/rand_os/src/windows.rs b/vendor/registry-40351f815f426200/rand_os/src/windows.rs new file mode 100644 index 000000000..6b06c7abf --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/src/windows.rs @@ -0,0 +1,44 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! Implementation for Windows + +extern crate winapi; + +use rand_core::{Error, ErrorKind}; +use super::OsRngImpl; + +use std::io; + +use self::winapi::shared::minwindef::ULONG; +use self::winapi::um::ntsecapi::RtlGenRandom; +use self::winapi::um::winnt::PVOID; + +#[derive(Clone, Debug)] +pub struct OsRng; + +impl OsRngImpl for OsRng { + fn new() -> Result { Ok(OsRng) } + + fn fill_chunk(&mut self, dest: &mut [u8]) -> Result<(), Error> { + let ret = unsafe { + RtlGenRandom(dest.as_mut_ptr() as PVOID, dest.len() as ULONG) + }; + if ret == 0 { + return Err(Error::with_cause( + ErrorKind::Unavailable, + "couldn't generate random bytes", + io::Error::last_os_error())); + } + Ok(()) + } + + fn max_chunk_size(&self) -> usize { ::max_value() as usize } + + fn method_str(&self) -> &'static str { "RtlGenRandom" } +} diff --git a/vendor/registry-40351f815f426200/rand_os/tests/mod.rs b/vendor/registry-40351f815f426200/rand_os/tests/mod.rs new file mode 100644 index 000000000..2130e169b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_os/tests/mod.rs @@ -0,0 +1,80 @@ +extern crate rand_os; + +use rand_os::rand_core::RngCore; +use rand_os::OsRng; + +#[test] +fn test_os_rng() { + let mut r = OsRng::new().unwrap(); + + r.next_u32(); + r.next_u64(); + + let mut v1 = [0u8; 1000]; + r.fill_bytes(&mut v1); + + let mut v2 = [0u8; 1000]; + r.fill_bytes(&mut v2); + + let mut n_diff_bits = 0; + for i in 0..v1.len() { + n_diff_bits += (v1[i] ^ v2[i]).count_ones(); + } + + // Check at least 1 bit per byte differs. p(failure) < 1e-1000 with random input. + assert!(n_diff_bits >= v1.len() as u32); +} + +#[test] +fn test_os_rng_empty() { + let mut r = OsRng::new().unwrap(); + + let mut empty = [0u8; 0]; + r.fill_bytes(&mut empty); +} + +#[test] +fn test_os_rng_huge() { + let mut r = OsRng::new().unwrap(); + + let mut huge = [0u8; 100_000]; + r.fill_bytes(&mut huge); +} + +#[cfg(not(any(target_arch = "wasm32", target_arch = "asmjs")))] +#[test] +fn test_os_rng_tasks() { + use std::sync::mpsc::channel; + use std::thread; + + let mut txs = vec!(); + for _ in 0..20 { + let (tx, rx) = channel(); + txs.push(tx); + + thread::spawn(move|| { + // wait until all the tasks are ready to go. + rx.recv().unwrap(); + + // deschedule to attempt to interleave things as much + // as possible (XXX: is this a good test?) + let mut r = OsRng::new().unwrap(); + thread::yield_now(); + let mut v = [0u8; 1000]; + + for _ in 0..100 { + r.next_u32(); + thread::yield_now(); + r.next_u64(); + thread::yield_now(); + r.fill_bytes(&mut v); + thread::yield_now(); + } + }); + } + + // start all the tasks + for tx in txs.iter() { + tx.send(()).unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/rand_pcg/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_pcg/.cargo-checksum.json new file mode 100644 index 000000000..a21533e56 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"f95c32b93b4ba4aac59fcf1d28b1818a8551a450198c075cf5720e71a5db17ef","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"82101af38b08afd05d0b09aae70b578f3d08d7fdc98ed643498e52175d85c09c","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"2234e3cefee876aeb686ad89e978bdb07bf118a1186ab1cf161bcdf69d4b4f57","README.md":"8da8a3dce4abed17df07963b65637cc150093d04d1d7354450afdcee26b0af4f","build.rs":"003108281c4f4bd7a40a93529012acc9d2555c7a4f4b3bfc3ab81d0ed92b8864","src/lib.rs":"443c6e23da72f86d4c0b24698c0d188ee984fce69e4f52d633191399b0051c6c","src/pcg128.rs":"71bc1063e56b0b906aab333438178bb3e636dd1fcdbae2c2452af9143aea5855","src/pcg64.rs":"0b36d28ec2e1cdd630473530785b3143966a4657e52f032e020bb5524be2e044","tests/lcg64xsh32.rs":"5770fb1dd2cce4843de89dccb05f79ffce9c0b8dc68487d09b30b376e8e982e3","tests/mcg128xsl64.rs":"8276f9ce83df0f76b0a242ec35fbbd6a6fcd5aacd9cd9a3b0812b538dc5a70f0"},"package":"abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_pcg/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_pcg/CHANGELOG.md new file mode 100644 index 000000000..695722480 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/CHANGELOG.md @@ -0,0 +1,19 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.2] - 2019-02-23 +- require `bincode` 1.1.2 for i128 auto-detection +- make `bincode` a dev-dependency again #663 +- clean up tests and Serde support + +## [0.1.1] - 2018-10-04 +- make `bincode` an explicit dependency when using Serde + +## [0.1.0] - 2018-10-04 +Initial release, including: + +- `Lcg64Xsh32` aka `Pcg32` +- `Mcg128Xsl64` aka `Pcg64Mcg` diff --git a/vendor/registry-40351f815f426200/rand_pcg/COPYRIGHT b/vendor/registry-40351f815f426200/rand_pcg/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_pcg/Cargo.toml b/vendor/registry-40351f815f426200/rand_pcg/Cargo.toml new file mode 100644 index 000000000..346f2f7bc --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/Cargo.toml @@ -0,0 +1,47 @@ +# 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 = "rand_pcg" +version = "0.1.2" +authors = ["The Rand Project Developers"] +build = "build.rs" +description = "Selected PCG random number generators\n" +homepage = "https://crates.io/crates/rand_pcg" +documentation = "https://rust-random.github.io/rand/rand_pcg" +readme = "README.md" +keywords = ["random", "rng", "pcg"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = "0.4" + +[dependencies.serde] +version = "1" +optional = true + +[dependencies.serde_derive] +version = "^1.0.38" +optional = true +[dev-dependencies.bincode] +version = "1.1.2" +[build-dependencies.autocfg] +version = "0.1" + +[features] +serde1 = ["serde", "serde_derive"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_pcg/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_pcg/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_pcg/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_pcg/LICENSE-MIT new file mode 100644 index 000000000..d46f058e9 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright 2018 Developers of the Rand project + +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/vendor/registry-40351f815f426200/rand_pcg/README.md b/vendor/registry-40351f815f426200/rand_pcg/README.md new file mode 100644 index 000000000..ae583a1a4 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/README.md @@ -0,0 +1,43 @@ +# rand_pcg + +[![Build Status](https://travis-ci.org/rust-random/rand.svg?branch=master)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_pcg.svg)](https://crates.io/crates/rand_pcg) +[[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_pcg) +[![API](https://docs.rs/rand_pcg/badge.svg)](https://docs.rs/rand_pcg) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Implements a selection of PCG random number generators. + +> PCG is a family of simple fast space-efficient statistically good algorithms +> for random number generation. [Melissa O'Neill, Harvey Mudd College, 2014]. + +The PCG algorithms are not suitable for cryptographic uses, but perform well +in statistical tests, use little memory and are fairly fast. +See the [pcg-random website](http://www.pcg-random.org/). + +This crate depends on [rand_core](https://crates.io/crates/rand_core) and is +part of the [Rand project](https://github.com/rust-random/rand). + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_pcg) +- [API documentation (docs.rs)](https://docs.rs/rand_pcg) +- [Changelog](CHANGELOG.md) + + +## Crate Features + +`rand_pcg` is `no_std` compatible by default. + +The `serde1` feature includes implementations of `Serialize` and `Deserialize` +for the included RNGs. + +## License + +`rand_pcg` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_pcg/build.rs b/vendor/registry-40351f815f426200/rand_pcg/build.rs new file mode 100644 index 000000000..06e12a47b --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/build.rs @@ -0,0 +1,7 @@ +extern crate autocfg; + +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + let ac = autocfg::new(); + ac.emit_rustc_version(1, 26); +} diff --git a/vendor/registry-40351f815f426200/rand_pcg/src/lib.rs b/vendor/registry-40351f815f426200/rand_pcg/src/lib.rs new file mode 100644 index 000000000..9648e85d2 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/src/lib.rs @@ -0,0 +1,48 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The PCG random number generators. +//! +//! This is a native Rust implementation of a small selection of PCG generators. +//! The primary goal of this crate is simple, minimal, well-tested code; in +//! other words it is explicitly not a goal to re-implement all of PCG. +//! +//! This crate provides: +//! +//! - `Pcg32` aka `Lcg64Xsh32`, officially known as `pcg32`, a general +//! purpose RNG. This is a good choice on both 32-bit and 64-bit CPUs +//! (for 32-bit output). +//! - `Pcg64Mcg` aka `Mcg128Xsl64`, officially known as `mcg_xsl_rr_128_64`, +//! a general purpose RNG using 128-bit multiplications. This has poor +//! performance on 32-bit CPUs but is a good choice on 64-bit CPUs for +//! both 32-bit and 64-bit output. (Note: this RNG is only available using +//! Rust 1.26 or later.) +//! +//! Both of these use 16 bytes of state and 128-bit seeds, and are considered +//! value-stable (i.e. any change affecting the output given a fixed seed would +//! be considered a breaking change to the crate). + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] + +#![no_std] + +pub extern crate rand_core; + +#[cfg(feature="serde1")] extern crate serde; +#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; + +mod pcg64; +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] mod pcg128; + +pub use self::pcg64::{Pcg32, Lcg64Xsh32}; +#[cfg(all(rustc_1_26, not(target_os = "emscripten")))] pub use self::pcg128::{Pcg64Mcg, Mcg128Xsl64}; diff --git a/vendor/registry-40351f815f426200/rand_pcg/src/pcg128.rs b/vendor/registry-40351f815f426200/rand_pcg/src/pcg128.rs new file mode 100644 index 000000000..9aff50607 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/src/pcg128.rs @@ -0,0 +1,122 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017 Paul Dicker. +// Copyright 2014-2017 Melissa O'Neill and PCG Project contributors +// +// 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. + +//! PCG random number generators + +// This is the default multiplier used by PCG for 64-bit state. +const MULTIPLIER: u128 = 0x2360_ED05_1FC6_5DA4_4385_DF64_9FCC_F645; + +use core::fmt; +use core::mem::transmute; +use rand_core::{RngCore, SeedableRng, Error, le}; + +/// A PCG random number generator (XSL 128/64 (MCG) variant). +/// +/// Permuted Congruential Generator with 128-bit state, internal Multiplicative +/// Congruential Generator, and 64-bit output via "xorshift low (bits), +/// random rotation" output function. +/// +/// This is a 128-bit MCG with the PCG-XSL-RR output function. +/// Note that compared to the standard `pcg64` (128-bit LCG with PCG-XSL-RR +/// output function), this RNG is faster, also has a long cycle, and still has +/// good performance on statistical tests. +/// +/// Note: this RNG is only available using Rust 1.26 or later. +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize,Deserialize))] +pub struct Mcg128Xsl64 { + state: u128, +} + +/// A friendly name for `Mcg128Xsl64`. +pub type Pcg64Mcg = Mcg128Xsl64; + +impl Mcg128Xsl64 { + /// Construct an instance compatible with PCG seed. + /// + /// Note that PCG specifies a default value for the parameter: + /// + /// - `state = 0xcafef00dd15ea5e5` + pub fn new(state: u128) -> Self { + // Force low bit to 1, as in C version (C++ uses `state | 3` instead). + Mcg128Xsl64 { state: state | 1 } + } +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for Mcg128Xsl64 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Mcg128Xsl64 {{}}") + } +} + +/// We use a single 126-bit seed to initialise the state and select a stream. +/// Two `seed` bits (lowest order of last byte) are ignored. +impl SeedableRng for Mcg128Xsl64 { + type Seed = [u8; 16]; + + fn from_seed(seed: Self::Seed) -> Self { + // Read as if a little-endian u128 value: + let mut seed_u64 = [0u64; 2]; + le::read_u64_into(&seed, &mut seed_u64); + let state = (seed_u64[0] as u128) | + (seed_u64[1] as u128) << 64; + Mcg128Xsl64::new(state) + } +} + +impl RngCore for Mcg128Xsl64 { + #[inline] + fn next_u32(&mut self) -> u32 { + self.next_u64() as u32 + } + + #[inline] + fn next_u64(&mut self) -> u64 { + // prepare the LCG for the next round + let state = self.state.wrapping_mul(MULTIPLIER); + self.state = state; + + // Output function XSL RR ("xorshift low (bits), random rotation") + // Constants are for 128-bit state, 64-bit output + const XSHIFT: u32 = 64; // (128 - 64 + 64) / 2 + const ROTATE: u32 = 122; // 128 - 6 + + let rot = (state >> ROTATE) as u32; + let xsl = ((state >> XSHIFT) as u64) ^ (state as u64); + xsl.rotate_right(rot) + } + + #[inline] + fn fill_bytes(&mut self, dest: &mut [u8]) { + // specialisation of impls::fill_bytes_via_next; approx 3x faster + let mut left = dest; + while left.len() >= 8 { + let (l, r) = {left}.split_at_mut(8); + left = r; + let chunk: [u8; 8] = unsafe { + transmute(self.next_u64().to_le()) + }; + l.copy_from_slice(&chunk); + } + let n = left.len(); + if n > 0 { + let chunk: [u8; 8] = unsafe { + transmute(self.next_u64().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } + } + + #[inline] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} diff --git a/vendor/registry-40351f815f426200/rand_pcg/src/pcg64.rs b/vendor/registry-40351f815f426200/rand_pcg/src/pcg64.rs new file mode 100644 index 000000000..9177ec248 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/src/pcg64.rs @@ -0,0 +1,141 @@ +// Copyright 2018 Developers of the Rand project. +// Copyright 2017 Paul Dicker. +// Copyright 2014-2017 Melissa O'Neill and PCG Project contributors +// +// 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. + +//! PCG random number generators + +use core::fmt; +use core::mem::transmute; +use rand_core::{RngCore, SeedableRng, Error, le, impls}; + +// This is the default multiplier used by PCG for 64-bit state. +const MULTIPLIER: u64 = 6364136223846793005; + +/// A PCG random number generator (XSH RR 64/32 (LCG) variant). +/// +/// Permuted Congruential Generator with 64-bit state, internal Linear +/// Congruential Generator, and 32-bit output via "xorshift high (bits), +/// random rotation" output function. +/// +/// This is a 64-bit LCG with explicitly chosen stream with the PCG-XSH-RR +/// output function. This combination is the standard `pcg32`. +/// +/// Despite the name, this implementation uses 16 bytes (128 bit) space +/// comprising 64 bits of state and 64 bits stream selector. These are both set +/// by `SeedableRng`, using a 128-bit seed. +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize,Deserialize))] +pub struct Lcg64Xsh32 { + state: u64, + increment: u64, +} + +/// `Lcg64Xsh32` is also officially known as `pcg32`. +pub type Pcg32 = Lcg64Xsh32; + +impl Lcg64Xsh32 { + /// Construct an instance compatible with PCG seed and stream. + /// + /// Note that PCG specifies default values for both parameters: + /// + /// - `state = 0xcafef00dd15ea5e5` + /// - `stream = 721347520444481703` + pub fn new(state: u64, stream: u64) -> Self { + // The increment must be odd, hence we discard one bit: + let increment = (stream << 1) | 1; + Lcg64Xsh32::from_state_incr(state, increment) + } + + #[inline] + fn from_state_incr(state: u64, increment: u64) -> Self { + let mut pcg = Lcg64Xsh32 { state, increment }; + // Move away from inital value: + pcg.state = pcg.state.wrapping_add(pcg.increment); + pcg.step(); + pcg + } + + #[inline] + fn step(&mut self) { + // prepare the LCG for the next round + self.state = self.state + .wrapping_mul(MULTIPLIER) + .wrapping_add(self.increment); + } +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for Lcg64Xsh32 { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "Lcg64Xsh32 {{}}") + } +} + +/// We use a single 127-bit seed to initialise the state and select a stream. +/// One `seed` bit (lowest bit of `seed[8]`) is ignored. +impl SeedableRng for Lcg64Xsh32 { + type Seed = [u8; 16]; + + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_u64 = [0u64; 2]; + le::read_u64_into(&seed, &mut seed_u64); + + // The increment must be odd, hence we discard one bit: + Lcg64Xsh32::from_state_incr(seed_u64[0], seed_u64[1] | 1) + } +} + +impl RngCore for Lcg64Xsh32 { + #[inline] + fn next_u32(&mut self) -> u32 { + let state = self.state; + self.step(); + + // Output function XSH RR: xorshift high (bits), followed by a random rotate + // Constants are for 64-bit state, 32-bit output + const ROTATE: u32 = 59; // 64 - 5 + const XSHIFT: u32 = 18; // (5 + 32) / 2 + const SPARE: u32 = 27; // 64 - 32 - 5 + + let rot = (state >> ROTATE) as u32; + let xsh = (((state >> XSHIFT) ^ state) >> SPARE) as u32; + xsh.rotate_right(rot) + } + + #[inline] + fn next_u64(&mut self) -> u64 { + impls::next_u64_via_u32(self) + } + + #[inline] + fn fill_bytes(&mut self, dest: &mut [u8]) { + // specialisation of impls::fill_bytes_via_next; approx 40% faster + let mut left = dest; + while left.len() >= 4 { + let (l, r) = {left}.split_at_mut(4); + left = r; + let chunk: [u8; 4] = unsafe { + transmute(self.next_u32().to_le()) + }; + l.copy_from_slice(&chunk); + } + let n = left.len(); + if n > 0 { + let chunk: [u8; 4] = unsafe { + transmute(self.next_u32().to_le()) + }; + left.copy_from_slice(&chunk[..n]); + } + } + + #[inline] + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} diff --git a/vendor/registry-40351f815f426200/rand_pcg/tests/lcg64xsh32.rs b/vendor/registry-40351f815f426200/rand_pcg/tests/lcg64xsh32.rs new file mode 100644 index 000000000..775b12c99 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/tests/lcg64xsh32.rs @@ -0,0 +1,58 @@ +extern crate rand_pcg; +extern crate rand_core; +#[cfg(all(feature="serde1", test))] extern crate bincode; + +use rand_core::{RngCore, SeedableRng}; +use rand_pcg::{Lcg64Xsh32, Pcg32}; + +#[test] +fn test_lcg64xsh32_construction() { + // Test that various construction techniques produce a working RNG. + let seed = [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]; + let mut rng1 = Lcg64Xsh32::from_seed(seed); + assert_eq!(rng1.next_u64(), 1204678643940597513); + + let mut rng2 = Lcg64Xsh32::from_rng(&mut rng1).unwrap(); + assert_eq!(rng2.next_u64(), 12384929573776311845); + + let mut rng3 = Lcg64Xsh32::seed_from_u64(0); + assert_eq!(rng3.next_u64(), 18195738587432868099); + + // This is the same as Lcg64Xsh32, so we only have a single test: + let mut rng4 = Pcg32::seed_from_u64(0); + assert_eq!(rng4.next_u64(), 18195738587432868099); +} + +#[test] +fn test_lcg64xsh32_true_values() { + // Numbers copied from official test suite. + let mut rng = Lcg64Xsh32::new(42, 54); + + let mut results = [0u32; 6]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected: [u32; 6] = [0xa15c02b7, 0x7b47f409, 0xba1d3330, + 0x83d2f293, 0xbfa4784b, 0xcbed606e]; + assert_eq!(results, expected); +} + +#[cfg(feature="serde1")] +#[test] +fn test_lcg64xsh32_serde() { + use bincode; + use std::io::{BufWriter, BufReader}; + + let mut rng = Lcg64Xsh32::seed_from_u64(0); + + let buf: Vec = Vec::new(); + let mut buf = BufWriter::new(buf); + bincode::serialize_into(&mut buf, &rng).expect("Could not serialize"); + + let buf = buf.into_inner().unwrap(); + let mut read = BufReader::new(&buf[..]); + let mut deserialized: Lcg64Xsh32 = bincode::deserialize_from(&mut read) + .expect("Could not deserialize"); + + for _ in 0..16 { + assert_eq!(rng.next_u64(), deserialized.next_u64()); + } +} diff --git a/vendor/registry-40351f815f426200/rand_pcg/tests/mcg128xsl64.rs b/vendor/registry-40351f815f426200/rand_pcg/tests/mcg128xsl64.rs new file mode 100644 index 000000000..3279536fc --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_pcg/tests/mcg128xsl64.rs @@ -0,0 +1,59 @@ +#![cfg(rustc_1_26)] +extern crate rand_pcg; +extern crate rand_core; +#[cfg(all(feature="serde1", test))] extern crate bincode; + +use rand_core::{RngCore, SeedableRng}; +use rand_pcg::{Mcg128Xsl64, Pcg64Mcg}; + +#[test] +fn test_mcg128xsl64_construction() { + // Test that various construction techniques produce a working RNG. + let seed = [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]; + let mut rng1 = Mcg128Xsl64::from_seed(seed); + assert_eq!(rng1.next_u64(), 7071994460355047496); + + let mut rng2 = Mcg128Xsl64::from_rng(&mut rng1).unwrap(); + assert_eq!(rng2.next_u64(), 12300796107712034932); + + let mut rng3 = Mcg128Xsl64::seed_from_u64(0); + assert_eq!(rng3.next_u64(), 6198063878555692194); + + // This is the same as Mcg128Xsl64, so we only have a single test: + let mut rng4 = Pcg64Mcg::seed_from_u64(0); + assert_eq!(rng4.next_u64(), 6198063878555692194); +} + +#[test] +fn test_mcg128xsl64_true_values() { + // Numbers copied from official test suite (C version). + let mut rng = Mcg128Xsl64::new(42); + + let mut results = [0u64; 6]; + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected: [u64; 6] = [0x63b4a3a813ce700a, 0x382954200617ab24, + 0xa7fd85ae3fe950ce, 0xd715286aa2887737, 0x60c92fee2e59f32c, 0x84c4e96beff30017]; + assert_eq!(results, expected); +} + +#[cfg(feature="serde1")] +#[test] +fn test_mcg128xsl64_serde() { + use bincode; + use std::io::{BufWriter, BufReader}; + + let mut rng = Mcg128Xsl64::seed_from_u64(0); + + let buf: Vec = Vec::new(); + let mut buf = BufWriter::new(buf); + bincode::serialize_into(&mut buf, &rng).expect("Could not serialize"); + + let buf = buf.into_inner().unwrap(); + let mut read = BufReader::new(&buf[..]); + let mut deserialized: Mcg128Xsl64 = bincode::deserialize_from(&mut read) + .expect("Could not deserialize"); + + for _ in 0..16 { + assert_eq!(rng.next_u64(), deserialized.next_u64()); + } +} diff --git a/vendor/registry-40351f815f426200/rand_xorshift/.cargo-checksum.json b/vendor/registry-40351f815f426200/rand_xorshift/.cargo-checksum.json new file mode 100644 index 000000000..ce75b5971 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"8b36d20dea31334f1dabb3c4ef2c5d4f373432e5fc4f16ea247f0c8550f21e1a","COPYRIGHT":"90eb64f0279b0d9432accfa6023ff803bc4965212383697eee27a0f426d5f8d5","Cargo.toml":"3fdcb1949fd24244fb3e608a0bb950f3466799207f6f93759addc26fa89cea68","LICENSE-APACHE":"aaff376532ea30a0cd5330b9502ad4a4c8bf769c539c87ffe78819d188a18ebf","LICENSE-MIT":"209fbbe0ad52d9235e37badf9cadfe4dbdc87203179c0899e738b39ade42177b","README.md":"d15ff53ca6f8a7d4791343836e29fe86ce7528029a05f9f327064aaaa01a5368","src/lib.rs":"642ec47c3419708550926cc03f26ca4915e6471dd796d1f1e83b675fb5633649","tests/mod.rs":"533eb0d703ff6154c21d9655c863223e79f81da026dc4abf79c24d2705ae3813"},"package":"cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rand_xorshift/CHANGELOG.md b/vendor/registry-40351f815f426200/rand_xorshift/CHANGELOG.md new file mode 100644 index 000000000..539af4131 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/CHANGELOG.md @@ -0,0 +1,11 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.1] - 2019-01-04 +- Reorganise code and tests; tweak doc + +## [0.1.0] - 2018-07-16 +- Pulled out of the Rand crate diff --git a/vendor/registry-40351f815f426200/rand_xorshift/COPYRIGHT b/vendor/registry-40351f815f426200/rand_xorshift/COPYRIGHT new file mode 100644 index 000000000..468d907ca --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/COPYRIGHT @@ -0,0 +1,12 @@ +Copyrights in the Rand project are retained by their contributors. No +copyright assignment is required to contribute to the Rand project. + +For full authorship information, see the version control history. + +Except as otherwise noted (below and/or in individual files), Rand is +licensed under the Apache License, Version 2.0 or + or the MIT license + or , at your option. + +The Rand project includes code from the Rust project +published under these same licenses. diff --git a/vendor/registry-40351f815f426200/rand_xorshift/Cargo.toml b/vendor/registry-40351f815f426200/rand_xorshift/Cargo.toml new file mode 100644 index 000000000..26aa48129 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/Cargo.toml @@ -0,0 +1,45 @@ +# 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 = "rand_xorshift" +version = "0.1.1" +authors = ["The Rand Project Developers", "The Rust Project Developers"] +description = "Xorshift random number generator\n" +homepage = "https://crates.io/crates/rand_xorshift" +documentation = "https://rust-random.github.io/rand/rand_xorshift" +readme = "README.md" +keywords = ["random", "rng", "xorshift"] +categories = ["algorithms", "no-std"] +license = "MIT/Apache-2.0" +repository = "https://github.com/rust-random/rand" +[dependencies.rand_core] +version = ">=0.2, <0.4" +default-features = false + +[dependencies.serde] +version = "1" +optional = true + +[dependencies.serde_derive] +version = "^1.0.38" +optional = true +[dev-dependencies.bincode] +version = "1" + +[features] +serde1 = ["serde", "serde_derive"] +[badges.appveyor] +repository = "rust-random/rand" + +[badges.travis-ci] +repository = "rust-random/rand" diff --git a/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-APACHE b/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-APACHE new file mode 100644 index 000000000..17d74680f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-APACHE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + https://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 + + https://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/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-MIT b/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-MIT new file mode 100644 index 000000000..d93b5baf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/LICENSE-MIT @@ -0,0 +1,26 @@ +Copyright 2018 Developers of the Rand project +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/vendor/registry-40351f815f426200/rand_xorshift/README.md b/vendor/registry-40351f815f426200/rand_xorshift/README.md new file mode 100644 index 000000000..573ee1231 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/README.md @@ -0,0 +1,45 @@ +# rand_xorshift + +[![Build Status](https://travis-ci.org/rust-random/rand.svg)](https://travis-ci.org/rust-random/rand) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/rust-random/rand?svg=true)](https://ci.appveyor.com/project/rust-random/rand) +[![Latest version](https://img.shields.io/crates/v/rand_xorshift.svg)](https://crates.io/crates/rand_xorshift) +[![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) +[![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_xorshift) +[![API](https://docs.rs/rand_xorshift/badge.svg)](https://docs.rs/rand_xorshift) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) + +Implements the Xorshift random number generator. + +The Xorshift[^1] algorithm is not suitable for cryptographic purposes +but is very fast. If you do not know for sure that it fits your +requirements, use a more secure one such as `StdRng` or `OsRng`. + +[^1]: Marsaglia, George (July 2003). + ["Xorshift RNGs"](https://www.jstatsoft.org/v08/i14/paper). + *Journal of Statistical Software*. Vol. 8 (Issue 14). + +Links: + +- [API documentation (master)](https://rust-random.github.io/rand/rand_xorshift) +- [API documentation (docs.rs)](https://docs.rs/rand_xorshift) +- [Changelog](CHANGELOG.md) + +[rand]: https://crates.io/crates/rand + + +## Crate Features + +`rand_xorshift` is `no_std` compatible. It does not require any functionality +outside of the `core` lib, thus there are no features to configure. + +The `serde1` feature includes implementations of `Serialize` and `Deserialize` +for the included RNGs. + + +## License + +`rand_xorshift` is distributed under the terms of both the MIT license and the +Apache License (Version 2.0). + +See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT), and +[COPYRIGHT](COPYRIGHT) for details. diff --git a/vendor/registry-40351f815f426200/rand_xorshift/src/lib.rs b/vendor/registry-40351f815f426200/rand_xorshift/src/lib.rs new file mode 100644 index 000000000..aad74e49f --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/src/lib.rs @@ -0,0 +1,123 @@ +// Copyright 2018 Developers of the Rand project. +// +// 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. + +//! The xorshift random number generator. + +#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://rust-random.github.io/rand/")] + +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] + +#![no_std] + +extern crate rand_core; + +#[cfg(feature="serde1")] extern crate serde; +#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; + +use core::num::Wrapping as w; +use core::{fmt, slice}; +use rand_core::{RngCore, SeedableRng, Error, impls, le}; + +/// An Xorshift random number generator. +/// +/// The Xorshift[^1] algorithm is not suitable for cryptographic purposes +/// but is very fast. If you do not know for sure that it fits your +/// requirements, use a more secure one such as `StdRng` or `OsRng`. +/// +/// [^1]: Marsaglia, George (July 2003). +/// ["Xorshift RNGs"](https://www.jstatsoft.org/v08/i14/paper). +/// *Journal of Statistical Software*. Vol. 8 (Issue 14). +#[derive(Clone)] +#[cfg_attr(feature="serde1", derive(Serialize,Deserialize))] +pub struct XorShiftRng { + x: w, + y: w, + z: w, + w: w, +} + +// Custom Debug implementation that does not expose the internal state +impl fmt::Debug for XorShiftRng { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "XorShiftRng {{}}") + } +} + +impl RngCore for XorShiftRng { + #[inline] + fn next_u32(&mut self) -> u32 { + let x = self.x; + let t = x ^ (x << 11); + self.x = self.y; + self.y = self.z; + self.z = self.w; + let w_ = self.w; + self.w = w_ ^ (w_ >> 19) ^ (t ^ (t >> 8)); + self.w.0 + } + + #[inline] + fn next_u64(&mut self) -> u64 { + impls::next_u64_via_u32(self) + } + + #[inline] + fn fill_bytes(&mut self, dest: &mut [u8]) { + impls::fill_bytes_via_next(self, dest) + } + + fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> { + Ok(self.fill_bytes(dest)) + } +} + +impl SeedableRng for XorShiftRng { + type Seed = [u8; 16]; + + fn from_seed(seed: Self::Seed) -> Self { + let mut seed_u32 = [0u32; 4]; + le::read_u32_into(&seed, &mut seed_u32); + + // Xorshift cannot be seeded with 0 and we cannot return an Error, but + // also do not wish to panic (because a random seed can legitimately be + // 0); our only option is therefore to use a preset value. + if seed_u32.iter().all(|&x| x == 0) { + seed_u32 = [0xBAD_5EED, 0xBAD_5EED, 0xBAD_5EED, 0xBAD_5EED]; + } + + XorShiftRng { + x: w(seed_u32[0]), + y: w(seed_u32[1]), + z: w(seed_u32[2]), + w: w(seed_u32[3]), + } + } + + fn from_rng(mut rng: R) -> Result { + let mut seed_u32 = [0u32; 4]; + loop { + unsafe { + let ptr = seed_u32.as_mut_ptr() as *mut u8; + + let slice = slice::from_raw_parts_mut(ptr, 4 * 4); + rng.try_fill_bytes(slice)?; + } + if !seed_u32.iter().all(|&x| x == 0) { break; } + } + + Ok(XorShiftRng { + x: w(seed_u32[0]), + y: w(seed_u32[1]), + z: w(seed_u32[2]), + w: w(seed_u32[3]), + }) + } +} diff --git a/vendor/registry-40351f815f426200/rand_xorshift/tests/mod.rs b/vendor/registry-40351f815f426200/rand_xorshift/tests/mod.rs new file mode 100644 index 000000000..8374b6410 --- /dev/null +++ b/vendor/registry-40351f815f426200/rand_xorshift/tests/mod.rs @@ -0,0 +1,92 @@ +extern crate rand_core; +extern crate rand_xorshift; +#[cfg(all(feature="serde1", test))] extern crate bincode; + +use rand_core::{RngCore, SeedableRng}; +use rand_xorshift::XorShiftRng; + +#[test] +fn test_xorshift_construction() { + // Test that various construction techniques produce a working RNG. + let seed = [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]; + let mut rng1 = XorShiftRng::from_seed(seed); + assert_eq!(rng1.next_u64(), 4325440999699518727); + + let _rng2 = XorShiftRng::from_rng(rng1).unwrap(); + // Note: we cannot test the state of _rng2 because from_rng does not + // fix Endianness. This is allowed in the trait specification. +} + +#[test] +fn test_xorshift_true_values() { + let seed = [16,15,14,13, 12,11,10,9, 8,7,6,5, 4,3,2,1]; + let mut rng = XorShiftRng::from_seed(seed); + + let mut results = [0u32; 9]; + for i in results.iter_mut() { *i = rng.next_u32(); } + let expected: [u32; 9] = [ + 2081028795, 620940381, 269070770, 16943764, 854422573, 29242889, + 1550291885, 1227154591, 271695242]; + assert_eq!(results, expected); + + let mut results = [0u64; 9]; + for i in results.iter_mut() { *i = rng.next_u64(); } + let expected: [u64; 9] = [ + 9247529084182843387, 8321512596129439293, 14104136531997710878, + 6848554330849612046, 343577296533772213, 17828467390962600268, + 9847333257685787782, 7717352744383350108, 1133407547287910111]; + assert_eq!(results, expected); + + let mut results = [0u8; 32]; + rng.fill_bytes(&mut results); + let expected = [102, 57, 212, 16, 233, 130, 49, 183, + 158, 187, 44, 203, 63, 149, 45, 17, + 117, 129, 131, 160, 70, 121, 158, 155, + 224, 209, 192, 53, 10, 62, 57, 72]; + assert_eq!(results, expected); +} + +#[test] +fn test_xorshift_zero_seed() { + // Xorshift does not work with an all zero seed. + // Assert it does not panic. + let seed = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; + let mut rng = XorShiftRng::from_seed(seed); + let a = rng.next_u64(); + let b = rng.next_u64(); + assert!(a != 0); + assert!(b != a); +} + +#[test] +fn test_xorshift_clone() { + let seed = [1,2,3,4, 5,5,7,8, 8,7,6,5, 4,3,2,1]; + let mut rng1 = XorShiftRng::from_seed(seed); + let mut rng2 = rng1.clone(); + for _ in 0..16 { + assert_eq!(rng1.next_u64(), rng2.next_u64()); + } +} + +#[cfg(feature="serde1")] +#[test] +fn test_xorshift_serde() { + use bincode; + use std::io::{BufWriter, BufReader}; + + let seed = [1,2,3,4, 5,6,7,8, 9,10,11,12, 13,14,15,16]; + let mut rng = XorShiftRng::from_seed(seed); + + let buf: Vec = Vec::new(); + let mut buf = BufWriter::new(buf); + bincode::serialize_into(&mut buf, &rng).expect("Could not serialize"); + + let buf = buf.into_inner().unwrap(); + let mut read = BufReader::new(&buf[..]); + let mut deserialized: XorShiftRng = bincode::deserialize_from(&mut read) + .expect("Could not deserialize"); + + for _ in 0..16 { + assert_eq!(rng.next_u64(), deserialized.next_u64()); + } +} diff --git a/vendor/registry-40351f815f426200/rdrand/.cargo-checksum.json b/vendor/registry-40351f815f426200/rdrand/.cargo-checksum.json new file mode 100644 index 000000000..c7b5a11ac --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"f11ed31fc1b481c7d0e24251d7d60d34442f1d25747c887c49dc9fbad7e13e59","LICENSE":"00d7b0c8bf95ea93162fccc84da96b906b15add708eade04f7ee6141f7b53141","README.mkd":"93853e9e773543ed0d0cf696b5fb151b15bddc1ad9c39996c9eb11b20a3c7ff6","appveyor.yml":"f502d8a0755b98e904a40b07e8ba270bccd729045b03c24a7db0dfbb4047b515","benches/rdrand.rs":"f3684c360d43bc8a780868c0a3af43b20d56975e03575122cee87277787cc8d0","benches/rdseed.rs":"520097b15a3f11c0c6a357e6cd23add598be22f37839bbc71040b827b05d1064","benches/std.rs":"6a5b52b070b2a594e735aa617f16fc6a861e64534634cdb61801c3297444f6fe","src/changelog.rs":"644e08c06836ecdf94f9a43aec109e9f05f9d85f00541683c72d0d3893ff8d6a","src/lib.rs":"8fc306db8a304d24c28fcefaec1849c0d8bbca97417420af7b81449c352b2e92"},"package":"678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/rdrand/Cargo.toml b/vendor/registry-40351f815f426200/rdrand/Cargo.toml new file mode 100644 index 000000000..6b3c80a87 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/Cargo.toml @@ -0,0 +1,28 @@ +# 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 = "rdrand" +version = "0.4.0" +authors = ["Simonas Kazlauskas "] +description = "An implementation of random number generator based on rdrand and rdseed instructions" +documentation = "https://docs.rs/rdrand/0.4.0/" +keywords = ["rand", "rdrand", "rdseed", "random"] +license = "ISC" +repository = "https://github.com/nagisa/rust_rdrand/" +[dependencies.rand_core] +version = "0.3" +default-features = false + +[features] +default = ["std"] +std = [] diff --git a/vendor/registry-40351f815f426200/rdrand/LICENSE b/vendor/registry-40351f815f426200/rdrand/LICENSE new file mode 100644 index 000000000..4d6f40d43 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/LICENSE @@ -0,0 +1,12 @@ +Copyright © 2014, 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/vendor/registry-40351f815f426200/rdrand/README.mkd b/vendor/registry-40351f815f426200/rdrand/README.mkd new file mode 100644 index 000000000..55ab48b8e --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/README.mkd @@ -0,0 +1,8 @@ +An implementation of random number generators based on `rdrand` and `rdseed` instructions. + +The random number generators provided by this crate are fairly slow (the latency for these +instructions is pretty high), but provide high quality random bits. Caveat is: neither AMD’s +nor Intel’s designs are public and therefore are not verifiable for lack of backdoors. + +Unless you know what you are doing, use the random number generators provided by the `rand` +crate (such as `EntropyRng`) instead. diff --git a/vendor/registry-40351f815f426200/rdrand/appveyor.yml b/vendor/registry-40351f815f426200/rdrand/appveyor.yml new file mode 100644 index 000000000..2e915cf4f --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/appveyor.yml @@ -0,0 +1,27 @@ +environment: + matrix: + - TARGET: 1.30.0-x86_64-pc-windows-msvc + - TARGET: 1.30.0-i686-pc-windows-msvc + - TARGET: 1.30.0-x86_64-pc-windows-gnu + - TARGET: 1.30.0-i686-pc-windows-gnu + - TARGET: nightly-x86_64-pc-windows-msvc + - TARGET: nightly-i686-pc-windows-msvc +install: + - ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-${env:TARGET}.exe" -FileName "rust.exe" + - ps: .\rust.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null + - ps: $env:PATH="$env:PATH;C:\rust\bin" + - rustc -vV + - cargo -vV +build: off + +test_script: +- cargo test +- cargo test --no-default-features + +for: +- matrix: + only: + - TARGET: nightly-x86_64-pc-windows-msvc + - TARGET: nightly-i686-pc-windows-msvc + test_script: + - cargo bench diff --git a/vendor/registry-40351f815f426200/rdrand/benches/rdrand.rs b/vendor/registry-40351f815f426200/rdrand/benches/rdrand.rs new file mode 100644 index 000000000..7e70c233e --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/benches/rdrand.rs @@ -0,0 +1,49 @@ +#![feature(test)] +extern crate rand_core; +extern crate rdrand; +extern crate test; + +use rand_core::RngCore; +use test::Bencher; + +#[bench] +fn bench_u16(b : &mut Bencher) { + if let Ok(gen) = rdrand::RdRand::new() { + b.bytes = 2; + b.iter(|| { + gen.try_next_u16().unwrap() + }); + } +} + +#[bench] +fn bench_u32(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdRand::new() { + b.bytes = 4; + b.iter(|| { + gen.next_u32() + }); + } +} + +#[bench] +fn bench_u64(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdRand::new() { + b.bytes = 8; + b.iter(|| { + gen.next_u64() + }); + } +} + +#[bench] +fn bench_fill(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdRand::new() { + let mut buffer = [0; 128]; + b.bytes = 128; + b.iter(|| { + gen.fill_bytes(&mut buffer); + buffer + }); + } +} diff --git a/vendor/registry-40351f815f426200/rdrand/benches/rdseed.rs b/vendor/registry-40351f815f426200/rdrand/benches/rdseed.rs new file mode 100644 index 000000000..6bf8cebf9 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/benches/rdseed.rs @@ -0,0 +1,49 @@ +#![feature(test)] +extern crate rand_core; +extern crate rdrand; +extern crate test; + +use rand_core::RngCore; +use test::Bencher; + +#[bench] +fn bench_rdseed_u16(b : &mut Bencher) { + if let Ok(gen) = rdrand::RdSeed::new() { + b.bytes = 2; + b.iter(|| { + gen.try_next_u16().unwrap() + }); + } +} + +#[bench] +fn bench_rdseed_u32(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdSeed::new() { + b.bytes = 4; + b.iter(|| { + gen.next_u32() + }); + } +} + +#[bench] +fn bench_rdseed_u64(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdSeed::new() { + b.bytes = 8; + b.iter(|| { + gen.next_u64() + }); + } +} + +#[bench] +fn bench_fill(b : &mut Bencher) { + if let Ok(mut gen) = rdrand::RdSeed::new() { + let mut buffer = [0; 128]; + b.bytes = 128; + b.iter(|| { + gen.fill_bytes(&mut buffer); + buffer + }); + } +} diff --git a/vendor/registry-40351f815f426200/rdrand/benches/std.rs b/vendor/registry-40351f815f426200/rdrand/benches/std.rs new file mode 100644 index 000000000..3fa8fadd9 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/benches/std.rs @@ -0,0 +1,31 @@ +// #![feature(test)] +// extern crate rand; +// extern crate test; +// +// use test::Bencher; +// use test::black_box; +// use rand::Rng; +// use rand::StdRng; +// use rand::OsRng; +// +// // OsRng is supposed to be the default for crypto uses. +// #[bench] +// fn bench_osrng_u64(b : &mut Bencher) { +// if let Ok(mut gen) = OsRng::new() { +// b.bytes = 8; +// b.iter(|| { +// black_box(gen.next_u64()); +// }); +// } +// } +// +// // StdRng is the default for everything else. +// #[bench] +// fn bench_stdrng_u64(b : &mut Bencher) { +// if let Ok(mut gen) = StdRng::new() { +// b.bytes = 8; +// b.iter(|| { +// gen.next_u64(); +// }); +// } +// } diff --git a/vendor/registry-40351f815f426200/rdrand/src/changelog.rs b/vendor/registry-40351f815f426200/rdrand/src/changelog.rs new file mode 100644 index 000000000..503f73810 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/src/changelog.rs @@ -0,0 +1,25 @@ +//! Project changelog + +/// ## Breaking changes +/// +/// Crate gained an enabled-by-default `std` feature. If you relied on rdrand being `core`-able +/// change your dependency to appear as such: +/// +/// ```toml +/// rdrand = { version = "0.4", default-features = false } +/// ``` +/// +/// This is done so that an advantage of the common feature detection functionality could be +/// employed by users that are not constrained by `core`. This functionality is faster, caches the +/// results and is shared between all users of the functionality. +/// +/// For `core` usage the feature detection has also been improved and will not be done if e.g. +/// crate is built with `rdrand` instructions enabled globally. +pub mod r0_4_0 {} + +/// Crate now works on stable! +/// +/// ## Breaking changes +/// +/// * Updated to `rand_core = ^0.3`. +pub mod r0_3_0 {} diff --git a/vendor/registry-40351f815f426200/rdrand/src/lib.rs b/vendor/registry-40351f815f426200/rdrand/src/lib.rs new file mode 100644 index 000000000..423ae2139 --- /dev/null +++ b/vendor/registry-40351f815f426200/rdrand/src/lib.rs @@ -0,0 +1,472 @@ +// Copyright © 2014, 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. +//! An implementation of random number generators based on `rdrand` and `rdseed` instructions. +//! +//! The random number generators provided by this crate are fairly slow (the latency for these +//! instructions is pretty high), but provide high quality random bits. Caveat is: neither AMD’s +//! nor Intel’s designs are public and therefore are not verifiable for lack of backdoors. +//! +//! Unless you know what you are doing, use the random number generators provided by the `rand` +//! crate (such as `OsRng`) instead. +//! +//! Here are a measurements for select processor architectures. Check [Agner’s instruction tables] +//! for up-to-date listings. +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//! +//!
ArchitectureLatency (cycles)Maximum throughput (per core)
u16u32u64
AMD Ryzen~1200~1200~2500~12MB/s @ 3.7GHz
Intel Skylake460460460~72MB/s @ 4.2GHz
Intel Haswell320320320~110MB/s @ 4.4GHz
+//! +//! [Agner’s instruction tables]: http://agner.org/optimize/ +#![cfg_attr(not(feature = "std"), no_std)] + +extern crate rand_core; + +#[cfg(feature = "std")] +extern crate core; + +pub mod changelog; + +use rand_core::{RngCore, CryptoRng, Error, ErrorKind}; +use core::slice; + +const RETRY_LIMIT: u8 = 127; + +#[cold] +#[inline(never)] +pub(crate) fn busy_loop_fail() -> ! { + panic!("hardware generator failure"); +} + +/// A cryptographically secure statistically uniform, non-periodic and non-deterministic random bit +/// generator. +/// +/// Note that this generator may be implemented using a deterministic algorithm that is reseeded +/// routinely from a non-deterministic entropy source to achieve the desirable properties. +/// +/// This generator is a viable replacement to any generator, however, since nobody has audited +/// Intel or AMD hardware yet, the usual disclaimers as to their suitability apply. +/// +/// It is potentially faster than `OsRng`, but is only supported on more recent Intel (Ivy Bridge +/// and later) and AMD (Ryzen and later) processors. +#[derive(Clone, Copy)] +pub struct RdRand(()); + +/// A cryptographically secure non-deterministic random bit generator. +/// +/// This generator produces high-entropy output and is suited to seed other pseudo-random +/// generators. +/// +/// This instruction currently is only available in Intel Broadwell (and later) and AMD Ryzen +/// processors. +/// +/// This generator is not intended for general random number generation purposes and should be used +/// to seed other generators implementing [rand_core::SeedableRng]. +#[derive(Clone, Copy)] +pub struct RdSeed(()); + +impl CryptoRng for RdRand {} +impl CryptoRng for RdSeed {} + +mod arch { + #[cfg(target_arch = "x86_64")] + pub use core::arch::x86_64::*; + #[cfg(target_arch = "x86")] + pub use core::arch::x86::*; + + #[cfg(target_arch = "x86")] + pub(crate) unsafe fn _rdrand64_step(dest: &mut u64) -> i32 { + let mut ret1: u32 = ::core::mem::uninitialized(); + let mut ret2: u32 = ::core::mem::uninitialized(); + if _rdrand32_step(&mut ret1) != 0 && _rdrand32_step(&mut ret2) != 0 { + *dest = (ret1 as u64) << 32 | (ret2 as u64); + 1 + } else { + 0 + } + } + + #[cfg(target_arch = "x86")] + pub(crate) unsafe fn _rdseed64_step(dest: &mut u64) -> i32 { + let mut ret1: u32 = ::core::mem::uninitialized(); + let mut ret2: u32 = ::core::mem::uninitialized(); + if _rdseed32_step(&mut ret1) != 0 && _rdseed32_step(&mut ret2) != 0 { + *dest = (ret1 as u64) << 32 | (ret2 as u64); + 1 + } else { + 0 + } + } +} + +#[cfg(not(feature = "std"))] +macro_rules! is_x86_feature_detected { + ("rdrand") => {{ + if cfg!(target_feature="rdrand") { + true + } else if cfg!(target_env = "sgx") { + false + } else { + const FLAG : u32 = 1 << 30; + unsafe { ::arch::__cpuid(1).ecx & FLAG == FLAG } + } + }}; + ("rdseed") => {{ + if cfg!(target_feature = "rdseed") { + true + } else if cfg!(target_env = "sgx") { + false + } else { + const FLAG : u32 = 1 << 18; + unsafe { ::arch::__cpuid(7).ebx & FLAG == FLAG } + } + }}; +} + +macro_rules! loop_rand { + ($el: ty, $step: path) => { { + let mut idx = 0; + loop { + let mut el: $el = ::core::mem::uninitialized(); + if $step(&mut el) != 0 { + break Some(el); + } else if idx == RETRY_LIMIT { + break None; + } + idx += 1; + } + } } +} + +macro_rules! impl_rand { + ($gen:ident, $feat:tt, $step16: path, $step32:path, $step64:path, + maxstep = $maxstep:path, maxty = $maxty: ty) => { + impl $gen { + /// Create a new instance of the random number generator. + /// + /// This constructor checks whether the CPU the program is running on supports the + /// instruction necessary for this generator to operate. If the instruction is not + /// supported, an error is returned. + pub fn new() -> Result { + if is_x86_feature_detected!($feat) { + Ok($gen(())) + } else { + Err(Error::new(rand_core::ErrorKind::Unavailable, + "the instruction is not supported")) + } + } + + /// Generate a single random `u16` value. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will return `None`. + /// + /// In case `None` is returned, the caller should assume that an non-recoverable + /// hardware failure has occured and use another random number genrator instead. + #[inline(always)] + pub fn try_next_u16(&self) -> Option { + #[target_feature(enable = $feat)] + unsafe fn imp() + -> Option { + loop_rand!(u16, $step16) + } + unsafe { imp() } + } + + /// Generate a single random `u32` value. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will return `None`. + /// + /// In case `None` is returned, the caller should assume that an non-recoverable + /// hardware failure has occured and use another random number genrator instead. + #[inline(always)] + pub fn try_next_u32(&self) -> Option { + #[target_feature(enable = $feat)] + unsafe fn imp() + -> Option { + loop_rand!(u32, $step32) + } + unsafe { imp() } + } + + /// Generate a single random `u64` value. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will return `None`. + /// + /// In case `None` is returned, the caller should assume that an non-recoverable + /// hardware failure has occured and use another random number genrator instead. + /// + /// Note, that on 32-bit targets, there’s no underlying instruction to generate a + /// 64-bit number, so it is emulated with the 32-bit version of the instruction. + #[inline(always)] + pub fn try_next_u64(&self) -> Option { + #[target_feature(enable = $feat)] + unsafe fn imp() + -> Option { + loop_rand!(u64, $step64) + } + unsafe { imp() } + } + } + + impl RngCore for $gen { + /// Generate a single random `u32` value. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// # Panic + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will `panic`. + /// + /// In case `panic` occurs, the caller should assume that an non-recoverable + /// hardware failure has occured and use another random number genrator instead. + #[inline(always)] + fn next_u32(&mut self) -> u32 { + if let Some(result) = self.try_next_u32() { + result + } else { + busy_loop_fail() + } + } + + /// Generate a single random `u64` value. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// Note, that on 32-bit targets, there’s no underlying instruction to generate a + /// 64-bit number, so it is emulated with the 32-bit version of the instruction. + /// + /// # Panic + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will `panic`. + /// + /// In case `panic` occurs, the caller should assume that an non-recoverable + /// hardware failure has occured and use another random number genrator instead. + #[inline(always)] + fn next_u64(&mut self) -> u64 { + if let Some(result) = self.try_next_u64() { + result + } else { + busy_loop_fail() + } + } + + /// Fill a buffer `dest` with random data. + /// + /// See `try_fill_bytes` for a more extensive documentation. + /// + /// # Panic + /// + /// This method will panic any time `try_fill_bytes` would return an error. + #[inline(always)] + fn fill_bytes(&mut self, dest: &mut [u8]) { + if let Err(_) = self.try_fill_bytes(dest) { + busy_loop_fail() + } + } + + /// Fill a buffer `dest` with random data. + /// + /// This method will use the most appropriate variant of the instruction available on + /// the machine to achieve the greatest single-core throughput, however it has a + /// slightly higher setup cost than the plain `next_u32` or `next_u64` methods. + /// + /// The underlying instruction may fail for variety reasons (such as actual hardware + /// failure or exhausted entropy), however the exact reason for the failure is not + /// usually exposed. + /// + /// This method will retry calling the instruction a few times, however if all the + /// attempts fail, it will return an error. + /// + /// If an error is returned, the caller should assume that an non-recoverable hardware + /// failure has occured and use another random number genrator instead. + #[inline(always)] + fn try_fill_bytes(&mut self, dest: &mut [u8]) + -> Result<(), Error> { + #[target_feature(enable = $feat)] + unsafe fn imp(dest: &mut [u8]) + -> Result<(), Error> + { + unsafe fn imp_less_fast(mut dest: &mut [u8], word: &mut $maxty, + buffer: &mut &[u8]) + -> Result<(), Error> + { + while !dest.is_empty() { + if buffer.is_empty() { + if let Some(w) = loop_rand!($maxty, $maxstep) { + *word = w; + *buffer = slice::from_raw_parts( + word as *const _ as *const u8, + ::core::mem::size_of::<$maxty>() + ); + } else { + return Err(Error::new(ErrorKind::Unexpected, + "hardware generator failure")); + } + } + + let len = dest.len().min(buffer.len()); + let (copy_src, leftover) = buffer.split_at(len); + let (copy_dest, dest_leftover) = { dest }.split_at_mut(len); + *buffer = leftover; + dest = dest_leftover; + ::core::ptr::copy_nonoverlapping( + copy_src.as_ptr(), copy_dest.as_mut_ptr(), len + ); + } + Ok(()) + } + + let destlen = dest.len(); + if destlen > ::core::mem::size_of::<$maxty>() { + let (left, mid, right) = dest.align_to_mut(); + let mut word = 0; + let mut buffer: &[u8] = &[]; + + for el in mid { + if let Some(val) = loop_rand!($maxty, $maxstep) { + *el = val; + } else { + return Err(Error::new(ErrorKind::Unexpected, + "hardware generator failure")); + } + } + + imp_less_fast(left, &mut word, &mut buffer)?; + imp_less_fast(right, &mut word, &mut buffer) + } else { + let mut word = 0; + let mut buffer: &[u8] = &[]; + imp_less_fast(dest, &mut word, &mut buffer) + } + } + unsafe { imp(dest) } + } + } + } +} + +#[cfg(target_arch = "x86_64")] +impl_rand!(RdRand, "rdrand", + ::arch::_rdrand16_step, ::arch::_rdrand32_step, ::arch::_rdrand64_step, + maxstep = ::arch::_rdrand64_step, maxty = u64); +#[cfg(target_arch = "x86_64")] +impl_rand!(RdSeed, "rdseed", + ::arch::_rdseed16_step, ::arch::_rdseed32_step, ::arch::_rdseed64_step, + maxstep = ::arch::_rdseed64_step, maxty = u64); +#[cfg(target_arch = "x86")] +impl_rand!(RdRand, "rdrand", + ::arch::_rdrand16_step, ::arch::_rdrand32_step, ::arch::_rdrand64_step, + maxstep = ::arch::_rdrand32_step, maxty = u32); +#[cfg(target_arch = "x86")] +impl_rand!(RdSeed, "rdseed", + ::arch::_rdseed16_step, ::arch::_rdseed32_step, ::arch::_rdseed64_step, + maxstep = ::arch::_rdseed32_step, maxty = u32); + +#[test] +fn rdrand_works() { + let _ = RdRand::new().map(|mut r| { + r.next_u32(); + r.next_u64(); + }); +} + +#[test] +fn fill_fills_all_bytes() { + let _ = RdRand::new().map(|mut r| { + let mut peach; + let mut banana; + let mut start = 0; + let mut end = 128; + 'outer: while start < end { + banana = [0; 128]; + for _ in 0..512 { + peach = [0; 128]; + r.fill_bytes(&mut peach[start..end]); + for (b, p) in banana.iter_mut().zip(peach.iter()) { + *b = *b | *p; + } + if (&banana[start..end]).iter().all(|x| *x != 0) { + assert!(banana[..start].iter().all(|x| *x == 0), "all other values must be 0"); + assert!(banana[end..].iter().all(|x| *x == 0), "all other values must be 0"); + if start < 17 { + start += 1; + } else { + end -= 3; + } + continue 'outer; + } + } + panic!("wow, we broke it? {} {} {:?}", start, end, &banana[..]) + } + }); +} + +#[test] +fn rdseed_works() { + let _ = RdSeed::new().map(|mut r| { + r.next_u32(); + r.next_u64(); + }); +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/.cargo-checksum.json b/vendor/registry-40351f815f426200/redox_syscall/.cargo-checksum.json new file mode 100644 index 000000000..2fcd6e78d --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d8dffae2831afa4bff1b9bce7178c0628e310c3757afb52aff2a79d949ca443d","LICENSE":"efcfee7981ff72431fffb06925cad00a23dce079ed4354f61030ad5abdb78829","README.md":"9161f18ba7f69b4ca51e844aee8ffb8237513a468c5c3b1f3a5f989044f895ac","src/arch/aarch64.rs":"3c36537214f8e10331d42ce4c7ac57a472db49fed029193c31982279d08bdad5","src/arch/arm.rs":"44ed9097879fce0ebe85d29e25ba378fb3ee7fcd649b569207495ed601c42a1c","src/arch/x86.rs":"e72a7f653c25b1ea5595af7ce991fe0e5c96547e127fc67e4967d60abbe1d3bd","src/arch/x86_64.rs":"4b809fde77985b335b2f53057d0f13debeb3edae2bc3b18bcc7eb0af4b6d8aef","src/call.rs":"b3e8bb24bf8a845e5b72e98671041c315743cac64208dfb8fffee964ae9a29a8","src/data.rs":"6296b1938b0d681c945c8a19933415968683630fabc7d8dc6f7fd7e2fc52d59c","src/error.rs":"d832a641ccb1baf10315e2e1ce59b12c30d605a526fc65a31f63bb3a92c3a2f7","src/flag.rs":"a5695709723fa1ef54b8ae2fd825ca7cf715f81677e99febaa0bdde43fc38d6e","src/io/dma.rs":"740cd441f844718a14f77c2fe292d29b7c468d686505810d8b3281f9528a6fe7","src/io/io.rs":"1bcb36d1867e9bab6a8186cd6928efe70ae2655e9f9d0dd3def20bc0fb6a82f6","src/io/mmio.rs":"b9fdb37d37a25a48106d60f1a977c541cb5162b20b12507c7dcd6eb3dff0a2c8","src/io/mod.rs":"4df12af3e82e6b5fe22112c9f51552112ee4811b7d1131d2a43d608d8d1cac09","src/io/pio.rs":"219fcd317d6c490a14794ec4db9de3e305c722dda720043c67076bda60632bb8","src/lib.rs":"9241e87a8ae552935268b2eecda4bcbc63134325bccf4b3d4bdacd9068794c34","src/number.rs":"4718baa58a0f3e6b9b66d1f328cb2a145e9b1f807654c3079a13b226c4085a29","src/scheme/generate.sh":"b022adacb74f2af1470e691341c37acc1582f428e9b8b6b9dccb790dde594b40","src/scheme/mod.rs":"2679272397bf0247e1a4695853465243ca02960feb4ced1124969f67ebd3e3ce","src/scheme/scheme.rs":"879728e4d4e7d8f3057df5a3a6af1636079135652594ee50ca1b665e876be595","src/scheme/scheme_block.rs":"a8ea17b1101548e9b36f6c9000f68fd5438a796069252f948bde7dda44088a7f","src/scheme/scheme_block_mut.rs":"8b881f84a54e2477967d43eb68dac7c578ff6451dba59eba0d517037b2ac4def","src/scheme/scheme_mut.rs":"30f9b0750437b7f55d5bb24da546fd4afcb3c27b0af06d5f681b8f1c4877e7b4"},"package":"12229c14a0f65c4f1cb046a3b52047cdd9da1f4b30f8a39c5063c8bae515e252"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/redox_syscall/Cargo.toml b/vendor/registry-40351f815f426200/redox_syscall/Cargo.toml new file mode 100644 index 000000000..d7bd8cc6c --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/Cargo.toml @@ -0,0 +1,23 @@ +# 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 = "redox_syscall" +version = "0.1.54" +authors = ["Jeremy Soller "] +description = "A Rust library to access raw Redox system calls" +documentation = "https://docs.rs/redox_syscall" +license = "MIT" +repository = "https://gitlab.redox-os.org/redox-os/syscall" + +[lib] +name = "syscall" diff --git a/vendor/registry-40351f815f426200/redox_syscall/LICENSE b/vendor/registry-40351f815f426200/redox_syscall/LICENSE new file mode 100644 index 000000000..1292bb7fb --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/LICENSE @@ -0,0 +1,22 @@ +Copyright (c) 2017 Redox OS Developers + +MIT License + +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/vendor/registry-40351f815f426200/redox_syscall/README.md b/vendor/registry-40351f815f426200/redox_syscall/README.md new file mode 100644 index 000000000..244c90861 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/README.md @@ -0,0 +1,6 @@ +# syscall +[Redox OS](https://gitlab.redox-os.org/redox-os/redox)'s syscall API + +[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) +[![crates.io](http://meritbadge.herokuapp.com/redox_syscall)](https://crates.io/crates/redox_syscall) +[![docs.rs](https://docs.rs/redox_syscall/badge.svg)](https://docs.rs/redox_syscall) diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/arch/aarch64.rs b/vendor/registry-40351f815f426200/redox_syscall/src/arch/aarch64.rs new file mode 100644 index 000000000..662f428d0 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/arch/aarch64.rs @@ -0,0 +1,77 @@ +use super::error::{Error, Result}; + +pub unsafe fn syscall0(mut a: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a) + : "x0", "x8" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b) + : "x0", "x8" + : "volatile"); + + Error::demux(a) +} + +// Clobbers all registers - special for clone +pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b) + : "memory", + "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7", + "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15", + "x16", "x17","x18", "x19", "x20", "x21", "x22", "x23", + "x24", "x25", "x26", "x27", "x28", "x29", "x30" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b), "{x1}"(c) + : "x0", "x1", "x8" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall3(mut a: usize, b: usize, c: usize, d: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b), "{x1}"(c), "{x2}"(d) + : "x0", "x1", "x2", "x8" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b), "{x1}"(c), "{x2}"(d), "{x3}"(e) + : "x0", "x1", "x2", "x3", "x8" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) + -> Result { + asm!("svc 0" + : "={x0}"(a) + : "{x8}"(a), "{x0}"(b), "{x1}"(c), "{x2}"(d), "{x3}"(e), "{x4}"(f) + : "x0", "x1", "x2", "x3", "x4", "x8" + : "volatile"); + + Error::demux(a) +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/arch/arm.rs b/vendor/registry-40351f815f426200/redox_syscall/src/arch/arm.rs new file mode 100644 index 000000000..e640f7ed3 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/arch/arm.rs @@ -0,0 +1,73 @@ +use super::error::{Error, Result}; + +pub unsafe fn syscall0(mut a: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a) + : "memory" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b) + : "memory" + : "volatile"); + + Error::demux(a) +} + +// Clobbers all registers - special for clone +pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b) + : "memory", "r0", "r1", "r2", "r3", "r4" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b), "{r1}"(c) + : "memory" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall3(mut a: usize, b: usize, c: usize, d: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b), "{r1}"(c), "{r2}"(d) + : "memory" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b), "{r1}"(c), "{r2}"(d), "{r3}"(e) + : "memory" + : "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) + -> Result { + asm!("swi $$0" + : "={r0}"(a) + : "{r7}"(a), "{r0}"(b), "{r1}"(c), "{r2}"(d), "{r3}"(e), "{r4}"(f) + : "memory" + : "volatile"); + + Error::demux(a) +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86.rs b/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86.rs new file mode 100644 index 000000000..0cd6409bb --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86.rs @@ -0,0 +1,73 @@ +use super::error::{Error, Result}; + +pub unsafe fn syscall0(mut a: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +// Clobbers all registers - special for clone +pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b) + : "memory", "ebx", "ecx", "edx", "esi", "edi" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b), "{ecx}"(c) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall3(mut a: usize, b: usize, c: usize, d: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b), "{ecx}"(c), "{edx}"(d) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b), "{ecx}"(c), "{edx}"(d), "{esi}"(e) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) + -> Result { + asm!("int 0x80" + : "={eax}"(a) + : "{eax}"(a), "{ebx}"(b), "{ecx}"(c), "{edx}"(d), "{esi}"(e), "{edi}"(f) + : "memory" + : "intel", "volatile"); + + Error::demux(a) +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86_64.rs b/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86_64.rs new file mode 100644 index 000000000..76c3da130 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/arch/x86_64.rs @@ -0,0 +1,74 @@ +use super::error::{Error, Result}; + +pub unsafe fn syscall0(mut a: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall1(mut a: usize, b: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +// Clobbers all registers - special for clone +pub unsafe fn syscall1_clobber(mut a: usize, b: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b) + : "memory", "rbx", "rcx", "rdx", "rsi", "rdi", "r8", + "r9", "r10", "r11", "r12", "r13", "r14", "r15" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall2(mut a: usize, b: usize, c: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b), "{rsi}"(c) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall3(mut a: usize, b: usize, c: usize, d: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall4(mut a: usize, b: usize, c: usize, d: usize, e: usize) -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d), "{r10}"(e) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} + +pub unsafe fn syscall5(mut a: usize, b: usize, c: usize, d: usize, e: usize, f: usize) + -> Result { + asm!("syscall" + : "={rax}"(a) + : "{rax}"(a), "{rdi}"(b), "{rsi}"(c), "{rdx}"(d), "{r10}"(e), "{r8}"(f) + : "rcx", "r11", "memory" + : "intel", "volatile"); + + Error::demux(a) +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/call.rs b/vendor/registry-40351f815f426200/redox_syscall/src/call.rs new file mode 100644 index 000000000..aff381a9b --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/call.rs @@ -0,0 +1,389 @@ +use super::arch::*; +use super::data::{Map, SigAction, Stat, StatVfs, TimeSpec}; +use super::error::Result; +use super::number::*; + +use core::{mem, ptr}; + +// Signal restorer +extern "C" fn restorer() -> ! { + sigreturn().unwrap(); + unreachable!(); +} + +/// Set the end of the process's heap +/// +/// When `addr` is `0`, this function will return the current break. +/// +/// When `addr` is nonzero, this function will attempt to set the end of the process's +/// heap to `addr` and return the new program break. The new program break should be +/// checked by the allocator, it may not be exactly `addr`, as it may be aligned to a page +/// boundary. +/// +/// On error, `Err(ENOMEM)` will be returned indicating that no memory is available +pub unsafe fn brk(addr: usize) -> Result { + syscall1(SYS_BRK, addr) +} + +/// Change the process's working directory +/// +/// This function will attempt to set the process's working directory to `path`, which can be +/// either a relative, scheme relative, or absolute path. +/// +/// On success, `Ok(0)` will be returned. On error, one of the following errors will be returned. +/// +/// # Errors +/// +/// * `EACCES` - permission is denied for one of the components of `path`, or `path` +/// * `EFAULT` - `path` does not point to the process's addressible memory +/// * `EIO` - an I/O error occurred +/// * `ENOENT` - `path` does not exit +/// * `ENOTDIR` - `path` is not a directory +pub fn chdir>(path: T) -> Result { + unsafe { syscall2(SYS_CHDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) } +} + +pub fn chmod>(path: T, mode: usize) -> Result { + unsafe { syscall3(SYS_CHMOD, path.as_ref().as_ptr() as usize, path.as_ref().len(), mode) } +} + +/// Produce a fork of the current process, or a new process thread +pub unsafe fn clone(flags: usize) -> Result { + syscall1_clobber(SYS_CLONE, flags) +} + +/// Close a file +pub fn close(fd: usize) -> Result { + unsafe { syscall1(SYS_CLOSE, fd) } +} + +/// Get the current system time +pub fn clock_gettime(clock: usize, tp: &mut TimeSpec) -> Result { + unsafe { syscall2(SYS_CLOCK_GETTIME, clock, tp as *mut TimeSpec as usize) } +} + +/// Copy and transform a file descriptor +pub fn dup(fd: usize, buf: &[u8]) -> Result { + unsafe { syscall3(SYS_DUP, fd, buf.as_ptr() as usize, buf.len()) } +} + +/// Copy and transform a file descriptor +pub fn dup2(fd: usize, newfd: usize, buf: &[u8]) -> Result { + unsafe { syscall4(SYS_DUP2, fd, newfd, buf.as_ptr() as usize, buf.len()) } +} + +/// Exit the current process +pub fn exit(status: usize) -> Result { + unsafe { syscall1(SYS_EXIT, status) } +} + +/// Change file permissions +pub fn fchmod(fd: usize, mode: u16) -> Result { + unsafe { syscall2(SYS_FCHMOD, fd, mode as usize) } + +} + +/// Change file ownership +pub fn fchown(fd: usize, uid: u32, gid: u32) -> Result { + unsafe { syscall3(SYS_FCHOWN, fd, uid as usize, gid as usize) } + +} + +/// Change file descriptor flags +pub fn fcntl(fd: usize, cmd: usize, arg: usize) -> Result { + unsafe { syscall3(SYS_FCNTL, fd, cmd, arg) } +} + +/// Replace the current process with a new executable +pub fn fexec(fd: usize, args: &[[usize; 2]], vars: &[[usize; 2]]) -> Result { + unsafe { syscall5(SYS_FEXEC, fd, args.as_ptr() as usize, args.len(), vars.as_ptr() as usize, vars.len()) } +} + +/// Map a file into memory +pub unsafe fn fmap(fd: usize, map: &Map) -> Result { + syscall3(SYS_FMAP, fd, map as *const Map as usize, mem::size_of::()) +} + +/// Unmap a memory-mapped file +pub unsafe fn funmap(addr: usize) -> Result { + syscall1(SYS_FUNMAP, addr) +} + +/// Retrieve the canonical path of a file +pub fn fpath(fd: usize, buf: &mut [u8]) -> Result { + unsafe { syscall3(SYS_FPATH, fd, buf.as_mut_ptr() as usize, buf.len()) } +} + +/// Rename a file +pub fn frename>(fd: usize, path: T) -> Result { + unsafe { syscall3(SYS_FRENAME, fd, path.as_ref().as_ptr() as usize, path.as_ref().len()) } +} + +/// Get metadata about a file +pub fn fstat(fd: usize, stat: &mut Stat) -> Result { + unsafe { syscall3(SYS_FSTAT, fd, stat as *mut Stat as usize, mem::size_of::()) } +} + +/// Get metadata about a filesystem +pub fn fstatvfs(fd: usize, stat: &mut StatVfs) -> Result { + unsafe { syscall3(SYS_FSTATVFS, fd, stat as *mut StatVfs as usize, mem::size_of::()) } +} + +/// Sync a file descriptor to its underlying medium +pub fn fsync(fd: usize) -> Result { + unsafe { syscall1(SYS_FSYNC, fd) } +} + +/// Truncate or extend a file to a specified length +pub fn ftruncate(fd: usize, len: usize) -> Result { + unsafe { syscall2(SYS_FTRUNCATE, fd, len) } +} + +// Change modify and/or access times +pub fn futimens(fd: usize, times: &[TimeSpec]) -> Result { + unsafe { syscall3(SYS_FUTIMENS, fd, times.as_ptr() as usize, times.len() * mem::size_of::()) } +} + +/// Fast userspace mutex +pub unsafe fn futex(addr: *mut i32, op: usize, val: i32, val2: usize, addr2: *mut i32) + -> Result { + syscall5(SYS_FUTEX, addr as usize, op, (val as isize) as usize, val2, addr2 as usize) +} + +/// Get the current working directory +pub fn getcwd(buf: &mut [u8]) -> Result { + unsafe { syscall2(SYS_GETCWD, buf.as_mut_ptr() as usize, buf.len()) } +} + +/// Get the effective group ID +pub fn getegid() -> Result { + unsafe { syscall0(SYS_GETEGID) } +} + +/// Get the effective namespace +pub fn getens() -> Result { + unsafe { syscall0(SYS_GETENS) } +} + +/// Get the effective user ID +pub fn geteuid() -> Result { + unsafe { syscall0(SYS_GETEUID) } +} + +/// Get the current group ID +pub fn getgid() -> Result { + unsafe { syscall0(SYS_GETGID) } +} + +/// Get the current namespace +pub fn getns() -> Result { + unsafe { syscall0(SYS_GETNS) } +} + +/// Get the current process ID +pub fn getpid() -> Result { + unsafe { syscall0(SYS_GETPID) } +} + +/// Get the process group ID +pub fn getpgid(pid: usize) -> Result { + unsafe { syscall1(SYS_GETPGID, pid) } +} + +/// Get the parent process ID +pub fn getppid() -> Result { + unsafe { syscall0(SYS_GETPPID) } +} + +/// Get the current user ID +pub fn getuid() -> Result { + unsafe { syscall0(SYS_GETUID) } +} + +/// Set the I/O privilege level +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +/// * `EINVAL` - `level > 3` +pub unsafe fn iopl(level: usize) -> Result { + syscall1(SYS_IOPL, level) +} + +/// Send a signal `sig` to the process identified by `pid` +pub fn kill(pid: usize, sig: usize) -> Result { + unsafe { syscall2(SYS_KILL, pid, sig) } +} + +/// Create a link to a file +pub unsafe fn link(old: *const u8, new: *const u8) -> Result { + syscall2(SYS_LINK, old as usize, new as usize) +} + +/// Seek to `offset` bytes in a file descriptor +pub fn lseek(fd: usize, offset: isize, whence: usize) -> Result { + unsafe { syscall3(SYS_LSEEK, fd, offset as usize, whence) } +} + +/// Make a new scheme namespace +pub fn mkns(schemes: &[[usize; 2]]) -> Result { + unsafe { syscall2(SYS_MKNS, schemes.as_ptr() as usize, schemes.len()) } +} + +/// Change mapping flags +pub unsafe fn mprotect(addr: usize, size: usize, flags: usize) -> Result { + syscall3(SYS_MPROTECT, addr, size, flags) +} + +/// Sleep for the time specified in `req` +pub fn nanosleep(req: &TimeSpec, rem: &mut TimeSpec) -> Result { + unsafe { syscall2(SYS_NANOSLEEP, req as *const TimeSpec as usize, + rem as *mut TimeSpec as usize) } +} + +/// Open a file +pub fn open>(path: T, flags: usize) -> Result { + unsafe { syscall3(SYS_OPEN, path.as_ref().as_ptr() as usize, path.as_ref().len(), flags) } +} + +/// Allocate pages, linearly in physical memory +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +/// * `ENOMEM` - the system has run out of available memory +pub unsafe fn physalloc(size: usize) -> Result { + syscall1(SYS_PHYSALLOC, size) +} + +/// Free physically allocated pages +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +pub unsafe fn physfree(physical_address: usize, size: usize) -> Result { + syscall2(SYS_PHYSFREE, physical_address, size) +} + +/// Map physical memory to virtual memory +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +pub unsafe fn physmap(physical_address: usize, size: usize, flags: usize) -> Result { + syscall3(SYS_PHYSMAP, physical_address, size, flags) +} + +/// Unmap previously mapped physical memory +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +/// * `EFAULT` - `virtual_address` has not been mapped +pub unsafe fn physunmap(virtual_address: usize) -> Result { + syscall1(SYS_PHYSUNMAP, virtual_address) +} + +/// Create a pair of file descriptors referencing the read and write ends of a pipe +pub fn pipe2(fds: &mut [usize; 2], flags: usize) -> Result { + unsafe { syscall2(SYS_PIPE2, fds.as_ptr() as usize, flags) } +} + +/// Read from a file descriptor into a buffer +pub fn read(fd: usize, buf: &mut [u8]) -> Result { + unsafe { syscall3(SYS_READ, fd, buf.as_mut_ptr() as usize, buf.len()) } +} + +/// Remove a directory +pub fn rmdir>(path: T) -> Result { + unsafe { syscall2(SYS_RMDIR, path.as_ref().as_ptr() as usize, path.as_ref().len()) } +} + +/// Set the process group ID +pub fn setpgid(pid: usize, pgid: usize) -> Result { + unsafe { syscall2(SYS_SETPGID, pid, pgid) } +} + +/// Set the current process group IDs +pub fn setregid(rgid: usize, egid: usize) -> Result { + unsafe { syscall2(SYS_SETREGID, rgid, egid) } +} + +/// Make a new scheme namespace +pub fn setrens(rns: usize, ens: usize) -> Result { + unsafe { syscall2(SYS_SETRENS, rns, ens) } +} + +/// Set the current process user IDs +pub fn setreuid(ruid: usize, euid: usize) -> Result { + unsafe { syscall2(SYS_SETREUID, ruid, euid) } +} + +/// Set up a signal handler +pub fn sigaction(sig: usize, act: Option<&SigAction>, oldact: Option<&mut SigAction>) -> Result { + unsafe { syscall4(SYS_SIGACTION, sig, + act.map(|x| x as *const _).unwrap_or_else(ptr::null) as usize, + oldact.map(|x| x as *mut _).unwrap_or_else(ptr::null_mut) as usize, + restorer as usize) } +} + +/// Get and/or set signal masks +pub fn sigprocmask(how: usize, set: Option<&[u64; 2]>, oldset: Option<&mut [u64; 2]>) -> Result { + unsafe { syscall3(SYS_SIGPROCMASK, how, + set.map(|x| x as *const _).unwrap_or_else(ptr::null) as usize, + oldset.map(|x| x as *mut _).unwrap_or_else(ptr::null_mut) as usize) } +} + +// Return from signal handler +pub fn sigreturn() -> Result { + unsafe { syscall0(SYS_SIGRETURN) } +} + +/// Set the file mode creation mask +pub fn umask(mask: usize) -> Result { + unsafe { syscall1(SYS_UMASK, mask) } +} + +/// Remove a file +pub fn unlink>(path: T) -> Result { + unsafe { syscall2(SYS_UNLINK, path.as_ref().as_ptr() as usize, path.as_ref().len()) } +} + +/// Convert a virtual address to a physical one +/// +/// # Errors +/// +/// * `EPERM` - `uid != 0` +pub unsafe fn virttophys(virtual_address: usize) -> Result { + syscall1(SYS_VIRTTOPHYS, virtual_address) +} + +/// Check if a child process has exited or received a signal +pub fn waitpid(pid: usize, status: &mut usize, options: usize) -> Result { + unsafe { syscall3(SYS_WAITPID, pid, status as *mut usize as usize, options) } +} + +/// Write a buffer to a file descriptor +/// +/// The kernel will attempt to write the bytes in `buf` to the file descriptor `fd`, returning +/// either an `Err`, explained below, or `Ok(count)` where `count` is the number of bytes which +/// were written. +/// +/// # Errors +/// +/// * `EAGAIN` - the file descriptor was opened with `O_NONBLOCK` and writing would block +/// * `EBADF` - the file descriptor is not valid or is not open for writing +/// * `EFAULT` - `buf` does not point to the process's addressible memory +/// * `EIO` - an I/O error occurred +/// * `ENOSPC` - the device containing the file descriptor has no room for data +/// * `EPIPE` - the file descriptor refers to a pipe or socket whose reading end is closed +pub fn write(fd: usize, buf: &[u8]) -> Result { + unsafe { syscall3(SYS_WRITE, fd, buf.as_ptr() as usize, buf.len()) } +} + +/// Yield the process's time slice to the kernel +/// +/// This function will return Ok(0) on success +pub fn sched_yield() -> Result { + unsafe { syscall0(SYS_YIELD) } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/data.rs b/vendor/registry-40351f815f426200/redox_syscall/src/data.rs new file mode 100644 index 000000000..89e3b9efa --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/data.rs @@ -0,0 +1,219 @@ +use core::ops::{Deref, DerefMut}; +use core::{mem, slice}; + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct Event { + pub id: usize, + pub flags: usize, + pub data: usize +} + +impl Deref for Event { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Event as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Event { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Event as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct ITimerSpec { + pub it_interval: TimeSpec, + pub it_value: TimeSpec, +} + +impl Deref for ITimerSpec { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const ITimerSpec as *const u8, + mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for ITimerSpec { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut ITimerSpec as *mut u8, + mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct Map { + pub offset: usize, + pub size: usize, + pub flags: usize, +} + +impl Deref for Map { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Map as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Map { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Map as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct Packet { + pub id: u64, + pub pid: usize, + pub uid: u32, + pub gid: u32, + pub a: usize, + pub b: usize, + pub c: usize, + pub d: usize +} + +impl Deref for Packet { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Packet as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Packet { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Packet as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug)] +#[repr(C)] +pub struct SigAction { + pub sa_handler: extern "C" fn(usize), + pub sa_mask: [u64; 2], + pub sa_flags: usize, +} + +impl Default for SigAction { + fn default() -> Self { + Self { + sa_handler: unsafe { mem::transmute(0usize) }, + sa_mask: [0; 2], + sa_flags: 0, + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct Stat { + pub st_dev: u64, + pub st_ino: u64, + pub st_mode: u16, + pub st_nlink: u32, + pub st_uid: u32, + pub st_gid: u32, + pub st_size: u64, + pub st_blksize: u32, + pub st_blocks: u64, + pub st_mtime: u64, + pub st_mtime_nsec: u32, + pub st_atime: u64, + pub st_atime_nsec: u32, + pub st_ctime: u64, + pub st_ctime_nsec: u32, +} + +impl Deref for Stat { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Stat as *const u8, + mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Stat { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Stat as *mut u8, + mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct StatVfs { + pub f_bsize: u32, + pub f_blocks: u64, + pub f_bfree: u64, + pub f_bavail: u64, +} + +impl Deref for StatVfs { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const StatVfs as *const u8, + mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for StatVfs { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut StatVfs as *mut u8, + mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Copy, Clone, Debug, Default)] +#[repr(C)] +pub struct TimeSpec { + pub tv_sec: i64, + pub tv_nsec: i32, +} + +impl Deref for TimeSpec { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const TimeSpec as *const u8, + mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for TimeSpec { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut TimeSpec as *mut u8, + mem::size_of::()) as &mut [u8] + } + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/error.rs b/vendor/registry-40351f815f426200/redox_syscall/src/error.rs new file mode 100644 index 000000000..fde4796a4 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/error.rs @@ -0,0 +1,311 @@ +use core::{fmt, result}; + +#[derive(Eq, PartialEq)] +pub struct Error { + pub errno: i32, +} + +pub type Result = result::Result; + +impl Error { + pub fn new(errno: i32) -> Error { + Error { errno: errno } + } + + pub fn mux(result: Result) -> usize { + match result { + Ok(value) => value, + Err(error) => -error.errno as usize, + } + } + + pub fn demux(value: usize) -> Result { + let errno = -(value as i32); + if errno >= 1 && errno < STR_ERROR.len() as i32 { + Err(Error::new(errno)) + } else { + Ok(value) + } + } + + pub fn text(&self) -> &'static str { + STR_ERROR.get(self.errno as usize).map(|&x| x).unwrap_or("Unknown Error") + } +} + +impl fmt::Debug for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> { + f.write_str(self.text()) + } +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> result::Result<(), fmt::Error> { + f.write_str(self.text()) + } +} + +pub const EPERM: i32 = 1; /* Operation not permitted */ +pub const ENOENT: i32 = 2; /* No such file or directory */ +pub const ESRCH: i32 = 3; /* No such process */ +pub const EINTR: i32 = 4; /* Interrupted system call */ +pub const EIO: i32 = 5; /* I/O error */ +pub const ENXIO: i32 = 6; /* No such device or address */ +pub const E2BIG: i32 = 7; /* Argument list too long */ +pub const ENOEXEC: i32 = 8; /* Exec format error */ +pub const EBADF: i32 = 9; /* Bad file number */ +pub const ECHILD: i32 = 10; /* No child processes */ +pub const EAGAIN: i32 = 11; /* Try again */ +pub const ENOMEM: i32 = 12; /* Out of memory */ +pub const EACCES: i32 = 13; /* Permission denied */ +pub const EFAULT: i32 = 14; /* Bad address */ +pub const ENOTBLK: i32 = 15; /* Block device required */ +pub const EBUSY: i32 = 16; /* Device or resource busy */ +pub const EEXIST: i32 = 17; /* File exists */ +pub const EXDEV: i32 = 18; /* Cross-device link */ +pub const ENODEV: i32 = 19; /* No such device */ +pub const ENOTDIR: i32 = 20; /* Not a directory */ +pub const EISDIR: i32 = 21; /* Is a directory */ +pub const EINVAL: i32 = 22; /* Invalid argument */ +pub const ENFILE: i32 = 23; /* File table overflow */ +pub const EMFILE: i32 = 24; /* Too many open files */ +pub const ENOTTY: i32 = 25; /* Not a typewriter */ +pub const ETXTBSY: i32 = 26; /* Text file busy */ +pub const EFBIG: i32 = 27; /* File too large */ +pub const ENOSPC: i32 = 28; /* No space left on device */ +pub const ESPIPE: i32 = 29; /* Illegal seek */ +pub const EROFS: i32 = 30; /* Read-only file system */ +pub const EMLINK: i32 = 31; /* Too many links */ +pub const EPIPE: i32 = 32; /* Broken pipe */ +pub const EDOM: i32 = 33; /* Math argument out of domain of func */ +pub const ERANGE: i32 = 34; /* Math result not representable */ +pub const EDEADLK: i32 = 35; /* Resource deadlock would occur */ +pub const ENAMETOOLONG: i32 = 36; /* File name too long */ +pub const ENOLCK: i32 = 37; /* No record locks available */ +pub const ENOSYS: i32 = 38; /* Function not implemented */ +pub const ENOTEMPTY: i32 = 39; /* Directory not empty */ +pub const ELOOP: i32 = 40; /* Too many symbolic links encountered */ +pub const EWOULDBLOCK: i32 = 41; /* Operation would block */ +pub const ENOMSG: i32 = 42; /* No message of desired type */ +pub const EIDRM: i32 = 43; /* Identifier removed */ +pub const ECHRNG: i32 = 44; /* Channel number out of range */ +pub const EL2NSYNC: i32 = 45; /* Level 2 not synchronized */ +pub const EL3HLT: i32 = 46; /* Level 3 halted */ +pub const EL3RST: i32 = 47; /* Level 3 reset */ +pub const ELNRNG: i32 = 48; /* Link number out of range */ +pub const EUNATCH: i32 = 49; /* Protocol driver not attached */ +pub const ENOCSI: i32 = 50; /* No CSI structure available */ +pub const EL2HLT: i32 = 51; /* Level 2 halted */ +pub const EBADE: i32 = 52; /* Invalid exchange */ +pub const EBADR: i32 = 53; /* Invalid request descriptor */ +pub const EXFULL: i32 = 54; /* Exchange full */ +pub const ENOANO: i32 = 55; /* No anode */ +pub const EBADRQC: i32 = 56; /* Invalid request code */ +pub const EBADSLT: i32 = 57; /* Invalid slot */ +pub const EDEADLOCK: i32 = 58; /* Resource deadlock would occur */ +pub const EBFONT: i32 = 59; /* Bad font file format */ +pub const ENOSTR: i32 = 60; /* Device not a stream */ +pub const ENODATA: i32 = 61; /* No data available */ +pub const ETIME: i32 = 62; /* Timer expired */ +pub const ENOSR: i32 = 63; /* Out of streams resources */ +pub const ENONET: i32 = 64; /* Machine is not on the network */ +pub const ENOPKG: i32 = 65; /* Package not installed */ +pub const EREMOTE: i32 = 66; /* Object is remote */ +pub const ENOLINK: i32 = 67; /* Link has been severed */ +pub const EADV: i32 = 68; /* Advertise error */ +pub const ESRMNT: i32 = 69; /* Srmount error */ +pub const ECOMM: i32 = 70; /* Communication error on send */ +pub const EPROTO: i32 = 71; /* Protocol error */ +pub const EMULTIHOP: i32 = 72; /* Multihop attempted */ +pub const EDOTDOT: i32 = 73; /* RFS specific error */ +pub const EBADMSG: i32 = 74; /* Not a data message */ +pub const EOVERFLOW: i32 = 75; /* Value too large for defined data type */ +pub const ENOTUNIQ: i32 = 76; /* Name not unique on network */ +pub const EBADFD: i32 = 77; /* File descriptor in bad state */ +pub const EREMCHG: i32 = 78; /* Remote address changed */ +pub const ELIBACC: i32 = 79; /* Can not access a needed shared library */ +pub const ELIBBAD: i32 = 80; /* Accessing a corrupted shared library */ +pub const ELIBSCN: i32 = 81; /* .lib section in a.out corrupted */ +pub const ELIBMAX: i32 = 82; /* Attempting to link in too many shared libraries */ +pub const ELIBEXEC: i32 = 83; /* Cannot exec a shared library directly */ +pub const EILSEQ: i32 = 84; /* Illegal byte sequence */ +pub const ERESTART: i32 = 85; /* Interrupted system call should be restarted */ +pub const ESTRPIPE: i32 = 86; /* Streams pipe error */ +pub const EUSERS: i32 = 87; /* Too many users */ +pub const ENOTSOCK: i32 = 88; /* Socket operation on non-socket */ +pub const EDESTADDRREQ: i32 = 89; /* Destination address required */ +pub const EMSGSIZE: i32 = 90; /* Message too long */ +pub const EPROTOTYPE: i32 = 91; /* Protocol wrong type for socket */ +pub const ENOPROTOOPT: i32 = 92; /* Protocol not available */ +pub const EPROTONOSUPPORT: i32 = 93; /* Protocol not supported */ +pub const ESOCKTNOSUPPORT: i32 = 94; /* Socket type not supported */ +pub const EOPNOTSUPP: i32 = 95; /* Operation not supported on transport endpoint */ +pub const EPFNOSUPPORT: i32 = 96; /* Protocol family not supported */ +pub const EAFNOSUPPORT: i32 = 97; /* Address family not supported by protocol */ +pub const EADDRINUSE: i32 = 98; /* Address already in use */ +pub const EADDRNOTAVAIL: i32 = 99; /* Cannot assign requested address */ +pub const ENETDOWN: i32 = 100; /* Network is down */ +pub const ENETUNREACH: i32 = 101; /* Network is unreachable */ +pub const ENETRESET: i32 = 102; /* Network dropped connection because of reset */ +pub const ECONNABORTED: i32 = 103; /* Software caused connection abort */ +pub const ECONNRESET: i32 = 104; /* Connection reset by peer */ +pub const ENOBUFS: i32 = 105; /* No buffer space available */ +pub const EISCONN: i32 = 106; /* Transport endpoint is already connected */ +pub const ENOTCONN: i32 = 107; /* Transport endpoint is not connected */ +pub const ESHUTDOWN: i32 = 108; /* Cannot send after transport endpoint shutdown */ +pub const ETOOMANYREFS: i32 = 109; /* Too many references: cannot splice */ +pub const ETIMEDOUT: i32 = 110; /* Connection timed out */ +pub const ECONNREFUSED: i32 = 111; /* Connection refused */ +pub const EHOSTDOWN: i32 = 112; /* Host is down */ +pub const EHOSTUNREACH: i32 = 113; /* No route to host */ +pub const EALREADY: i32 = 114; /* Operation already in progress */ +pub const EINPROGRESS: i32 = 115; /* Operation now in progress */ +pub const ESTALE: i32 = 116; /* Stale NFS file handle */ +pub const EUCLEAN: i32 = 117; /* Structure needs cleaning */ +pub const ENOTNAM: i32 = 118; /* Not a XENIX named type file */ +pub const ENAVAIL: i32 = 119; /* No XENIX semaphores available */ +pub const EISNAM: i32 = 120; /* Is a named type file */ +pub const EREMOTEIO: i32 = 121; /* Remote I/O error */ +pub const EDQUOT: i32 = 122; /* Quota exceeded */ +pub const ENOMEDIUM: i32 = 123; /* No medium found */ +pub const EMEDIUMTYPE: i32 = 124; /* Wrong medium type */ +pub const ECANCELED: i32 = 125; /* Operation Canceled */ +pub const ENOKEY: i32 = 126; /* Required key not available */ +pub const EKEYEXPIRED: i32 = 127; /* Key has expired */ +pub const EKEYREVOKED: i32 = 128; /* Key has been revoked */ +pub const EKEYREJECTED: i32 = 129; /* Key was rejected by service */ +pub const EOWNERDEAD: i32 = 130; /* Owner died */ +pub const ENOTRECOVERABLE: i32 = 131; /* State not recoverable */ + +pub static STR_ERROR: [&'static str; 132] = ["Success", + "Operation not permitted", + "No such file or directory", + "No such process", + "Interrupted system call", + "I/O error", + "No such device or address", + "Argument list too long", + "Exec format error", + "Bad file number", + "No child processes", + "Try again", + "Out of memory", + "Permission denied", + "Bad address", + "Block device required", + "Device or resource busy", + "File exists", + "Cross-device link", + "No such device", + "Not a directory", + "Is a directory", + "Invalid argument", + "File table overflow", + "Too many open files", + "Not a typewriter", + "Text file busy", + "File too large", + "No space left on device", + "Illegal seek", + "Read-only file system", + "Too many links", + "Broken pipe", + "Math argument out of domain of func", + "Math result not representable", + "Resource deadlock would occur", + "File name too long", + "No record locks available", + "Function not implemented", + "Directory not empty", + "Too many symbolic links encountered", + "Operation would block", + "No message of desired type", + "Identifier removed", + "Channel number out of range", + "Level 2 not synchronized", + "Level 3 halted", + "Level 3 reset", + "Link number out of range", + "Protocol driver not attached", + "No CSI structure available", + "Level 2 halted", + "Invalid exchange", + "Invalid request descriptor", + "Exchange full", + "No anode", + "Invalid request code", + "Invalid slot", + "Resource deadlock would occur", + "Bad font file format", + "Device not a stream", + "No data available", + "Timer expired", + "Out of streams resources", + "Machine is not on the network", + "Package not installed", + "Object is remote", + "Link has been severed", + "Advertise error", + "Srmount error", + "Communication error on send", + "Protocol error", + "Multihop attempted", + "RFS specific error", + "Not a data message", + "Value too large for defined data type", + "Name not unique on network", + "File descriptor in bad state", + "Remote address changed", + "Can not access a needed shared library", + "Accessing a corrupted shared library", + ".lib section in a.out corrupted", + "Attempting to link in too many shared libraries", + "Cannot exec a shared library directly", + "Illegal byte sequence", + "Interrupted system call should be restarted", + "Streams pipe error", + "Too many users", + "Socket operation on non-socket", + "Destination address required", + "Message too long", + "Protocol wrong type for socket", + "Protocol not available", + "Protocol not supported", + "Socket type not supported", + "Operation not supported on transport endpoint", + "Protocol family not supported", + "Address family not supported by protocol", + "Address already in use", + "Cannot assign requested address", + "Network is down", + "Network is unreachable", + "Network dropped connection because of reset", + "Software caused connection abort", + "Connection reset by peer", + "No buffer space available", + "Transport endpoint is already connected", + "Transport endpoint is not connected", + "Cannot send after transport endpoint shutdown", + "Too many references: cannot splice", + "Connection timed out", + "Connection refused", + "Host is down", + "No route to host", + "Operation already in progress", + "Operation now in progress", + "Stale NFS file handle", + "Structure needs cleaning", + "Not a XENIX named type file", + "No XENIX semaphores available", + "Is a named type file", + "Remote I/O error", + "Quota exceeded", + "No medium found", + "Wrong medium type", + "Operation Canceled", + "Required key not available", + "Key has expired", + "Key has been revoked", + "Key was rejected by service", + "Owner died", + "State not recoverable"]; diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/flag.rs b/vendor/registry-40351f815f426200/redox_syscall/src/flag.rs new file mode 100644 index 000000000..6a03793b8 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/flag.rs @@ -0,0 +1,162 @@ +pub const CLONE_VM: usize = 0x100; +pub const CLONE_FS: usize = 0x200; +pub const CLONE_FILES: usize = 0x400; +pub const CLONE_SIGHAND: usize = 0x800; +pub const CLONE_VFORK: usize = 0x4000; +pub const CLONE_THREAD: usize = 0x10000; +pub const CLONE_STACK: usize = 0x1000_0000; + +pub const CLOCK_REALTIME: usize = 1; +pub const CLOCK_MONOTONIC: usize = 4; + +pub const EVENT_NONE: usize = 0; +pub const EVENT_READ: usize = 1; +pub const EVENT_WRITE: usize = 2; + +pub const F_DUPFD: usize = 0; +pub const F_GETFD: usize = 1; +pub const F_SETFD: usize = 2; +pub const F_GETFL: usize = 3; +pub const F_SETFL: usize = 4; + +pub const FUTEX_WAIT: usize = 0; +pub const FUTEX_WAKE: usize = 1; +pub const FUTEX_REQUEUE: usize = 2; + +pub const MAP_SHARED: usize = 0x0001; +pub const MAP_PRIVATE: usize = 0x0002; + +pub const MODE_TYPE: u16 = 0xF000; +pub const MODE_DIR: u16 = 0x4000; +pub const MODE_FILE: u16 = 0x8000; +pub const MODE_SYMLINK: u16 = 0xA000; +pub const MODE_FIFO: u16 = 0x1000; +pub const MODE_CHR: u16 = 0x2000; + +pub const MODE_PERM: u16 = 0x0FFF; +pub const MODE_SETUID: u16 = 0o4000; +pub const MODE_SETGID: u16 = 0o2000; + +pub const O_RDONLY: usize = 0x0001_0000; +pub const O_WRONLY: usize = 0x0002_0000; +pub const O_RDWR: usize = 0x0003_0000; +pub const O_NONBLOCK: usize = 0x0004_0000; +pub const O_APPEND: usize = 0x0008_0000; +pub const O_SHLOCK: usize = 0x0010_0000; +pub const O_EXLOCK: usize = 0x0020_0000; +pub const O_ASYNC: usize = 0x0040_0000; +pub const O_FSYNC: usize = 0x0080_0000; +pub const O_CLOEXEC: usize = 0x0100_0000; +pub const O_CREAT: usize = 0x0200_0000; +pub const O_TRUNC: usize = 0x0400_0000; +pub const O_EXCL: usize = 0x0800_0000; +pub const O_DIRECTORY: usize = 0x1000_0000; +pub const O_STAT: usize = 0x2000_0000; +pub const O_SYMLINK: usize = 0x4000_0000; +pub const O_NOFOLLOW: usize = 0x8000_0000; +pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; + +pub const PHYSMAP_WRITE: usize = 0x0000_0001; +pub const PHYSMAP_WRITE_COMBINE: usize = 0x0000_0002; +pub const PHYSMAP_NO_CACHE: usize = 0x0000_0004; + +pub const PROT_NONE: usize = 0x0000_0000; +pub const PROT_EXEC: usize = 0x0001_0000; +pub const PROT_WRITE: usize = 0x0002_0000; +pub const PROT_READ: usize = 0x0004_0000; + +pub const SEEK_SET: usize = 0; +pub const SEEK_CUR: usize = 1; +pub const SEEK_END: usize = 2; + +pub const SIGHUP: usize = 1; +pub const SIGINT: usize = 2; +pub const SIGQUIT: usize = 3; +pub const SIGILL: usize = 4; +pub const SIGTRAP: usize = 5; +pub const SIGABRT: usize = 6; +pub const SIGBUS: usize = 7; +pub const SIGFPE: usize = 8; +pub const SIGKILL: usize = 9; +pub const SIGUSR1: usize = 10; +pub const SIGSEGV: usize = 11; +pub const SIGUSR2: usize = 12; +pub const SIGPIPE: usize = 13; +pub const SIGALRM: usize = 14; +pub const SIGTERM: usize = 15; +pub const SIGSTKFLT: usize= 16; +pub const SIGCHLD: usize = 17; +pub const SIGCONT: usize = 18; +pub const SIGSTOP: usize = 19; +pub const SIGTSTP: usize = 20; +pub const SIGTTIN: usize = 21; +pub const SIGTTOU: usize = 22; +pub const SIGURG: usize = 23; +pub const SIGXCPU: usize = 24; +pub const SIGXFSZ: usize = 25; +pub const SIGVTALRM: usize= 26; +pub const SIGPROF: usize = 27; +pub const SIGWINCH: usize = 28; +pub const SIGIO: usize = 29; +pub const SIGPWR: usize = 30; +pub const SIGSYS: usize = 31; + +pub const SIG_DFL: usize = 0; +pub const SIG_IGN: usize = 1; + +pub const SIG_BLOCK: usize = 0; +pub const SIG_UNBLOCK: usize = 1; +pub const SIG_SETMASK: usize = 2; + +pub const SA_NOCLDSTOP: usize = 0x00000001; +pub const SA_NOCLDWAIT: usize = 0x00000002; +pub const SA_SIGINFO: usize = 0x00000004; +pub const SA_RESTORER: usize = 0x04000000; +pub const SA_ONSTACK: usize = 0x08000000; +pub const SA_RESTART: usize = 0x10000000; +pub const SA_NODEFER: usize = 0x40000000; +pub const SA_RESETHAND: usize = 0x80000000; + +pub const WNOHANG: usize = 0x01; +pub const WUNTRACED: usize = 0x02; +pub const WCONTINUED: usize = 0x08; + +/// True if status indicates the child is stopped. +pub fn wifstopped(status: usize) -> bool { + (status & 0xff) == 0x7f +} + +/// If wifstopped(status), the signal that stopped the child. +pub fn wstopsig(status: usize) -> usize { + (status >> 8) & 0xff +} + +/// True if status indicates the child continued after a stop. +pub fn wifcontinued(status: usize) -> bool { + status == 0xffff +} + +/// True if STATUS indicates termination by a signal. +pub fn wifsignaled(status: usize) -> bool { + ((status & 0x7f) + 1) as i8 >= 2 +} + +/// If wifsignaled(status), the terminating signal. +pub fn wtermsig(status: usize) -> usize { + status & 0x7f +} + +/// True if status indicates normal termination. +pub fn wifexited(status: usize) -> bool { + wtermsig(status) == 0 +} + +/// If wifexited(status), the exit status. +pub fn wexitstatus(status: usize) -> usize { + (status >> 8) & 0xff +} + +/// True if status indicates a core dump was created. +pub fn wcoredump(status: usize) -> bool { + (status & 0x80) != 0 +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/io/dma.rs b/vendor/registry-40351f815f426200/redox_syscall/src/io/dma.rs new file mode 100644 index 000000000..d5334b843 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/io/dma.rs @@ -0,0 +1,76 @@ +use core::{mem, ptr}; +use core::ops::{Deref, DerefMut}; + +use Result; + +struct PhysBox { + address: usize, + size: usize +} + +impl PhysBox { + fn new(size: usize) -> Result { + let address = unsafe { ::physalloc(size)? }; + Ok(PhysBox { + address: address, + size: size + }) + } +} + +impl Drop for PhysBox { + fn drop(&mut self) { + let _ = unsafe { ::physfree(self.address, self.size) }; + } +} + +pub struct Dma { + phys: PhysBox, + virt: *mut T +} + +impl Dma { + pub fn new(value: T) -> Result> { + let phys = PhysBox::new(mem::size_of::())?; + let virt = unsafe { ::physmap(phys.address, phys.size, ::PHYSMAP_WRITE)? } as *mut T; + unsafe { ptr::write(virt, value); } + Ok(Dma { + phys: phys, + virt: virt + }) + } + + pub fn zeroed() -> Result> { + let phys = PhysBox::new(mem::size_of::())?; + let virt = unsafe { ::physmap(phys.address, phys.size, ::PHYSMAP_WRITE)? } as *mut T; + unsafe { ptr::write_bytes(virt as *mut u8, 0, phys.size); } + Ok(Dma { + phys: phys, + virt: virt + }) + } + + pub fn physical(&self) -> usize { + self.phys.address + } +} + +impl Deref for Dma { + type Target = T; + fn deref(&self) -> &T { + unsafe { &*self.virt } + } +} + +impl DerefMut for Dma { + fn deref_mut(&mut self) -> &mut T { + unsafe { &mut *self.virt } + } +} + +impl Drop for Dma { + fn drop(&mut self) { + unsafe { drop(ptr::read(self.virt)); } + let _ = unsafe { ::physunmap(self.virt as usize) }; + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/io/io.rs b/vendor/registry-40351f815f426200/redox_syscall/src/io/io.rs new file mode 100644 index 000000000..fb866b581 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/io/io.rs @@ -0,0 +1,67 @@ +use core::cmp::PartialEq; +use core::ops::{BitAnd, BitOr, Not}; + +pub trait Io { + type Value: Copy + PartialEq + BitAnd + BitOr + Not; + + fn read(&self) -> Self::Value; + fn write(&mut self, value: Self::Value); + + #[inline(always)] + fn readf(&self, flags: Self::Value) -> bool { + (self.read() & flags) as Self::Value == flags + } + + #[inline(always)] + fn writef(&mut self, flags: Self::Value, value: bool) { + let tmp: Self::Value = match value { + true => self.read() | flags, + false => self.read() & !flags, + }; + self.write(tmp); + } +} + +pub struct ReadOnly { + inner: I +} + +impl ReadOnly { + pub const fn new(inner: I) -> ReadOnly { + ReadOnly { + inner: inner + } + } + + #[inline(always)] + pub fn read(&self) -> I::Value { + self.inner.read() + } + + #[inline(always)] + pub fn readf(&self, flags: I::Value) -> bool { + self.inner.readf(flags) + } +} + +pub struct WriteOnly { + inner: I +} + +impl WriteOnly { + pub const fn new(inner: I) -> WriteOnly { + WriteOnly { + inner: inner + } + } + + #[inline(always)] + pub fn write(&mut self, value: I::Value) { + self.inner.write(value) + } + + #[inline(always)] + pub fn writef(&mut self, flags: I::Value, value: bool) { + self.inner.writef(flags, value) + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/io/mmio.rs b/vendor/registry-40351f815f426200/redox_syscall/src/io/mmio.rs new file mode 100644 index 000000000..b8e7727d3 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/io/mmio.rs @@ -0,0 +1,31 @@ +use core::ptr::{read_volatile, write_volatile}; +use core::mem::uninitialized; +use core::ops::{BitAnd, BitOr, Not}; + +use super::io::Io; + +#[repr(packed)] +pub struct Mmio { + value: T, +} + +impl Mmio { + /// Create a new Mmio without initializing + pub fn new() -> Self { + Mmio { + value: unsafe { uninitialized() } + } + } +} + +impl Io for Mmio where T: Copy + PartialEq + BitAnd + BitOr + Not { + type Value = T; + + fn read(&self) -> T { + unsafe { read_volatile(&self.value) } + } + + fn write(&mut self, value: T) { + unsafe { write_volatile(&mut self.value, value) }; + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/io/mod.rs b/vendor/registry-40351f815f426200/redox_syscall/src/io/mod.rs new file mode 100644 index 000000000..a35456e30 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/io/mod.rs @@ -0,0 +1,11 @@ +//! I/O functions + +pub use self::dma::*; +pub use self::io::*; +pub use self::mmio::*; +pub use self::pio::*; + +mod dma; +mod io; +mod mmio; +mod pio; diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/io/pio.rs b/vendor/registry-40351f815f426200/redox_syscall/src/io/pio.rs new file mode 100644 index 000000000..91ae310b6 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/io/pio.rs @@ -0,0 +1,89 @@ +use core::marker::PhantomData; + +use super::io::Io; + +/// Generic PIO +#[derive(Copy, Clone)] +pub struct Pio { + port: u16, + value: PhantomData, +} + +impl Pio { + /// Create a PIO from a given port + pub const fn new(port: u16) -> Self { + Pio:: { + port: port, + value: PhantomData, + } + } +} + +/// Read/Write for byte PIO +impl Io for Pio { + type Value = u8; + + /// Read + #[inline(always)] + fn read(&self) -> u8 { + let value: u8; + unsafe { + asm!("in $0, $1" : "={al}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + value + } + + /// Write + #[inline(always)] + fn write(&mut self, value: u8) { + unsafe { + asm!("out $1, $0" : : "{al}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + } +} + +/// Read/Write for word PIO +impl Io for Pio { + type Value = u16; + + /// Read + #[inline(always)] + fn read(&self) -> u16 { + let value: u16; + unsafe { + asm!("in $0, $1" : "={ax}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + value + } + + /// Write + #[inline(always)] + fn write(&mut self, value: u16) { + unsafe { + asm!("out $1, $0" : : "{ax}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + } +} + +/// Read/Write for doubleword PIO +impl Io for Pio { + type Value = u32; + + /// Read + #[inline(always)] + fn read(&self) -> u32 { + let value: u32; + unsafe { + asm!("in $0, $1" : "={eax}"(value) : "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + value + } + + /// Write + #[inline(always)] + fn write(&mut self, value: u32) { + unsafe { + asm!("out $1, $0" : : "{eax}"(value), "{dx}"(self.port) : "memory" : "intel", "volatile"); + } + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/lib.rs b/vendor/registry-40351f815f426200/redox_syscall/src/lib.rs new file mode 100644 index 000000000..8851fbb79 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/lib.rs @@ -0,0 +1,49 @@ +#![feature(asm)] +#![feature(const_fn)] +#![no_std] + +pub use self::arch::*; +pub use self::call::*; +pub use self::data::*; +pub use self::error::*; +pub use self::flag::*; +pub use self::io::*; +pub use self::number::*; +pub use self::scheme::*; + +#[cfg(target_arch = "arm")] +#[path="arch/arm.rs"] +mod arch; + +#[cfg(target_arch = "aarch64")] +#[path="arch/aarch64.rs"] +mod arch; + +#[cfg(target_arch = "x86")] +#[path="arch/x86.rs"] +mod arch; + +#[cfg(target_arch = "x86_64")] +#[path="arch/x86_64.rs"] +mod arch; + +/// Function definitions +pub mod call; + +/// Complex structures that are used for some system calls +pub mod data; + +/// All errors that can be generated by a system call +pub mod error; + +/// Flags used as an argument to many system calls +pub mod flag; + +/// Functions for low level hardware control +pub mod io; + +/// Call numbers used by each system call +pub mod number; + +/// A trait useful for scheme handlers +pub mod scheme; diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/number.rs b/vendor/registry-40351f815f426200/redox_syscall/src/number.rs new file mode 100644 index 000000000..ec9acfaac --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/number.rs @@ -0,0 +1,76 @@ +pub const SYS_CLASS: usize = 0xF000_0000; +pub const SYS_CLASS_PATH: usize=0x1000_0000; +pub const SYS_CLASS_FILE: usize=0x2000_0000; + +pub const SYS_ARG: usize = 0x0F00_0000; +pub const SYS_ARG_SLICE: usize =0x0100_0000; +pub const SYS_ARG_MSLICE: usize=0x0200_0000; +pub const SYS_ARG_PATH: usize = 0x0300_0000; + +pub const SYS_RET: usize = 0x00F0_0000; +pub const SYS_RET_FILE: usize = 0x0010_0000; + +pub const SYS_LINK: usize = SYS_CLASS_PATH | SYS_ARG_PATH | 9; +pub const SYS_OPEN: usize = SYS_CLASS_PATH | SYS_RET_FILE | 5; +pub const SYS_CHMOD: usize = SYS_CLASS_PATH | 15; +pub const SYS_RMDIR: usize = SYS_CLASS_PATH | 84; +pub const SYS_UNLINK: usize = SYS_CLASS_PATH | 10; + +pub const SYS_CLOSE: usize = SYS_CLASS_FILE | 6; +pub const SYS_DUP: usize = SYS_CLASS_FILE | SYS_RET_FILE | 41; +pub const SYS_DUP2: usize = SYS_CLASS_FILE | SYS_RET_FILE | 63; +pub const SYS_READ: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 3; +pub const SYS_WRITE: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 4; +pub const SYS_LSEEK: usize = SYS_CLASS_FILE | 19; +pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94; +pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207; +pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55; +pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927; +pub const SYS_FEXEC: usize = SYS_CLASS_FILE | 11; +pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 90; +pub const SYS_FUNMAP: usize = SYS_CLASS_FILE | 91; +pub const SYS_FPATH: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 928; +pub const SYS_FRENAME: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 38; +pub const SYS_FSTAT: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 28; +pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 100; +pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118; +pub const SYS_FTRUNCATE: usize =SYS_CLASS_FILE | 93; +pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320; + +pub const SYS_BRK: usize = 45; +pub const SYS_CHDIR: usize = 12; +pub const SYS_CLOCK_GETTIME: usize = 265; +pub const SYS_CLONE: usize = 120; +pub const SYS_EXIT: usize = 1; +pub const SYS_FUTEX: usize = 240; +pub const SYS_GETCWD: usize = 183; +pub const SYS_GETEGID: usize = 202; +pub const SYS_GETENS: usize = 951; +pub const SYS_GETEUID: usize = 201; +pub const SYS_GETGID: usize = 200; +pub const SYS_GETNS: usize = 950; +pub const SYS_GETPID: usize = 20; +pub const SYS_GETPGID: usize = 132; +pub const SYS_GETPPID: usize = 64; +pub const SYS_GETUID: usize = 199; +pub const SYS_IOPL: usize = 110; +pub const SYS_KILL: usize = 37; +pub const SYS_MPROTECT: usize = 125; +pub const SYS_MKNS: usize = 984; +pub const SYS_NANOSLEEP: usize =162; +pub const SYS_PHYSALLOC: usize =945; +pub const SYS_PHYSFREE: usize = 946; +pub const SYS_PHYSMAP: usize = 947; +pub const SYS_PHYSUNMAP: usize =948; +pub const SYS_VIRTTOPHYS: usize=949; +pub const SYS_PIPE2: usize = 331; +pub const SYS_SETPGID: usize = 57; +pub const SYS_SETREGID: usize = 204; +pub const SYS_SETRENS: usize = 952; +pub const SYS_SETREUID: usize = 203; +pub const SYS_SIGACTION: usize =67; +pub const SYS_SIGPROCMASK:usize=126; +pub const SYS_SIGRETURN: usize =119; +pub const SYS_UMASK: usize = 60; +pub const SYS_WAITPID: usize = 7; +pub const SYS_YIELD: usize = 158; diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/generate.sh b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/generate.sh new file mode 100755 index 000000000..e5d11ae30 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/generate.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e + +echo "Generating SchemeMut from Scheme" +sed 's/trait Scheme/trait SchemeMut/' scheme.rs \ +| sed 's/\&self/\&mut self/g' \ +> scheme_mut.rs + +echo "Generating SchemeBlock from Scheme" +sed 's/trait Scheme/trait SchemeBlock/' scheme.rs \ +| sed 's/fn handle(\&self, packet: \&mut Packet)/fn handle(\&self, packet: \&Packet) -> Option/' \ +| sed 's/packet.a = Error::mux(res);/res.transpose().map(Error::mux)/' \ +| sed 's/Result/Result>/g' \ +> scheme_block.rs + +echo "Generating SchemeBlockMut from SchemeBlock" +sed 's/trait SchemeBlock/trait SchemeBlockMut/' scheme_block.rs \ +| sed 's/\&self/\&mut self/g' \ +> scheme_block_mut.rs diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/mod.rs b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/mod.rs new file mode 100644 index 000000000..66f8fc76d --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/mod.rs @@ -0,0 +1,9 @@ +pub use self::scheme::Scheme; +pub use self::scheme_mut::SchemeMut; +pub use self::scheme_block::SchemeBlock; +pub use self::scheme_block_mut::SchemeBlockMut; + +mod scheme; +mod scheme_mut; +mod scheme_block; +mod scheme_block_mut; diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme.rs b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme.rs new file mode 100644 index 000000000..c047e9683 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme.rs @@ -0,0 +1,167 @@ +use core::{mem, slice}; + +use data::*; +use error::*; +use number::*; + +pub trait Scheme { + fn handle(&self, packet: &mut Packet) { + let res = match packet.a { + SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), + SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), + SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + + SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), + SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), + SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), + SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FMAP => if packet.d >= mem::size_of::() { + self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FUNMAP => self.funmap(packet.b), + SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FSTAT => if packet.d >= mem::size_of::() { + self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSTATVFS => if packet.d >= mem::size_of::() { + self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSYNC => self.fsync(packet.b), + SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), + SYS_FUTIMENS => if packet.d >= mem::size_of::() { + self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_CLOSE => self.close(packet.b), + _ => Err(Error::new(ENOSYS)) + }; + + packet.a = Error::mux(res); + } + + /* Scheme operations */ + + #[allow(unused_variables)] + fn open(&self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn rmdir(&self, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn unlink(&self, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + /* Resource operations */ + #[allow(unused_variables)] + fn dup(&self, old_id: usize, buf: &[u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn read(&self, id: usize, buf: &mut [u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn write(&self, id: usize, buf: &[u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn seek(&self, id: usize, pos: usize, whence: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchmod(&self, id: usize, mode: u16) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchown(&self, id: usize, uid: u32, gid: u32) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fcntl(&self, id: usize, cmd: usize, arg: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fevent(&self, id: usize, flags: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fmap(&self, id: usize, map: &Map) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn funmap(&self, address: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fpath(&self, id: usize, buf: &mut [u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn frename(&self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstat(&self, id: usize, stat: &mut Stat) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstatvfs(&self, id: usize, stat: &mut StatVfs) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fsync(&self, id: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn ftruncate(&self, id: usize, len: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn futimens(&self, id: usize, times: &[TimeSpec]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn close(&self, id: usize) -> Result { + Err(Error::new(EBADF)) + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block.rs b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block.rs new file mode 100644 index 000000000..0407dde61 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block.rs @@ -0,0 +1,167 @@ +use core::{mem, slice}; + +use data::*; +use error::*; +use number::*; + +pub trait SchemeBlock { + fn handle(&self, packet: &Packet) -> Option { + let res = match packet.a { + SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), + SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), + SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + + SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), + SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), + SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), + SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FMAP => if packet.d >= mem::size_of::() { + self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FUNMAP => self.funmap(packet.b), + SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FSTAT => if packet.d >= mem::size_of::() { + self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSTATVFS => if packet.d >= mem::size_of::() { + self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSYNC => self.fsync(packet.b), + SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), + SYS_FUTIMENS => if packet.d >= mem::size_of::() { + self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_CLOSE => self.close(packet.b), + _ => Err(Error::new(ENOSYS)) + }; + + res.transpose().map(Error::mux) + } + + /* Scheme operations */ + + #[allow(unused_variables)] + fn open(&self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn chmod(&self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn rmdir(&self, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn unlink(&self, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + /* Resource operations */ + #[allow(unused_variables)] + fn dup(&self, old_id: usize, buf: &[u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn read(&self, id: usize, buf: &mut [u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn write(&self, id: usize, buf: &[u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn seek(&self, id: usize, pos: usize, whence: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchmod(&self, id: usize, mode: u16) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchown(&self, id: usize, uid: u32, gid: u32) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fcntl(&self, id: usize, cmd: usize, arg: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fevent(&self, id: usize, flags: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fmap(&self, id: usize, map: &Map) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn funmap(&self, address: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fpath(&self, id: usize, buf: &mut [u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn frename(&self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstat(&self, id: usize, stat: &mut Stat) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstatvfs(&self, id: usize, stat: &mut StatVfs) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fsync(&self, id: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn ftruncate(&self, id: usize, len: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn futimens(&self, id: usize, times: &[TimeSpec]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn close(&self, id: usize) -> Result> { + Err(Error::new(EBADF)) + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block_mut.rs b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block_mut.rs new file mode 100644 index 000000000..411035f42 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_block_mut.rs @@ -0,0 +1,167 @@ +use core::{mem, slice}; + +use data::*; +use error::*; +use number::*; + +pub trait SchemeBlockMut { + fn handle(&mut self, packet: &Packet) -> Option { + let res = match packet.a { + SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), + SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), + SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + + SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), + SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), + SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), + SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FMAP => if packet.d >= mem::size_of::() { + self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FUNMAP => self.funmap(packet.b), + SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FSTAT => if packet.d >= mem::size_of::() { + self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSTATVFS => if packet.d >= mem::size_of::() { + self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSYNC => self.fsync(packet.b), + SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), + SYS_FUTIMENS => if packet.d >= mem::size_of::() { + self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_CLOSE => self.close(packet.b), + _ => Err(Error::new(ENOSYS)) + }; + + res.transpose().map(Error::mux) + } + + /* Scheme operations */ + + #[allow(unused_variables)] + fn open(&mut self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn chmod(&mut self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn rmdir(&mut self, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn unlink(&mut self, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(ENOENT)) + } + + /* Resource operations */ + #[allow(unused_variables)] + fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn read(&mut self, id: usize, buf: &mut [u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn write(&mut self, id: usize, buf: &[u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn seek(&mut self, id: usize, pos: usize, whence: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchmod(&mut self, id: usize, mode: u16) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchown(&mut self, id: usize, uid: u32, gid: u32) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fcntl(&mut self, id: usize, cmd: usize, arg: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fevent(&mut self, id: usize, flags: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fmap(&mut self, id: usize, map: &Map) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn funmap(&mut self, address: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn frename(&mut self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstat(&mut self, id: usize, stat: &mut Stat) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstatvfs(&mut self, id: usize, stat: &mut StatVfs) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fsync(&mut self, id: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn ftruncate(&mut self, id: usize, len: usize) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn futimens(&mut self, id: usize, times: &[TimeSpec]) -> Result> { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn close(&mut self, id: usize) -> Result> { + Err(Error::new(EBADF)) + } +} diff --git a/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_mut.rs b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_mut.rs new file mode 100644 index 000000000..abd2e88e5 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_syscall/src/scheme/scheme_mut.rs @@ -0,0 +1,167 @@ +use core::{mem, slice}; + +use data::*; +use error::*; +use number::*; + +pub trait SchemeMut { + fn handle(&mut self, packet: &mut Packet) { + let res = match packet.a { + SYS_OPEN => self.open(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d, packet.uid, packet.gid), + SYS_CHMOD => self.chmod(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.d as u16, packet.uid, packet.gid), + SYS_RMDIR => self.rmdir(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + SYS_UNLINK => self.unlink(unsafe { slice::from_raw_parts(packet.b as *const u8, packet.c) }, packet.uid, packet.gid), + + SYS_DUP => self.dup(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_READ => self.read(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_WRITE => self.write(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }), + SYS_LSEEK => self.seek(packet.b, packet.c, packet.d), + SYS_FCHMOD => self.fchmod(packet.b, packet.c as u16), + SYS_FCHOWN => self.fchown(packet.b, packet.c as u32, packet.d as u32), + SYS_FCNTL => self.fcntl(packet.b, packet.c, packet.d), + SYS_FEVENT => self.fevent(packet.b, packet.c), + SYS_FMAP => if packet.d >= mem::size_of::() { + self.fmap(packet.b, unsafe { &*(packet.c as *const Map) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FUNMAP => self.funmap(packet.b), + SYS_FPATH => self.fpath(packet.b, unsafe { slice::from_raw_parts_mut(packet.c as *mut u8, packet.d) }), + SYS_FRENAME => self.frename(packet.b, unsafe { slice::from_raw_parts(packet.c as *const u8, packet.d) }, packet.uid, packet.gid), + SYS_FSTAT => if packet.d >= mem::size_of::() { + self.fstat(packet.b, unsafe { &mut *(packet.c as *mut Stat) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSTATVFS => if packet.d >= mem::size_of::() { + self.fstatvfs(packet.b, unsafe { &mut *(packet.c as *mut StatVfs) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_FSYNC => self.fsync(packet.b), + SYS_FTRUNCATE => self.ftruncate(packet.b, packet.c), + SYS_FUTIMENS => if packet.d >= mem::size_of::() { + self.futimens(packet.b, unsafe { slice::from_raw_parts(packet.c as *const TimeSpec, packet.d / mem::size_of::()) }) + } else { + Err(Error::new(EFAULT)) + }, + SYS_CLOSE => self.close(packet.b), + _ => Err(Error::new(ENOSYS)) + }; + + packet.a = Error::mux(res); + } + + /* Scheme operations */ + + #[allow(unused_variables)] + fn open(&mut self, path: &[u8], flags: usize, uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn chmod(&mut self, path: &[u8], mode: u16, uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn rmdir(&mut self, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + #[allow(unused_variables)] + fn unlink(&mut self, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(ENOENT)) + } + + /* Resource operations */ + #[allow(unused_variables)] + fn dup(&mut self, old_id: usize, buf: &[u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn read(&mut self, id: usize, buf: &mut [u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn write(&mut self, id: usize, buf: &[u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn seek(&mut self, id: usize, pos: usize, whence: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchmod(&mut self, id: usize, mode: u16) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fchown(&mut self, id: usize, uid: u32, gid: u32) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fcntl(&mut self, id: usize, cmd: usize, arg: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fevent(&mut self, id: usize, flags: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fmap(&mut self, id: usize, map: &Map) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn funmap(&mut self, address: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fpath(&mut self, id: usize, buf: &mut [u8]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn frename(&mut self, id: usize, path: &[u8], uid: u32, gid: u32) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstat(&mut self, id: usize, stat: &mut Stat) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fstatvfs(&mut self, id: usize, stat: &mut StatVfs) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn fsync(&mut self, id: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn ftruncate(&mut self, id: usize, len: usize) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn futimens(&mut self, id: usize, times: &[TimeSpec]) -> Result { + Err(Error::new(EBADF)) + } + + #[allow(unused_variables)] + fn close(&mut self, id: usize) -> Result { + Err(Error::new(EBADF)) + } +} diff --git a/vendor/registry-40351f815f426200/redox_termios/.cargo-checksum.json b/vendor/registry-40351f815f426200/redox_termios/.cargo-checksum.json new file mode 100644 index 000000000..cfb655d32 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_termios/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"e7d20b4132bf22e2c98a5f846f8c16e7628a9181d485fd131b97127ea8719130","LICENSE":"cb46b697c3fd9d27d7bfe1b1ad48f8a58a284984504c6eb215ae2164538df7cb","README.md":"c62ac3d33174db7977cfc7fc77605885f5445c0c9c7d1310dcbe3564c2854edb","src/lib.rs":"af5bc7c59c695880fef0352f9e0f9e9f8682c262a9b1c0fce725b10553647b4e"},"package":"7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/redox_termios/Cargo.toml b/vendor/registry-40351f815f426200/redox_termios/Cargo.toml new file mode 100644 index 000000000..a89b0e89c --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_termios/Cargo.toml @@ -0,0 +1,26 @@ +# 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 = "redox_termios" +version = "0.1.1" +authors = ["Jeremy Soller "] +description = "A Rust library to access Redox termios functions" +documentation = "https://docs.rs/redox_termios" +license = "MIT" +repository = "https://github.com/redox-os/termios" + +[lib] +name = "redox_termios" +path = "src/lib.rs" +[dependencies.redox_syscall] +version = "0.1" diff --git a/vendor/registry-40351f815f426200/redox_termios/LICENSE b/vendor/registry-40351f815f426200/redox_termios/LICENSE new file mode 100644 index 000000000..5deeece4f --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_termios/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 Redox OS + +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/vendor/registry-40351f815f426200/redox_termios/README.md b/vendor/registry-40351f815f426200/redox_termios/README.md new file mode 100644 index 000000000..24156cb95 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_termios/README.md @@ -0,0 +1,2 @@ +# termios +Redox Rust termios library diff --git a/vendor/registry-40351f815f426200/redox_termios/src/lib.rs b/vendor/registry-40351f815f426200/redox_termios/src/lib.rs new file mode 100644 index 000000000..b1c904502 --- /dev/null +++ b/vendor/registry-40351f815f426200/redox_termios/src/lib.rs @@ -0,0 +1,218 @@ +#![allow(non_camel_case_types)] +#![no_std] + +extern crate syscall; + +use core::{mem, slice}; +use core::ops::{Deref, DerefMut}; + +pub type tcflag_t = u32; +pub type cc_t = u8; + +/* c_cc { */ +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; +/* } c_cc */ + +/* c_iflag { */ +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 IXON: tcflag_t = 0o001000; +pub const IXOFF: tcflag_t = 0o002000; +/* } c_iflag */ + +/* c_oflag { */ +pub const OPOST: tcflag_t = 0o000001; +pub const ONLCR: tcflag_t = 0o000002; +pub const OLCUC: 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; +/* } c_oflag */ + +/* c_cflag { */ +pub const B0: tcflag_t = 0o000000; +pub const B50: tcflag_t = 0o000001; +pub const B75: tcflag_t = 0o000002; +pub const B110: tcflag_t = 0o000003; +pub const B134: tcflag_t = 0o000004; +pub const B150: tcflag_t = 0o000005; +pub const B200: tcflag_t = 0o000006; +pub const B300: tcflag_t = 0o000007; +pub const B600: tcflag_t = 0o000010; +pub const B1200: tcflag_t = 0o000011; +pub const B1800: tcflag_t = 0o000012; +pub const B2400: tcflag_t = 0o000013; +pub const B4800: tcflag_t = 0o000014; +pub const B9600: tcflag_t = 0o000015; +pub const B19200: tcflag_t = 0o000016; +pub const B38400: tcflag_t = 0o000017; +pub const B57600: tcflag_t = 0o0020; +pub const B115200: tcflag_t = 0o0021; +pub const B230400: tcflag_t = 0o0022; +pub const B460800: tcflag_t = 0o0023; +pub const B500000: tcflag_t = 0o0024; +pub const B576000: tcflag_t = 0o0025; +pub const B921600: tcflag_t = 0o0026; +pub const B1000000: tcflag_t = 0o0027; +pub const B1152000: tcflag_t = 0o0030; +pub const B1500000: tcflag_t = 0o0031; +pub const B2000000: tcflag_t = 0o0032; +pub const B2500000: tcflag_t = 0o0033; +pub const B3000000: tcflag_t = 0o0034; +pub const B3500000: tcflag_t = 0o0035; +pub const B4000000: tcflag_t = 0o0036; + +pub const __MAX_BAUD: tcflag_t = B4000000; + +pub const CSIZE: tcflag_t = 0o0001400; +pub const CS5: tcflag_t = 0o0000000; +pub const CS6: tcflag_t = 0o0000400; +pub const CS7: tcflag_t = 0o0001000; +pub const CS8: tcflag_t = 0o0001400; + +pub const CSTOPB: tcflag_t = 0o0002000; +pub const CREAD: tcflag_t = 0o0004000; +pub const PARENB: tcflag_t = 0o0010000; +pub const PARODD: tcflag_t = 0o0020000; +pub const HUPCL: tcflag_t = 0o0040000; + +pub const CLOCAL: tcflag_t = 0o0100000; +/* } c_clfag */ + +/* c_lflag { */ +pub const ISIG: tcflag_t = 0x00000080; +pub const ICANON: tcflag_t = 0x00000100; +pub const ECHO: tcflag_t = 0x00000008; +pub const ECHOE: tcflag_t = 0x00000002; +pub const ECHOK: tcflag_t = 0x00000004; +pub const ECHONL: tcflag_t = 0x00000010; +pub const NOFLSH: tcflag_t = 0x80000000; +pub const TOSTOP: tcflag_t = 0x00400000; +pub const IEXTEN: tcflag_t = 0x00000400; +/* } c_lflag */ + +#[derive(Clone, Copy, Debug)] +#[repr(C)] +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; 32] +} + +impl Default for Termios { + fn default() -> Termios { + let mut termios = Termios { + c_iflag: ICRNL | IXON, + c_oflag: OPOST | ONLCR, + c_cflag: B38400 | CS8 | CREAD | HUPCL, + c_lflag: ISIG | ICANON | ECHO | ECHOE | ECHOK | IEXTEN, + c_cc: [0; 32] + }; + + { + let mut cc = |i: usize, b: cc_t| { + termios.c_cc[i] = b; + }; + + cc(VEOF, 0o004); // CTRL-D + cc(VEOL, 0o000); // NUL + cc(VEOL2, 0o000); // NUL + cc(VERASE, 0o177); // DEL + cc(VWERASE, 0o027); // CTRL-W + cc(VKILL, 0o025); // CTRL-U + cc(VREPRINT, 0o022);// CTRL-R + cc(VINTR, 0o003); // CTRL-C + cc(VQUIT, 0o034); // CTRL-\ + cc(VSUSP, 0o032); // CTRL-Z + cc(VSTART, 0o021); // CTRL-Q + cc(VSTOP, 0o023); // CTRL-S + cc(VLNEXT, 0o026); // CTRL-V + cc(VDISCARD, 0o017);// CTRL-U + cc(VMIN, 1); + cc(VTIME, 0); + } + + termios + } +} + +impl Termios { + pub fn make_raw(&mut self) { + self.c_iflag &= !(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); + self.c_oflag &= !OPOST; + self.c_cflag &= !(CSIZE | PARENB); + self.c_cflag |= CS8; + self.c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); + } +} + +impl Deref for Termios { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Termios as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Termios { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Termios as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} + +#[derive(Clone, Copy, Debug, Default)] +#[repr(C)] +pub struct Winsize { + pub ws_row: u16, + pub ws_col: u16 +} + +impl Deref for Winsize { + type Target = [u8]; + fn deref(&self) -> &[u8] { + unsafe { + slice::from_raw_parts(self as *const Winsize as *const u8, mem::size_of::()) as &[u8] + } + } +} + +impl DerefMut for Winsize { + fn deref_mut(&mut self) -> &mut [u8] { + unsafe { + slice::from_raw_parts_mut(self as *mut Winsize as *mut u8, mem::size_of::()) as &mut [u8] + } + } +} diff --git a/vendor/registry-40351f815f426200/remain/.cargo-checksum.json b/vendor/registry-40351f815f426200/remain/.cargo-checksum.json new file mode 100644 index 000000000..674c455ed --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d0838b7a04d0227945245ca894dbd409d9ad1d1d1fc426d51511015f0b431f4b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"4a0cd9b5971cc01dc325f7efd3bd3eaad7b92f5d2db4f53b97b6c54b86db29a4","src/check.rs":"0817a7877fdb0048f3a4f95743ceac87ba9edc10a0e85e6f6720e78e88a5fa4f","src/compare.rs":"b4749ef0a9fd590bcdae0e88c1c85c4387d67e00cef5ce42f3c79c5962b8d5af","src/emit.rs":"9f169a4609c452e1bf84e904e36348c59d3756af6be10f7b52aaac3a71e84efc","src/format.rs":"dfad2eff460c631b8b6a604db4d8c4f232973c4a52bcad409820652eec231a6d","src/lib.rs":"f34d2ee3d2993b7ec9fa38b12691d74d254b83c8812a81732e6adccacc9264eb","src/parse.rs":"c9052bf88265866010ffde62f3de121ce51a3697e2a84e86039698b974704783","src/visit.rs":"589ffe2d53c72057cedb65186f9ce73d6240f3267269d47cd968cd776118bcb4","tests/compiletest.rs":"798a092a2e6f7e7085f08f9b6a022fcf4550f027af596cb04e27fbd33a3b6f70","tests/stable.rs":"bf11f85194e48b7b3120c089c3c04bdf5b17e486f2bb2658f330a58d2a25b07d","tests/ui/enum.rs":"2e12d32637ce23201698bded6d888e2ea83145a887c97cbb8b0aa16e09fecc33","tests/ui/enum.stderr":"6b5e3a7961ffbb851411de6dddce1b2fed5b633d2e904cd6b5cf2900a01c7fa6","tests/ui/let-stable.rs":"45d40796a720591d57b8490f28aea2e41d69c5450e75f337312e59c9469b288d","tests/ui/let-stable.stderr":"1e913d626d709e9f437aaf8b2451a33d110a9a9e8a18e69d99629630a866659c","tests/ui/let-unstable.rs":"5cc32e47dfa844c756ba9c305272e5ad3e5415919b8a4dda6577a1a6d2cc5f02","tests/ui/let-unstable.stderr":"ee565f0e54729fe3353ca373c5c4945c3329c7107d551f9ad63df9e5b01145b0","tests/ui/match-stable.rs":"8d9422074a364db27a3ae9f4b0c7869f5b374738315536cf4c1a0a52d4731379","tests/ui/match-stable.stderr":"27da2da6d4ae09b0bddf3d6c07f8185869597fed0d99daf513166c2ccc7e146c","tests/ui/match-unstable.rs":"374b606c355ce781406115c9920447bdf517dfd6a5bc9199fd5a1899bfd9b3bf","tests/ui/match-unstable.stderr":"df4451390bd42eeb25d96b8a97ea384c7c0b81ac4d0088ee9011613215ca4815","tests/ui/struct.rs":"2d74dbe91a8af8da4a0f0267d34483dda63274d21f96a8d139d4a890571c233c","tests/ui/struct.stderr":"f037fc85e16f6bfa24a9939bd7cc332804448d3d8bd12c7bdd29d43bfec0c210","tests/ui/unnamed-fields.rs":"aae1255b0e4e4f2f283d9112478e67ea271783685575db446a7041734043041b","tests/ui/unnamed-fields.stderr":"9bd8dacb7570a28e8d709fccb31eca833b705b355a198d125a45f5f8c61b0cc5","tests/ui/unsupported.rs":"ce4252df7a1c6801a0a4e4d962454013f7f137c30f92e501db409a15fdb35dde","tests/ui/unsupported.stderr":"cbeb5037d82ee5bf4230085a727f554f3bebef5d748ab55e210f1fa0f2c8a914","tests/unstable.rs":"e9b3226bd548194cdbf295db40218b082df4131735d9d4f5eee49af9406df77e"},"package":"725c14cd936029b13547500781bd45284848e8e3970b7ef4179ecb202a150d64"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/remain/Cargo.toml b/vendor/registry-40351f815f426200/remain/Cargo.toml new file mode 100644 index 000000000..4134e6754 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/Cargo.toml @@ -0,0 +1,39 @@ +# 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 = "remain" +version = "0.1.3" +authors = ["David Tolnay "] +description = "Compile-time checks that an enum, struct, or match is written in sorted order." +documentation = "https://docs.rs/remain" +readme = "README.md" +license = "MIT OR Apache-2.0" +repository = "https://github.com/dtolnay/remain" + +[lib] +proc-macro = true +[dependencies.proc-macro2] +version = "0.4" + +[dependencies.quote] +version = "0.6" + +[dependencies.syn] +version = "0.15" +features = ["full", "visit-mut"] +[dev-dependencies.select-rustc] +version = "0.1" + +[dev-dependencies.trybuild] +version = "1.0" diff --git a/vendor/registry-40351f815f426200/remain/LICENSE-APACHE b/vendor/registry-40351f815f426200/remain/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/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/vendor/registry-40351f815f426200/remain/LICENSE-MIT b/vendor/registry-40351f815f426200/remain/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/LICENSE-MIT @@ -0,0 +1,23 @@ +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/vendor/registry-40351f815f426200/remain/README.md b/vendor/registry-40351f815f426200/remain/README.md new file mode 100644 index 000000000..c3a48779b --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/README.md @@ -0,0 +1,135 @@ +Remain sorted +============= + +[![Build Status](https://api.travis-ci.com/dtolnay/remain.svg?branch=master)](https://travis-ci.com/dtolnay/remain) +[![Latest Version](https://img.shields.io/crates/v/remain.svg)](https://crates.io/crates/remain) +[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/remain) + +This crate provides an attribute macro to check at compile time that the +variants of an enum or the arms of a match expression are written in sorted +order. + +```toml +[dependencies] +remain = "0.1" +``` + +## Syntax + +Place a `#[remain::sorted]` attribute on enums, structs, match-expressions, or +let-statements whose value is a match-expression. + +Alternatively, import as `use remain::sorted;` and use `#[sorted]` as the +attribute. + +```rust +#[remain::sorted] +#[derive(Debug)] +pub enum Error { + BlockSignal(signal::Error), + CreateCrasClient(libcras::Error), + CreateEventFd(sys_util::Error), + CreateSignalFd(sys_util::SignalFdError), + CreateSocket(io::Error), + DetectImageType(qcow::Error), + DeviceJail(io_jail::Error), + NetDeviceNew(virtio::NetError), + SpawnVcpu(io::Error), +} + +#[remain::sorted] +#[derive(Debug)] +pub enum Registers { + ax: u16, + cx: u16, + di: u16, + si: u16, + sp: u16, +} + +impl Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + #[remain::sorted] + match self { + BlockSignal(e) => write!(f, "failed to block signal: {}", e), + CreateCrasClient(e) => write!(f, "failed to create cras client: {}", e), + CreateEventFd(e) => write!(f, "failed to create eventfd: {}", e), + CreateSignalFd(e) => write!(f, "failed to create signalfd: {}", e), + CreateSocket(e) => write!(f, "failed to create socket: {}", e), + DetectImageType(e) => write!(f, "failed to detect disk image type: {}", e), + DeviceJail(e) => write!(f, "failed to jail device: {}", e), + NetDeviceNew(e) => write!(f, "failed to set up virtio networking: {}", e), + SpawnVcpu(e) => write!(f, "failed to spawn VCPU thread: {}", e), + } + } +} +``` + +If an enum variant, struct field, or match arm is inserted out of order, + +```diff + NetDeviceNew(virtio::NetError), + SpawnVcpu(io::Error), ++ AaaUhOh(Box), + } +``` + +then the macro produces a compile error. + +```console +error: AaaUhOh should sort before BlockSignal + --> tests/stable.rs:49:5 + | +49 | AaaUhOh(Box), + | ^^^^^^^ +``` + +## Compiler support + +The attribute on enums and structs is supported on any rustc version 1.31+. + +Rust does not yet have stable support for user-defined attributes within a +function body, so the attribute on match-expressions and let-statements requires +a nightly compiler and the following two features enabled: + +```rust +#![feature(proc_macro_hygiene, stmt_expr_attributes)] +``` + +As a stable alternative, this crate provides a function-level attribute called +`#[remain::check]` which makes match-expression and let-statement attributes +work on any rustc version 1.31+. Place this attribute on any function containing +`#[sorted]` to make them work on a stable compiler. + +```rust +impl Display for Error { + #[remain::check] + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + use self::Error::*; + + #[sorted] + match self { + /* ... */ + } + } +} +``` + +
+ +#### License + + +Licensed under either of
Apache License, Version +2.0 or MIT license at your option. + + +
+ + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in this crate 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/vendor/registry-40351f815f426200/remain/src/check.rs b/vendor/registry-40351f815f426200/remain/src/check.rs new file mode 100644 index 000000000..0995078b4 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/check.rs @@ -0,0 +1,83 @@ +use syn::{Arm, Ident, Result, Variant}; +use syn::{Error, Field, Pat, PatIdent}; + +use crate::compare::Path; +use crate::format; +use crate::parse::Input::{self, *}; + +pub fn sorted(input: Input) -> Result<()> { + let paths = match input { + Enum(item) => collect_paths(item.variants)?, + Struct(fields) => collect_paths(fields.named)?, + Match(expr) | Let(expr) => collect_paths(expr.arms)?, + }; + + for i in 1..paths.len() { + let cur = &paths[i]; + if *cur < paths[i - 1] { + let lesser = cur; + let correct_pos = paths[..i - 1].binary_search(cur).unwrap_err(); + let greater = &paths[correct_pos]; + return Err(format::error(lesser, greater)); + } + } + + Ok(()) +} + +fn collect_paths(iter: I) -> Result> +where + I: IntoIterator, + I::Item: IntoPath, +{ + iter.into_iter().map(IntoPath::into_path).collect() +} + +trait IntoPath { + fn into_path(self) -> Result; +} + +impl IntoPath for Variant { + fn into_path(self) -> Result { + Ok(Path { + segments: vec![self.ident], + }) + } +} + +impl IntoPath for Field { + fn into_path(self) -> Result { + Ok(Path { + segments: vec![self.ident.expect("must be named field")], + }) + } +} + +impl IntoPath for Arm { + fn into_path(self) -> Result { + // Sort by just the first pat. + let pat = self.pats.into_iter().next().expect("at least one pat"); + + let segments = match pat { + Pat::Wild(pat) => vec![Ident::from(pat.underscore_token)], + Pat::Path(pat) => idents_of_path(pat.path), + Pat::Struct(pat) => idents_of_path(pat.path), + Pat::TupleStruct(pat) => idents_of_path(pat.path), + Pat::Ident(ref pat) if is_just_ident(pat) => vec![pat.ident.clone()], + other => { + let msg = "unsupported by #[remain::sorted]"; + return Err(Error::new_spanned(other, msg)); + } + }; + + Ok(Path { segments }) + } +} + +fn idents_of_path(path: syn::Path) -> Vec { + path.segments.into_iter().map(|seg| seg.ident).collect() +} + +fn is_just_ident(pat: &PatIdent) -> bool { + pat.by_ref.is_none() && pat.mutability.is_none() && pat.subpat.is_none() +} diff --git a/vendor/registry-40351f815f426200/remain/src/compare.rs b/vendor/registry-40351f815f426200/remain/src/compare.rs new file mode 100644 index 000000000..59f997d23 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/compare.rs @@ -0,0 +1,45 @@ +use proc_macro2::Ident; +use std::cmp::Ordering; + +#[derive(PartialEq, Eq)] +pub struct Path { + pub segments: Vec, +} + +impl PartialOrd for Path { + fn partial_cmp(&self, other: &Path) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for Path { + fn cmp(&self, other: &Path) -> Ordering { + // Lexicographic ordering across path segments. + for (lhs, rhs) in self.segments.iter().zip(&other.segments) { + match cmp(&lhs.to_string(), &rhs.to_string()) { + Ordering::Equal => {} + non_eq => return non_eq, + } + } + + self.segments.len().cmp(&other.segments.len()) + } +} + +// TODO: more intelligent comparison +// for example to handle numeric cases like E9 < E10. +fn cmp(lhs: &str, rhs: &str) -> Ordering { + // Sort `_` last. + match (lhs == "_", rhs == "_") { + (true, true) => return Ordering::Equal, + (true, false) => return Ordering::Greater, + (false, true) => return Ordering::Less, + (false, false) => {} + } + + let lhs = lhs.to_ascii_lowercase(); + let rhs = rhs.to_ascii_lowercase(); + + // For now: asciibetical ordering. + lhs.cmp(&rhs) +} diff --git a/vendor/registry-40351f815f426200/remain/src/emit.rs b/vendor/registry-40351f815f426200/remain/src/emit.rs new file mode 100644 index 000000000..d1ddda8f6 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/emit.rs @@ -0,0 +1,39 @@ +use proc_macro::TokenStream; +use proc_macro2::Span; +use quote::quote; +use syn::Error; + +#[derive(Copy, Clone)] +pub enum Kind { + Enum, + Match, + Struct, + Let, +} + +pub fn emit(err: Error, kind: Kind, original: TokenStream) -> TokenStream { + let mut err = err; + if !probably_has_spans(kind) { + // Otherwise the error is printed without any line number. + err = Error::new(Span::call_site(), &err.to_string()); + } + + let err = err.to_compile_error(); + let original = proc_macro2::TokenStream::from(original); + + let expanded = match kind { + Kind::Enum | Kind::Let | Kind::Struct => quote!(#err #original), + Kind::Match => quote!({ #err #original }), + }; + + TokenStream::from(expanded) +} + +// Rustc is so bad at spans. +// https://github.com/rust-lang/rust/issues/43081 +fn probably_has_spans(kind: Kind) -> bool { + match kind { + Kind::Enum | Kind::Struct => true, + Kind::Match | Kind::Let => false, + } +} diff --git a/vendor/registry-40351f815f426200/remain/src/format.rs b/vendor/registry-40351f815f426200/remain/src/format.rs new file mode 100644 index 000000000..583264372 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/format.rs @@ -0,0 +1,27 @@ +use proc_macro2::TokenStream; +use quote::TokenStreamExt; +use std::fmt::{self, Display}; +use syn::Error; + +use crate::compare::Path; + +impl Display for Path { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + for (i, segment) in self.segments.iter().enumerate() { + if i > 0 { + formatter.write_str("::")?; + } + segment.fmt(formatter)?; + } + Ok(()) + } +} + +pub fn error(lesser: &Path, greater: &Path) -> Error { + let mut spans = TokenStream::new(); + spans.append_all(&lesser.segments); + + let msg = format!("{} should sort before {}", lesser, greater); + + Error::new_spanned(spans, msg) +} diff --git a/vendor/registry-40351f815f426200/remain/src/lib.rs b/vendor/registry-40351f815f426200/remain/src/lib.rs new file mode 100644 index 000000000..967143e50 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/lib.rs @@ -0,0 +1,176 @@ +//! This crate provides an attribute macro to check at compile time that the +//! variants of an enum or the arms of a match expression are written in sorted +//! order. +//! +//! # Syntax +//! +//! Place a `#[remain::sorted]` attribute on enums, structs, match-expressions, +//! or let-statements whose value is a match-expression. +//! +//! Alternatively, import as `use remain::sorted;` and use `#[sorted]` as the +//! attribute. +//! +//! ``` +//! # use std::error::Error as StdError; +//! # use std::fmt::{self, Display}; +//! # use std::io; +//! # +//! #[remain::sorted] +//! #[derive(Debug)] +//! pub enum Error { +//! BlockSignal(signal::Error), +//! CreateCrasClient(libcras::Error), +//! CreateEventFd(sys_util::Error), +//! CreateSignalFd(sys_util::SignalFdError), +//! CreateSocket(io::Error), +//! DetectImageType(qcow::Error), +//! DeviceJail(io_jail::Error), +//! NetDeviceNew(virtio::NetError), +//! SpawnVcpu(io::Error), +//! } +//! +//! impl Display for Error { +//! # #[remain::check] +//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! use self::Error::*; +//! +//! #[remain::sorted] +//! match self { +//! BlockSignal(e) => write!(f, "failed to block signal: {}", e), +//! CreateCrasClient(e) => write!(f, "failed to create cras client: {}", e), +//! CreateEventFd(e) => write!(f, "failed to create eventfd: {}", e), +//! CreateSignalFd(e) => write!(f, "failed to create signalfd: {}", e), +//! CreateSocket(e) => write!(f, "failed to create socket: {}", e), +//! DetectImageType(e) => write!(f, "failed to detect disk image type: {}", e), +//! DeviceJail(e) => write!(f, "failed to jail device: {}", e), +//! NetDeviceNew(e) => write!(f, "failed to set up virtio networking: {}", e), +//! SpawnVcpu(e) => write!(f, "failed to spawn VCPU thread: {}", e), +//! } +//! } +//! } +//! # +//! # mod signal { +//! # pub use std::io::Error; +//! # } +//! # +//! # mod libcras { +//! # pub use std::io::Error; +//! # } +//! # +//! # mod sys_util { +//! # pub use std::io::{Error, Error as SignalFdError}; +//! # } +//! # +//! # mod qcow { +//! # pub use std::io::Error; +//! # } +//! # +//! # mod io_jail { +//! # pub use std::io::Error; +//! # } +//! # +//! # mod virtio { +//! # pub use std::io::Error as NetError; +//! # } +//! # +//! # fn main() {} +//! ``` +//! +//! If an enum variant, struct field, or match arm is inserted out of order,\ +//! +//! ```diff +//! NetDeviceNew(virtio::NetError), +//! SpawnVcpu(io::Error), +//! + AaaUhOh(Box), +//! } +//! ``` +//! +//! then the macro produces a compile error. +//! +//! ```console +//! error: AaaUhOh should sort before BlockSignal +//! --> tests/stable.rs:49:5 +//! | +//! 49 | AaaUhOh(Box), +//! | ^^^^^^^ +//! ``` +//! +//! # Compiler support +//! +//! The attribute on enums is supported on any rustc version 1.31+. +//! +//! Rust does not yet have stable support for user-defined attributes within a +//! function body, so the attribute on match-expressions and let-statements +//! requires a nightly compiler and the following two features enabled: +//! +//! ``` +//! # const IGNORE: &str = stringify! { +//! #![feature(proc_macro_hygiene, stmt_expr_attributes)] +//! # }; +//! ``` +//! +//! As a stable alternative, this crate provides a function-level attribute +//! called `#[remain::check]` which makes match-expression and let-statement +//! attributes work on any rustc version 1.31+. Place this attribute on any +//! function containing `#[sorted]` to make them work on a stable compiler. +//! +//! ``` +//! # use std::fmt::{self, Display}; +//! # +//! # enum Error {} +//! # +//! impl Display for Error { +//! #[remain::check] +//! fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { +//! use self::Error::*; +//! +//! #[sorted] +//! match self { +//! /* ... */ +//! # _ => unimplemented!(), +//! } +//! } +//! } +//! # +//! # fn main() {} +//! ``` + +extern crate proc_macro; + +mod check; +mod compare; +mod emit; +mod format; +mod parse; +mod visit; + +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, ItemFn}; + +use crate::emit::emit; +use crate::parse::{Input, Nothing}; + +#[proc_macro_attribute] +pub fn sorted(args: TokenStream, input: TokenStream) -> TokenStream { + let original = input.clone(); + + let _ = parse_macro_input!(args as Nothing); + let input = parse_macro_input!(input as Input); + let kind = input.kind(); + + match check::sorted(input) { + Ok(()) => original, + Err(err) => emit(err, kind, original), + } +} + +#[proc_macro_attribute] +pub fn check(args: TokenStream, input: TokenStream) -> TokenStream { + let _ = parse_macro_input!(args as Nothing); + let mut input = parse_macro_input!(input as ItemFn); + + visit::check(&mut input); + + TokenStream::from(quote!(#input)) +} diff --git a/vendor/registry-40351f815f426200/remain/src/parse.rs b/vendor/registry-40351f815f426200/remain/src/parse.rs new file mode 100644 index 000000000..97bd9f8f3 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/parse.rs @@ -0,0 +1,80 @@ +use proc_macro2::Span; +use syn::parse::{Parse, ParseStream}; +use syn::{Attribute, Error, Expr, Fields, Result, Stmt, Token, Visibility}; + +use crate::emit::Kind; + +pub struct Nothing; + +impl Parse for Nothing { + fn parse(_input: ParseStream) -> Result { + Ok(Nothing) + } +} + +pub enum Input { + Enum(syn::ItemEnum), + Match(syn::ExprMatch), + Struct(syn::FieldsNamed), + Let(syn::ExprMatch), +} + +impl Input { + pub fn kind(&self) -> Kind { + match self { + Input::Enum(_) => Kind::Enum, + Input::Match(_) => Kind::Match, + Input::Struct(_) => Kind::Struct, + Input::Let(_) => Kind::Let, + } + } +} + +impl Parse for Input { + fn parse(input: ParseStream) -> Result { + let _ = input.call(Attribute::parse_outer)?; + + if input.peek(Token![match]) { + let expr = match input.parse()? { + Expr::Match(expr) => expr, + _ => unreachable!("expected match"), + }; + return Ok(Input::Match(expr)); + } + + if input.peek(Token![let]) { + let stmt = match input.parse()? { + Stmt::Local(stmt) => stmt, + _ => unreachable!("expected let"), + }; + let init = match stmt.init { + Some((_, init)) => *init, + None => return Err(unexpected()), + }; + let expr = match init { + Expr::Match(expr) => expr, + _ => return Err(unexpected()), + }; + return Ok(Input::Let(expr)); + } + + let ahead = input.fork(); + let _: Visibility = ahead.parse()?; + if ahead.peek(Token![enum]) { + return input.parse().map(Input::Enum); + } else if ahead.peek(Token![struct]) { + let input: syn::ItemStruct = input.parse()?; + if let Fields::Named(fields) = input.fields { + return Ok(Input::Struct(fields)); + } + } + + Err(unexpected()) + } +} + +fn unexpected() -> Error { + let span = Span::call_site(); + let msg = "expected enum, struct, or match expression"; + Error::new(span, msg) +} diff --git a/vendor/registry-40351f815f426200/remain/src/visit.rs b/vendor/registry-40351f815f426200/remain/src/visit.rs new file mode 100644 index 000000000..f681aa9af --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/src/visit.rs @@ -0,0 +1,77 @@ +use quote::quote; +use syn::visit_mut::{self, VisitMut}; +use syn::{parse_quote, Attribute, Expr, ExprMatch, ItemFn, Local}; + +use crate::parse::Input; + +pub fn check(input: &mut ItemFn) { + Checker.visit_item_fn_mut(input); +} + +struct Checker; + +impl VisitMut for Checker { + fn visit_expr_mut(&mut self, expr: &mut Expr) { + visit_mut::visit_expr_mut(self, expr); + + let expr_match = match expr { + Expr::Match(expr) => expr, + _ => return, + }; + + if !take_sorted_attr(&mut expr_match.attrs) { + return; + } + + let input = expr_match.clone(); + check_and_insert_error(input, expr); + } + + fn visit_local_mut(&mut self, local: &mut Local) { + visit_mut::visit_local_mut(self, local); + + let init = match &local.init { + Some((_, init)) => init, + None => return, + }; + + let expr_match = match init.as_ref() { + Expr::Match(expr) => expr, + _ => return, + }; + + if !take_sorted_attr(&mut local.attrs) { + return; + } + + let input = expr_match.clone(); + let expr = local.init.as_mut().unwrap().1.as_mut(); + check_and_insert_error(input, expr); + } +} + +fn take_sorted_attr(attrs: &mut Vec) -> bool { + for i in 0..attrs.len() { + let path = &attrs[i].path; + let path = quote!(#path).to_string(); + if path == "sorted" || path == "remain :: sorted" { + attrs.remove(i); + return true; + } + } + + false +} + +fn check_and_insert_error(input: ExprMatch, out: &mut Expr) { + let original = quote!(#input); + let input = Input::Match(input); + + if let Err(err) = crate::check::sorted(input) { + let err = err.to_compile_error(); + *out = parse_quote!({ + #err + #original + }); + } +} diff --git a/vendor/registry-40351f815f426200/remain/tests/compiletest.rs b/vendor/registry-40351f815f426200/remain/tests/compiletest.rs new file mode 100644 index 000000000..2e861bf67 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/compiletest.rs @@ -0,0 +1,6 @@ +#[rustc::attr(not(nightly), ignore)] +#[test] +fn ui() { + let t = trybuild::TestCases::new(); + t.compile_fail("tests/ui/*.rs"); +} diff --git a/vendor/registry-40351f815f426200/remain/tests/stable.rs b/vendor/registry-40351f815f426200/remain/tests/stable.rs new file mode 100644 index 000000000..a3b6a7bb0 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/stable.rs @@ -0,0 +1,45 @@ +#![allow(dead_code)] + +#[remain::sorted] +pub enum TestEnum { + A, + B, + C, + D, +} + +#[remain::sorted] +pub struct TestStruct { + a: usize, + b: usize, + c: usize, + d: usize, +} + +#[test] +#[remain::check] +fn test_match() { + let value = TestEnum::A; + + #[sorted] + let _ = match value { + TestEnum::A => {} + TestEnum::B => {} + TestEnum::C => {} + _ => {} + }; +} + +#[test] +#[remain::check] +fn test_let() { + let value = TestEnum::A; + + #[sorted] + match value { + TestEnum::A => {} + TestEnum::B => {} + TestEnum::C => {} + _ => {} + } +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/enum.rs b/vendor/registry-40351f815f426200/remain/tests/ui/enum.rs new file mode 100644 index 000000000..dc98475b0 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/enum.rs @@ -0,0 +1,11 @@ +use remain::sorted; + +#[sorted] +enum E { + Aaa, + Ccc(u8), + Ddd { u: u8 }, + Bbb(u8, u8), +} + +fn main() {} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/enum.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/enum.stderr new file mode 100644 index 000000000..50ffa8c6c --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/enum.stderr @@ -0,0 +1,5 @@ +error: Bbb should sort before Ccc + --> $DIR/enum.rs:8:5 + | +8 | Bbb(u8, u8), + | ^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.rs b/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.rs new file mode 100644 index 000000000..b05d3e38a --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.rs @@ -0,0 +1,19 @@ +enum E { + Aaa, + Bbb(u8, u8), + Ccc(u8), + Ddd { u: u8 }, +} + +#[remain::check] +fn main() { + let value = E::Aaa; + + #[sorted] + let _ = match value { + E::Aaa => {} + E::Ccc(_) => {} + E::Ddd { u: _ } => {} + E::Bbb(_, _) => {} + }; +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.stderr new file mode 100644 index 000000000..90737505f --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/let-stable.stderr @@ -0,0 +1,5 @@ +error: E::Bbb should sort before E::Ccc + --> $DIR/let-stable.rs:17:9 + | +17 | E::Bbb(_, _) => {} + | ^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.rs b/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.rs new file mode 100644 index 000000000..8d65c52bb --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.rs @@ -0,0 +1,22 @@ +#![feature(proc_macro_hygiene, stmt_expr_attributes)] + +use remain::sorted; + +enum E { + Aaa, + Bbb(u8, u8), + Ccc(u8), + Ddd { u: u8 }, +} + +fn main() { + let value = E::Aaa; + + #[sorted] + let _ = match value { + E::Aaa => {} + E::Ccc(_) => {} + E::Ddd { u: _ } => {} + E::Bbb(_, _) => {} + }; +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.stderr new file mode 100644 index 000000000..97c5ba1d5 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/let-unstable.stderr @@ -0,0 +1,5 @@ +error: E::Bbb should sort before E::Ccc + --> $DIR/let-unstable.rs:15:5 + | +15 | #[sorted] + | ^^^^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.rs b/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.rs new file mode 100644 index 000000000..6bdade497 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.rs @@ -0,0 +1,19 @@ +enum E { + Aaa, + Bbb(u8, u8), + Ccc(u8), + Ddd { u: u8 }, +} + +#[remain::check] +fn main() { + let value = E::Aaa; + + #[sorted] + match value { + E::Aaa => {} + E::Ccc(_) => {} + E::Ddd { u: _ } => {} + E::Bbb(_, _) => {} + } +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.stderr new file mode 100644 index 000000000..183daa98b --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/match-stable.stderr @@ -0,0 +1,5 @@ +error: E::Bbb should sort before E::Ccc + --> $DIR/match-stable.rs:17:9 + | +17 | E::Bbb(_, _) => {} + | ^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.rs b/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.rs new file mode 100644 index 000000000..db047f187 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.rs @@ -0,0 +1,22 @@ +#![feature(proc_macro_hygiene, stmt_expr_attributes)] + +use remain::sorted; + +enum E { + Aaa, + Bbb(u8, u8), + Ccc(u8), + Ddd { u: u8 }, +} + +fn main() { + let value = E::Aaa; + + #[sorted] + match value { + E::Aaa => {} + E::Ccc(_) => {} + E::Ddd { u: _ } => {} + E::Bbb(_, _) => {} + } +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.stderr new file mode 100644 index 000000000..b2bdea0ee --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/match-unstable.stderr @@ -0,0 +1,5 @@ +error: E::Bbb should sort before E::Ccc + --> $DIR/match-unstable.rs:15:5 + | +15 | #[sorted] + | ^^^^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/struct.rs b/vendor/registry-40351f815f426200/remain/tests/ui/struct.rs new file mode 100644 index 000000000..5f2cd4151 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/struct.rs @@ -0,0 +1,11 @@ +use remain::sorted; + +#[sorted] +struct TestStruct { + d: usize, + c: usize, + a: usize, + b: usize, +} + +fn main() {} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/struct.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/struct.stderr new file mode 100644 index 000000000..2ead15b72 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/struct.stderr @@ -0,0 +1,5 @@ +error: c should sort before d + --> $DIR/struct.rs:6:5 + | +6 | c: usize, + | ^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.rs b/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.rs new file mode 100644 index 000000000..2fcfda9fc --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.rs @@ -0,0 +1,7 @@ +#[remain::sorted] +struct TupleStruct(usize, usize, usize); + +#[remain::sorted] +struct UnitStruct; + +fn main() {} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.stderr new file mode 100644 index 000000000..b7e28f523 --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/unnamed-fields.stderr @@ -0,0 +1,11 @@ +error: expected enum, struct, or match expression + --> $DIR/unnamed-fields.rs:1:1 + | +1 | #[remain::sorted] + | ^^^^^^^^^^^^^^^^^ + +error: expected enum, struct, or match expression + --> $DIR/unnamed-fields.rs:4:1 + | +4 | #[remain::sorted] + | ^^^^^^^^^^^^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.rs b/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.rs new file mode 100644 index 000000000..b11c9749e --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.rs @@ -0,0 +1,10 @@ +#[remain::check] +fn main() { + let value = 0; + + #[sorted] + match value { + 0..=20 => {} + _ => {} + } +} diff --git a/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.stderr b/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.stderr new file mode 100644 index 000000000..e471e1eaf --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/ui/unsupported.stderr @@ -0,0 +1,5 @@ +error: unsupported by #[remain::sorted] + --> $DIR/unsupported.rs:7:9 + | +7 | 0..=20 => {} + | ^^^^^^ diff --git a/vendor/registry-40351f815f426200/remain/tests/unstable.rs b/vendor/registry-40351f815f426200/remain/tests/unstable.rs new file mode 100644 index 000000000..78dbd08ed --- /dev/null +++ b/vendor/registry-40351f815f426200/remain/tests/unstable.rs @@ -0,0 +1,45 @@ +#![allow(dead_code)] +#![cfg(not(remain_stable_testing))] +#![feature(proc_macro_hygiene, stmt_expr_attributes)] + +#[remain::sorted] +pub enum TestEnum { + A, + B, + C, + D, +} + +#[remain::sorted] +pub struct TestStruct { + a: usize, + b: usize, + c: usize, + d: usize, +} + +#[test] +fn test_match() { + let value = TestEnum::A; + + #[remain::sorted] + let _ = match value { + TestEnum::A => {} + TestEnum::B => {} + TestEnum::C => {} + _ => {} + }; +} + +#[test] +fn test_let() { + let value = TestEnum::A; + + #[remain::sorted] + match value { + TestEnum::A => {} + TestEnum::B => {} + TestEnum::C => {} + _ => {} + } +} diff --git a/vendor/registry-40351f815f426200/remove_dir_all/.cargo-checksum.json b/vendor/registry-40351f815f426200/remove_dir_all/.cargo-checksum.json new file mode 100644 index 000000000..87c20b6d2 --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"98438ca5f5f5250e387979caec56f688beee15585c33fb7a2931d72aa3397b1e","LICENCE-APACHE":"c6c8c9dbe29fb4d68d829c7a402f9f6baae3472ecf107cc2a57c75a9a8d1b85c","LICENCE-MIT":"db264505cb1856383e255c8373da9e5aeadc1cd92b570fcc94fd1fb7d892db78","src/fs.rs":"a76e48978d35d611d35367cb95b342e2dcc6590c2ae750579dee00f86da6d509","src/lib.rs":"80fc8332b0a6303915417a996a6c3001a067add3022f0f278b2f67c676759beb"},"package":"3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/remove_dir_all/Cargo.toml b/vendor/registry-40351f815f426200/remove_dir_all/Cargo.toml new file mode 100644 index 000000000..88d3cace7 --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/Cargo.toml @@ -0,0 +1,26 @@ +# 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 = "remove_dir_all" +version = "0.5.1" +authors = ["Aaronepower "] +include = ["Cargo.toml", "LICENCE-APACHE", "LICENCE-MIT", "src/**/*"] +description = "A safe, reliable implementation of remove_dir_all for Windows" +readme = "README.md" +keywords = ["utility", "filesystem", "remove_dir", "windows"] +categories = ["filesystem"] +license = "MIT/Apache-2.0" +repository = "https://github.com/Aaronepower/remove_dir_all.git" +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["std", "errhandlingapi", "winerror", "fileapi", "winbase"] diff --git a/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-APACHE b/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-APACHE new file mode 100644 index 000000000..01de39235 --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-APACHE @@ -0,0 +1,191 @@ + 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 + +Copyright 2017 Aaron Power + +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/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-MIT b/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-MIT new file mode 100644 index 000000000..627895f4e --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/LICENCE-MIT @@ -0,0 +1,26 @@ +Copyright (c) 2017 Aaron Power + +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/vendor/registry-40351f815f426200/remove_dir_all/src/fs.rs b/vendor/registry-40351f815f426200/remove_dir_all/src/fs.rs new file mode 100644 index 000000000..730582b8a --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/src/fs.rs @@ -0,0 +1,265 @@ +use std::ffi::OsString; +use std::fs::{self, File, OpenOptions}; +use std::{io, ptr}; +use std::os::windows::prelude::*; +use std::path::{Path, PathBuf}; + +use winapi::shared::minwindef::*; +use winapi::shared::winerror::*; +use winapi::um::errhandlingapi::*; +use winapi::um::fileapi::*; +use winapi::um::minwinbase::*; +use winapi::um::winbase::*; +use winapi::um::winnt::*; + +pub const VOLUME_NAME_DOS: DWORD = 0x0; + +struct RmdirContext<'a> { + base_dir: &'a Path, + readonly: bool, + counter: u64, +} + +/// Reliably removes directory and all of it's children. +/// ```rust +/// extern crate remove_dir_all; +/// +/// use remove_dir_all::*; +/// +/// fn main() { +/// remove_dir_all("./temp/").unwrap(); +/// } +/// ``` +pub fn remove_dir_all>(path: P) -> io::Result<()> { + // On Windows it is not enough to just recursively remove the contents of a + // directory and then the directory itself. Deleting does not happen + // instantaneously, but is scheduled. + // To work around this, we move the file or directory to some `base_dir` + // right before deletion to avoid races. + // + // As `base_dir` we choose the parent dir of the directory we want to + // remove. We very probably have permission to create files here, as we + // already need write permission in this dir to delete the directory. And it + // should be on the same volume. + // + // To handle files with names like `CON` and `morse .. .`, and when a + // directory structure is so deep it needs long path names the path is first + // converted to a `//?/`-path with `get_path()`. + // + // To make sure we don't leave a moved file laying around if the process + // crashes before we can delete the file, we do all operations on an file + // handle. By opening a file with `FILE_FLAG_DELETE_ON_CLOSE` Windows will + // always delete the file when the handle closes. + // + // All files are renamed to be in the `base_dir`, and have their name + // changed to "rm-". After every rename the counter is increased. + // Rename should not overwrite possibly existing files in the base dir. So + // if it fails with `AlreadyExists`, we just increase the counter and try + // again. + // + // For read-only files and directories we first have to remove the read-only + // attribute before we can move or delete them. This also removes the + // attribute from possible hardlinks to the file, so just before closing we + // restore the read-only attribute. + // + // If 'path' points to a directory symlink or junction we should not + // recursively remove the target of the link, but only the link itself. + // + // Moving and deleting is guaranteed to succeed if we are able to open the + // file with `DELETE` permission. If others have the file open we only have + // `DELETE` permission if they have specified `FILE_SHARE_DELETE`. We can + // also delete the file now, but it will not disappear until all others have + // closed the file. But no-one can open the file after we have flagged it + // for deletion. + + // Open the path once to get the canonical path, file type and attributes. + let (path, metadata) = { + let path = path.as_ref(); + let mut opts = OpenOptions::new(); + opts.access_mode(FILE_READ_ATTRIBUTES); + opts.custom_flags(FILE_FLAG_BACKUP_SEMANTICS | + FILE_FLAG_OPEN_REPARSE_POINT); + let file = opts.open(path)?; + (get_path(&file)?, path.metadata()?) + }; + + let mut ctx = RmdirContext { + base_dir: match path.parent() { + Some(dir) => dir, + None => return Err(io::Error::new(io::ErrorKind::PermissionDenied, + "Can't delete root directory")) + }, + readonly: metadata.permissions().readonly(), + counter: 0, + }; + + let filetype = metadata.file_type(); + if filetype.is_dir() { + if !filetype.is_symlink() { + remove_dir_all_recursive(path.as_ref(), &mut ctx) + } else { + remove_item(path.as_ref(), &mut ctx) + } + } else { + Err(io::Error::new(io::ErrorKind::PermissionDenied, "Not a directory")) + } +} + +fn remove_item(path: &Path, ctx: &mut RmdirContext) -> io::Result<()> { + if ctx.readonly { + // remove read-only permision + let mut permissions = path.metadata()?.permissions(); + permissions.set_readonly(false); + + fs::set_permissions(path, permissions)?; + } + + let mut opts = OpenOptions::new(); + opts.access_mode(DELETE); + opts.custom_flags(FILE_FLAG_BACKUP_SEMANTICS | // delete directory + FILE_FLAG_OPEN_REPARSE_POINT | // delete symlink + FILE_FLAG_DELETE_ON_CLOSE); + let file = opts.open(path)?; + move_item(&file, ctx)?; + + if ctx.readonly { + // restore read-only flag just in case there are other hard links + match fs::metadata(&path) { + Ok(metadata) => { + let mut perm = metadata.permissions(); + perm.set_readonly(true); + fs::set_permissions(&path, perm)?; + }, + Err(ref err) if err.kind() == io::ErrorKind::NotFound => {}, + err => return err.map(|_| ()), + } + } + + Ok(()) +} + +fn move_item(file: &File, ctx: &mut RmdirContext) -> io::Result<()> { + let mut tmpname = ctx.base_dir.join(format!{"rm-{}", ctx.counter}); + ctx.counter += 1; + + // Try to rename the file. If it already exists, just retry with an other + // filename. + while let Err(err) = rename(file, &tmpname, false) { + if err.kind() != io::ErrorKind::AlreadyExists { return Err(err) }; + tmpname = ctx.base_dir.join(format!("rm-{}", ctx.counter)); + ctx.counter += 1; + } + + Ok(()) +} + +fn rename(file: &File, new: &Path, replace: bool) -> io::Result<()> { + // &self must be opened with DELETE permission + use std::iter; + #[cfg(target_arch = "x86")] + const STRUCT_SIZE: usize = 12; + #[cfg(target_arch = "x86_64")] + const STRUCT_SIZE: usize = 20; + + // FIXME: check for internal NULs in 'new' + let mut data: Vec = iter::repeat(0u16).take(STRUCT_SIZE/2) + .chain(new.as_os_str().encode_wide()) + .collect(); + data.push(0); + let size = data.len() * 2; + + unsafe { + // Thanks to alignment guarantees on Windows this works + // (8 for 32-bit and 16 for 64-bit) + let info = data.as_mut_ptr() as *mut FILE_RENAME_INFO; + // The type of ReplaceIfExists is BOOL, but it actually expects a + // BOOLEAN. This means true is -1, not c::TRUE. + (*info).ReplaceIfExists = if replace { -1 } else { FALSE }; + (*info).RootDirectory = ptr::null_mut(); + (*info).FileNameLength = (size - STRUCT_SIZE) as DWORD; + let result = SetFileInformationByHandle(file.as_raw_handle(), + FileRenameInfo, + data.as_mut_ptr() as *mut _ as *mut _, + size as DWORD); + + if result == 0 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } + } +} + +fn get_path(f: &File) -> io::Result { + + fill_utf16_buf(|buf, sz| unsafe { + GetFinalPathNameByHandleW(f.as_raw_handle(), buf, sz, VOLUME_NAME_DOS) + }, |buf| { + PathBuf::from(OsString::from_wide(buf)) + }) +} + +fn remove_dir_all_recursive(path: &Path, ctx: &mut RmdirContext) + -> io::Result<()> { + let dir_readonly = ctx.readonly; + for child in try!(fs::read_dir(path)) { + let child = try!(child); + let child_type = try!(child.file_type()); + ctx.readonly = try!(child.metadata()).permissions().readonly(); + if child_type.is_dir() { + try!(remove_dir_all_recursive(&child.path(), ctx)); + } else { + try!(remove_item(&child.path().as_ref(), ctx)); + } + } + ctx.readonly = dir_readonly; + remove_item(path, ctx) +} + +fn fill_utf16_buf(mut f1: F1, f2: F2) -> io::Result + where F1: FnMut(*mut u16, DWORD) -> DWORD, + F2: FnOnce(&[u16]) -> T +{ + // Start off with a stack buf but then spill over to the heap if we end up + // needing more space. + let mut stack_buf = [0u16; 512]; + let mut heap_buf = Vec::new(); + unsafe { + let mut n = stack_buf.len(); + + loop { + let buf = if n <= stack_buf.len() { + &mut stack_buf[..] + } else { + let extra = n - heap_buf.len(); + heap_buf.reserve(extra); + heap_buf.set_len(n); + &mut heap_buf[..] + }; + + // This function is typically called on windows API functions which + // will return the correct length of the string, but these functions + // also return the `0` on error. In some cases, however, the + // returned "correct length" may actually be 0! + // + // To handle this case we call `SetLastError` to reset it to 0 and + // then check it again if we get the "0 error value". If the "last + // error" is still 0 then we interpret it as a 0 length buffer and + // not an actual error. + SetLastError(0); + let k = match f1(buf.as_mut_ptr(), n as DWORD) { + 0 if GetLastError() == 0 => 0, + 0 => return Err(io::Error::last_os_error()), + n => n, + } as usize; + if k == n && GetLastError() == ERROR_INSUFFICIENT_BUFFER { + n *= 2; + } else if k >= n { + n = k; + } else { + return Ok(f2(&buf[..k])) + } + } + } +} + diff --git a/vendor/registry-40351f815f426200/remove_dir_all/src/lib.rs b/vendor/registry-40351f815f426200/remove_dir_all/src/lib.rs new file mode 100644 index 000000000..367d44e16 --- /dev/null +++ b/vendor/registry-40351f815f426200/remove_dir_all/src/lib.rs @@ -0,0 +1,12 @@ +#[cfg(windows)] +extern crate winapi; + +#[cfg(windows)] +mod fs; + +#[cfg(windows)] +pub use self::fs::remove_dir_all; + +#[cfg(not(windows))] +pub use std::fs::remove_dir_all; + diff --git a/vendor/registry-40351f815f426200/serde/.cargo-checksum.json b/vendor/registry-40351f815f426200/serde/.cargo-checksum.json new file mode 100644 index 000000000..855da1633 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"9f1e33b4b64aefd1513f71b767ce2c8d77b3ad0ec94490f4258a111e0380c587","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"3760f279854d1ca296894756ebd4d8bc91fe164874aa4c17db522843a9725f8e","build.rs":"36983e7377af4e76eba9c8745e0d58c1668afaf651abf4ba53d203f985593f32","crates-io.md":"131dee2d4beaf83485aed22942b98815ef65af9bcfb65f02b5b90c59b8bc7b8b","src/de/from_primitive.rs":"058fa17313ed3a9c29ec04c6ec67f21a756f6f28cdeb4b0dfcd7012b3e702d0b","src/de/ignored_any.rs":"3c199f3e4c3f8775ab30439c6868b61aa0a32fa23232b218afb94d1aadb15f0a","src/de/impls.rs":"75a798b149c690ef197d3f190c95f42a2bc0a8f7b3bd9f689f7faae02c0e9403","src/de/mod.rs":"76161f9f86b1589495681da619a6785561b587c27c62724fe960b630be69c564","src/de/utf8.rs":"f17524ee0af98ec3abcfd7d0b812fbd1033263bd8e2ce2f57c1e1999ce153558","src/de/value.rs":"a878f6bdd57d25b0b93bfc6288ed1e46c50870dc8703748b6fbb8c0965a6b586","src/export.rs":"1519d8bf2d18368eb0a394e1aceff74e092922902a966f388b74fddecdbeb5f9","src/integer128.rs":"f8298a559f1fae7579819cb68f6cba8c01cdda11737cf1fb498bf52810c130b6","src/lib.rs":"cdb28f42ebc35a886f5b380190f8339d315cf8c75e356fd5d60264fa4497bcac","src/macros.rs":"f18fc25c5fb857238bf119cdee5c7987a8584dea69c51f27ca718b7dfd871d0f","src/private/de.rs":"2a4b0b7145135b1116f7b0af4adebe74b7d3aa4cc96896584066a654aa4b6c6c","src/private/macros.rs":"ebb6affd4c89e3b5f9a42e03f8b7d966bc588875e9b44e962d0b7aba7f80a10f","src/private/mod.rs":"f8f2cd5edbfc26c268b34cdb89db1b34e6348f81384f03d18532e7568575006d","src/private/ser.rs":"946bf9910bb646a4c1732fd17f8c98db2515fe23edeb6e622e3618ff4de46b33","src/ser/impls.rs":"1a6598433a22d2672f743619e4ec99c55378d9283f26783ade02dd2ce4acf892","src/ser/impossible.rs":"3dd0e165b88fc67e698e675f16569b91fab9e054caa4c3e1997f929ba364fe90","src/ser/mod.rs":"6fac442413315d14b60fb62d9298c857d2b93276dc8d03729db44bf8fb9a1ec5"},"package":"32746bf0f26eab52f06af0d0aa1984f641341d06d8d673c693871da2d188c9be"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/serde/Cargo.toml b/vendor/registry-40351f815f426200/serde/Cargo.toml new file mode 100644 index 000000000..572c27db5 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/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 = "serde" +version = "1.0.92" +authors = ["Erick Tryzelaar ", "David Tolnay "] +build = "build.rs" +include = ["Cargo.toml", "build.rs", "src/**/*.rs", "crates-io.md", "README.md", "LICENSE-APACHE", "LICENSE-MIT"] +description = "A generic serialization/deserialization framework" +homepage = "https://serde.rs" +documentation = "https://docs.serde.rs/serde/" +readme = "crates-io.md" +keywords = ["serde", "serialization", "no_std"] +categories = ["encoding"] +license = "MIT OR Apache-2.0" +repository = "https://github.com/serde-rs/serde" +[package.metadata.playground] +features = ["derive", "rc"] +[dependencies.serde_derive] +version = "1.0" +optional = true +[dev-dependencies.serde_derive] +version = "1.0" + +[features] +alloc = ["unstable"] +default = ["std"] +derive = ["serde_derive"] +rc = [] +std = [] +unstable = [] +[badges.appveyor] +repository = "serde-rs/serde" + +[badges.travis-ci] +repository = "serde-rs/serde" diff --git a/vendor/registry-40351f815f426200/serde/LICENSE-APACHE b/vendor/registry-40351f815f426200/serde/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/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/vendor/registry-40351f815f426200/serde/LICENSE-MIT b/vendor/registry-40351f815f426200/serde/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/LICENSE-MIT @@ -0,0 +1,23 @@ +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/vendor/registry-40351f815f426200/serde/README.md b/vendor/registry-40351f815f426200/serde/README.md new file mode 100644 index 000000000..db5fa09d7 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/README.md @@ -0,0 +1,99 @@ +# Serde   [![Build Status]][travis] [![Latest Version]][crates.io] [![Rustc Version 1.13+]][rustc] + +[Build Status]: https://api.travis-ci.org/serde-rs/serde.svg?branch=master +[travis]: https://travis-ci.org/serde-rs/serde +[Latest Version]: https://img.shields.io/crates/v/serde.svg +[crates.io]: https://crates.io/crates/serde +[Rustc Version 1.13+]: https://img.shields.io/badge/rustc-1.13+-lightgray.svg +[rustc]: https://blog.rust-lang.org/2016/11/10/Rust-1.13.html + +**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** + +--- + +You may be looking for: + +- [An overview of Serde](https://serde.rs/) +- [Data formats supported by Serde](https://serde.rs/#data-formats) +- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/derive.html) +- [Examples](https://serde.rs/examples.html) +- [API documentation](https://docs.serde.rs/serde/) +- [Release notes](https://github.com/serde-rs/serde/releases) + +## Serde in action + +
+ +Click to show Cargo.toml. +Run this code in the playground. + + +```toml +[dependencies] + +# The core APIs, including the Serialize and Deserialize traits. Always +# required when using Serde. The "derive" feature is only required when +# using #[derive(Serialize, Deserialize)] to make Serde work with structs +# and enums defined in your crate. +serde = { version = "1.0", features = ["derive"] } + +# Each data format lives in its own crate; the sample code below uses JSON +# but you may be using a different one. +serde_json = "1.0" +``` + +
+

+ +```rust +use serde::{Serialize, Deserialize}; + +#[derive(Serialize, Deserialize, Debug)] +struct Point { + x: i32, + y: i32, +} + +fn main() { + let point = Point { x: 1, y: 2 }; + + // Convert the Point to a JSON string. + let serialized = serde_json::to_string(&point).unwrap(); + + // Prints serialized = {"x":1,"y":2} + println!("serialized = {}", serialized); + + // Convert the JSON string back to a Point. + let deserialized: Point = serde_json::from_str(&serialized).unwrap(); + + // Prints deserialized = Point { x: 1, y: 2 } + println!("deserialized = {:?}", deserialized); +} +``` + +## Getting help + +Serde developers live in the #serde channel on [`irc.mozilla.org`][irc]. The +\#rust channel is also a good resource with generally faster response time but +less specific knowledge about Serde. If IRC is not your thing or you don't get a +good response, we are happy to respond to [GitHub issues][issues] as well. + +[irc]: https://wiki.mozilla.org/IRC +[issues]: https://github.com/serde-rs/serde/issues/new/choose + +
+ +#### License + + +Licensed under either of Apache License, Version +2.0 or MIT license at your option. + + +
+ + +Unless you explicitly state otherwise, any contribution intentionally submitted +for inclusion in Serde 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/vendor/registry-40351f815f426200/serde/build.rs b/vendor/registry-40351f815f426200/serde/build.rs new file mode 100644 index 000000000..e27e2f34f --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/build.rs @@ -0,0 +1,100 @@ +use std::env; +use std::process::Command; +use std::str::{self, FromStr}; + +// The rustc-cfg strings below are *not* public API. Please let us know by +// opening a GitHub issue if your build environment requires some way to enable +// these cfgs other than by executing our build script. +fn main() { + let minor = match rustc_minor_version() { + Some(minor) => minor, + None => return, + }; + + let target = env::var("TARGET").unwrap(); + let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; + + // std::collections::Bound was stabilized in Rust 1.17 + // but it was moved to core::ops later in Rust 1.26: + // https://doc.rust-lang.org/core/ops/enum.Bound.html + if minor >= 26 { + println!("cargo:rustc-cfg=ops_bound"); + } else if minor >= 17 && cfg!(feature = "std") { + println!("cargo:rustc-cfg=collections_bound"); + } + + // core::cmp::Reverse stabilized in Rust 1.19: + // https://doc.rust-lang.org/stable/core/cmp/struct.Reverse.html + if minor >= 19 { + println!("cargo:rustc-cfg=core_reverse"); + } + + // CString::into_boxed_c_str stabilized in Rust 1.20: + // https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str + if minor >= 20 { + println!("cargo:rustc-cfg=de_boxed_c_str"); + } + + // From> for Rc / Arc stabilized in Rust 1.21: + // https://doc.rust-lang.org/std/rc/struct.Rc.html#impl-From> + // https://doc.rust-lang.org/std/sync/struct.Arc.html#impl-From> + if minor >= 21 { + println!("cargo:rustc-cfg=de_rc_dst"); + } + + // Duration available in core since Rust 1.25: + // https://blog.rust-lang.org/2018/03/29/Rust-1.25.html#library-stabilizations + if minor >= 25 { + println!("cargo:rustc-cfg=core_duration"); + } + + // 128-bit integers stabilized in Rust 1.26: + // https://blog.rust-lang.org/2018/05/10/Rust-1.26.html + // + // Disabled on Emscripten targets as Emscripten doesn't + // currently support integers larger than 64 bits. + if minor >= 26 && !emscripten { + println!("cargo:rustc-cfg=integer128"); + } + + // Inclusive ranges methods stabilized in Rust 1.27: + // https://github.com/rust-lang/rust/pull/50758 + if minor >= 27 { + println!("cargo:rustc-cfg=range_inclusive"); + } + + // Non-zero integers stabilized in Rust 1.28: + // https://github.com/rust-lang/rust/pull/50808 + if minor >= 28 { + println!("cargo:rustc-cfg=num_nonzero"); + } +} + +fn rustc_minor_version() -> Option { + let rustc = match env::var_os("RUSTC") { + Some(rustc) => rustc, + None => return None, + }; + + let output = match Command::new(rustc).arg("--version").output() { + Ok(output) => output, + Err(_) => return None, + }; + + let version = match str::from_utf8(&output.stdout) { + Ok(version) => version, + Err(_) => return None, + }; + + let mut pieces = version.split('.'); + if pieces.next() != Some("rustc 1") { + return None; + } + + let next = match pieces.next() { + Some(next) => next, + None => return None, + }; + + u32::from_str(next).ok() +} diff --git a/vendor/registry-40351f815f426200/serde/crates-io.md b/vendor/registry-40351f815f426200/serde/crates-io.md new file mode 100644 index 000000000..3c6caa1a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/crates-io.md @@ -0,0 +1,52 @@ + + +**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** + +--- + +You may be looking for: + +- [An overview of Serde](https://serde.rs/) +- [Data formats supported by Serde](https://serde.rs/#data-formats) +- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/derive.html) +- [Examples](https://serde.rs/examples.html) +- [API documentation](https://docs.serde.rs/serde/) +- [Release notes](https://github.com/serde-rs/serde/releases) + +## Serde in action + +```rust +use serde::{Serialize, Deserialize}; + +#[derive(Serialize, Deserialize, Debug)] +struct Point { + x: i32, + y: i32, +} + +fn main() { + let point = Point { x: 1, y: 2 }; + + // Convert the Point to a JSON string. + let serialized = serde_json::to_string(&point).unwrap(); + + // Prints serialized = {"x":1,"y":2} + println!("serialized = {}", serialized); + + // Convert the JSON string back to a Point. + let deserialized: Point = serde_json::from_str(&serialized).unwrap(); + + // Prints deserialized = Point { x: 1, y: 2 } + println!("deserialized = {:?}", deserialized); +} +``` + +## Getting help + +Serde developers live in the #serde channel on [`irc.mozilla.org`][irc]. The +\#rust channel is also a good resource with generally faster response time but +less specific knowledge about Serde. If IRC is not your thing or you don't get a +good response, we are happy to respond to [GitHub issues][issues] as well. + +[irc]: https://wiki.mozilla.org/IRC +[issues]: https://github.com/serde-rs/serde/issues/new/choose diff --git a/vendor/registry-40351f815f426200/serde/src/de/from_primitive.rs b/vendor/registry-40351f815f426200/serde/src/de/from_primitive.rs new file mode 100644 index 000000000..544f3f1b8 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/from_primitive.rs @@ -0,0 +1,260 @@ +use lib::*; + +macro_rules! int_to_int { + ($dst:ident, $n:ident) => { + if $dst::min_value() as i64 <= $n as i64 && $n as i64 <= $dst::max_value() as i64 { + Some($n as $dst) + } else { + None + } + }; +} + +macro_rules! int_to_uint { + ($dst:ident, $n:ident) => { + if 0 <= $n && $n as u64 <= $dst::max_value() as u64 { + Some($n as $dst) + } else { + None + } + }; +} + +macro_rules! uint_to { + ($dst:ident, $n:ident) => { + if $n as u64 <= $dst::max_value() as u64 { + Some($n as $dst) + } else { + None + } + }; +} + +pub trait FromPrimitive: Sized { + fn from_i8(n: i8) -> Option; + fn from_i16(n: i16) -> Option; + fn from_i32(n: i32) -> Option; + fn from_i64(n: i64) -> Option; + fn from_u8(n: u8) -> Option; + fn from_u16(n: u16) -> Option; + fn from_u32(n: u32) -> Option; + fn from_u64(n: u64) -> Option; +} + +macro_rules! impl_from_primitive_for_int { + ($t:ident) => { + impl FromPrimitive for $t { + #[inline] + fn from_i8(n: i8) -> Option { + int_to_int!($t, n) + } + #[inline] + fn from_i16(n: i16) -> Option { + int_to_int!($t, n) + } + #[inline] + fn from_i32(n: i32) -> Option { + int_to_int!($t, n) + } + #[inline] + fn from_i64(n: i64) -> Option { + int_to_int!($t, n) + } + #[inline] + fn from_u8(n: u8) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u16(n: u16) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u32(n: u32) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u64(n: u64) -> Option { + uint_to!($t, n) + } + } + }; +} + +macro_rules! impl_from_primitive_for_uint { + ($t:ident) => { + impl FromPrimitive for $t { + #[inline] + fn from_i8(n: i8) -> Option { + int_to_uint!($t, n) + } + #[inline] + fn from_i16(n: i16) -> Option { + int_to_uint!($t, n) + } + #[inline] + fn from_i32(n: i32) -> Option { + int_to_uint!($t, n) + } + #[inline] + fn from_i64(n: i64) -> Option { + int_to_uint!($t, n) + } + #[inline] + fn from_u8(n: u8) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u16(n: u16) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u32(n: u32) -> Option { + uint_to!($t, n) + } + #[inline] + fn from_u64(n: u64) -> Option { + uint_to!($t, n) + } + } + }; +} + +macro_rules! impl_from_primitive_for_float { + ($t:ident) => { + impl FromPrimitive for $t { + #[inline] + fn from_i8(n: i8) -> Option { + Some(n as Self) + } + #[inline] + fn from_i16(n: i16) -> Option { + Some(n as Self) + } + #[inline] + fn from_i32(n: i32) -> Option { + Some(n as Self) + } + #[inline] + fn from_i64(n: i64) -> Option { + Some(n as Self) + } + #[inline] + fn from_u8(n: u8) -> Option { + Some(n as Self) + } + #[inline] + fn from_u16(n: u16) -> Option { + Some(n as Self) + } + #[inline] + fn from_u32(n: u32) -> Option { + Some(n as Self) + } + #[inline] + fn from_u64(n: u64) -> Option { + Some(n as Self) + } + } + }; +} + +impl_from_primitive_for_int!(isize); +impl_from_primitive_for_int!(i8); +impl_from_primitive_for_int!(i16); +impl_from_primitive_for_int!(i32); +impl_from_primitive_for_int!(i64); +impl_from_primitive_for_uint!(usize); +impl_from_primitive_for_uint!(u8); +impl_from_primitive_for_uint!(u16); +impl_from_primitive_for_uint!(u32); +impl_from_primitive_for_uint!(u64); +impl_from_primitive_for_float!(f32); +impl_from_primitive_for_float!(f64); + +serde_if_integer128! { + impl FromPrimitive for i128 { + #[inline] + fn from_i8(n: i8) -> Option { + Some(n as i128) + } + #[inline] + fn from_i16(n: i16) -> Option { + Some(n as i128) + } + #[inline] + fn from_i32(n: i32) -> Option { + Some(n as i128) + } + #[inline] + fn from_i64(n: i64) -> Option { + Some(n as i128) + } + #[inline] + fn from_u8(n: u8) -> Option { + Some(n as i128) + } + #[inline] + fn from_u16(n: u16) -> Option { + Some(n as i128) + } + #[inline] + fn from_u32(n: u32) -> Option { + Some(n as i128) + } + #[inline] + fn from_u64(n: u64) -> Option { + Some(n as i128) + } + } + + impl FromPrimitive for u128 { + #[inline] + fn from_i8(n: i8) -> Option { + if n >= 0 { + Some(n as u128) + } else { + None + } + } + #[inline] + fn from_i16(n: i16) -> Option { + if n >= 0 { + Some(n as u128) + } else { + None + } + } + #[inline] + fn from_i32(n: i32) -> Option { + if n >= 0 { + Some(n as u128) + } else { + None + } + } + #[inline] + fn from_i64(n: i64) -> Option { + if n >= 0 { + Some(n as u128) + } else { + None + } + } + #[inline] + fn from_u8(n: u8) -> Option { + Some(n as u128) + } + #[inline] + fn from_u16(n: u16) -> Option { + Some(n as u128) + } + #[inline] + fn from_u32(n: u32) -> Option { + Some(n as u128) + } + #[inline] + fn from_u64(n: u64) -> Option { + Some(n as u128) + } + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/de/ignored_any.rs b/vendor/registry-40351f815f426200/serde/src/de/ignored_any.rs new file mode 100644 index 000000000..855d68e1a --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/ignored_any.rs @@ -0,0 +1,218 @@ +use lib::*; + +use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor}; + +/// An efficient way of discarding data from a deserializer. +/// +/// Think of this like `serde_json::Value` in that it can be deserialized from +/// any type, except that it does not store any information about the data that +/// gets deserialized. +/// +/// ```edition2018 +/// use std::fmt; +/// use std::marker::PhantomData; +/// +/// use serde::de::{ +/// self, Deserialize, DeserializeSeed, Deserializer, IgnoredAny, SeqAccess, Visitor, +/// }; +/// +/// /// A seed that can be used to deserialize only the `n`th element of a sequence +/// /// while efficiently discarding elements of any type before or after index `n`. +/// /// +/// /// For example to deserialize only the element at index 3: +/// /// +/// /// ``` +/// /// NthElement::new(3).deserialize(deserializer) +/// /// ``` +/// pub struct NthElement { +/// n: usize, +/// marker: PhantomData, +/// } +/// +/// impl NthElement { +/// pub fn new(n: usize) -> Self { +/// NthElement { +/// n: n, +/// marker: PhantomData, +/// } +/// } +/// } +/// +/// impl<'de, T> Visitor<'de> for NthElement +/// where +/// T: Deserialize<'de>, +/// { +/// type Value = T; +/// +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!( +/// formatter, +/// "a sequence in which we care about element {}", +/// self.n +/// ) +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result +/// where +/// A: SeqAccess<'de>, +/// { +/// // Skip over the first `n` elements. +/// for i in 0..self.n { +/// // It is an error if the sequence ends before we get to element `n`. +/// if seq.next_element::()?.is_none() { +/// return Err(de::Error::invalid_length(i, &self)); +/// } +/// } +/// +/// // Deserialize the one we care about. +/// let nth = match seq.next_element()? { +/// Some(nth) => nth, +/// None => { +/// return Err(de::Error::invalid_length(self.n, &self)); +/// } +/// }; +/// +/// // Skip over any remaining elements in the sequence after `n`. +/// while let Some(IgnoredAny) = seq.next_element()? { +/// // ignore +/// } +/// +/// Ok(nth) +/// } +/// } +/// +/// impl<'de, T> DeserializeSeed<'de> for NthElement +/// where +/// T: Deserialize<'de>, +/// { +/// type Value = T; +/// +/// fn deserialize(self, deserializer: D) -> Result +/// where +/// D: Deserializer<'de>, +/// { +/// deserializer.deserialize_seq(self) +/// } +/// } +/// +/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error> +/// # where +/// # D: Deserializer<'de>, +/// # { +/// // Deserialize only the sequence element at index 3 from this deserializer. +/// // The element at index 3 is required to be a string. Elements before and +/// // after index 3 are allowed to be of any type. +/// let s: String = NthElement::new(3).deserialize(deserializer)?; +/// # Ok(()) +/// # } +/// ``` +#[derive(Copy, Clone, Debug, Default)] +pub struct IgnoredAny; + +impl<'de> Visitor<'de> for IgnoredAny { + type Value = IgnoredAny; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("anything at all") + } + + #[inline] + fn visit_bool(self, x: bool) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_i64(self, x: i64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_u64(self, x: u64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_f64(self, x: f64) -> Result { + let _ = x; + Ok(IgnoredAny) + } + + #[inline] + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + let _ = s; + Ok(IgnoredAny) + } + + #[inline] + fn visit_none(self) -> Result { + Ok(IgnoredAny) + } + + #[inline] + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + IgnoredAny::deserialize(deserializer) + } + + #[inline] + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + IgnoredAny::deserialize(deserializer) + } + + #[inline] + fn visit_unit(self) -> Result { + Ok(IgnoredAny) + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + while let Some(IgnoredAny) = try!(seq.next_element()) { + // Gobble + } + Ok(IgnoredAny) + } + + #[inline] + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + while let Some((IgnoredAny, IgnoredAny)) = try!(map.next_entry()) { + // Gobble + } + Ok(IgnoredAny) + } + + #[inline] + fn visit_bytes(self, bytes: &[u8]) -> Result + where + E: Error, + { + let _ = bytes; + Ok(IgnoredAny) + } +} + +impl<'de> Deserialize<'de> for IgnoredAny { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_ignored_any(IgnoredAny) + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/de/impls.rs b/vendor/registry-40351f815f426200/serde/src/de/impls.rs new file mode 100644 index 000000000..1d4c31878 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/impls.rs @@ -0,0 +1,2545 @@ +use lib::*; + +use de::{ + Deserialize, Deserializer, EnumAccess, Error, SeqAccess, Unexpected, VariantAccess, Visitor, +}; + +#[cfg(any(core_duration, feature = "std", feature = "alloc"))] +use de::MapAccess; + +use de::from_primitive::FromPrimitive; +use private::de::InPlaceSeed; + +#[cfg(any(feature = "std", feature = "alloc"))] +use private::de::size_hint; + +//////////////////////////////////////////////////////////////////////////////// + +struct UnitVisitor; + +impl<'de> Visitor<'de> for UnitVisitor { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("unit") + } + + fn visit_unit(self) -> Result + where + E: Error, + { + Ok(()) + } +} + +impl<'de> Deserialize<'de> for () { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_unit(UnitVisitor) + } +} + +#[cfg(feature = "unstable")] +impl<'de> Deserialize<'de> for ! { + fn deserialize(_deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Err(Error::custom("cannot deserialize `!`")) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct BoolVisitor; + +impl<'de> Visitor<'de> for BoolVisitor { + type Value = bool; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a boolean") + } + + fn visit_bool(self, v: bool) -> Result + where + E: Error, + { + Ok(v) + } +} + +impl<'de> Deserialize<'de> for bool { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_bool(BoolVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! visit_integer_method { + ($src_ty:ident, $method:ident, $from_method:ident, $group:ident, $group_ty:ident) => { + #[inline] + fn $method(self, v: $src_ty) -> Result + where + E: Error, + { + match FromPrimitive::$from_method(v) { + Some(v) => Ok(v), + None => Err(Error::invalid_value(Unexpected::$group(v as $group_ty), &self)), + } + } + } +} + +macro_rules! visit_float_method { + ($src_ty:ident, $method:ident) => { + #[inline] + fn $method(self, v: $src_ty) -> Result + where + E: Error, + { + Ok(v as Self::Value) + } + } +} + +macro_rules! impl_deserialize_num { + ($ty:ident, $method:ident, $($visit:ident),*) => { + impl<'de> Deserialize<'de> for $ty { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct PrimitiveVisitor; + + impl<'de> Visitor<'de> for PrimitiveVisitor { + type Value = $ty; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(stringify!($ty)) + } + + $( + impl_deserialize_num!($visit $ty); + )* + } + + deserializer.$method(PrimitiveVisitor) + } + } + }; + + (integer $ty:ident) => { + visit_integer_method!(i8, visit_i8, from_i8, Signed, i64); + visit_integer_method!(i16, visit_i16, from_i16, Signed, i64); + visit_integer_method!(i32, visit_i32, from_i32, Signed, i64); + visit_integer_method!(i64, visit_i64, from_i64, Signed, i64); + + visit_integer_method!(u8, visit_u8, from_u8, Unsigned, u64); + visit_integer_method!(u16, visit_u16, from_u16, Unsigned, u64); + visit_integer_method!(u32, visit_u32, from_u32, Unsigned, u64); + visit_integer_method!(u64, visit_u64, from_u64, Unsigned, u64); + }; + + (float $ty:ident) => { + visit_float_method!(f32, visit_f32); + visit_float_method!(f64, visit_f64); + }; +} + +impl_deserialize_num!(i8, deserialize_i8, integer); +impl_deserialize_num!(i16, deserialize_i16, integer); +impl_deserialize_num!(i32, deserialize_i32, integer); +impl_deserialize_num!(i64, deserialize_i64, integer); +impl_deserialize_num!(isize, deserialize_i64, integer); + +impl_deserialize_num!(u8, deserialize_u8, integer); +impl_deserialize_num!(u16, deserialize_u16, integer); +impl_deserialize_num!(u32, deserialize_u32, integer); +impl_deserialize_num!(u64, deserialize_u64, integer); +impl_deserialize_num!(usize, deserialize_u64, integer); + +impl_deserialize_num!(f32, deserialize_f32, integer, float); +impl_deserialize_num!(f64, deserialize_f64, integer, float); + +serde_if_integer128! { + impl<'de> Deserialize<'de> for i128 { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct PrimitiveVisitor; + + impl<'de> Visitor<'de> for PrimitiveVisitor { + type Value = i128; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("i128") + } + + impl_deserialize_num!(integer i128); + + #[inline] + fn visit_i128(self, v: i128) -> Result + where + E: Error, + { + Ok(v) + } + + #[inline] + fn visit_u128(self, v: u128) -> Result + where + E: Error, + { + if v <= i128::max_value() as u128 { + Ok(v as i128) + } else { + Err(Error::invalid_value(Unexpected::Other("u128"), &self)) + } + } + } + + deserializer.deserialize_i128(PrimitiveVisitor) + } + } + + impl<'de> Deserialize<'de> for u128 { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct PrimitiveVisitor; + + impl<'de> Visitor<'de> for PrimitiveVisitor { + type Value = u128; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("u128") + } + + impl_deserialize_num!(integer u128); + + #[inline] + fn visit_i128(self, v: i128) -> Result + where + E: Error, + { + if v >= 0 { + Ok(v as u128) + } else { + Err(Error::invalid_value(Unexpected::Other("i128"), &self)) + } + } + + #[inline] + fn visit_u128(self, v: u128) -> Result + where + E: Error, + { + Ok(v) + } + } + + deserializer.deserialize_u128(PrimitiveVisitor) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct CharVisitor; + +impl<'de> Visitor<'de> for CharVisitor { + type Value = char; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a character") + } + + #[inline] + fn visit_char(self, v: char) -> Result + where + E: Error, + { + Ok(v) + } + + #[inline] + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + let mut iter = v.chars(); + match (iter.next(), iter.next()) { + (Some(c), None) => Ok(c), + _ => Err(Error::invalid_value(Unexpected::Str(v), &self)), + } + } +} + +impl<'de> Deserialize<'de> for char { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_char(CharVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +struct StringVisitor; +#[cfg(any(feature = "std", feature = "alloc"))] +struct StringInPlaceVisitor<'a>(&'a mut String); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de> Visitor<'de> for StringVisitor { + type Value = String; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(v.to_owned()) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(v) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => Ok(s.to_owned()), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + match String::from_utf8(v) { + Ok(s) => Ok(s), + Err(e) => Err(Error::invalid_value( + Unexpected::Bytes(&e.into_bytes()), + &self, + )), + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de> Visitor<'de> for StringInPlaceVisitor<'a> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + self.0.clear(); + self.0.push_str(v); + Ok(()) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + *self.0 = v; + Ok(()) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => { + self.0.clear(); + self.0.push_str(s); + Ok(()) + } + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + match String::from_utf8(v) { + Ok(s) => { + *self.0 = s; + Ok(()) + } + Err(e) => Err(Error::invalid_value( + Unexpected::Bytes(&e.into_bytes()), + &self, + )), + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de> Deserialize<'de> for String { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_string(StringVisitor) + } + + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + deserializer.deserialize_string(StringInPlaceVisitor(place)) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct StrVisitor; + +impl<'a> Visitor<'a> for StrVisitor { + type Value = &'a str; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a borrowed string") + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(v) // so easy + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + str::from_utf8(v).map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self)) + } +} + +impl<'de: 'a, 'a> Deserialize<'de> for &'a str { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(StrVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct BytesVisitor; + +impl<'a> Visitor<'a> for BytesVisitor { + type Value = &'a [u8]; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a borrowed byte array") + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + Ok(v) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(v.as_bytes()) + } +} + +impl<'de: 'a, 'a> Deserialize<'de> for &'a [u8] { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_bytes(BytesVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +struct CStringVisitor; + +#[cfg(feature = "std")] +impl<'de> Visitor<'de> for CStringVisitor { + type Value = CString; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("byte array") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let len = size_hint::cautious(seq.size_hint()); + let mut values = Vec::with_capacity(len); + + while let Some(value) = try!(seq.next_element()) { + values.push(value); + } + + CString::new(values).map_err(Error::custom) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + CString::new(v).map_err(Error::custom) + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for CString { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_byte_buf(CStringVisitor) + } +} + +macro_rules! forwarded_impl { + ( + $(#[doc = $doc:tt])* + ( $($id: ident),* ), $ty: ty, $func: expr + ) => { + $(#[doc = $doc])* + impl<'de $(, $id : Deserialize<'de>,)*> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map($func) + } + } + } +} + +#[cfg(all(feature = "std", de_boxed_c_str))] +forwarded_impl!((), Box, CString::into_boxed_c_str); + +#[cfg(core_reverse)] +forwarded_impl!((T), Reverse, Reverse); + +//////////////////////////////////////////////////////////////////////////////// + +struct OptionVisitor { + marker: PhantomData, +} + +impl<'de, T> Visitor<'de> for OptionVisitor +where + T: Deserialize<'de>, +{ + type Value = Option; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("option") + } + + #[inline] + fn visit_unit(self) -> Result + where + E: Error, + { + Ok(None) + } + + #[inline] + fn visit_none(self) -> Result + where + E: Error, + { + Ok(None) + } + + #[inline] + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + T::deserialize(deserializer).map(Some) + } + + #[doc(hidden)] + fn __private_visit_untagged_option(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Ok(T::deserialize(deserializer).ok()) + } +} + +impl<'de, T> Deserialize<'de> for Option +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_option(OptionVisitor { + marker: PhantomData, + }) + } + + // The Some variant's repr is opaque, so we can't play cute tricks with its + // tag to have deserialize_in_place build the content in place unconditionally. + // + // FIXME: investigate whether branching on the old value being Some to + // deserialize_in_place the value is profitable (probably data-dependent?) +} + +//////////////////////////////////////////////////////////////////////////////// + +struct PhantomDataVisitor { + marker: PhantomData, +} + +impl<'de, T: ?Sized> Visitor<'de> for PhantomDataVisitor { + type Value = PhantomData; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("unit") + } + + #[inline] + fn visit_unit(self) -> Result + where + E: Error, + { + Ok(PhantomData) + } +} + +impl<'de, T: ?Sized> Deserialize<'de> for PhantomData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let visitor = PhantomDataVisitor { + marker: PhantomData, + }; + deserializer.deserialize_unit_struct("PhantomData", visitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! seq_impl { + ( + $ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $access:ident, + $clear:expr, + $with_capacity:expr, + $reserve:expr, + $insert:expr + ) => { + impl<'de, T $(, $typaram)*> Deserialize<'de> for $ty + where + T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound1 $(+ $bound2)*,)* + { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SeqVisitor { + marker: PhantomData<$ty>, + } + + impl<'de, T $(, $typaram)*> Visitor<'de> for SeqVisitor + where + T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound1 $(+ $bound2)*,)* + { + type Value = $ty; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a sequence") + } + + #[inline] + fn visit_seq(self, mut $access: A) -> Result + where + A: SeqAccess<'de>, + { + let mut values = $with_capacity; + + while let Some(value) = try!($access.next_element()) { + $insert(&mut values, value); + } + + Ok(values) + } + } + + let visitor = SeqVisitor { marker: PhantomData }; + deserializer.deserialize_seq(visitor) + } + + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + struct SeqInPlaceVisitor<'a, T: 'a $(, $typaram: 'a)*>(&'a mut $ty); + + impl<'a, 'de, T $(, $typaram)*> Visitor<'de> for SeqInPlaceVisitor<'a, T $(, $typaram)*> + where + T: Deserialize<'de> $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound1 $(+ $bound2)*,)* + { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a sequence") + } + + #[inline] + fn visit_seq(mut self, mut $access: A) -> Result + where + A: SeqAccess<'de>, + { + $clear(&mut self.0); + $reserve(&mut self.0, size_hint::cautious($access.size_hint())); + + // FIXME: try to overwrite old values here? (Vec, VecDeque, LinkedList) + while let Some(value) = try!($access.next_element()) { + $insert(&mut self.0, value); + } + + Ok(()) + } + } + + deserializer.deserialize_seq(SeqInPlaceVisitor(place)) + } + } + } +} + +// Dummy impl of reserve +#[cfg(any(feature = "std", feature = "alloc"))] +fn nop_reserve(_seq: T, _n: usize) {} + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!( + BinaryHeap, + seq, + BinaryHeap::clear, + BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())), + BinaryHeap::reserve, + BinaryHeap::push); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!( + BTreeSet, + seq, + BTreeSet::clear, + BTreeSet::new(), + nop_reserve, + BTreeSet::insert); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!( + LinkedList, + seq, + LinkedList::clear, + LinkedList::new(), + nop_reserve, + LinkedList::push_back +); + +#[cfg(feature = "std")] +seq_impl!( + HashSet, + seq, + HashSet::clear, + HashSet::with_capacity_and_hasher(size_hint::cautious(seq.size_hint()), S::default()), + HashSet::reserve, + HashSet::insert); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!( + VecDeque, + seq, + VecDeque::clear, + VecDeque::with_capacity(size_hint::cautious(seq.size_hint())), + VecDeque::reserve, + VecDeque::push_back +); + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, T> Deserialize<'de> for Vec +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct VecVisitor { + marker: PhantomData, + } + + impl<'de, T> Visitor<'de> for VecVisitor + where + T: Deserialize<'de>, + { + type Value = Vec; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a sequence") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let mut values = Vec::with_capacity(size_hint::cautious(seq.size_hint())); + + while let Some(value) = try!(seq.next_element()) { + values.push(value); + } + + Ok(values) + } + } + + let visitor = VecVisitor { + marker: PhantomData, + }; + deserializer.deserialize_seq(visitor) + } + + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + struct VecInPlaceVisitor<'a, T: 'a>(&'a mut Vec); + + impl<'a, 'de, T> Visitor<'de> for VecInPlaceVisitor<'a, T> + where + T: Deserialize<'de>, + { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a sequence") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let hint = size_hint::cautious(seq.size_hint()); + if let Some(additional) = hint.checked_sub(self.0.len()) { + self.0.reserve(additional); + } + + for i in 0..self.0.len() { + let next = { + let next_place = InPlaceSeed(&mut self.0[i]); + try!(seq.next_element_seed(next_place)) + }; + if next.is_none() { + self.0.truncate(i); + return Ok(()); + } + } + + while let Some(value) = try!(seq.next_element()) { + self.0.push(value); + } + + Ok(()) + } + } + + deserializer.deserialize_seq(VecInPlaceVisitor(place)) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +struct ArrayVisitor { + marker: PhantomData, +} +struct ArrayInPlaceVisitor<'a, A: 'a>(&'a mut A); + +impl ArrayVisitor { + fn new() -> Self { + ArrayVisitor { + marker: PhantomData, + } + } +} + +impl<'de, T> Visitor<'de> for ArrayVisitor<[T; 0]> { + type Value = [T; 0]; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("an empty array") + } + + #[inline] + fn visit_seq(self, _: A) -> Result + where + A: SeqAccess<'de>, + { + Ok([]) + } +} + +// Does not require T: Deserialize<'de>. +impl<'de, T> Deserialize<'de> for [T; 0] { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_tuple(0, ArrayVisitor::<[T; 0]>::new()) + } +} + +macro_rules! array_impls { + ($($len:expr => ($($n:tt)+))+) => { + $( + impl<'de, T> Visitor<'de> for ArrayVisitor<[T; $len]> + where + T: Deserialize<'de>, + { + type Value = [T; $len]; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("an array of length ", $len)) + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + Ok([$( + match try!(seq.next_element()) { + Some(val) => val, + None => return Err(Error::invalid_length($n, &self)), + } + ),+]) + } + } + + impl<'a, 'de, T> Visitor<'de> for ArrayInPlaceVisitor<'a, [T; $len]> + where + T: Deserialize<'de>, + { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("an array of length ", $len)) + } + + #[inline] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let mut fail_idx = None; + for (idx, dest) in self.0[..].iter_mut().enumerate() { + if try!(seq.next_element_seed(InPlaceSeed(dest))).is_none() { + fail_idx = Some(idx); + break; + } + } + if let Some(idx) = fail_idx { + return Err(Error::invalid_length(idx, &self)); + } + Ok(()) + } + } + + impl<'de, T> Deserialize<'de> for [T; $len] + where + T: Deserialize<'de>, + { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_tuple($len, ArrayVisitor::<[T; $len]>::new()) + } + + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + deserializer.deserialize_tuple($len, ArrayInPlaceVisitor(place)) + } + } + )+ + } +} + +array_impls! { + 1 => (0) + 2 => (0 1) + 3 => (0 1 2) + 4 => (0 1 2 3) + 5 => (0 1 2 3 4) + 6 => (0 1 2 3 4 5) + 7 => (0 1 2 3 4 5 6) + 8 => (0 1 2 3 4 5 6 7) + 9 => (0 1 2 3 4 5 6 7 8) + 10 => (0 1 2 3 4 5 6 7 8 9) + 11 => (0 1 2 3 4 5 6 7 8 9 10) + 12 => (0 1 2 3 4 5 6 7 8 9 10 11) + 13 => (0 1 2 3 4 5 6 7 8 9 10 11 12) + 14 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13) + 15 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14) + 16 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) + 17 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16) + 18 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17) + 19 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18) + 20 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) + 21 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) + 22 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21) + 23 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22) + 24 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23) + 25 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24) + 26 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25) + 27 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26) + 28 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27) + 29 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28) + 30 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29) + 31 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30) + 32 => (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31) +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! tuple_impls { + ($($len:tt => ($($n:tt $name:ident)+))+) => { + $( + impl<'de, $($name: Deserialize<'de>),+> Deserialize<'de> for ($($name,)+) { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TupleVisitor<$($name,)+> { + marker: PhantomData<($($name,)+)>, + } + + impl<'de, $($name: Deserialize<'de>),+> Visitor<'de> for TupleVisitor<$($name,)+> { + type Value = ($($name,)+); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("a tuple of size ", $len)) + } + + #[inline] + #[allow(non_snake_case)] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + $( + let $name = match try!(seq.next_element()) { + Some(value) => value, + None => return Err(Error::invalid_length($n, &self)), + }; + )+ + + Ok(($($name,)+)) + } + } + + deserializer.deserialize_tuple($len, TupleVisitor { marker: PhantomData }) + } + + #[inline] + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + struct TupleInPlaceVisitor<'a, $($name: 'a,)+>(&'a mut ($($name,)+)); + + impl<'a, 'de, $($name: Deserialize<'de>),+> Visitor<'de> for TupleInPlaceVisitor<'a, $($name,)+> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("a tuple of size ", $len)) + } + + #[inline] + #[allow(non_snake_case)] + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + $( + if try!(seq.next_element_seed(InPlaceSeed(&mut (self.0).$n))).is_none() { + return Err(Error::invalid_length($n, &self)); + } + )+ + + Ok(()) + } + } + + deserializer.deserialize_tuple($len, TupleInPlaceVisitor(place)) + } + } + )+ + } +} + +tuple_impls! { + 1 => (0 T0) + 2 => (0 T0 1 T1) + 3 => (0 T0 1 T1 2 T2) + 4 => (0 T0 1 T1 2 T2 3 T3) + 5 => (0 T0 1 T1 2 T2 3 T3 4 T4) + 6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5) + 7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6) + 8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7) + 9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8) + 10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9) + 11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10) + 12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11) + 13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12) + 14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13) + 15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14) + 16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15) +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! map_impl { + ( + $ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound1:ident $(+ $bound2:ident)*)* >, + $access:ident, + $with_capacity:expr + ) => { + impl<'de, K, V $(, $typaram)*> Deserialize<'de> for $ty + where + K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*, + V: Deserialize<'de>, + $($typaram: $bound1 $(+ $bound2)*),* + { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct MapVisitor { + marker: PhantomData<$ty>, + } + + impl<'de, K, V $(, $typaram)*> Visitor<'de> for MapVisitor + where + K: Deserialize<'de> $(+ $kbound1 $(+ $kbound2)*)*, + V: Deserialize<'de>, + $($typaram: $bound1 $(+ $bound2)*),* + { + type Value = $ty; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a map") + } + + #[inline] + fn visit_map(self, mut $access: A) -> Result + where + A: MapAccess<'de>, + { + let mut values = $with_capacity; + + while let Some((key, value)) = try!($access.next_entry()) { + values.insert(key, value); + } + + Ok(values) + } + } + + let visitor = MapVisitor { marker: PhantomData }; + deserializer.deserialize_map(visitor) + } + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +map_impl!( + BTreeMap, + map, + BTreeMap::new()); + +#[cfg(feature = "std")] +map_impl!( + HashMap, + map, + HashMap::with_capacity_and_hasher(size_hint::cautious(map.size_hint()), S::default())); + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +macro_rules! parse_ip_impl { + ($expecting:tt $ty:ty; $size:tt) => { + impl<'de> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + struct IpAddrVisitor; + + impl<'de> Visitor<'de> for IpAddrVisitor { + type Value = $ty; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str($expecting) + } + + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + s.parse().map_err(Error::custom) + } + } + + deserializer.deserialize_str(IpAddrVisitor) + } else { + <[u8; $size]>::deserialize(deserializer).map(<$ty>::from) + } + } + } + }; +} + +#[cfg(feature = "std")] +macro_rules! variant_identifier { + ( + $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) + $expecting_message: expr, + $variants_name: ident + ) => { + enum $name_kind { + $( $variant ),* + } + + static $variants_name: &'static [&'static str] = &[ $( stringify!($variant) ),*]; + + impl<'de> Deserialize<'de> for $name_kind { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct KindVisitor; + + impl<'de> Visitor<'de> for KindVisitor { + type Value = $name_kind; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str($expecting_message) + } + + fn visit_u32(self, value: u32) -> Result + where + E: Error, + { + match value { + $( + $index => Ok($name_kind :: $variant), + )* + _ => Err(Error::invalid_value(Unexpected::Unsigned(value as u64), &self),), + } + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + $( + stringify!($variant) => Ok($name_kind :: $variant), + )* + _ => Err(Error::unknown_variant(value, $variants_name)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + $( + $bytes => Ok($name_kind :: $variant), + )* + _ => { + match str::from_utf8(value) { + Ok(value) => Err(Error::unknown_variant(value, $variants_name)), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(value), &self)), + } + } + } + } + } + + deserializer.deserialize_identifier(KindVisitor) + } + } + } +} + +#[cfg(feature = "std")] +macro_rules! deserialize_enum { + ( + $name: ident $name_kind: ident ( $($variant: ident; $bytes: expr; $index: expr),* ) + $expecting_message: expr, + $deserializer: expr + ) => { + variant_identifier!{ + $name_kind ( $($variant; $bytes; $index),* ) + $expecting_message, + VARIANTS + } + + struct EnumVisitor; + impl<'de> Visitor<'de> for EnumVisitor { + type Value = $name; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(concat!("a ", stringify!($name))) + } + + + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + match try!(data.variant()) { + $( + ($name_kind :: $variant, v) => v.newtype_variant().map($name :: $variant), + )* + } + } + } + $deserializer.deserialize_enum(stringify!($name), VARIANTS, EnumVisitor) + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for net::IpAddr { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + struct IpAddrVisitor; + + impl<'de> Visitor<'de> for IpAddrVisitor { + type Value = net::IpAddr; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("IP address") + } + + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + s.parse().map_err(Error::custom) + } + } + + deserializer.deserialize_str(IpAddrVisitor) + } else { + use lib::net::IpAddr; + deserialize_enum! { + IpAddr IpAddrKind (V4; b"V4"; 0, V6; b"V6"; 1) + "`V4` or `V6`", + deserializer + } + } + } +} + +#[cfg(feature = "std")] +parse_ip_impl!("IPv4 address" net::Ipv4Addr; 4); + +#[cfg(feature = "std")] +parse_ip_impl!("IPv6 address" net::Ipv6Addr; 16); + +#[cfg(feature = "std")] +macro_rules! parse_socket_impl { + ($expecting:tt $ty:ty, $new:expr) => { + impl<'de> Deserialize<'de> for $ty { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + struct SocketAddrVisitor; + + impl<'de> Visitor<'de> for SocketAddrVisitor { + type Value = $ty; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str($expecting) + } + + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + s.parse().map_err(Error::custom) + } + } + + deserializer.deserialize_str(SocketAddrVisitor) + } else { + <(_, u16)>::deserialize(deserializer).map(|(ip, port)| $new(ip, port)) + } + } + } + }; +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for net::SocketAddr { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + if deserializer.is_human_readable() { + struct SocketAddrVisitor; + + impl<'de> Visitor<'de> for SocketAddrVisitor { + type Value = net::SocketAddr; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("socket address") + } + + fn visit_str(self, s: &str) -> Result + where + E: Error, + { + s.parse().map_err(Error::custom) + } + } + + deserializer.deserialize_str(SocketAddrVisitor) + } else { + use lib::net::SocketAddr; + deserialize_enum! { + SocketAddr SocketAddrKind (V4; b"V4"; 0, V6; b"V6"; 1) + "`V4` or `V6`", + deserializer + } + } + } +} + +#[cfg(feature = "std")] +parse_socket_impl!("IPv4 socket address" net::SocketAddrV4, net::SocketAddrV4::new); + +#[cfg(feature = "std")] +parse_socket_impl!("IPv6 socket address" net::SocketAddrV6, |ip, port| net::SocketAddrV6::new( + ip, port, 0, 0 +)); + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +struct PathVisitor; + +#[cfg(feature = "std")] +impl<'a> Visitor<'a> for PathVisitor { + type Value = &'a Path; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a borrowed path") + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(v.as_ref()) + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + str::from_utf8(v) + .map(AsRef::as_ref) + .map_err(|_| Error::invalid_value(Unexpected::Bytes(v), &self)) + } +} + +#[cfg(feature = "std")] +impl<'de: 'a, 'a> Deserialize<'de> for &'a Path { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(PathVisitor) + } +} + +#[cfg(feature = "std")] +struct PathBufVisitor; + +#[cfg(feature = "std")] +impl<'de> Visitor<'de> for PathBufVisitor { + type Value = PathBuf; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("path string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(From::from(v)) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(From::from(v)) + } +} + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for PathBuf { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_string(PathBufVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +// If this were outside of the serde crate, it would just use: +// +// #[derive(Deserialize)] +// #[serde(variant_identifier)] +#[cfg(all(feature = "std", any(unix, windows)))] +variant_identifier! { + OsStringKind (Unix; b"Unix"; 0, Windows; b"Windows"; 1) + "`Unix` or `Windows`", + OSSTR_VARIANTS +} + +#[cfg(all(feature = "std", any(unix, windows)))] +struct OsStringVisitor; + +#[cfg(all(feature = "std", any(unix, windows)))] +impl<'de> Visitor<'de> for OsStringVisitor { + type Value = OsString; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("os string") + } + + #[cfg(unix)] + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + use std::os::unix::ffi::OsStringExt; + + match try!(data.variant()) { + (OsStringKind::Unix, v) => v.newtype_variant().map(OsString::from_vec), + (OsStringKind::Windows, _) => Err(Error::custom( + "cannot deserialize Windows OS string on Unix", + )), + } + } + + #[cfg(windows)] + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + use std::os::windows::ffi::OsStringExt; + + match try!(data.variant()) { + (OsStringKind::Windows, v) => v + .newtype_variant::>() + .map(|vec| OsString::from_wide(&vec)), + (OsStringKind::Unix, _) => Err(Error::custom( + "cannot deserialize Unix OS string on Windows", + )), + } + } +} + +#[cfg(all(feature = "std", any(unix, windows)))] +impl<'de> Deserialize<'de> for OsString { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_enum("OsString", OSSTR_VARIANTS, OsStringVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +forwarded_impl!((T), Box, Box::new); + +#[cfg(any(feature = "std", feature = "alloc"))] +forwarded_impl!((T), Box<[T]>, Vec::into_boxed_slice); + +#[cfg(any(feature = "std", feature = "alloc"))] +forwarded_impl!((), Box, String::into_boxed_str); + +#[cfg(all( + not(de_rc_dst), + feature = "rc", + any(feature = "std", feature = "alloc") +))] +forwarded_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Deserializing a data structure containing `Arc` will not attempt to + /// deduplicate `Arc` references to the same data. Every deserialized `Arc` + /// will end up with a strong count of 1. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + (T), Arc, Arc::new +} + +#[cfg(all( + not(de_rc_dst), + feature = "rc", + any(feature = "std", feature = "alloc") +))] +forwarded_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Deserializing a data structure containing `Rc` will not attempt to + /// deduplicate `Rc` references to the same data. Every deserialized `Rc` + /// will end up with a strong count of 1. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + (T), Rc, Rc::new +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, T: ?Sized> Deserialize<'de> for Cow<'a, T> +where + T: ToOwned, + T::Owned: Deserialize<'de>, +{ + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + T::Owned::deserialize(deserializer).map(Cow::Owned) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting +/// `Weak` has a reference count of 0 and cannot be upgraded. +/// +/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +impl<'de, T: ?Sized> Deserialize<'de> for RcWeak +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + try!(Option::::deserialize(deserializer)); + Ok(RcWeak::new()) + } +} + +/// This impl requires the [`"rc"`] Cargo feature of Serde. The resulting +/// `Weak` has a reference count of 0 and cannot be upgraded. +/// +/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +impl<'de, T: ?Sized> Deserialize<'de> for ArcWeak +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + try!(Option::::deserialize(deserializer)); + Ok(ArcWeak::new()) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))] +macro_rules! box_forwarded_impl { + ( + $(#[doc = $doc:tt])* + $t:ident + ) => { + $(#[doc = $doc])* + impl<'de, T: ?Sized> Deserialize<'de> for $t + where + Box: Deserialize<'de>, + { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Box::deserialize(deserializer).map(Into::into) + } + } + }; +} + +#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))] +box_forwarded_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Deserializing a data structure containing `Rc` will not attempt to + /// deduplicate `Rc` references to the same data. Every deserialized `Rc` + /// will end up with a strong count of 1. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + Rc +} + +#[cfg(all(de_rc_dst, feature = "rc", any(feature = "std", feature = "alloc")))] +box_forwarded_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Deserializing a data structure containing `Arc` will not attempt to + /// deduplicate `Arc` references to the same data. Every deserialized `Arc` + /// will end up with a strong count of 1. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + Arc +} + +//////////////////////////////////////////////////////////////////////////////// + +impl<'de, T> Deserialize<'de> for Cell +where + T: Deserialize<'de> + Copy, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + T::deserialize(deserializer).map(Cell::new) + } +} + +forwarded_impl!((T), RefCell, RefCell::new); + +#[cfg(feature = "std")] +forwarded_impl!((T), Mutex, Mutex::new); + +#[cfg(feature = "std")] +forwarded_impl!((T), RwLock, RwLock::new); + +//////////////////////////////////////////////////////////////////////////////// + +// This is a cleaned-up version of the impl generated by: +// +// #[derive(Deserialize)] +// #[serde(deny_unknown_fields)] +// struct Duration { +// secs: u64, +// nanos: u32, +// } +#[cfg(any(core_duration, feature = "std"))] +impl<'de> Deserialize<'de> for Duration { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(field_identifier, rename_all = "lowercase")] + enum Field { + Secs, + Nanos, + }; + + impl<'de> Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`secs` or `nanos`") + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "secs" => Ok(Field::Secs), + "nanos" => Ok(Field::Nanos), + _ => Err(Error::unknown_field(value, FIELDS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"secs" => Ok(Field::Secs), + b"nanos" => Ok(Field::Nanos), + _ => { + let value = ::export::from_utf8_lossy(value); + Err(Error::unknown_field(&value, FIELDS)) + } + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + struct DurationVisitor; + + impl<'de> Visitor<'de> for DurationVisitor { + type Value = Duration; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("struct Duration") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let secs: u64 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(0, &self)); + } + }; + let nanos: u32 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(1, &self)); + } + }; + Ok(Duration::new(secs, nanos)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut secs: Option = None; + let mut nanos: Option = None; + while let Some(key) = try!(map.next_key()) { + match key { + Field::Secs => { + if secs.is_some() { + return Err(::duplicate_field("secs")); + } + secs = Some(try!(map.next_value())); + } + Field::Nanos => { + if nanos.is_some() { + return Err(::duplicate_field("nanos")); + } + nanos = Some(try!(map.next_value())); + } + } + } + let secs = match secs { + Some(secs) => secs, + None => return Err(::missing_field("secs")), + }; + let nanos = match nanos { + Some(nanos) => nanos, + None => return Err(::missing_field("nanos")), + }; + Ok(Duration::new(secs, nanos)) + } + } + + const FIELDS: &'static [&'static str] = &["secs", "nanos"]; + deserializer.deserialize_struct("Duration", FIELDS, DurationVisitor) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl<'de> Deserialize<'de> for SystemTime { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Reuse duration + enum Field { + Secs, + Nanos, + }; + + impl<'de> Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`secs_since_epoch` or `nanos_since_epoch`") + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "secs_since_epoch" => Ok(Field::Secs), + "nanos_since_epoch" => Ok(Field::Nanos), + _ => Err(Error::unknown_field(value, FIELDS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"secs_since_epoch" => Ok(Field::Secs), + b"nanos_since_epoch" => Ok(Field::Nanos), + _ => { + let value = String::from_utf8_lossy(value); + Err(Error::unknown_field(&value, FIELDS)) + } + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + struct DurationVisitor; + + impl<'de> Visitor<'de> for DurationVisitor { + type Value = Duration; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("struct SystemTime") + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let secs: u64 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(0, &self)); + } + }; + let nanos: u32 = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(1, &self)); + } + }; + Ok(Duration::new(secs, nanos)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut secs: Option = None; + let mut nanos: Option = None; + while let Some(key) = try!(map.next_key()) { + match key { + Field::Secs => { + if secs.is_some() { + return Err(::duplicate_field( + "secs_since_epoch", + )); + } + secs = Some(try!(map.next_value())); + } + Field::Nanos => { + if nanos.is_some() { + return Err(::duplicate_field( + "nanos_since_epoch", + )); + } + nanos = Some(try!(map.next_value())); + } + } + } + let secs = match secs { + Some(secs) => secs, + None => return Err(::missing_field("secs_since_epoch")), + }; + let nanos = match nanos { + Some(nanos) => nanos, + None => return Err(::missing_field("nanos_since_epoch")), + }; + Ok(Duration::new(secs, nanos)) + } + } + + const FIELDS: &'static [&'static str] = &["secs_since_epoch", "nanos_since_epoch"]; + let duration = try!(deserializer.deserialize_struct("SystemTime", FIELDS, DurationVisitor)); + Ok(UNIX_EPOCH + duration) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +// Similar to: +// +// #[derive(Deserialize)] +// #[serde(deny_unknown_fields)] +// struct Range { +// start: u64, +// end: u32, +// } +impl<'de, Idx> Deserialize<'de> for Range +where + Idx: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let (start, end) = deserializer.deserialize_struct( + "Range", + range::FIELDS, + range::RangeVisitor { + expecting: "struct Range", + phantom: PhantomData, + }, + )?; + Ok(start..end) + } +} + +#[cfg(range_inclusive)] +impl<'de, Idx> Deserialize<'de> for RangeInclusive +where + Idx: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let (start, end) = deserializer.deserialize_struct( + "RangeInclusive", + range::FIELDS, + range::RangeVisitor { + expecting: "struct RangeInclusive", + phantom: PhantomData, + }, + )?; + Ok(RangeInclusive::new(start, end)) + } +} + +mod range { + use lib::*; + + use de::{Deserialize, Deserializer, Error, MapAccess, SeqAccess, Visitor}; + + pub const FIELDS: &'static [&'static str] = &["start", "end"]; + + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(field_identifier, rename_all = "lowercase")] + enum Field { + Start, + End, + } + + impl<'de> Deserialize<'de> for Field { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`start` or `end`") + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "start" => Ok(Field::Start), + "end" => Ok(Field::End), + _ => Err(Error::unknown_field(value, FIELDS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"start" => Ok(Field::Start), + b"end" => Ok(Field::End), + _ => { + let value = ::export::from_utf8_lossy(value); + Err(Error::unknown_field(&value, FIELDS)) + } + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + pub struct RangeVisitor { + pub expecting: &'static str, + pub phantom: PhantomData, + } + + impl<'de, Idx> Visitor<'de> for RangeVisitor + where + Idx: Deserialize<'de>, + { + type Value = (Idx, Idx); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(self.expecting) + } + + fn visit_seq(self, mut seq: A) -> Result + where + A: SeqAccess<'de>, + { + let start: Idx = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(0, &self)); + } + }; + let end: Idx = match try!(seq.next_element()) { + Some(value) => value, + None => { + return Err(Error::invalid_length(1, &self)); + } + }; + Ok((start, end)) + } + + fn visit_map(self, mut map: A) -> Result + where + A: MapAccess<'de>, + { + let mut start: Option = None; + let mut end: Option = None; + while let Some(key) = try!(map.next_key()) { + match key { + Field::Start => { + if start.is_some() { + return Err(::duplicate_field("start")); + } + start = Some(try!(map.next_value())); + } + Field::End => { + if end.is_some() { + return Err(::duplicate_field("end")); + } + end = Some(try!(map.next_value())); + } + } + } + let start = match start { + Some(start) => start, + None => return Err(::missing_field("start")), + }; + let end = match end { + Some(end) => end, + None => return Err(::missing_field("end")), + }; + Ok((start, end)) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(ops_bound, collections_bound))] +impl<'de, T> Deserialize<'de> for Bound +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + enum Field { + Unbounded, + Included, + Excluded, + } + + impl<'de> Deserialize<'de> for Field { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`Unbounded`, `Included` or `Excluded`") + } + + fn visit_u32(self, value: u32) -> Result + where + E: Error, + { + match value { + 0 => Ok(Field::Unbounded), + 1 => Ok(Field::Included), + 2 => Ok(Field::Excluded), + _ => Err(Error::invalid_value( + Unexpected::Unsigned(value as u64), + &self, + )), + } + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "Unbounded" => Ok(Field::Unbounded), + "Included" => Ok(Field::Included), + "Excluded" => Ok(Field::Excluded), + _ => Err(Error::unknown_variant(value, VARIANTS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"Unbounded" => Ok(Field::Unbounded), + b"Included" => Ok(Field::Included), + b"Excluded" => Ok(Field::Excluded), + _ => match str::from_utf8(value) { + Ok(value) => Err(Error::unknown_variant(value, VARIANTS)), + Err(_) => { + Err(Error::invalid_value(Unexpected::Bytes(value), &self)) + } + }, + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + struct BoundVisitor(PhantomData>); + + impl<'de, T> Visitor<'de> for BoundVisitor + where + T: Deserialize<'de>, + { + type Value = Bound; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("enum Bound") + } + + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + match try!(data.variant()) { + (Field::Unbounded, v) => v.unit_variant().map(|()| Bound::Unbounded), + (Field::Included, v) => v.newtype_variant().map(Bound::Included), + (Field::Excluded, v) => v.newtype_variant().map(Bound::Excluded), + } + } + } + + const VARIANTS: &'static [&'static str] = &["Unbounded", "Included", "Excluded"]; + + deserializer.deserialize_enum("Bound", VARIANTS, BoundVisitor(PhantomData)) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! nonzero_integers { + ( $( $T: ident, )+ ) => { + $( + #[cfg(num_nonzero)] + impl<'de> Deserialize<'de> for num::$T { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let value = try!(Deserialize::deserialize(deserializer)); + match ::new(value) { + Some(nonzero) => Ok(nonzero), + None => Err(Error::custom("expected a non-zero value")), + } + } + } + )+ + }; +} + +nonzero_integers! { + // Not including signed NonZeroI* since they might be removed + NonZeroU8, + NonZeroU16, + NonZeroU32, + NonZeroU64, + NonZeroUsize, +} + +// Currently 128-bit integers do not work on Emscripten targets so we need an +// additional `#[cfg]` +serde_if_integer128! { + nonzero_integers! { + NonZeroU128, + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl<'de, T, E> Deserialize<'de> for Result +where + T: Deserialize<'de>, + E: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // If this were outside of the serde crate, it would just use: + // + // #[derive(Deserialize)] + // #[serde(variant_identifier)] + enum Field { + Ok, + Err, + } + + impl<'de> Deserialize<'de> for Field { + #[inline] + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct FieldVisitor; + + impl<'de> Visitor<'de> for FieldVisitor { + type Value = Field; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("`Ok` or `Err`") + } + + fn visit_u32(self, value: u32) -> Result + where + E: Error, + { + match value { + 0 => Ok(Field::Ok), + 1 => Ok(Field::Err), + _ => Err(Error::invalid_value( + Unexpected::Unsigned(value as u64), + &self, + )), + } + } + + fn visit_str(self, value: &str) -> Result + where + E: Error, + { + match value { + "Ok" => Ok(Field::Ok), + "Err" => Ok(Field::Err), + _ => Err(Error::unknown_variant(value, VARIANTS)), + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + E: Error, + { + match value { + b"Ok" => Ok(Field::Ok), + b"Err" => Ok(Field::Err), + _ => match str::from_utf8(value) { + Ok(value) => Err(Error::unknown_variant(value, VARIANTS)), + Err(_) => { + Err(Error::invalid_value(Unexpected::Bytes(value), &self)) + } + }, + } + } + } + + deserializer.deserialize_identifier(FieldVisitor) + } + } + + struct ResultVisitor(PhantomData>); + + impl<'de, T, E> Visitor<'de> for ResultVisitor + where + T: Deserialize<'de>, + E: Deserialize<'de>, + { + type Value = Result; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("enum Result") + } + + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + match try!(data.variant()) { + (Field::Ok, v) => v.newtype_variant().map(Ok), + (Field::Err, v) => v.newtype_variant().map(Err), + } + } + } + + const VARIANTS: &'static [&'static str] = &["Ok", "Err"]; + + deserializer.deserialize_enum("Result", VARIANTS, ResultVisitor(PhantomData)) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl<'de, T> Deserialize<'de> for Wrapping +where + T: Deserialize<'de>, +{ + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map(Wrapping) + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/de/mod.rs b/vendor/registry-40351f815f426200/serde/src/de/mod.rs new file mode 100644 index 000000000..896b1a600 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/mod.rs @@ -0,0 +1,2269 @@ +//! Generic data structure deserialization framework. +//! +//! The two most important traits in this module are [`Deserialize`] and +//! [`Deserializer`]. +//! +//! - **A type that implements `Deserialize` is a data structure** that can be +//! deserialized from any data format supported by Serde, and conversely +//! - **A type that implements `Deserializer` is a data format** that can +//! deserialize any data structure supported by Serde. +//! +//! # The Deserialize trait +//! +//! Serde provides [`Deserialize`] implementations for many Rust primitive and +//! standard library types. The complete list is below. All of these can be +//! deserialized using Serde out of the box. +//! +//! Additionally, Serde provides a procedural macro called [`serde_derive`] to +//! automatically generate [`Deserialize`] implementations for structs and enums +//! in your program. See the [derive section of the manual] for how to use this. +//! +//! In rare cases it may be necessary to implement [`Deserialize`] manually for +//! some type in your program. See the [Implementing `Deserialize`] section of +//! the manual for more about this. +//! +//! Third-party crates may provide [`Deserialize`] implementations for types +//! that they expose. For example the [`linked-hash-map`] crate provides a +//! [`LinkedHashMap`] type that is deserializable by Serde because the +//! crate provides an implementation of [`Deserialize`] for it. +//! +//! # The Deserializer trait +//! +//! [`Deserializer`] implementations are provided by third-party crates, for +//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. +//! +//! A partial list of well-maintained formats is given on the [Serde +//! website][data formats]. +//! +//! # Implementations of Deserialize provided by Serde +//! +//! This is a slightly different set of types than what is supported for +//! serialization. Some types can be serialized by Serde but not deserialized. +//! One example is `OsStr`. +//! +//! - **Primitive types**: +//! - bool +//! - i8, i16, i32, i64, i128, isize +//! - u8, u16, u32, u64, u128, usize +//! - f32, f64 +//! - char +//! - **Compound types**: +//! - \[T; 0\] through \[T; 32\] +//! - tuples up to size 16 +//! - **Common standard library types**: +//! - String +//! - Option\ +//! - Result\ +//! - PhantomData\ +//! - **Wrapper types**: +//! - Box\ +//! - Box\<\[T\]\> +//! - Box\ +//! - Cow\<'a, T\> +//! - Cell\ +//! - RefCell\ +//! - Mutex\ +//! - RwLock\ +//! - Rc\ *(if* features = ["rc"] *is enabled)* +//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - **Collection types**: +//! - BTreeMap\ +//! - BTreeSet\ +//! - BinaryHeap\ +//! - HashMap\ +//! - HashSet\ +//! - LinkedList\ +//! - VecDeque\ +//! - Vec\ +//! - **Zero-copy types**: +//! - &str +//! - &\[u8\] +//! - **FFI types**: +//! - CString +//! - Box\ +//! - OsString +//! - **Miscellaneous standard library types**: +//! - Duration +//! - SystemTime +//! - Path +//! - PathBuf +//! - Range\ +//! - RangeInclusive\ +//! - Bound\ +//! - num::NonZero* +//! - `!` *(unstable)* +//! - **Net types**: +//! - IpAddr +//! - Ipv4Addr +//! - Ipv6Addr +//! - SocketAddr +//! - SocketAddrV4 +//! - SocketAddrV6 +//! +//! [Implementing `Deserialize`]: https://serde.rs/impl-deserialize.html +//! [`Deserialize`]: ../trait.Deserialize.html +//! [`Deserializer`]: ../trait.Deserializer.html +//! [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +//! [`bincode`]: https://github.com/TyOverby/bincode +//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +//! [`serde_derive`]: https://crates.io/crates/serde_derive +//! [`serde_json`]: https://github.com/serde-rs/json +//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml +//! [derive section of the manual]: https://serde.rs/derive.html +//! [data formats]: https://serde.rs/#data-formats + +use lib::*; + +//////////////////////////////////////////////////////////////////////////////// + +pub mod value; + +mod from_primitive; +mod ignored_any; +mod impls; +mod utf8; + +pub use self::ignored_any::IgnoredAny; + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! declare_error_trait { + (Error: Sized $(+ $($supertrait:ident)::+)*) => { + /// The `Error` trait allows `Deserialize` implementations to create descriptive + /// error messages belonging to the `Deserializer` against which they are + /// currently running. + /// + /// Every `Deserializer` declares an `Error` type that encompasses both + /// general-purpose deserialization errors as well as errors specific to the + /// particular deserialization format. For example the `Error` type of + /// `serde_json` can represent errors like an invalid JSON escape sequence or an + /// unterminated string literal, in addition to the error cases that are part of + /// this trait. + /// + /// Most deserializers should only need to provide the `Error::custom` method + /// and inherit the default behavior for the other methods. + /// + /// # Example implementation + /// + /// The [example data format] presented on the website shows an error + /// type appropriate for a basic JSON data format. + /// + /// [example data format]: https://serde.rs/data-format.html + pub trait Error: Sized $(+ $($supertrait)::+)* { + /// Raised when there is general error when deserializing a type. + /// + /// The message should not be capitalized and should not end with a period. + /// + /// ```edition2018 + /// # use std::str::FromStr; + /// # + /// # struct IpAddr; + /// # + /// # impl FromStr for IpAddr { + /// # type Err = String; + /// # + /// # fn from_str(_: &str) -> Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::de::{self, Deserialize, Deserializer}; + /// + /// impl<'de> Deserialize<'de> for IpAddr { + /// fn deserialize(deserializer: D) -> Result + /// where + /// D: Deserializer<'de>, + /// { + /// let s = String::deserialize(deserializer)?; + /// s.parse().map_err(de::Error::custom) + /// } + /// } + /// ``` + fn custom(msg: T) -> Self + where + T: Display; + + /// Raised when a `Deserialize` receives a type different from what it was + /// expecting. + /// + /// The `unexp` argument provides information about what type was received. + /// This is the type that was present in the input file or other source data + /// of the Deserializer. + /// + /// The `exp` argument provides information about what type was being + /// expected. This is the type that is written in the program. + /// + /// For example if we try to deserialize a String out of a JSON file + /// containing an integer, the unexpected type is the integer and the + /// expected type is the string. + #[cold] + fn invalid_type(unexp: Unexpected, exp: &Expected) -> Self { + Error::custom(format_args!("invalid type: {}, expected {}", unexp, exp)) + } + + /// Raised when a `Deserialize` receives a value of the right type but that + /// is wrong for some other reason. + /// + /// The `unexp` argument provides information about what value was received. + /// This is the value that was present in the input file or other source + /// data of the Deserializer. + /// + /// The `exp` argument provides information about what value was being + /// expected. This is the type that is written in the program. + /// + /// For example if we try to deserialize a String out of some binary data + /// that is not valid UTF-8, the unexpected value is the bytes and the + /// expected value is a string. + #[cold] + fn invalid_value(unexp: Unexpected, exp: &Expected) -> Self { + Error::custom(format_args!("invalid value: {}, expected {}", unexp, exp)) + } + + /// Raised when deserializing a sequence or map and the input data contains + /// too many or too few elements. + /// + /// The `len` argument is the number of elements encountered. The sequence + /// or map may have expected more arguments or fewer arguments. + /// + /// The `exp` argument provides information about what data was being + /// expected. For example `exp` might say that a tuple of size 6 was + /// expected. + #[cold] + fn invalid_length(len: usize, exp: &Expected) -> Self { + Error::custom(format_args!("invalid length {}, expected {}", len, exp)) + } + + /// Raised when a `Deserialize` enum type received a variant with an + /// unrecognized name. + #[cold] + fn unknown_variant(variant: &str, expected: &'static [&'static str]) -> Self { + if expected.is_empty() { + Error::custom(format_args!( + "unknown variant `{}`, there are no variants", + variant + )) + } else { + Error::custom(format_args!( + "unknown variant `{}`, expected {}", + variant, + OneOf { names: expected } + )) + } + } + + /// Raised when a `Deserialize` struct type received a field with an + /// unrecognized name. + #[cold] + fn unknown_field(field: &str, expected: &'static [&'static str]) -> Self { + if expected.is_empty() { + Error::custom(format_args!( + "unknown field `{}`, there are no fields", + field + )) + } else { + Error::custom(format_args!( + "unknown field `{}`, expected {}", + field, + OneOf { names: expected } + )) + } + } + + /// Raised when a `Deserialize` struct type expected to receive a required + /// field with a particular name but that field was not present in the + /// input. + #[cold] + fn missing_field(field: &'static str) -> Self { + Error::custom(format_args!("missing field `{}`", field)) + } + + /// Raised when a `Deserialize` struct type received more than one of the + /// same field. + #[cold] + fn duplicate_field(field: &'static str) -> Self { + Error::custom(format_args!("duplicate field `{}`", field)) + } + } + } +} + +#[cfg(feature = "std")] +declare_error_trait!(Error: Sized + error::Error); + +#[cfg(not(feature = "std"))] +declare_error_trait!(Error: Sized + Debug + Display); + +/// `Unexpected` represents an unexpected invocation of any one of the `Visitor` +/// trait methods. +/// +/// This is used as an argument to the `invalid_type`, `invalid_value`, and +/// `invalid_length` methods of the `Error` trait to build error messages. +/// +/// ```edition2018 +/// # use std::fmt; +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # +/// # struct Example; +/// # +/// # impl<'de> Visitor<'de> for Example { +/// # type Value = (); +/// # +/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// # write!(formatter, "definitely not a boolean") +/// # } +/// # +/// fn visit_bool(self, v: bool) -> Result +/// where +/// E: de::Error, +/// { +/// Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) +/// } +/// # } +/// ``` +#[derive(Copy, Clone, PartialEq, Debug)] +pub enum Unexpected<'a> { + /// The input contained a boolean value that was not expected. + Bool(bool), + + /// The input contained an unsigned integer `u8`, `u16`, `u32` or `u64` that + /// was not expected. + Unsigned(u64), + + /// The input contained a signed integer `i8`, `i16`, `i32` or `i64` that + /// was not expected. + Signed(i64), + + /// The input contained a floating point `f32` or `f64` that was not + /// expected. + Float(f64), + + /// The input contained a `char` that was not expected. + Char(char), + + /// The input contained a `&str` or `String` that was not expected. + Str(&'a str), + + /// The input contained a `&[u8]` or `Vec` that was not expected. + Bytes(&'a [u8]), + + /// The input contained a unit `()` that was not expected. + Unit, + + /// The input contained an `Option` that was not expected. + Option, + + /// The input contained a newtype struct that was not expected. + NewtypeStruct, + + /// The input contained a sequence that was not expected. + Seq, + + /// The input contained a map that was not expected. + Map, + + /// The input contained an enum that was not expected. + Enum, + + /// The input contained a unit variant that was not expected. + UnitVariant, + + /// The input contained a newtype variant that was not expected. + NewtypeVariant, + + /// The input contained a tuple variant that was not expected. + TupleVariant, + + /// The input contained a struct variant that was not expected. + StructVariant, + + /// A message stating what uncategorized thing the input contained that was + /// not expected. + /// + /// The message should be a noun or noun phrase, not capitalized and without + /// a period. An example message is "unoriginal superhero". + Other(&'a str), +} + +impl<'a> fmt::Display for Unexpected<'a> { + fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { + use self::Unexpected::*; + match *self { + Bool(b) => write!(formatter, "boolean `{}`", b), + Unsigned(i) => write!(formatter, "integer `{}`", i), + Signed(i) => write!(formatter, "integer `{}`", i), + Float(f) => write!(formatter, "floating point `{}`", f), + Char(c) => write!(formatter, "character `{}`", c), + Str(s) => write!(formatter, "string {:?}", s), + Bytes(_) => write!(formatter, "byte array"), + Unit => write!(formatter, "unit value"), + Option => write!(formatter, "Option value"), + NewtypeStruct => write!(formatter, "newtype struct"), + Seq => write!(formatter, "sequence"), + Map => write!(formatter, "map"), + Enum => write!(formatter, "enum"), + UnitVariant => write!(formatter, "unit variant"), + NewtypeVariant => write!(formatter, "newtype variant"), + TupleVariant => write!(formatter, "tuple variant"), + StructVariant => write!(formatter, "struct variant"), + Other(other) => formatter.write_str(other), + } + } +} + +/// `Expected` represents an explanation of what data a `Visitor` was expecting +/// to receive. +/// +/// This is used as an argument to the `invalid_type`, `invalid_value`, and +/// `invalid_length` methods of the `Error` trait to build error messages. The +/// message should be a noun or noun phrase that completes the sentence "This +/// Visitor expects to receive ...", for example the message could be "an +/// integer between 0 and 64". The message should not be capitalized and should +/// not end with a period. +/// +/// Within the context of a `Visitor` implementation, the `Visitor` itself +/// (`&self`) is an implementation of this trait. +/// +/// ```edition2018 +/// # use std::fmt; +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # +/// # struct Example; +/// # +/// # impl<'de> Visitor<'de> for Example { +/// # type Value = (); +/// # +/// # fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// # write!(formatter, "definitely not a boolean") +/// # } +/// # +/// fn visit_bool(self, v: bool) -> Result +/// where +/// E: de::Error, +/// { +/// Err(de::Error::invalid_type(Unexpected::Bool(v), &self)) +/// } +/// # } +/// ``` +/// +/// Outside of a `Visitor`, `&"..."` can be used. +/// +/// ```edition2018 +/// # use serde::de::{self, Unexpected}; +/// # +/// # fn example() -> Result<(), E> +/// # where +/// # E: de::Error, +/// # { +/// # let v = true; +/// return Err(de::Error::invalid_type(Unexpected::Bool(v), &"a negative integer")); +/// # } +/// ``` +pub trait Expected { + /// Format an explanation of what data was being expected. Same signature as + /// the `Display` and `Debug` traits. + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result; +} + +impl<'de, T> Expected for T +where + T: Visitor<'de>, +{ + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + self.expecting(formatter) + } +} + +impl<'a> Expected for &'a str { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(self) + } +} + +impl<'a> Display for Expected + 'a { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + Expected::fmt(self, formatter) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A **data structure** that can be deserialized from any data format supported +/// by Serde. +/// +/// Serde provides `Deserialize` implementations for many Rust primitive and +/// standard library types. The complete list is [here][de]. All of these can +/// be deserialized using Serde out of the box. +/// +/// Additionally, Serde provides a procedural macro called `serde_derive` to +/// automatically generate `Deserialize` implementations for structs and enums +/// in your program. See the [derive section of the manual][derive] for how to +/// use this. +/// +/// In rare cases it may be necessary to implement `Deserialize` manually for +/// some type in your program. See the [Implementing +/// `Deserialize`][impl-deserialize] section of the manual for more about this. +/// +/// Third-party crates may provide `Deserialize` implementations for types that +/// they expose. For example the `linked-hash-map` crate provides a +/// `LinkedHashMap` type that is deserializable by Serde because the crate +/// provides an implementation of `Deserialize` for it. +/// +/// [de]: https://docs.serde.rs/serde/de/index.html +/// [derive]: https://serde.rs/derive.html +/// [impl-deserialize]: https://serde.rs/impl-deserialize.html +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by `Self` when deserialized. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +pub trait Deserialize<'de>: Sized { + /// Deserialize this value from the given Serde deserializer. + /// + /// See the [Implementing `Deserialize`][impl-deserialize] section of the + /// manual for more information about how to implement this method. + /// + /// [impl-deserialize]: https://serde.rs/impl-deserialize.html + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>; + + /// Deserializes a value into `self` from the given Deserializer. + /// + /// The purpose of this method is to allow the deserializer to reuse + /// resources and avoid copies. As such, if this method returns an error, + /// `self` will be in an indeterminate state where some parts of the struct + /// have been overwritten. Although whatever state that is will be + /// memory-safe. + /// + /// This is generally useful when repeatedly deserializing values that + /// are processed one at a time, where the value of `self` doesn't matter + /// when the next deserialization occurs. + /// + /// If you manually implement this, your recursive deserializations should + /// use `deserialize_in_place`. + /// + /// This method is stable and an official public API, but hidden from the + /// documentation because it is almost never what newbies are looking for. + /// Showing it in rustdoc would cause it to be featured more prominently + /// than it deserves. + #[doc(hidden)] + fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> + where + D: Deserializer<'de>, + { + // Default implementation just delegates to `deserialize` impl. + *place = Deserialize::deserialize(deserializer)?; + Ok(()) + } +} + +/// A data structure that can be deserialized without borrowing any data from +/// the deserializer. +/// +/// This is primarily useful for trait bounds on functions. For example a +/// `from_str` function may be able to deserialize a data structure that borrows +/// from the input string, but a `from_reader` function may only deserialize +/// owned data. +/// +/// ```edition2018 +/// # use serde::de::{Deserialize, DeserializeOwned}; +/// # use std::io::{Read, Result}; +/// # +/// # trait Ignore { +/// fn from_str<'a, T>(s: &'a str) -> Result +/// where +/// T: Deserialize<'a>; +/// +/// fn from_reader(rdr: R) -> Result +/// where +/// R: Read, +/// T: DeserializeOwned; +/// # } +/// ``` +/// +/// # Lifetime +/// +/// The relationship between `Deserialize` and `DeserializeOwned` in trait +/// bounds is explained in more detail on the page [Understanding deserializer +/// lifetimes]. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +pub trait DeserializeOwned: for<'de> Deserialize<'de> {} +impl DeserializeOwned for T where T: for<'de> Deserialize<'de> {} + +/// `DeserializeSeed` is the stateful form of the `Deserialize` trait. If you +/// ever find yourself looking for a way to pass data into a `Deserialize` impl, +/// this trait is the way to do it. +/// +/// As one example of stateful deserialization consider deserializing a JSON +/// array into an existing buffer. Using the `Deserialize` trait we could +/// deserialize a JSON array into a `Vec` but it would be a freshly allocated +/// `Vec`; there is no way for `Deserialize` to reuse a previously allocated +/// buffer. Using `DeserializeSeed` instead makes this possible as in the +/// example code below. +/// +/// The canonical API for stateless deserialization looks like this: +/// +/// ```edition2018 +/// # use serde::Deserialize; +/// # +/// # enum Error {} +/// # +/// fn func<'de, T: Deserialize<'de>>() -> Result +/// # { +/// # unimplemented!() +/// # } +/// ``` +/// +/// Adjusting an API like this to support stateful deserialization is a matter +/// of accepting a seed as input: +/// +/// ```edition2018 +/// # use serde::de::DeserializeSeed; +/// # +/// # enum Error {} +/// # +/// fn func_seed<'de, T: DeserializeSeed<'de>>(seed: T) -> Result +/// # { +/// # let _ = seed; +/// # unimplemented!() +/// # } +/// ``` +/// +/// In practice the majority of deserialization is stateless. An API expecting a +/// seed can be appeased by passing `std::marker::PhantomData` as a seed in the +/// case of stateless deserialization. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by `Self::Value` when deserialized. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example +/// +/// Suppose we have JSON that looks like `[[1, 2], [3, 4, 5], [6]]` and we need +/// to deserialize it into a flat representation like `vec![1, 2, 3, 4, 5, 6]`. +/// Allocating a brand new `Vec` for each subarray would be slow. Instead we +/// would like to allocate a single `Vec` and then deserialize each subarray +/// into it. This requires stateful deserialization using the `DeserializeSeed` +/// trait. +/// +/// ```edition2018 +/// use std::fmt; +/// use std::marker::PhantomData; +/// +/// use serde::de::{Deserialize, DeserializeSeed, Deserializer, SeqAccess, Visitor}; +/// +/// // A DeserializeSeed implementation that uses stateful deserialization to +/// // append array elements onto the end of an existing vector. The preexisting +/// // state ("seed") in this case is the Vec. The `deserialize` method of +/// // `ExtendVec` will be traversing the inner arrays of the JSON input and +/// // appending each integer into the existing Vec. +/// struct ExtendVec<'a, T: 'a>(&'a mut Vec); +/// +/// impl<'de, 'a, T> DeserializeSeed<'de> for ExtendVec<'a, T> +/// where +/// T: Deserialize<'de>, +/// { +/// // The return type of the `deserialize` method. This implementation +/// // appends onto an existing vector but does not create any new data +/// // structure, so the return type is (). +/// type Value = (); +/// +/// fn deserialize(self, deserializer: D) -> Result +/// where +/// D: Deserializer<'de>, +/// { +/// // Visitor implementation that will walk an inner array of the JSON +/// // input. +/// struct ExtendVecVisitor<'a, T: 'a>(&'a mut Vec); +/// +/// impl<'de, 'a, T> Visitor<'de> for ExtendVecVisitor<'a, T> +/// where +/// T: Deserialize<'de>, +/// { +/// type Value = (); +/// +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "an array of integers") +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result<(), A::Error> +/// where +/// A: SeqAccess<'de>, +/// { +/// // Visit each element in the inner array and push it onto +/// // the existing vector. +/// while let Some(elem) = seq.next_element()? { +/// self.0.push(elem); +/// } +/// Ok(()) +/// } +/// } +/// +/// deserializer.deserialize_seq(ExtendVecVisitor(self.0)) +/// } +/// } +/// +/// // Visitor implementation that will walk the outer array of the JSON input. +/// struct FlattenedVecVisitor(PhantomData); +/// +/// impl<'de, T> Visitor<'de> for FlattenedVecVisitor +/// where +/// T: Deserialize<'de>, +/// { +/// // This Visitor constructs a single Vec to hold the flattened +/// // contents of the inner arrays. +/// type Value = Vec; +/// +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "an array of arrays") +/// } +/// +/// fn visit_seq(self, mut seq: A) -> Result, A::Error> +/// where +/// A: SeqAccess<'de>, +/// { +/// // Create a single Vec to hold the flattened contents. +/// let mut vec = Vec::new(); +/// +/// // Each iteration through this loop is one inner array. +/// while let Some(()) = seq.next_element_seed(ExtendVec(&mut vec))? { +/// // Nothing to do; inner array has been appended into `vec`. +/// } +/// +/// // Return the finished vec. +/// Ok(vec) +/// } +/// } +/// +/// # fn example<'de, D>(deserializer: D) -> Result<(), D::Error> +/// # where +/// # D: Deserializer<'de>, +/// # { +/// let visitor = FlattenedVecVisitor(PhantomData); +/// let flattened: Vec = deserializer.deserialize_seq(visitor)?; +/// # Ok(()) +/// # } +/// ``` +pub trait DeserializeSeed<'de>: Sized { + /// The type produced by using this seed. + type Value; + + /// Equivalent to the more common `Deserialize::deserialize` method, except + /// with some initial piece of data (the seed) passed in. + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>; +} + +impl<'de, T> DeserializeSeed<'de> for PhantomData +where + T: Deserialize<'de>, +{ + type Value = T; + + #[inline] + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + T::deserialize(deserializer) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A **data format** that can deserialize any data structure supported by +/// Serde. +/// +/// The role of this trait is to define the deserialization half of the [Serde +/// data model], which is a way to categorize every Rust data type into one of +/// 29 possible types. Each method of the `Serializer` trait corresponds to one +/// of the types of the data model. +/// +/// Implementations of `Deserialize` map themselves into this data model by +/// passing to the `Deserializer` a `Visitor` implementation that can receive +/// these various types. +/// +/// The types that make up the Serde data model are: +/// +/// - **14 primitive types** +/// - bool +/// - i8, i16, i32, i64, i128 +/// - u8, u16, u32, u64, u128 +/// - f32, f64 +/// - char +/// - **string** +/// - UTF-8 bytes with a length and no null terminator. +/// - When serializing, all strings are handled equally. When deserializing, +/// there are three flavors of strings: transient, owned, and borrowed. +/// - **byte array** - \[u8\] +/// - Similar to strings, during deserialization byte arrays can be +/// transient, owned, or borrowed. +/// - **option** +/// - Either none or some value. +/// - **unit** +/// - The type of `()` in Rust. It represents an anonymous value containing +/// no data. +/// - **unit_struct** +/// - For example `struct Unit` or `PhantomData`. It represents a named +/// value containing no data. +/// - **unit_variant** +/// - For example the `E::A` and `E::B` in `enum E { A, B }`. +/// - **newtype_struct** +/// - For example `struct Millimeters(u8)`. +/// - **newtype_variant** +/// - For example the `E::N` in `enum E { N(u8) }`. +/// - **seq** +/// - A variably sized heterogeneous sequence of values, for example `Vec` +/// or `HashSet`. When serializing, the length may or may not be known +/// before iterating through all the data. When deserializing, the length +/// is determined by looking at the serialized data. +/// - **tuple** +/// - A statically sized heterogeneous sequence of values for which the +/// length will be known at deserialization time without looking at the +/// serialized data, for example `(u8,)` or `(String, u64, Vec)` or +/// `[u64; 10]`. +/// - **tuple_struct** +/// - A named tuple, for example `struct Rgb(u8, u8, u8)`. +/// - **tuple_variant** +/// - For example the `E::T` in `enum E { T(u8, u8) }`. +/// - **map** +/// - A heterogeneous key-value pairing, for example `BTreeMap`. +/// - **struct** +/// - A heterogeneous key-value pairing in which the keys are strings and +/// will be known at deserialization time without looking at the serialized +/// data, for example `struct S { r: u8, g: u8, b: u8 }`. +/// - **struct_variant** +/// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. +/// +/// The `Deserializer` trait supports two entry point styles which enables +/// different kinds of deserialization. +/// +/// 1. The `deserialize` method. Self-describing data formats like JSON are able +/// to look at the serialized data and tell what it represents. For example +/// the JSON deserializer may see an opening curly brace (`{`) and know that +/// it is seeing a map. If the data format supports +/// `Deserializer::deserialize_any`, it will drive the Visitor using whatever +/// type it sees in the input. JSON uses this approach when deserializing +/// `serde_json::Value` which is an enum that can represent any JSON +/// document. Without knowing what is in a JSON document, we can deserialize +/// it to `serde_json::Value` by going through +/// `Deserializer::deserialize_any`. +/// +/// 2. The various `deserialize_*` methods. Non-self-describing formats like +/// Bincode need to be told what is in the input in order to deserialize it. +/// The `deserialize_*` methods are hints to the deserializer for how to +/// interpret the next piece of input. Non-self-describing formats are not +/// able to deserialize something like `serde_json::Value` which relies on +/// `Deserializer::deserialize_any`. +/// +/// When implementing `Deserialize`, you should avoid relying on +/// `Deserializer::deserialize_any` unless you need to be told by the +/// Deserializer what type is in the input. Know that relying on +/// `Deserializer::deserialize_any` means your data type will be able to +/// deserialize from self-describing formats only, ruling out Bincode and many +/// others. +/// +/// [Serde data model]: https://serde.rs/data-model.html +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed from the input when deserializing. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website contains example code for +/// a basic JSON `Deserializer`. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait Deserializer<'de>: Sized { + /// The error type that can be returned if some error occurs during + /// deserialization. + type Error: Error; + + /// Require the `Deserializer` to figure out how to drive the visitor based + /// on what data type is in the input. + /// + /// When implementing `Deserialize`, you should avoid relying on + /// `Deserializer::deserialize_any` unless you need to be told by the + /// Deserializer what type is in the input. Know that relying on + /// `Deserializer::deserialize_any` means your data type will be able to + /// deserialize from self-describing formats only, ruling out Bincode and + /// many others. + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `bool` value. + fn deserialize_bool(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an `i8` value. + fn deserialize_i8(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an `i16` value. + fn deserialize_i16(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an `i32` value. + fn deserialize_i32(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an `i64` value. + fn deserialize_i64(self, visitor: V) -> Result + where + V: Visitor<'de>; + + serde_if_integer128! { + /// Hint that the `Deserialize` type is expecting an `i128` value. + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default behavior unconditionally returns an error. + fn deserialize_i128(self, visitor: V) -> Result + where + V: Visitor<'de> + { + let _ = visitor; + Err(Error::custom("i128 is not supported")) + } + } + + /// Hint that the `Deserialize` type is expecting a `u8` value. + fn deserialize_u8(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u16` value. + fn deserialize_u16(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u32` value. + fn deserialize_u32(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `u64` value. + fn deserialize_u64(self, visitor: V) -> Result + where + V: Visitor<'de>; + + serde_if_integer128! { + /// Hint that the `Deserialize` type is expecting an `u128` value. + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default behavior unconditionally returns an error. + fn deserialize_u128(self, visitor: V) -> Result + where + V: Visitor<'de> + { + let _ = visitor; + Err(Error::custom("u128 is not supported")) + } + } + + /// Hint that the `Deserialize` type is expecting a `f32` value. + fn deserialize_f32(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `f64` value. + fn deserialize_f64(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a `char` value. + fn deserialize_char(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a string value and does + /// not benefit from taking ownership of buffered data owned by the + /// `Deserializer`. + /// + /// If the `Visitor` would benefit from taking ownership of `String` data, + /// indiciate this to the `Deserializer` by using `deserialize_string` + /// instead. + fn deserialize_str(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a string value and would + /// benefit from taking ownership of buffered data owned by the + /// `Deserializer`. + /// + /// If the `Visitor` would not benefit from taking ownership of `String` + /// data, indicate that to the `Deserializer` by using `deserialize_str` + /// instead. + fn deserialize_string(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a byte array and does not + /// benefit from taking ownership of buffered data owned by the + /// `Deserializer`. + /// + /// If the `Visitor` would benefit from taking ownership of `Vec` data, + /// indicate this to the `Deserializer` by using `deserialize_byte_buf` + /// instead. + fn deserialize_bytes(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a byte array and would + /// benefit from taking ownership of buffered data owned by the + /// `Deserializer`. + /// + /// If the `Visitor` would not benefit from taking ownership of `Vec` + /// data, indicate that to the `Deserializer` by using `deserialize_bytes` + /// instead. + fn deserialize_byte_buf(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an optional value. + /// + /// This allows deserializers that encode an optional value as a nullable + /// value to convert the null value into `None` and a regular value into + /// `Some(value)`. + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a unit value. + fn deserialize_unit(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a unit struct with a + /// particular name. + fn deserialize_unit_struct( + self, + name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a newtype struct with a + /// particular name. + fn deserialize_newtype_struct( + self, + name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a sequence of values. + fn deserialize_seq(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a sequence of values and + /// knows how many values there are without looking at the serialized data. + fn deserialize_tuple(self, len: usize, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a tuple struct with a + /// particular name and number of fields. + fn deserialize_tuple_struct( + self, + name: &'static str, + len: usize, + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a map of key-value pairs. + fn deserialize_map(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting a struct with a particular + /// name and fields. + fn deserialize_struct( + self, + name: &'static str, + fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting an enum value with a + /// particular name and possible variants. + fn deserialize_enum( + self, + name: &'static str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type is expecting the name of a struct + /// field or the discriminant of an enum variant. + fn deserialize_identifier(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Hint that the `Deserialize` type needs to deserialize a value whose type + /// doesn't matter because it is ignored. + /// + /// Deserializers for non-self-describing formats may not support this mode. + fn deserialize_ignored_any(self, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Determine whether `Deserialize` implementations should expect to + /// deserialize their human-readable form. + /// + /// Some types have a human-readable form that may be somewhat expensive to + /// construct, as well as a binary form that is compact and efficient. + /// Generally text-based formats like JSON and YAML will prefer to use the + /// human-readable one and binary formats like Bincode will prefer the + /// compact one. + /// + /// ```edition2018 + /// # use std::ops::Add; + /// # use std::str::FromStr; + /// # + /// # struct Timestamp; + /// # + /// # impl Timestamp { + /// # const EPOCH: Timestamp = Timestamp; + /// # } + /// # + /// # impl FromStr for Timestamp { + /// # type Err = String; + /// # fn from_str(_: &str) -> Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # struct Duration; + /// # + /// # impl Duration { + /// # fn seconds(_: u64) -> Self { unimplemented!() } + /// # } + /// # + /// # impl Add for Timestamp { + /// # type Output = Timestamp; + /// # fn add(self, _: Duration) -> Self::Output { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::de::{self, Deserialize, Deserializer}; + /// + /// impl<'de> Deserialize<'de> for Timestamp { + /// fn deserialize(deserializer: D) -> Result + /// where + /// D: Deserializer<'de>, + /// { + /// if deserializer.is_human_readable() { + /// // Deserialize from a human-readable string like "2015-05-15T17:01:00Z". + /// let s = String::deserialize(deserializer)?; + /// Timestamp::from_str(&s).map_err(de::Error::custom) + /// } else { + /// // Deserialize from a compact binary representation, seconds since + /// // the Unix epoch. + /// let n = u64::deserialize(deserializer)?; + /// Ok(Timestamp::EPOCH + Duration::seconds(n)) + /// } + /// } + /// } + /// ``` + /// + /// The default implementation of this method returns `true`. Data formats + /// may override this to `false` to request a compact form for types that + /// support one. Note that modifying this method to change a format from + /// human-readable to compact or vice versa should be regarded as a breaking + /// change, as a value serialized in human-readable mode is not required to + /// deserialize from the same data in compact mode. + #[inline] + fn is_human_readable(&self) -> bool { + true + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// This trait represents a visitor that walks through a deserializer. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the requirement for lifetime of data +/// that may be borrowed by `Self::Value`. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example +/// +/// ```edition2018 +/// # use std::fmt; +/// # +/// # use serde::de::{self, Unexpected, Visitor}; +/// # +/// /// A visitor that deserializes a long string - a string containing at least +/// /// some minimum number of bytes. +/// struct LongString { +/// min: usize, +/// } +/// +/// impl<'de> Visitor<'de> for LongString { +/// type Value = String; +/// +/// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { +/// write!(formatter, "a string containing at least {} bytes", self.min) +/// } +/// +/// fn visit_str(self, s: &str) -> Result +/// where +/// E: de::Error, +/// { +/// if s.len() >= self.min { +/// Ok(s.to_owned()) +/// } else { +/// Err(de::Error::invalid_value(Unexpected::Str(s), &self)) +/// } +/// } +/// } +/// ``` +pub trait Visitor<'de>: Sized { + /// The value produced by this visitor. + type Value; + + /// Format a message stating what data this Visitor expects to receive. + /// + /// This is used in error messages. The message should complete the sentence + /// "This Visitor expects to receive ...", for example the message could be + /// "an integer between 0 and 64". The message should not be capitalized and + /// should not end with a period. + /// + /// ```edition2018 + /// # use std::fmt; + /// # + /// # struct S { + /// # max: usize, + /// # } + /// # + /// # impl<'de> serde::de::Visitor<'de> for S { + /// # type Value = (); + /// # + /// fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + /// write!(formatter, "an integer between 0 and {}", self.max) + /// } + /// # } + /// ``` + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result; + + /// The input contains a boolean. + /// + /// The default implementation fails with a type error. + fn visit_bool(self, v: bool) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Bool(v), &self)) + } + + /// The input contains an `i8`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 + fn visit_i8(self, v: i8) -> Result + where + E: Error, + { + self.visit_i64(v as i64) + } + + /// The input contains an `i16`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 + fn visit_i16(self, v: i16) -> Result + where + E: Error, + { + self.visit_i64(v as i64) + } + + /// The input contains an `i32`. + /// + /// The default implementation forwards to [`visit_i64`]. + /// + /// [`visit_i64`]: #method.visit_i64 + fn visit_i32(self, v: i32) -> Result + where + E: Error, + { + self.visit_i64(v as i64) + } + + /// The input contains an `i64`. + /// + /// The default implementation fails with a type error. + fn visit_i64(self, v: i64) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Signed(v), &self)) + } + + serde_if_integer128! { + /// The input contains a `i128`. + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default implementation fails with a type error. + fn visit_i128(self, v: i128) -> Result + where + E: Error, + { + let _ = v; + Err(Error::invalid_type(Unexpected::Other("i128"), &self)) + } + } + + /// The input contains a `u8`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 + fn visit_u8(self, v: u8) -> Result + where + E: Error, + { + self.visit_u64(v as u64) + } + + /// The input contains a `u16`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 + fn visit_u16(self, v: u16) -> Result + where + E: Error, + { + self.visit_u64(v as u64) + } + + /// The input contains a `u32`. + /// + /// The default implementation forwards to [`visit_u64`]. + /// + /// [`visit_u64`]: #method.visit_u64 + fn visit_u32(self, v: u32) -> Result + where + E: Error, + { + self.visit_u64(v as u64) + } + + /// The input contains a `u64`. + /// + /// The default implementation fails with a type error. + fn visit_u64(self, v: u64) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Unsigned(v), &self)) + } + + serde_if_integer128! { + /// The input contains a `u128`. + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default implementation fails with a type error. + fn visit_u128(self, v: u128) -> Result + where + E: Error, + { + let _ = v; + Err(Error::invalid_type(Unexpected::Other("u128"), &self)) + } + } + + /// The input contains an `f32`. + /// + /// The default implementation forwards to [`visit_f64`]. + /// + /// [`visit_f64`]: #method.visit_f64 + fn visit_f32(self, v: f32) -> Result + where + E: Error, + { + self.visit_f64(v as f64) + } + + /// The input contains an `f64`. + /// + /// The default implementation fails with a type error. + fn visit_f64(self, v: f64) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Float(v), &self)) + } + + /// The input contains a `char`. + /// + /// The default implementation forwards to [`visit_str`] as a one-character + /// string. + /// + /// [`visit_str`]: #method.visit_str + #[inline] + fn visit_char(self, v: char) -> Result + where + E: Error, + { + self.visit_str(utf8::encode(v).as_str()) + } + + /// The input contains a string. The lifetime of the string is ephemeral and + /// it may be destroyed after this method returns. + /// + /// This method allows the `Deserializer` to avoid a copy by retaining + /// ownership of any buffered data. `Deserialize` implementations that do + /// not benefit from taking ownership of `String` data should indicate that + /// to the deserializer by using `Deserializer::deserialize_str` rather than + /// `Deserializer::deserialize_string`. + /// + /// It is never correct to implement `visit_string` without implementing + /// `visit_str`. Implement neither, both, or just `visit_str`. + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Str(v), &self)) + } + + /// The input contains a string that lives at least as long as the + /// `Deserializer`. + /// + /// This enables zero-copy deserialization of strings in some formats. For + /// example JSON input containing the JSON string `"borrowed"` can be + /// deserialized with zero copying into a `&'a str` as long as the input + /// data outlives `'a`. + /// + /// The default implementation forwards to `visit_str`. + #[inline] + fn visit_borrowed_str(self, v: &'de str) -> Result + where + E: Error, + { + self.visit_str(v) + } + + /// The input contains a string and ownership of the string is being given + /// to the `Visitor`. + /// + /// This method allows the `Visitor` to avoid a copy by taking ownership of + /// a string created by the `Deserializer`. `Deserialize` implementations + /// that benefit from taking ownership of `String` data should indicate that + /// to the deserializer by using `Deserializer::deserialize_string` rather + /// than `Deserializer::deserialize_str`, although not every deserializer + /// will honor such a request. + /// + /// It is never correct to implement `visit_string` without implementing + /// `visit_str`. Implement neither, both, or just `visit_str`. + /// + /// The default implementation forwards to `visit_str` and then drops the + /// `String`. + #[inline] + #[cfg(any(feature = "std", feature = "alloc"))] + fn visit_string(self, v: String) -> Result + where + E: Error, + { + self.visit_str(&v) + } + + /// The input contains a byte array. The lifetime of the byte array is + /// ephemeral and it may be destroyed after this method returns. + /// + /// This method allows the `Deserializer` to avoid a copy by retaining + /// ownership of any buffered data. `Deserialize` implementations that do + /// not benefit from taking ownership of `Vec` data should indicate that + /// to the deserializer by using `Deserializer::deserialize_bytes` rather + /// than `Deserializer::deserialize_byte_buf`. + /// + /// It is never correct to implement `visit_byte_buf` without implementing + /// `visit_bytes`. Implement neither, both, or just `visit_bytes`. + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + let _ = v; + Err(Error::invalid_type(Unexpected::Bytes(v), &self)) + } + + /// The input contains a byte array that lives at least as long as the + /// `Deserializer`. + /// + /// This enables zero-copy deserialization of bytes in some formats. For + /// example Bincode data containing bytes can be deserialized with zero + /// copying into a `&'a [u8]` as long as the input data outlives `'a`. + /// + /// The default implementation forwards to `visit_bytes`. + #[inline] + fn visit_borrowed_bytes(self, v: &'de [u8]) -> Result + where + E: Error, + { + self.visit_bytes(v) + } + + /// The input contains a byte array and ownership of the byte array is being + /// given to the `Visitor`. + /// + /// This method allows the `Visitor` to avoid a copy by taking ownership of + /// a byte buffer created by the `Deserializer`. `Deserialize` + /// implementations that benefit from taking ownership of `Vec` data + /// should indicate that to the deserializer by using + /// `Deserializer::deserialize_byte_buf` rather than + /// `Deserializer::deserialize_bytes`, although not every deserializer will + /// honor such a request. + /// + /// It is never correct to implement `visit_byte_buf` without implementing + /// `visit_bytes`. Implement neither, both, or just `visit_bytes`. + /// + /// The default implementation forwards to `visit_bytes` and then drops the + /// `Vec`. + #[cfg(any(feature = "std", feature = "alloc"))] + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + self.visit_bytes(&v) + } + + /// The input contains an optional that is absent. + /// + /// The default implementation fails with a type error. + fn visit_none(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// The input contains an optional that is present. + /// + /// The default implementation fails with a type error. + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::Option, &self)) + } + + /// The input contains a unit `()`. + /// + /// The default implementation fails with a type error. + fn visit_unit(self) -> Result + where + E: Error, + { + Err(Error::invalid_type(Unexpected::Unit, &self)) + } + + /// The input contains a newtype struct. + /// + /// The content of the newtype struct may be read from the given + /// `Deserializer`. + /// + /// The default implementation fails with a type error. + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let _ = deserializer; + Err(Error::invalid_type(Unexpected::NewtypeStruct, &self)) + } + + /// The input contains a sequence of elements. + /// + /// The default implementation fails with a type error. + fn visit_seq(self, seq: A) -> Result + where + A: SeqAccess<'de>, + { + let _ = seq; + Err(Error::invalid_type(Unexpected::Seq, &self)) + } + + /// The input contains a key-value map. + /// + /// The default implementation fails with a type error. + fn visit_map(self, map: A) -> Result + where + A: MapAccess<'de>, + { + let _ = map; + Err(Error::invalid_type(Unexpected::Map, &self)) + } + + /// The input contains an enum. + /// + /// The default implementation fails with a type error. + fn visit_enum(self, data: A) -> Result + where + A: EnumAccess<'de>, + { + let _ = data; + Err(Error::invalid_type(Unexpected::Enum, &self)) + } + + // Used when deserializing a flattened Option field. Not public API. + #[doc(hidden)] + fn __private_visit_untagged_option(self, _: D) -> Result + where + D: Deserializer<'de>, + { + Err(()) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Provides a `Visitor` access to each element of a sequence in the input. +/// +/// This is a trait that a `Deserializer` passes to a `Visitor` implementation, +/// which deserializes each item in a sequence. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by deserialized sequence elements. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SeqAccess` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SeqAccess<'de> { + /// The error type that can be returned if some error occurs during + /// deserialization. + type Error: Error; + + /// This returns `Ok(Some(value))` for the next value in the sequence, or + /// `Ok(None)` if there are no more remaining items. + /// + /// `Deserialize` implementations should typically use + /// `SeqAccess::next_element` instead. + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>; + + /// This returns `Ok(Some(value))` for the next value in the sequence, or + /// `Ok(None)` if there are no more remaining items. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `SeqAccess` implementations should not override the default behavior. + #[inline] + fn next_element(&mut self) -> Result, Self::Error> + where + T: Deserialize<'de>, + { + self.next_element_seed(PhantomData) + } + + /// Returns the number of elements remaining in the sequence, if known. + #[inline] + fn size_hint(&self) -> Option { + None + } +} + +impl<'de, 'a, A> SeqAccess<'de> for &'a mut A +where + A: SeqAccess<'de>, +{ + type Error = A::Error; + + #[inline] + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>, + { + (**self).next_element_seed(seed) + } + + #[inline] + fn next_element(&mut self) -> Result, Self::Error> + where + T: Deserialize<'de>, + { + (**self).next_element() + } + + #[inline] + fn size_hint(&self) -> Option { + (**self).size_hint() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Provides a `Visitor` access to each entry of a map in the input. +/// +/// This is a trait that a `Deserializer` passes to a `Visitor` implementation. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by deserialized map entries. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `MapAccess` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait MapAccess<'de> { + /// The error type that can be returned if some error occurs during + /// deserialization. + type Error: Error; + + /// This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)` + /// if there are no more remaining entries. + /// + /// `Deserialize` implementations should typically use + /// `MapAccess::next_key` or `MapAccess::next_entry` instead. + fn next_key_seed(&mut self, seed: K) -> Result, Self::Error> + where + K: DeserializeSeed<'de>; + + /// This returns a `Ok(value)` for the next value in the map. + /// + /// `Deserialize` implementations should typically use + /// `MapAccess::next_value` instead. + /// + /// # Panics + /// + /// Calling `next_value_seed` before `next_key_seed` is incorrect and is + /// allowed to panic or return bogus results. + fn next_value_seed(&mut self, seed: V) -> Result + where + V: DeserializeSeed<'de>; + + /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in + /// the map, or `Ok(None)` if there are no more remaining items. + /// + /// `MapAccess` implementations should override the default behavior if a + /// more efficient implementation is possible. + /// + /// `Deserialize` implementations should typically use + /// `MapAccess::next_entry` instead. + #[inline] + fn next_entry_seed( + &mut self, + kseed: K, + vseed: V, + ) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, + V: DeserializeSeed<'de>, + { + match try!(self.next_key_seed(kseed)) { + Some(key) => { + let value = try!(self.next_value_seed(vseed)); + Ok(Some((key, value))) + } + None => Ok(None), + } + } + + /// This returns `Ok(Some(key))` for the next key in the map, or `Ok(None)` + /// if there are no more remaining entries. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `MapAccess` implementations should not override the default behavior. + #[inline] + fn next_key(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + { + self.next_key_seed(PhantomData) + } + + /// This returns a `Ok(value)` for the next value in the map. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `MapAccess` implementations should not override the default behavior. + /// + /// # Panics + /// + /// Calling `next_value` before `next_key` is incorrect and is allowed to + /// panic or return bogus results. + #[inline] + fn next_value(&mut self) -> Result + where + V: Deserialize<'de>, + { + self.next_value_seed(PhantomData) + } + + /// This returns `Ok(Some((key, value)))` for the next (key-value) pair in + /// the map, or `Ok(None)` if there are no more remaining items. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `MapAccess` implementations should not override the default behavior. + #[inline] + fn next_entry(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + V: Deserialize<'de>, + { + self.next_entry_seed(PhantomData, PhantomData) + } + + /// Returns the number of entries remaining in the map, if known. + #[inline] + fn size_hint(&self) -> Option { + None + } +} + +impl<'de, 'a, A> MapAccess<'de> for &'a mut A +where + A: MapAccess<'de>, +{ + type Error = A::Error; + + #[inline] + fn next_key_seed(&mut self, seed: K) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, + { + (**self).next_key_seed(seed) + } + + #[inline] + fn next_value_seed(&mut self, seed: V) -> Result + where + V: DeserializeSeed<'de>, + { + (**self).next_value_seed(seed) + } + + #[inline] + fn next_entry_seed( + &mut self, + kseed: K, + vseed: V, + ) -> Result, Self::Error> + where + K: DeserializeSeed<'de>, + V: DeserializeSeed<'de>, + { + (**self).next_entry_seed(kseed, vseed) + } + + #[inline] + fn next_entry(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + V: Deserialize<'de>, + { + (**self).next_entry() + } + + #[inline] + fn next_key(&mut self) -> Result, Self::Error> + where + K: Deserialize<'de>, + { + (**self).next_key() + } + + #[inline] + fn next_value(&mut self) -> Result + where + V: Deserialize<'de>, + { + (**self).next_value() + } + + #[inline] + fn size_hint(&self) -> Option { + (**self).size_hint() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Provides a `Visitor` access to the data of an enum in the input. +/// +/// `EnumAccess` is created by the `Deserializer` and passed to the +/// `Visitor` in order to identify which variant of an enum to deserialize. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by the deserialized enum variant. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `EnumAccess` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait EnumAccess<'de>: Sized { + /// The error type that can be returned if some error occurs during + /// deserialization. + type Error: Error; + /// The `Visitor` that will be used to deserialize the content of the enum + /// variant. + type Variant: VariantAccess<'de, Error = Self::Error>; + + /// `variant` is called to identify which variant to deserialize. + /// + /// `Deserialize` implementations should typically use `EnumAccess::variant` + /// instead. + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> + where + V: DeserializeSeed<'de>; + + /// `variant` is called to identify which variant to deserialize. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `EnumAccess` implementations should not override the default behavior. + #[inline] + fn variant(self) -> Result<(V, Self::Variant), Self::Error> + where + V: Deserialize<'de>, + { + self.variant_seed(PhantomData) + } +} + +/// `VariantAccess` is a visitor that is created by the `Deserializer` and +/// passed to the `Deserialize` to deserialize the content of a particular enum +/// variant. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed by the deserialized enum variant. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `VariantAccess` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait VariantAccess<'de>: Sized { + /// The error type that can be returned if some error occurs during + /// deserialization. Must match the error type of our `EnumAccess`. + type Error: Error; + + /// Called when deserializing a variant with no values. + /// + /// If the data contains a different type of variant, the following + /// `invalid_type` error should be constructed: + /// + /// ```edition2018 + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// fn unit_variant(self) -> Result<(), Self::Error> { + /// // What the data actually contained; suppose it is a tuple variant. + /// let unexp = Unexpected::TupleVariant; + /// Err(de::Error::invalid_type(unexp, &"unit variant")) + /// } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where + /// # T: DeserializeSeed<'de>, + /// # { unimplemented!() } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # } + /// ``` + fn unit_variant(self) -> Result<(), Self::Error>; + + /// Called when deserializing a variant with a single value. + /// + /// `Deserialize` implementations should typically use + /// `VariantAccess::newtype_variant` instead. + /// + /// If the data contains a different type of variant, the following + /// `invalid_type` error should be constructed: + /// + /// ```edition2018 + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// fn newtype_variant_seed(self, _seed: T) -> Result + /// where + /// T: DeserializeSeed<'de>, + /// { + /// // What the data actually contained; suppose it is a unit variant. + /// let unexp = Unexpected::UnitVariant; + /// Err(de::Error::invalid_type(unexp, &"newtype variant")) + /// } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # } + /// ``` + fn newtype_variant_seed(self, seed: T) -> Result + where + T: DeserializeSeed<'de>; + + /// Called when deserializing a variant with a single value. + /// + /// This method exists as a convenience for `Deserialize` implementations. + /// `VariantAccess` implementations should not override the default + /// behavior. + #[inline] + fn newtype_variant(self) -> Result + where + T: Deserialize<'de>, + { + self.newtype_variant_seed(PhantomData) + } + + /// Called when deserializing a tuple-like variant. + /// + /// The `len` is the number of fields expected in the tuple variant. + /// + /// If the data contains a different type of variant, the following + /// `invalid_type` error should be constructed: + /// + /// ```edition2018 + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where + /// # T: DeserializeSeed<'de>, + /// # { unimplemented!() } + /// # + /// fn tuple_variant( + /// self, + /// _len: usize, + /// _visitor: V, + /// ) -> Result + /// where + /// V: Visitor<'de>, + /// { + /// // What the data actually contained; suppose it is a unit variant. + /// let unexp = Unexpected::UnitVariant; + /// Err(de::Error::invalid_type(unexp, &"tuple variant")) + /// } + /// # + /// # fn struct_variant(self, _: &[&str], _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # } + /// ``` + fn tuple_variant(self, len: usize, visitor: V) -> Result + where + V: Visitor<'de>; + + /// Called when deserializing a struct-like variant. + /// + /// The `fields` are the names of the fields of the struct variant. + /// + /// If the data contains a different type of variant, the following + /// `invalid_type` error should be constructed: + /// + /// ```edition2018 + /// # use serde::de::{self, value, DeserializeSeed, Visitor, VariantAccess, Unexpected}; + /// # + /// # struct X; + /// # + /// # impl<'de> VariantAccess<'de> for X { + /// # type Error = value::Error; + /// # + /// # fn unit_variant(self) -> Result<(), Self::Error> { + /// # unimplemented!() + /// # } + /// # + /// # fn newtype_variant_seed(self, _: T) -> Result + /// # where + /// # T: DeserializeSeed<'de>, + /// # { unimplemented!() } + /// # + /// # fn tuple_variant(self, _: usize, _: V) -> Result + /// # where + /// # V: Visitor<'de>, + /// # { unimplemented!() } + /// # + /// fn struct_variant( + /// self, + /// _fields: &'static [&'static str], + /// _visitor: V, + /// ) -> Result + /// where + /// V: Visitor<'de>, + /// { + /// // What the data actually contained; suppose it is a unit variant. + /// let unexp = Unexpected::UnitVariant; + /// Err(de::Error::invalid_type(unexp, &"struct variant")) + /// } + /// # } + /// ``` + fn struct_variant( + self, + fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>; +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Converts an existing value into a `Deserializer` from which other values can +/// be deserialized. +/// +/// # Lifetime +/// +/// The `'de` lifetime of this trait is the lifetime of data that may be +/// borrowed from the resulting `Deserializer`. See the page [Understanding +/// deserializer lifetimes] for a more detailed explanation of these lifetimes. +/// +/// [Understanding deserializer lifetimes]: https://serde.rs/lifetimes.html +/// +/// # Example +/// +/// ```edition2018 +/// use std::str::FromStr; +/// use serde::Deserialize; +/// use serde::de::{value, IntoDeserializer}; +/// +/// #[derive(Deserialize)] +/// enum Setting { +/// On, +/// Off, +/// } +/// +/// impl FromStr for Setting { +/// type Err = value::Error; +/// +/// fn from_str(s: &str) -> Result { +/// Self::deserialize(s.into_deserializer()) +/// } +/// } +/// ``` +pub trait IntoDeserializer<'de, E: Error = value::Error> { + /// The type of the deserializer being converted into. + type Deserializer: Deserializer<'de, Error = E>; + + /// Convert this value into a deserializer. + fn into_deserializer(self) -> Self::Deserializer; +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Used in error messages. +/// +/// - expected `a` +/// - expected `a` or `b` +/// - expected one of `a`, `b`, `c` +/// +/// The slice of names must not be empty. +struct OneOf { + names: &'static [&'static str], +} + +impl Display for OneOf { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self.names.len() { + 0 => panic!(), // special case elsewhere + 1 => write!(formatter, "`{}`", self.names[0]), + 2 => write!(formatter, "`{}` or `{}`", self.names[0], self.names[1]), + _ => { + try!(write!(formatter, "one of ")); + for (i, alt) in self.names.iter().enumerate() { + if i > 0 { + try!(write!(formatter, ", ")); + } + try!(write!(formatter, "`{}`", alt)); + } + Ok(()) + } + } + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/de/utf8.rs b/vendor/registry-40351f815f426200/serde/src/de/utf8.rs new file mode 100644 index 000000000..576fd03cf --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/utf8.rs @@ -0,0 +1,46 @@ +use lib::*; + +const TAG_CONT: u8 = 0b1000_0000; +const TAG_TWO_B: u8 = 0b1100_0000; +const TAG_THREE_B: u8 = 0b1110_0000; +const TAG_FOUR_B: u8 = 0b1111_0000; +const MAX_ONE_B: u32 = 0x80; +const MAX_TWO_B: u32 = 0x800; +const MAX_THREE_B: u32 = 0x10000; + +#[inline] +pub fn encode(c: char) -> Encode { + let code = c as u32; + let mut buf = [0; 4]; + let pos = if code < MAX_ONE_B { + buf[3] = code as u8; + 3 + } else if code < MAX_TWO_B { + buf[2] = (code >> 6 & 0x1F) as u8 | TAG_TWO_B; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 2 + } else if code < MAX_THREE_B { + buf[1] = (code >> 12 & 0x0F) as u8 | TAG_THREE_B; + buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 1 + } else { + buf[0] = (code >> 18 & 0x07) as u8 | TAG_FOUR_B; + buf[1] = (code >> 12 & 0x3F) as u8 | TAG_CONT; + buf[2] = (code >> 6 & 0x3F) as u8 | TAG_CONT; + buf[3] = (code & 0x3F) as u8 | TAG_CONT; + 0 + }; + Encode { buf: buf, pos: pos } +} + +pub struct Encode { + buf: [u8; 4], + pos: usize, +} + +impl Encode { + pub fn as_str(&self) -> &str { + str::from_utf8(&self.buf[self.pos..]).unwrap() + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/de/value.rs b/vendor/registry-40351f815f426200/serde/src/de/value.rs new file mode 100644 index 000000000..d0a185da2 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/de/value.rs @@ -0,0 +1,1497 @@ +//! Building blocks for deserializing basic values using the `IntoDeserializer` +//! trait. +//! +//! ```edition2018 +//! use std::str::FromStr; +//! use serde::Deserialize; +//! use serde::de::{value, IntoDeserializer}; +//! +//! #[derive(Deserialize)] +//! enum Setting { +//! On, +//! Off, +//! } +//! +//! impl FromStr for Setting { +//! type Err = value::Error; +//! +//! fn from_str(s: &str) -> Result { +//! Self::deserialize(s.into_deserializer()) +//! } +//! } +//! ``` + +use lib::*; + +use self::private::{First, Second}; +use de::{self, Expected, IntoDeserializer, SeqAccess}; +use private::de::size_hint; +use ser; + +//////////////////////////////////////////////////////////////////////////////// + +// For structs that contain a PhantomData. We do not want the trait +// bound `E: Clone` inferred by derive(Clone). +macro_rules! impl_copy_clone { + ($ty:ident $(<$lifetime:tt>)*) => { + impl<$($lifetime,)* E> Copy for $ty<$($lifetime,)* E> {} + + impl<$($lifetime,)* E> Clone for $ty<$($lifetime,)* E> { + fn clone(&self) -> Self { + *self + } + } + }; +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A minimal representation of all possible errors that can occur using the +/// `IntoDeserializer` trait. +#[derive(Clone, Debug, PartialEq)] +pub struct Error { + err: ErrorImpl, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +type ErrorImpl = Box; +#[cfg(not(any(feature = "std", feature = "alloc")))] +type ErrorImpl = (); + +impl de::Error for Error { + #[cfg(any(feature = "std", feature = "alloc"))] + #[cold] + fn custom(msg: T) -> Self + where + T: Display, + { + Error { + err: msg.to_string().into_boxed_str(), + } + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + #[cold] + fn custom(msg: T) -> Self + where + T: Display, + { + let _ = msg; + Error { err: () } + } +} + +impl ser::Error for Error { + #[cold] + fn custom(msg: T) -> Self + where + T: Display, + { + de::Error::custom(msg) + } +} + +impl Display for Error { + #[cfg(any(feature = "std", feature = "alloc"))] + fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { + formatter.write_str(&self.err) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn fmt(&self, formatter: &mut fmt::Formatter) -> Result<(), fmt::Error> { + formatter.write_str("Serde deserialization error") + } +} + +#[cfg(feature = "std")] +impl error::Error for Error { + fn description(&self) -> &str { + &self.err + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl<'de, E> IntoDeserializer<'de, E> for () +where + E: de::Error, +{ + type Deserializer = UnitDeserializer; + + fn into_deserializer(self) -> UnitDeserializer { + UnitDeserializer { + marker: PhantomData, + } + } +} + +/// A deserializer holding a `()`. +#[derive(Debug)] +pub struct UnitDeserializer { + marker: PhantomData, +} + +impl_copy_clone!(UnitDeserializer); + +impl<'de, E> de::Deserializer<'de> for UnitDeserializer +where + E: de::Error, +{ + type Error = E; + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf unit unit_struct newtype_struct seq tuple tuple_struct + map struct enum identifier ignored_any + } + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_unit() + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_none() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer that cannot be instantiated. +#[cfg(feature = "unstable")] +pub struct NeverDeserializer { + never: !, + marker: PhantomData, +} + +#[cfg(feature = "unstable")] +impl<'de, E> IntoDeserializer<'de, E> for ! +where + E: de::Error, +{ + type Deserializer = NeverDeserializer; + + fn into_deserializer(self) -> Self::Deserializer { + self + } +} + +#[cfg(feature = "unstable")] +impl<'de, E> de::Deserializer<'de> for NeverDeserializer +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, _visitor: V) -> Result + where + V: de::Visitor<'de>, + { + self.never + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! primitive_deserializer { + ($ty:ty, $doc:tt, $name:ident, $method:ident $($cast:tt)*) => { + #[doc = "A deserializer holding"] + #[doc = $doc] + #[derive(Debug)] + pub struct $name { + value: $ty, + marker: PhantomData + } + + impl_copy_clone!($name); + + impl<'de, E> IntoDeserializer<'de, E> for $ty + where + E: de::Error, + { + type Deserializer = $name; + + fn into_deserializer(self) -> $name { + $name { + value: self, + marker: PhantomData, + } + } + } + + impl<'de, E> de::Deserializer<'de> for $name + where + E: de::Error, + { + type Error = E; + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str + string bytes byte_buf option unit unit_struct newtype_struct seq + tuple tuple_struct map struct enum identifier ignored_any + } + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.$method(self.value $($cast)*) + } + } + } +} + +primitive_deserializer!(bool, "a `bool`.", BoolDeserializer, visit_bool); +primitive_deserializer!(i8, "an `i8`.", I8Deserializer, visit_i8); +primitive_deserializer!(i16, "an `i16`.", I16Deserializer, visit_i16); +primitive_deserializer!(i32, "an `i32`.", I32Deserializer, visit_i32); +primitive_deserializer!(i64, "an `i64`.", I64Deserializer, visit_i64); +primitive_deserializer!(isize, "an `isize`.", IsizeDeserializer, visit_i64 as i64); +primitive_deserializer!(u8, "a `u8`.", U8Deserializer, visit_u8); +primitive_deserializer!(u16, "a `u16`.", U16Deserializer, visit_u16); +primitive_deserializer!(u64, "a `u64`.", U64Deserializer, visit_u64); +primitive_deserializer!(usize, "a `usize`.", UsizeDeserializer, visit_u64 as u64); +primitive_deserializer!(f32, "an `f32`.", F32Deserializer, visit_f32); +primitive_deserializer!(f64, "an `f64`.", F64Deserializer, visit_f64); +primitive_deserializer!(char, "a `char`.", CharDeserializer, visit_char); + +serde_if_integer128! { + primitive_deserializer!(i128, "an `i128`.", I128Deserializer, visit_i128); + primitive_deserializer!(u128, "a `u128`.", U128Deserializer, visit_u128); +} + +/// A deserializer holding a `u32`. +#[derive(Debug)] +pub struct U32Deserializer { + value: u32, + marker: PhantomData, +} + +impl_copy_clone!(U32Deserializer); + +impl<'de, E> IntoDeserializer<'de, E> for u32 +where + E: de::Error, +{ + type Deserializer = U32Deserializer; + + fn into_deserializer(self) -> U32Deserializer { + U32Deserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, E> de::Deserializer<'de> for U32Deserializer +where + E: de::Error, +{ + type Error = E; + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_u32(self.value) + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } +} + +impl<'de, E> de::EnumAccess<'de> for U32Deserializer +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `&str`. +#[derive(Debug)] +pub struct StrDeserializer<'a, E> { + value: &'a str, + marker: PhantomData, +} + +impl_copy_clone!(StrDeserializer<'de>); + +impl<'de, 'a, E> IntoDeserializer<'de, E> for &'a str +where + E: de::Error, +{ + type Deserializer = StrDeserializer<'a, E>; + + fn into_deserializer(self) -> StrDeserializer<'a, E> { + StrDeserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, 'a, E> de::Deserializer<'de> for StrDeserializer<'a, E> +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_str(self.value) + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +impl<'de, 'a, E> de::EnumAccess<'de> for StrDeserializer<'a, E> +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `&str` with a lifetime tied to another +/// deserializer. +#[derive(Debug)] +pub struct BorrowedStrDeserializer<'de, E> { + value: &'de str, + marker: PhantomData, +} + +impl_copy_clone!(BorrowedStrDeserializer<'de>); + +impl<'de, E> BorrowedStrDeserializer<'de, E> { + /// Create a new borrowed deserializer from the given string. + pub fn new(value: &'de str) -> BorrowedStrDeserializer<'de, E> { + BorrowedStrDeserializer { + value: value, + marker: PhantomData, + } + } +} + +impl<'de, E> de::Deserializer<'de> for BorrowedStrDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_borrowed_str(self.value) + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +impl<'de, E> de::EnumAccess<'de> for BorrowedStrDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `String`. +#[cfg(any(feature = "std", feature = "alloc"))] +#[derive(Debug)] +pub struct StringDeserializer { + value: String, + marker: PhantomData, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl Clone for StringDeserializer { + fn clone(&self) -> Self { + StringDeserializer { + value: self.value.clone(), + marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, E> IntoDeserializer<'de, E> for String +where + E: de::Error, +{ + type Deserializer = StringDeserializer; + + fn into_deserializer(self) -> StringDeserializer { + StringDeserializer { + value: self, + marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, E> de::Deserializer<'de> for StringDeserializer +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_string(self.value) + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::EnumAccess<'de> for StringDeserializer +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `Cow`. +#[cfg(any(feature = "std", feature = "alloc"))] +#[derive(Debug)] +pub struct CowStrDeserializer<'a, E> { + value: Cow<'a, str>, + marker: PhantomData, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, E> Clone for CowStrDeserializer<'a, E> { + fn clone(&self) -> Self { + CowStrDeserializer { + value: self.value.clone(), + marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> IntoDeserializer<'de, E> for Cow<'a, str> +where + E: de::Error, +{ + type Deserializer = CowStrDeserializer<'a, E>; + + fn into_deserializer(self) -> CowStrDeserializer<'a, E> { + CowStrDeserializer { + value: self, + marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::Deserializer<'de> for CowStrDeserializer<'a, E> +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Cow::Borrowed(string) => visitor.visit_str(string), + Cow::Owned(string) => visitor.visit_string(string), + } + } + + fn deserialize_enum( + self, + name: &str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + let _ = name; + let _ = variants; + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, 'a, E> de::EnumAccess<'de> for CowStrDeserializer<'a, E> +where + E: de::Error, +{ + type Error = E; + type Variant = private::UnitOnly; + + fn variant_seed(self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + seed.deserialize(self).map(private::unit_only) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `&[u8]` with a lifetime tied to another +/// deserializer. +#[derive(Debug)] +pub struct BorrowedBytesDeserializer<'de, E> { + value: &'de [u8], + marker: PhantomData, +} + +impl_copy_clone!(BorrowedBytesDeserializer<'de>); + +impl<'de, E> BorrowedBytesDeserializer<'de, E> { + /// Create a new borrowed deserializer from the given byte slice. + pub fn new(value: &'de [u8]) -> BorrowedBytesDeserializer<'de, E> { + BorrowedBytesDeserializer { + value: value, + marker: PhantomData, + } + } +} + +impl<'de, E> de::Deserializer<'de> for BorrowedBytesDeserializer<'de, E> +where + E: de::Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_borrowed_bytes(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any enum + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer that iterates over a sequence. +#[derive(Clone, Debug)] +pub struct SeqDeserializer { + iter: iter::Fuse, + count: usize, + marker: PhantomData, +} + +impl SeqDeserializer +where + I: Iterator, +{ + /// Construct a new `SeqDeserializer`. + pub fn new(iter: I) -> Self { + SeqDeserializer { + iter: iter.fuse(), + count: 0, + marker: PhantomData, + } + } +} + +impl SeqDeserializer +where + I: Iterator, + E: de::Error, +{ + /// Check for remaining elements after passing a `SeqDeserializer` to + /// `Visitor::visit_seq`. + pub fn end(self) -> Result<(), E> { + let remaining = self.iter.count(); + if remaining == 0 { + Ok(()) + } else { + // First argument is the number of elements in the data, second + // argument is the number of elements expected by the Deserialize. + Err(de::Error::invalid_length( + self.count + remaining, + &ExpectedInSeq(self.count), + )) + } + } +} + +impl<'de, I, T, E> de::Deserializer<'de> for SeqDeserializer +where + I: Iterator, + T: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let v = try!(visitor.visit_seq(&mut self)); + try!(self.end()); + Ok(v) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } +} + +impl<'de, I, T, E> de::SeqAccess<'de> for SeqDeserializer +where + I: Iterator, + T: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn next_element_seed(&mut self, seed: V) -> Result, Self::Error> + where + V: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(value) => { + self.count += 1; + seed.deserialize(value.into_deserializer()).map(Some) + } + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } +} + +struct ExpectedInSeq(usize); + +impl Expected for ExpectedInSeq { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + if self.0 == 1 { + write!(formatter, "1 element in sequence") + } else { + write!(formatter, "{} elements in sequence", self.0) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, T, E> IntoDeserializer<'de, E> for Vec +where + T: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Deserializer = SeqDeserializer<::IntoIter, E>; + + fn into_deserializer(self) -> Self::Deserializer { + SeqDeserializer::new(self.into_iter()) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, T, E> IntoDeserializer<'de, E> for BTreeSet +where + T: IntoDeserializer<'de, E> + Eq + Ord, + E: de::Error, +{ + type Deserializer = SeqDeserializer<::IntoIter, E>; + + fn into_deserializer(self) -> Self::Deserializer { + SeqDeserializer::new(self.into_iter()) + } +} + +#[cfg(feature = "std")] +impl<'de, T, S, E> IntoDeserializer<'de, E> for HashSet +where + T: IntoDeserializer<'de, E> + Eq + Hash, + S: BuildHasher, + E: de::Error, +{ + type Deserializer = SeqDeserializer<::IntoIter, E>; + + fn into_deserializer(self) -> Self::Deserializer { + SeqDeserializer::new(self.into_iter()) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `SeqAccess`. +#[derive(Clone, Debug)] +pub struct SeqAccessDeserializer { + seq: A, +} + +impl SeqAccessDeserializer { + /// Construct a new `SeqAccessDeserializer`. + pub fn new(seq: A) -> Self { + SeqAccessDeserializer { seq: seq } + } +} + +impl<'de, A> de::Deserializer<'de> for SeqAccessDeserializer +where + A: de::SeqAccess<'de>, +{ + type Error = A::Error; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_seq(self.seq) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer that iterates over a map. +pub struct MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, +{ + iter: iter::Fuse, + value: Option>, + count: usize, + lifetime: PhantomData<&'de ()>, + error: PhantomData, +} + +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, +{ + /// Construct a new `MapDeserializer`. + pub fn new(iter: I) -> Self { + MapDeserializer { + iter: iter.fuse(), + value: None, + count: 0, + lifetime: PhantomData, + error: PhantomData, + } + } +} + +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + E: de::Error, +{ + /// Check for remaining elements after passing a `MapDeserializer` to + /// `Visitor::visit_map`. + pub fn end(self) -> Result<(), E> { + let remaining = self.iter.count(); + if remaining == 0 { + Ok(()) + } else { + // First argument is the number of elements in the data, second + // argument is the number of elements expected by the Deserialize. + Err(de::Error::invalid_length( + self.count + remaining, + &ExpectedInMap(self.count), + )) + } + } +} + +impl<'de, I, E> MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, +{ + fn next_pair(&mut self) -> Option<(First, Second)> { + match self.iter.next() { + Some(kv) => { + self.count += 1; + Some(private::Pair::split(kv)) + } + None => None, + } + } +} + +impl<'de, I, E> de::Deserializer<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let value = try!(visitor.visit_map(&mut self)); + try!(self.end()); + Ok(value) + } + + fn deserialize_seq(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let value = try!(visitor.visit_seq(&mut self)); + try!(self.end()); + Ok(value) + } + + fn deserialize_tuple(self, len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let _ = len; + self.deserialize_seq(visitor) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct tuple_struct map + struct enum identifier ignored_any + } +} + +impl<'de, I, E> de::MapAccess<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.next_pair() { + Some((key, value)) => { + self.value = Some(value); + seed.deserialize(key.into_deserializer()).map(Some) + } + None => Ok(None), + } + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + let value = self.value.take(); + // Panic because this indicates a bug in the program rather than an + // expected failure. + let value = value.expect("MapAccess::visit_value called before visit_key"); + seed.deserialize(value.into_deserializer()) + } + + fn next_entry_seed( + &mut self, + kseed: TK, + vseed: TV, + ) -> Result, Self::Error> + where + TK: de::DeserializeSeed<'de>, + TV: de::DeserializeSeed<'de>, + { + match self.next_pair() { + Some((key, value)) => { + let key = try!(kseed.deserialize(key.into_deserializer())); + let value = try!(vseed.deserialize(value.into_deserializer())); + Ok(Some((key, value))) + } + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } +} + +impl<'de, I, E> de::SeqAccess<'de> for MapDeserializer<'de, I, E> +where + I: Iterator, + I::Item: private::Pair, + First: IntoDeserializer<'de, E>, + Second: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.next_pair() { + Some((k, v)) => { + let de = PairDeserializer(k, v, PhantomData); + seed.deserialize(de).map(Some) + } + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } +} + +// Cannot #[derive(Clone)] because of the bound `Second: Clone`. +impl<'de, I, E> Clone for MapDeserializer<'de, I, E> +where + I: Iterator + Clone, + I::Item: private::Pair, + Second: Clone, +{ + fn clone(&self) -> Self { + MapDeserializer { + iter: self.iter.clone(), + value: self.value.clone(), + count: self.count, + lifetime: self.lifetime, + error: self.error, + } + } +} + +// Cannot #[derive(Debug)] because of the bound `Second: Debug`. +impl<'de, I, E> Debug for MapDeserializer<'de, I, E> +where + I: Iterator + Debug, + I::Item: private::Pair, + Second: Debug, +{ + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter + .debug_struct("MapDeserializer") + .field("iter", &self.iter) + .field("value", &self.value) + .field("count", &self.count) + .field("lifetime", &self.lifetime) + .field("error", &self.error) + .finish() + } +} + +// Used in the `impl SeqAccess for MapDeserializer` to visit the map as a +// sequence of pairs. +struct PairDeserializer(A, B, PhantomData); + +impl<'de, A, B, E> de::Deserializer<'de> for PairDeserializer +where + A: IntoDeserializer<'de, E>, + B: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct tuple_struct map + struct enum identifier ignored_any + } + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + self.deserialize_seq(visitor) + } + + fn deserialize_seq(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let mut pair_visitor = PairVisitor(Some(self.0), Some(self.1), PhantomData); + let pair = try!(visitor.visit_seq(&mut pair_visitor)); + if pair_visitor.1.is_none() { + Ok(pair) + } else { + let remaining = pair_visitor.size_hint().unwrap(); + // First argument is the number of elements in the data, second + // argument is the number of elements expected by the Deserialize. + Err(de::Error::invalid_length(2, &ExpectedInSeq(2 - remaining))) + } + } + + fn deserialize_tuple(self, len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + if len == 2 { + self.deserialize_seq(visitor) + } else { + // First argument is the number of elements in the data, second + // argument is the number of elements expected by the Deserialize. + Err(de::Error::invalid_length(2, &ExpectedInSeq(len))) + } + } +} + +struct PairVisitor(Option, Option, PhantomData); + +impl<'de, A, B, E> de::SeqAccess<'de> for PairVisitor +where + A: IntoDeserializer<'de, E>, + B: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + if let Some(k) = self.0.take() { + seed.deserialize(k.into_deserializer()).map(Some) + } else if let Some(v) = self.1.take() { + seed.deserialize(v.into_deserializer()).map(Some) + } else { + Ok(None) + } + } + + fn size_hint(&self) -> Option { + if self.0.is_some() { + Some(2) + } else if self.1.is_some() { + Some(1) + } else { + Some(0) + } + } +} + +struct ExpectedInMap(usize); + +impl Expected for ExpectedInMap { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + if self.0 == 1 { + write!(formatter, "1 element in map") + } else { + write!(formatter, "{} elements in map", self.0) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'de, K, V, E> IntoDeserializer<'de, E> for BTreeMap +where + K: IntoDeserializer<'de, E> + Eq + Ord, + V: IntoDeserializer<'de, E>, + E: de::Error, +{ + type Deserializer = MapDeserializer<'de, ::IntoIter, E>; + + fn into_deserializer(self) -> Self::Deserializer { + MapDeserializer::new(self.into_iter()) + } +} + +#[cfg(feature = "std")] +impl<'de, K, V, S, E> IntoDeserializer<'de, E> for HashMap +where + K: IntoDeserializer<'de, E> + Eq + Hash, + V: IntoDeserializer<'de, E>, + S: BuildHasher, + E: de::Error, +{ + type Deserializer = MapDeserializer<'de, ::IntoIter, E>; + + fn into_deserializer(self) -> Self::Deserializer { + MapDeserializer::new(self.into_iter()) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A deserializer holding a `MapAccess`. +#[derive(Clone, Debug)] +pub struct MapAccessDeserializer { + map: A, +} + +impl MapAccessDeserializer { + /// Construct a new `MapAccessDeserializer`. + pub fn new(map: A) -> Self { + MapAccessDeserializer { map: map } + } +} + +impl<'de, A> de::Deserializer<'de> for MapAccessDeserializer +where + A: de::MapAccess<'de>, +{ + type Error = A::Error; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_map(self.map) + } + + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_enum(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +impl<'de, A> de::EnumAccess<'de> for MapAccessDeserializer +where + A: de::MapAccess<'de>, +{ + type Error = A::Error; + type Variant = private::MapAsEnum; + + fn variant_seed(mut self, seed: T) -> Result<(T::Value, Self::Variant), Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.map.next_key_seed(seed)? { + Some(key) => Ok((key, private::map_as_enum(self.map))), + None => Err(de::Error::invalid_type(de::Unexpected::Map, &"enum")), + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +mod private { + use lib::*; + + use de::{self, DeserializeSeed, Deserializer, MapAccess, Unexpected, VariantAccess, Visitor}; + + #[derive(Clone, Debug)] + pub struct UnitOnly { + marker: PhantomData, + } + + pub fn unit_only(t: T) -> (T, UnitOnly) { + ( + t, + UnitOnly { + marker: PhantomData, + }, + ) + } + + impl<'de, E> de::VariantAccess<'de> for UnitOnly + where + E: de::Error, + { + type Error = E; + + fn unit_variant(self) -> Result<(), Self::Error> { + Ok(()) + } + + fn newtype_variant_seed(self, _seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + Err(de::Error::invalid_type( + Unexpected::UnitVariant, + &"newtype variant", + )) + } + + fn tuple_variant(self, _len: usize, _visitor: V) -> Result + where + V: de::Visitor<'de>, + { + Err(de::Error::invalid_type( + Unexpected::UnitVariant, + &"tuple variant", + )) + } + + fn struct_variant( + self, + _fields: &'static [&'static str], + _visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + Err(de::Error::invalid_type( + Unexpected::UnitVariant, + &"struct variant", + )) + } + } + + #[derive(Clone, Debug)] + pub struct MapAsEnum { + map: A, + } + + pub fn map_as_enum(map: A) -> MapAsEnum { + MapAsEnum { map: map } + } + + impl<'de, A> VariantAccess<'de> for MapAsEnum + where + A: MapAccess<'de>, + { + type Error = A::Error; + + fn unit_variant(mut self) -> Result<(), Self::Error> { + self.map.next_value() + } + + fn newtype_variant_seed(mut self, seed: T) -> Result + where + T: DeserializeSeed<'de>, + { + self.map.next_value_seed(seed) + } + + fn tuple_variant(mut self, len: usize, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.map.next_value_seed(SeedTupleVariant { + len: len, + visitor: visitor, + }) + } + + fn struct_variant( + mut self, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + self.map + .next_value_seed(SeedStructVariant { visitor: visitor }) + } + } + + struct SeedTupleVariant { + len: usize, + visitor: V, + } + + impl<'de, V> DeserializeSeed<'de> for SeedTupleVariant + where + V: Visitor<'de>, + { + type Value = V::Value; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_tuple(self.len, self.visitor) + } + } + + struct SeedStructVariant { + visitor: V, + } + + impl<'de, V> DeserializeSeed<'de> for SeedStructVariant + where + V: Visitor<'de>, + { + type Value = V::Value; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_map(self.visitor) + } + } + + /// Avoid having to restate the generic types on `MapDeserializer`. The + /// `Iterator::Item` contains enough information to figure out K and V. + pub trait Pair { + type First; + type Second; + fn split(self) -> (Self::First, Self::Second); + } + + impl Pair for (A, B) { + type First = A; + type Second = B; + fn split(self) -> (A, B) { + self + } + } + + pub type First = ::First; + pub type Second = ::Second; +} diff --git a/vendor/registry-40351f815f426200/serde/src/export.rs b/vendor/registry-40351f815f426200/serde/src/export.rs new file mode 100644 index 000000000..80dcb7f5a --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/export.rs @@ -0,0 +1,36 @@ +pub use lib::clone::Clone; +pub use lib::convert::{From, Into}; +pub use lib::default::Default; +pub use lib::fmt::{self, Formatter}; +pub use lib::marker::PhantomData; +pub use lib::option::Option::{self, None, Some}; +pub use lib::result::Result::{self, Err, Ok}; + +pub use self::string::from_utf8_lossy; + +#[cfg(any(feature = "alloc", feature = "std"))] +pub use lib::{ToString, Vec}; + +mod string { + use lib::*; + + #[cfg(any(feature = "std", feature = "alloc"))] + pub fn from_utf8_lossy(bytes: &[u8]) -> Cow { + String::from_utf8_lossy(bytes) + } + + // The generated code calls this like: + // + // let value = &_serde::export::from_utf8_lossy(bytes); + // Err(_serde::de::Error::unknown_variant(value, VARIANTS)) + // + // so it is okay for the return type to be different from the std case as long + // as the above works. + #[cfg(not(any(feature = "std", feature = "alloc")))] + pub fn from_utf8_lossy(bytes: &[u8]) -> &str { + // Three unicode replacement characters if it fails. They look like a + // white-on-black question mark. The user will recognize it as invalid + // UTF-8. + str::from_utf8(bytes).unwrap_or("\u{fffd}\u{fffd}\u{fffd}") + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/integer128.rs b/vendor/registry-40351f815f426200/serde/src/integer128.rs new file mode 100644 index 000000000..7a24e50ad --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/integer128.rs @@ -0,0 +1,82 @@ +/// Conditional compilation depending on whether Serde is built with support for +/// 128-bit integers. +/// +/// Data formats that wish to support Rust compiler versions older than 1.26 may +/// place the i128 / u128 methods of their Serializer and Deserializer behind +/// this macro. +/// +/// Data formats that require a minimum Rust compiler version of at least 1.26 +/// do not need to bother with this macro and may assume support for 128-bit +/// integers. +/// +/// ```edition2018 +/// # use serde::private::ser::Error; +/// # +/// # struct MySerializer; +/// # +/// use serde::{serde_if_integer128, Serializer}; +/// +/// impl Serializer for MySerializer { +/// type Ok = (); +/// type Error = Error; +/// +/// fn serialize_i64(self, v: i64) -> Result { +/// /* ... */ +/// # unimplemented!() +/// } +/// +/// /* ... */ +/// +/// serde_if_integer128! { +/// fn serialize_i128(self, v: i128) -> Result { +/// /* ... */ +/// # unimplemented!() +/// } +/// +/// fn serialize_u128(self, v: u128) -> Result { +/// /* ... */ +/// # unimplemented!() +/// } +/// } +/// # +/// # serde::__serialize_unimplemented! { +/// # bool i8 i16 i32 u8 u16 u32 u64 f32 f64 char str bytes none some +/// # unit unit_struct unit_variant newtype_struct newtype_variant seq +/// # tuple tuple_struct tuple_variant map struct struct_variant +/// # } +/// } +/// ``` +/// +/// When Serde is built with support for 128-bit integers, this macro expands +/// transparently into just the input tokens. +/// +/// ```edition2018 +/// macro_rules! serde_if_integer128 { +/// ($($tt:tt)*) => { +/// $($tt)* +/// }; +/// } +/// ``` +/// +/// When built without support for 128-bit integers, this macro expands to +/// nothing. +/// +/// ```edition2018 +/// macro_rules! serde_if_integer128 { +/// ($($tt:tt)*) => {}; +/// } +/// ``` +#[cfg(integer128)] +#[macro_export] +macro_rules! serde_if_integer128 { + ($($tt:tt)*) => { + $($tt)* + }; +} + +#[cfg(not(integer128))] +#[macro_export] +#[doc(hidden)] +macro_rules! serde_if_integer128 { + ($($tt:tt)*) => {}; +} diff --git a/vendor/registry-40351f815f426200/serde/src/lib.rs b/vendor/registry-40351f815f426200/serde/src/lib.rs new file mode 100644 index 000000000..4133c1436 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/lib.rs @@ -0,0 +1,255 @@ +//! # Serde +//! +//! Serde is a framework for ***ser***ializing and ***de***serializing Rust data +//! structures efficiently and generically. +//! +//! The Serde ecosystem consists of data structures that know how to serialize +//! and deserialize themselves along with data formats that know how to +//! serialize and deserialize other things. Serde provides the layer by which +//! these two groups interact with each other, allowing any supported data +//! structure to be serialized and deserialized using any supported data format. +//! +//! See the Serde website [https://serde.rs/] for additional documentation and +//! usage examples. +//! +//! [https://serde.rs/]: https://serde.rs/ +//! +//! ## Design +//! +//! Where many other languages rely on runtime reflection for serializing data, +//! Serde is instead built on Rust's powerful trait system. A data structure +//! that knows how to serialize and deserialize itself is one that implements +//! Serde's `Serialize` and `Deserialize` traits (or uses Serde's derive +//! attribute to automatically generate implementations at compile time). This +//! avoids any overhead of reflection or runtime type information. In fact in +//! many situations the interaction between data structure and data format can +//! be completely optimized away by the Rust compiler, leaving Serde +//! serialization to perform the same speed as a handwritten serializer for the +//! specific selection of data structure and data format. +//! +//! ## Data formats +//! +//! The following is a partial list of data formats that have been implemented +//! for Serde by the community. +//! +//! - [JSON], the ubiquitous JavaScript Object Notation used by many HTTP APIs. +//! - [Bincode], a compact binary format +//! used for IPC within the Servo rendering engine. +//! - [CBOR], a Concise Binary Object Representation designed for small message +//! size without the need for version negotiation. +//! - [YAML], a popular human-friendly configuration language that ain't markup +//! language. +//! - [MessagePack], an efficient binary format that resembles a compact JSON. +//! - [TOML], a minimal configuration format used by [Cargo]. +//! - [Pickle], a format common in the Python world. +//! - [RON], a Rusty Object Notation. +//! - [BSON], the data storage and network transfer format used by MongoDB. +//! - [Avro], a binary format used within Apache Hadoop, with support for schema +//! definition. +//! - [JSON5], A superset of JSON including some productions from ES5. +//! - [URL], the x-www-form-urlencoded format. +//! - [Envy], a way to deserialize environment variables into Rust structs. +//! *(deserialization only)* +//! - [Envy Store], a way to deserialize [AWS Parameter Store] parameters into +//! Rust structs. *(deserialization only)* +//! +//! [JSON]: https://github.com/serde-rs/json +//! [Bincode]: https://github.com/TyOverby/bincode +//! [CBOR]: https://github.com/pyfisch/cbor +//! [YAML]: https://github.com/dtolnay/serde-yaml +//! [MessagePack]: https://github.com/3Hren/msgpack-rust +//! [TOML]: https://github.com/alexcrichton/toml-rs +//! [Pickle]: https://github.com/birkenfeld/serde-pickle +//! [RON]: https://github.com/ron-rs/ron +//! [BSON]: https://github.com/zonyitoo/bson-rs +//! [Avro]: https://github.com/flavray/avro-rs +//! [JSON5]: https://github.com/callum-oakley/json5-rs +//! [URL]: https://github.com/nox/serde_urlencoded +//! [Envy]: https://github.com/softprops/envy +//! [Envy Store]: https://github.com/softprops/envy-store +//! [Cargo]: http://doc.crates.io/manifest.html +//! [AWS Parameter Store]: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html + +//////////////////////////////////////////////////////////////////////////////// + +// Serde types in rustdoc of other crates get linked to here. +#![doc(html_root_url = "https://docs.rs/serde/1.0.92")] +// Support using Serde without the standard library! +#![cfg_attr(not(feature = "std"), no_std)] +// Unstable functionality only if the user asks for it. For tracking and +// discussion of these features please refer to this issue: +// +// https://github.com/serde-rs/serde/issues/812 +#![cfg_attr(feature = "unstable", feature(specialization, never_type))] +#![cfg_attr(feature = "alloc", feature(alloc))] +#![allow(unknown_lints, bare_trait_objects)] +#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))] +#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] +// Ignored clippy and clippy_pedantic lints +#![cfg_attr( + feature = "cargo-clippy", + allow( + // not available in our oldest supported compiler + const_static_lifetime, + empty_enum, + redundant_field_names, + // integer and float ser/de requires these sorts of casts + cast_possible_truncation, + cast_possible_wrap, + cast_precision_loss, + cast_sign_loss, + // things are often more readable this way + cast_lossless, + module_name_repetitions, + single_match_else, + type_complexity, + use_self, + zero_prefixed_literal, + // not practical + needless_pass_by_value, + similar_names, + // preference + doc_markdown, + ) +)] +// Rustc lints. +#![deny(missing_docs, unused_imports)] + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "alloc")] +extern crate alloc; + +/// A facade around all the types we need from the `std`, `core`, and `alloc` +/// crates. This avoids elaborate import wrangling having to happen in every +/// module. +mod lib { + mod core { + #[cfg(not(feature = "std"))] + pub use core::*; + #[cfg(feature = "std")] + pub use std::*; + } + + pub use self::core::{cmp, iter, mem, num, slice, str}; + pub use self::core::{f32, f64}; + pub use self::core::{i16, i32, i64, i8, isize}; + pub use self::core::{u16, u32, u64, u8, usize}; + + pub use self::core::cell::{Cell, RefCell}; + pub use self::core::clone::{self, Clone}; + pub use self::core::convert::{self, From, Into}; + pub use self::core::default::{self, Default}; + pub use self::core::fmt::{self, Debug, Display}; + pub use self::core::marker::{self, PhantomData}; + pub use self::core::ops::Range; + pub use self::core::option::{self, Option}; + pub use self::core::result::{self, Result}; + + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::borrow::{Cow, ToOwned}; + #[cfg(feature = "std")] + pub use std::borrow::{Cow, ToOwned}; + + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::string::{String, ToString}; + #[cfg(feature = "std")] + pub use std::string::{String, ToString}; + + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::vec::Vec; + #[cfg(feature = "std")] + pub use std::vec::Vec; + + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::boxed::Box; + #[cfg(feature = "std")] + pub use std::boxed::Box; + + #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))] + pub use alloc::rc::{Rc, Weak as RcWeak}; + #[cfg(all(feature = "rc", feature = "std"))] + pub use std::rc::{Rc, Weak as RcWeak}; + + #[cfg(all(feature = "rc", feature = "alloc", not(feature = "std")))] + pub use alloc::sync::{Arc, Weak as ArcWeak}; + #[cfg(all(feature = "rc", feature = "std"))] + pub use std::sync::{Arc, Weak as ArcWeak}; + + #[cfg(all(feature = "alloc", not(feature = "std")))] + pub use alloc::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque}; + #[cfg(feature = "std")] + pub use std::collections::{BTreeMap, BTreeSet, BinaryHeap, LinkedList, VecDeque}; + + #[cfg(feature = "std")] + pub use std::{error, net}; + + #[cfg(feature = "std")] + pub use std::collections::{HashMap, HashSet}; + #[cfg(feature = "std")] + pub use std::ffi::{CStr, CString, OsStr, OsString}; + #[cfg(feature = "std")] + pub use std::hash::{BuildHasher, Hash}; + #[cfg(feature = "std")] + pub use std::io::Write; + #[cfg(feature = "std")] + pub use std::num::Wrapping; + #[cfg(feature = "std")] + pub use std::path::{Path, PathBuf}; + #[cfg(feature = "std")] + pub use std::sync::{Mutex, RwLock}; + #[cfg(feature = "std")] + pub use std::time::{SystemTime, UNIX_EPOCH}; + + #[cfg(all(feature = "std", collections_bound))] + pub use std::collections::Bound; + + #[cfg(core_reverse)] + pub use self::core::cmp::Reverse; + + #[cfg(ops_bound)] + pub use self::core::ops::Bound; + + #[cfg(range_inclusive)] + pub use self::core::ops::RangeInclusive; + + #[cfg(any(core_duration, feature = "std"))] + pub use self::core::time::Duration; +} + +//////////////////////////////////////////////////////////////////////////////// + +#[macro_use] +mod macros; + +#[macro_use] +mod integer128; + +pub mod de; +pub mod ser; + +#[doc(inline)] +pub use de::{Deserialize, Deserializer}; +#[doc(inline)] +pub use ser::{Serialize, Serializer}; + +// Generated code uses these to support no_std. Not public API. +#[doc(hidden)] +pub mod export; + +// Helpers used by generated code and doc tests. Not public API. +#[doc(hidden)] +pub mod private; + +// Re-export #[derive(Serialize, Deserialize)]. +// +// The reason re-exporting is not enabled by default is that disabling it would +// be annoying for crates that provide handwritten impls or data formats. They +// would need to disable default features and then explicitly re-enable std. +#[cfg(feature = "serde_derive")] +#[allow(unused_imports)] +#[macro_use] +extern crate serde_derive; +#[cfg(feature = "serde_derive")] +#[doc(hidden)] +pub use serde_derive::*; diff --git a/vendor/registry-40351f815f426200/serde/src/macros.rs b/vendor/registry-40351f815f426200/serde/src/macros.rs new file mode 100644 index 000000000..57600a535 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/macros.rs @@ -0,0 +1,236 @@ +// Super explicit first paragraph because this shows up at the top level and +// trips up people who are just looking for basic Serialize / Deserialize +// documentation. +// +/// Helper macro when implementing the `Deserializer` part of a new data format +/// for Serde. +/// +/// Some [`Deserializer`] implementations for self-describing formats do not +/// care what hint the [`Visitor`] gives them, they just want to blindly call +/// the [`Visitor`] method corresponding to the data they can tell is in the +/// input. This requires repetitive implementations of all the [`Deserializer`] +/// trait methods. +/// +/// ```edition2018 +/// # use serde::forward_to_deserialize_any; +/// # use serde::de::{value, Deserializer, Visitor}; +/// # +/// # struct MyDeserializer; +/// # +/// # impl<'de> Deserializer<'de> for MyDeserializer { +/// # type Error = value::Error; +/// # +/// # fn deserialize_any(self, _: V) -> Result +/// # where +/// # V: Visitor<'de>, +/// # { +/// # unimplemented!() +/// # } +/// # +/// #[inline] +/// fn deserialize_bool(self, visitor: V) -> Result +/// where +/// V: Visitor<'de>, +/// { +/// self.deserialize_any(visitor) +/// } +/// # +/// # forward_to_deserialize_any! { +/// # i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string +/// # bytes byte_buf option unit unit_struct newtype_struct seq tuple +/// # tuple_struct map struct enum identifier ignored_any +/// # } +/// # } +/// ``` +/// +/// The `forward_to_deserialize_any!` macro implements these simple forwarding +/// methods so that they forward directly to [`Deserializer::deserialize_any`]. +/// You can choose which methods to forward. +/// +/// ```edition2018 +/// # use serde::forward_to_deserialize_any; +/// # use serde::de::{value, Deserializer, Visitor}; +/// # +/// # struct MyDeserializer; +/// # +/// impl<'de> Deserializer<'de> for MyDeserializer { +/// # type Error = value::Error; +/// # +/// fn deserialize_any(self, visitor: V) -> Result +/// where +/// V: Visitor<'de>, +/// { +/// /* ... */ +/// # let _ = visitor; +/// # unimplemented!() +/// } +/// +/// forward_to_deserialize_any! { +/// bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string +/// bytes byte_buf option unit unit_struct newtype_struct seq tuple +/// tuple_struct map struct enum identifier ignored_any +/// } +/// } +/// ``` +/// +/// The macro assumes the convention that your `Deserializer` lifetime parameter +/// is called `'de` and that the `Visitor` type parameters on each method are +/// called `V`. A different type parameter and a different lifetime can be +/// specified explicitly if necessary. +/// +/// ```edition2018 +/// # use std::marker::PhantomData; +/// # +/// # use serde::forward_to_deserialize_any; +/// # use serde::de::{value, Deserializer, Visitor}; +/// # +/// # struct MyDeserializer(PhantomData); +/// # +/// # impl<'q, V> Deserializer<'q> for MyDeserializer { +/// # type Error = value::Error; +/// # +/// # fn deserialize_any(self, visitor: W) -> Result +/// # where +/// # W: Visitor<'q>, +/// # { +/// # unimplemented!() +/// # } +/// # +/// forward_to_deserialize_any! { +/// > +/// bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string +/// bytes byte_buf option unit unit_struct newtype_struct seq tuple +/// tuple_struct map struct enum identifier ignored_any +/// } +/// # } +/// ``` +/// +/// [`Deserializer`]: trait.Deserializer.html +/// [`Visitor`]: de/trait.Visitor.html +/// [`Deserializer::deserialize_any`]: trait.Deserializer.html#tymethod.deserialize_any +#[macro_export(local_inner_macros)] +macro_rules! forward_to_deserialize_any { + (<$visitor:ident: Visitor<$lifetime:tt>> $($func:ident)*) => { + $(forward_to_deserialize_any_helper!{$func<$lifetime, $visitor>})* + }; + // This case must be after the previous one. + ($($func:ident)*) => { + $(forward_to_deserialize_any_helper!{$func<'de, V>})* + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! forward_to_deserialize_any_method { + ($func:ident<$l:tt, $v:ident>($($arg:ident : $ty:ty),*)) => { + #[inline] + fn $func<$v>(self, $($arg: $ty,)* visitor: $v) -> $crate::export::Result<$v::Value, Self::Error> + where + $v: $crate::de::Visitor<$l>, + { + $( + let _ = $arg; + )* + self.deserialize_any(visitor) + } + }; +} + +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! forward_to_deserialize_any_helper { + (bool<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_bool<$l, $v>()} + }; + (i8<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i8<$l, $v>()} + }; + (i16<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i16<$l, $v>()} + }; + (i32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i32<$l, $v>()} + }; + (i64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_i64<$l, $v>()} + }; + (i128<$l:tt, $v:ident>) => { + serde_if_integer128! { + forward_to_deserialize_any_method!{deserialize_i128<$l, $v>()} + } + }; + (u8<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u8<$l, $v>()} + }; + (u16<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u16<$l, $v>()} + }; + (u32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u32<$l, $v>()} + }; + (u64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_u64<$l, $v>()} + }; + (u128<$l:tt, $v:ident>) => { + serde_if_integer128! { + forward_to_deserialize_any_method!{deserialize_u128<$l, $v>()} + } + }; + (f32<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_f32<$l, $v>()} + }; + (f64<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_f64<$l, $v>()} + }; + (char<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_char<$l, $v>()} + }; + (str<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_str<$l, $v>()} + }; + (string<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_string<$l, $v>()} + }; + (bytes<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_bytes<$l, $v>()} + }; + (byte_buf<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_byte_buf<$l, $v>()} + }; + (option<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_option<$l, $v>()} + }; + (unit<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_unit<$l, $v>()} + }; + (unit_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_unit_struct<$l, $v>(name: &'static str)} + }; + (newtype_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_newtype_struct<$l, $v>(name: &'static str)} + }; + (seq<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_seq<$l, $v>()} + }; + (tuple<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_tuple<$l, $v>(len: usize)} + }; + (tuple_struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_tuple_struct<$l, $v>(name: &'static str, len: usize)} + }; + (map<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_map<$l, $v>()} + }; + (struct<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_struct<$l, $v>(name: &'static str, fields: &'static [&'static str])} + }; + (enum<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_enum<$l, $v>(name: &'static str, variants: &'static [&'static str])} + }; + (identifier<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_identifier<$l, $v>()} + }; + (ignored_any<$l:tt, $v:ident>) => { + forward_to_deserialize_any_method!{deserialize_ignored_any<$l, $v>()} + }; +} diff --git a/vendor/registry-40351f815f426200/serde/src/private/de.rs b/vendor/registry-40351f815f426200/serde/src/private/de.rs new file mode 100644 index 000000000..feb3d4c7b --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/private/de.rs @@ -0,0 +1,2935 @@ +use lib::*; + +use de::{Deserialize, DeserializeSeed, Deserializer, Error, IntoDeserializer, Visitor}; + +#[cfg(any(feature = "std", feature = "alloc"))] +use de::{MapAccess, Unexpected}; + +#[cfg(any(feature = "std", feature = "alloc"))] +pub use self::content::{ + Content, ContentDeserializer, ContentRefDeserializer, EnumDeserializer, + InternallyTaggedUnitVisitor, TagContentOtherField, TagContentOtherFieldVisitor, + TagOrContentField, TagOrContentFieldVisitor, TaggedContentVisitor, UntaggedUnitVisitor, +}; + +/// If the missing field is of type `Option` then treat is as `None`, +/// otherwise it is an error. +pub fn missing_field<'de, V, E>(field: &'static str) -> Result +where + V: Deserialize<'de>, + E: Error, +{ + struct MissingFieldDeserializer(&'static str, PhantomData); + + impl<'de, E> Deserializer<'de> for MissingFieldDeserializer + where + E: Error, + { + type Error = E; + + fn deserialize_any(self, _visitor: V) -> Result + where + V: Visitor<'de>, + { + Err(Error::missing_field(self.0)) + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_none() + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + let deserializer = MissingFieldDeserializer(field, PhantomData); + Deserialize::deserialize(deserializer) +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub fn borrow_cow_str<'de: 'a, 'a, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + struct CowStrVisitor; + + impl<'a> Visitor<'a> for CowStrVisitor { + type Value = Cow<'a, str>; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a string") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.to_owned())) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v)) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(Cow::Owned(v)) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => Ok(Cow::Owned(s.to_owned())), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + match str::from_utf8(v) { + Ok(s) => Ok(Cow::Borrowed(s)), + Err(_) => Err(Error::invalid_value(Unexpected::Bytes(v), &self)), + } + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + match String::from_utf8(v) { + Ok(s) => Ok(Cow::Owned(s)), + Err(e) => Err(Error::invalid_value( + Unexpected::Bytes(&e.into_bytes()), + &self, + )), + } + } + } + + deserializer.deserialize_str(CowStrVisitor) +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub fn borrow_cow_bytes<'de: 'a, 'a, D>(deserializer: D) -> Result, D::Error> +where + D: Deserializer<'de>, +{ + struct CowBytesVisitor; + + impl<'a> Visitor<'a> for CowBytesVisitor { + type Value = Cow<'a, [u8]>; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str("a byte array") + } + + fn visit_str(self, v: &str) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.as_bytes().to_vec())) + } + + fn visit_borrowed_str(self, v: &'a str) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v.as_bytes())) + } + + fn visit_string(self, v: String) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.into_bytes())) + } + + fn visit_bytes(self, v: &[u8]) -> Result + where + E: Error, + { + Ok(Cow::Owned(v.to_vec())) + } + + fn visit_borrowed_bytes(self, v: &'a [u8]) -> Result + where + E: Error, + { + Ok(Cow::Borrowed(v)) + } + + fn visit_byte_buf(self, v: Vec) -> Result + where + E: Error, + { + Ok(Cow::Owned(v)) + } + } + + deserializer.deserialize_bytes(CowBytesVisitor) +} + +pub mod size_hint { + use lib::*; + + pub fn from_bounds(iter: &I) -> Option + where + I: Iterator, + { + helper(iter.size_hint()) + } + + #[inline] + pub fn cautious(hint: Option) -> usize { + cmp::min(hint.unwrap_or(0), 4096) + } + + fn helper(bounds: (usize, Option)) -> Option { + match bounds { + (lower, Some(upper)) if lower == upper => Some(upper), + _ => None, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +mod content { + // This module is private and nothing here should be used outside of + // generated code. + // + // We will iterate on the implementation for a few releases and only have to + // worry about backward compatibility for the `untagged` and `tag` attributes + // rather than for this entire mechanism. + // + // This issue is tracking making some of this stuff public: + // https://github.com/serde-rs/serde/issues/741 + + use lib::*; + + use super::size_hint; + use de::{ + self, Deserialize, DeserializeSeed, Deserializer, EnumAccess, Expected, IgnoredAny, + MapAccess, SeqAccess, Unexpected, Visitor, + }; + + /// Used from generated code to buffer the contents of the Deserializer when + /// deserializing untagged enums and internally tagged enums. + /// + /// Not public API. Use serde-value instead. + #[derive(Debug)] + pub enum Content<'de> { + Bool(bool), + + U8(u8), + U16(u16), + U32(u32), + U64(u64), + + I8(i8), + I16(i16), + I32(i32), + I64(i64), + + F32(f32), + F64(f64), + + Char(char), + String(String), + Str(&'de str), + ByteBuf(Vec), + Bytes(&'de [u8]), + + None, + Some(Box>), + + Unit, + Newtype(Box>), + Seq(Vec>), + Map(Vec<(Content<'de>, Content<'de>)>), + } + + impl<'de> Content<'de> { + pub fn as_str(&self) -> Option<&str> { + match *self { + Content::Str(x) => Some(x), + Content::String(ref x) => Some(x), + Content::Bytes(x) => str::from_utf8(x).ok(), + Content::ByteBuf(ref x) => str::from_utf8(x).ok(), + _ => None, + } + } + + #[cold] + fn unexpected(&self) -> Unexpected { + match *self { + Content::Bool(b) => Unexpected::Bool(b), + Content::U8(n) => Unexpected::Unsigned(n as u64), + Content::U16(n) => Unexpected::Unsigned(n as u64), + Content::U32(n) => Unexpected::Unsigned(n as u64), + Content::U64(n) => Unexpected::Unsigned(n), + Content::I8(n) => Unexpected::Signed(n as i64), + Content::I16(n) => Unexpected::Signed(n as i64), + Content::I32(n) => Unexpected::Signed(n as i64), + Content::I64(n) => Unexpected::Signed(n), + Content::F32(f) => Unexpected::Float(f as f64), + Content::F64(f) => Unexpected::Float(f), + Content::Char(c) => Unexpected::Char(c), + Content::String(ref s) => Unexpected::Str(s), + Content::Str(s) => Unexpected::Str(s), + Content::ByteBuf(ref b) => Unexpected::Bytes(b), + Content::Bytes(b) => Unexpected::Bytes(b), + Content::None | Content::Some(_) => Unexpected::Option, + Content::Unit => Unexpected::Unit, + Content::Newtype(_) => Unexpected::NewtypeStruct, + Content::Seq(_) => Unexpected::Seq, + Content::Map(_) => Unexpected::Map, + } + } + } + + impl<'de> Deserialize<'de> for Content<'de> { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Untagged and internally tagged enums are only supported in + // self-describing formats. + let visitor = ContentVisitor { value: PhantomData }; + deserializer.deserialize_any(visitor) + } + } + + struct ContentVisitor<'de> { + value: PhantomData>, + } + + impl<'de> ContentVisitor<'de> { + fn new() -> Self { + ContentVisitor { value: PhantomData } + } + } + + impl<'de> Visitor<'de> for ContentVisitor<'de> { + type Value = Content<'de>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.write_str("any value") + } + + fn visit_bool(self, value: bool) -> Result + where + F: de::Error, + { + Ok(Content::Bool(value)) + } + + fn visit_i8(self, value: i8) -> Result + where + F: de::Error, + { + Ok(Content::I8(value)) + } + + fn visit_i16(self, value: i16) -> Result + where + F: de::Error, + { + Ok(Content::I16(value)) + } + + fn visit_i32(self, value: i32) -> Result + where + F: de::Error, + { + Ok(Content::I32(value)) + } + + fn visit_i64(self, value: i64) -> Result + where + F: de::Error, + { + Ok(Content::I64(value)) + } + + fn visit_u8(self, value: u8) -> Result + where + F: de::Error, + { + Ok(Content::U8(value)) + } + + fn visit_u16(self, value: u16) -> Result + where + F: de::Error, + { + Ok(Content::U16(value)) + } + + fn visit_u32(self, value: u32) -> Result + where + F: de::Error, + { + Ok(Content::U32(value)) + } + + fn visit_u64(self, value: u64) -> Result + where + F: de::Error, + { + Ok(Content::U64(value)) + } + + fn visit_f32(self, value: f32) -> Result + where + F: de::Error, + { + Ok(Content::F32(value)) + } + + fn visit_f64(self, value: f64) -> Result + where + F: de::Error, + { + Ok(Content::F64(value)) + } + + fn visit_char(self, value: char) -> Result + where + F: de::Error, + { + Ok(Content::Char(value)) + } + + fn visit_str(self, value: &str) -> Result + where + F: de::Error, + { + Ok(Content::String(value.into())) + } + + fn visit_borrowed_str(self, value: &'de str) -> Result + where + F: de::Error, + { + Ok(Content::Str(value)) + } + + fn visit_string(self, value: String) -> Result + where + F: de::Error, + { + Ok(Content::String(value)) + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + F: de::Error, + { + Ok(Content::ByteBuf(value.into())) + } + + fn visit_borrowed_bytes(self, value: &'de [u8]) -> Result + where + F: de::Error, + { + Ok(Content::Bytes(value)) + } + + fn visit_byte_buf(self, value: Vec) -> Result + where + F: de::Error, + { + Ok(Content::ByteBuf(value)) + } + + fn visit_unit(self) -> Result + where + F: de::Error, + { + Ok(Content::Unit) + } + + fn visit_none(self) -> Result + where + F: de::Error, + { + Ok(Content::None) + } + + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map(|v| Content::Some(Box::new(v))) + } + + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Deserialize::deserialize(deserializer).map(|v| Content::Newtype(Box::new(v))) + } + + fn visit_seq(self, mut visitor: V) -> Result + where + V: SeqAccess<'de>, + { + let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint())); + while let Some(e) = try!(visitor.next_element()) { + vec.push(e); + } + Ok(Content::Seq(vec)) + } + + fn visit_map(self, mut visitor: V) -> Result + where + V: MapAccess<'de>, + { + let mut vec = Vec::with_capacity(size_hint::cautious(visitor.size_hint())); + while let Some(kv) = try!(visitor.next_entry()) { + vec.push(kv); + } + Ok(Content::Map(vec)) + } + + fn visit_enum(self, _visitor: V) -> Result + where + V: EnumAccess<'de>, + { + Err(de::Error::custom( + "untagged and internally tagged enums do not support enum input", + )) + } + } + + /// This is the type of the map keys in an internally tagged enum. + /// + /// Not public API. + pub enum TagOrContent<'de> { + Tag, + Content(Content<'de>), + } + + struct TagOrContentVisitor<'de> { + name: &'static str, + value: PhantomData>, + } + + impl<'de> TagOrContentVisitor<'de> { + fn new(name: &'static str) -> Self { + TagOrContentVisitor { + name: name, + value: PhantomData, + } + } + } + + impl<'de> DeserializeSeed<'de> for TagOrContentVisitor<'de> { + type Value = TagOrContent<'de>; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Internally tagged enums are only supported in self-describing + // formats. + deserializer.deserialize_any(self) + } + } + + impl<'de> Visitor<'de> for TagOrContentVisitor<'de> { + type Value = TagOrContent<'de>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + write!(fmt, "a type tag `{}` or any other value", self.name) + } + + fn visit_bool(self, value: bool) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_bool(value) + .map(TagOrContent::Content) + } + + fn visit_i8(self, value: i8) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i8(value) + .map(TagOrContent::Content) + } + + fn visit_i16(self, value: i16) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i16(value) + .map(TagOrContent::Content) + } + + fn visit_i32(self, value: i32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i32(value) + .map(TagOrContent::Content) + } + + fn visit_i64(self, value: i64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_i64(value) + .map(TagOrContent::Content) + } + + fn visit_u8(self, value: u8) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u8(value) + .map(TagOrContent::Content) + } + + fn visit_u16(self, value: u16) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u16(value) + .map(TagOrContent::Content) + } + + fn visit_u32(self, value: u32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u32(value) + .map(TagOrContent::Content) + } + + fn visit_u64(self, value: u64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_u64(value) + .map(TagOrContent::Content) + } + + fn visit_f32(self, value: f32) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_f32(value) + .map(TagOrContent::Content) + } + + fn visit_f64(self, value: f64) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_f64(value) + .map(TagOrContent::Content) + } + + fn visit_char(self, value: char) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_char(value) + .map(TagOrContent::Content) + } + + fn visit_str(self, value: &str) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_str(value) + .map(TagOrContent::Content) + } + } + + fn visit_borrowed_str(self, value: &'de str) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_borrowed_str(value) + .map(TagOrContent::Content) + } + } + + fn visit_string(self, value: String) -> Result + where + F: de::Error, + { + if value == self.name { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_string(value) + .map(TagOrContent::Content) + } + } + + fn visit_bytes(self, value: &[u8]) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_bytes(value) + .map(TagOrContent::Content) + } + } + + fn visit_borrowed_bytes(self, value: &'de [u8]) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_borrowed_bytes(value) + .map(TagOrContent::Content) + } + } + + fn visit_byte_buf(self, value: Vec) -> Result + where + F: de::Error, + { + if value == self.name.as_bytes() { + Ok(TagOrContent::Tag) + } else { + ContentVisitor::new() + .visit_byte_buf(value) + .map(TagOrContent::Content) + } + } + + fn visit_unit(self) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_unit() + .map(TagOrContent::Content) + } + + fn visit_none(self) -> Result + where + F: de::Error, + { + ContentVisitor::new() + .visit_none() + .map(TagOrContent::Content) + } + + fn visit_some(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + ContentVisitor::new() + .visit_some(deserializer) + .map(TagOrContent::Content) + } + + fn visit_newtype_struct(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + ContentVisitor::new() + .visit_newtype_struct(deserializer) + .map(TagOrContent::Content) + } + + fn visit_seq(self, visitor: V) -> Result + where + V: SeqAccess<'de>, + { + ContentVisitor::new() + .visit_seq(visitor) + .map(TagOrContent::Content) + } + + fn visit_map(self, visitor: V) -> Result + where + V: MapAccess<'de>, + { + ContentVisitor::new() + .visit_map(visitor) + .map(TagOrContent::Content) + } + + fn visit_enum(self, visitor: V) -> Result + where + V: EnumAccess<'de>, + { + ContentVisitor::new() + .visit_enum(visitor) + .map(TagOrContent::Content) + } + } + + /// Used by generated code to deserialize an internally tagged enum. + /// + /// Not public API. + pub struct TaggedContent<'de, T> { + pub tag: T, + pub content: Content<'de>, + } + + /// Not public API. + pub struct TaggedContentVisitor<'de, T> { + tag_name: &'static str, + value: PhantomData>, + } + + impl<'de, T> TaggedContentVisitor<'de, T> { + /// Visitor for the content of an internally tagged enum with the given + /// tag name. + pub fn new(name: &'static str) -> Self { + TaggedContentVisitor { + tag_name: name, + value: PhantomData, + } + } + } + + impl<'de, T> DeserializeSeed<'de> for TaggedContentVisitor<'de, T> + where + T: Deserialize<'de>, + { + type Value = TaggedContent<'de, T>; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + // Internally tagged enums are only supported in self-describing + // formats. + deserializer.deserialize_any(self) + } + } + + impl<'de, T> Visitor<'de> for TaggedContentVisitor<'de, T> + where + T: Deserialize<'de>, + { + type Value = TaggedContent<'de, T>; + + fn expecting(&self, fmt: &mut fmt::Formatter) -> fmt::Result { + fmt.write_str("internally tagged enum") + } + + fn visit_seq(self, mut seq: S) -> Result + where + S: SeqAccess<'de>, + { + let tag = match try!(seq.next_element()) { + Some(tag) => tag, + None => { + return Err(de::Error::missing_field(self.tag_name)); + } + }; + let rest = de::value::SeqAccessDeserializer::new(seq); + Ok(TaggedContent { + tag: tag, + content: try!(Content::deserialize(rest)), + }) + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'de>, + { + let mut tag = None; + let mut vec = Vec::with_capacity(size_hint::cautious(map.size_hint())); + while let Some(k) = try!(map.next_key_seed(TagOrContentVisitor::new(self.tag_name))) { + match k { + TagOrContent::Tag => { + if tag.is_some() { + return Err(de::Error::duplicate_field(self.tag_name)); + } + tag = Some(try!(map.next_value())); + } + TagOrContent::Content(k) => { + let v = try!(map.next_value()); + vec.push((k, v)); + } + } + } + match tag { + None => Err(de::Error::missing_field(self.tag_name)), + Some(tag) => Ok(TaggedContent { + tag: tag, + content: Content::Map(vec), + }), + } + } + } + + /// Used by generated code to deserialize an adjacently tagged enum. + /// + /// Not public API. + pub enum TagOrContentField { + Tag, + Content, + } + + /// Not public API. + pub struct TagOrContentFieldVisitor { + pub tag: &'static str, + pub content: &'static str, + } + + impl<'de> DeserializeSeed<'de> for TagOrContentFieldVisitor { + type Value = TagOrContentField; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(self) + } + } + + impl<'de> Visitor<'de> for TagOrContentFieldVisitor { + type Value = TagOrContentField; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!(formatter, "{:?} or {:?}", self.tag, self.content) + } + + fn visit_str(self, field: &str) -> Result + where + E: de::Error, + { + if field == self.tag { + Ok(TagOrContentField::Tag) + } else if field == self.content { + Ok(TagOrContentField::Content) + } else { + Err(de::Error::invalid_value(Unexpected::Str(field), &self)) + } + } + } + + /// Used by generated code to deserialize an adjacently tagged enum when + /// ignoring unrelated fields is allowed. + /// + /// Not public API. + pub enum TagContentOtherField { + Tag, + Content, + Other, + } + + /// Not public API. + pub struct TagContentOtherFieldVisitor { + pub tag: &'static str, + pub content: &'static str, + } + + impl<'de> DeserializeSeed<'de> for TagContentOtherFieldVisitor { + type Value = TagContentOtherField; + + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + deserializer.deserialize_str(self) + } + } + + impl<'de> Visitor<'de> for TagContentOtherFieldVisitor { + type Value = TagContentOtherField; + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!( + formatter, + "{:?}, {:?}, or other ignored fields", + self.tag, self.content + ) + } + + fn visit_str(self, field: &str) -> Result + where + E: de::Error, + { + if field == self.tag { + Ok(TagContentOtherField::Tag) + } else if field == self.content { + Ok(TagContentOtherField::Content) + } else { + Ok(TagContentOtherField::Other) + } + } + } + + /// Not public API + pub struct ContentDeserializer<'de, E> { + content: Content<'de>, + err: PhantomData, + } + + impl<'de, E> ContentDeserializer<'de, E> + where + E: de::Error, + { + #[cold] + fn invalid_type(self, exp: &Expected) -> E { + de::Error::invalid_type(self.content.unexpected(), exp) + } + + fn deserialize_integer(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + } + + fn visit_content_seq<'de, V, E>(content: Vec>, visitor: V) -> Result + where + V: Visitor<'de>, + E: de::Error, + { + let seq = content.into_iter().map(ContentDeserializer::new); + let mut seq_visitor = de::value::SeqDeserializer::new(seq); + let value = try!(visitor.visit_seq(&mut seq_visitor)); + try!(seq_visitor.end()); + Ok(value) + } + + fn visit_content_map<'de, V, E>( + content: Vec<(Content<'de>, Content<'de>)>, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + E: de::Error, + { + let map = content + .into_iter() + .map(|(k, v)| (ContentDeserializer::new(k), ContentDeserializer::new(v))); + let mut map_visitor = de::value::MapDeserializer::new(map); + let value = try!(visitor.visit_map(&mut map_visitor)); + try!(map_visitor.end()); + Ok(value) + } + + /// Used when deserializing an internally tagged enum because the content + /// will be used exactly once. + impl<'de, E> Deserializer<'de> for ContentDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Bool(v) => visitor.visit_bool(v), + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::Char(v) => visitor.visit_char(v), + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(v) => visitor.visit_byte_buf(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Unit => visitor.visit_unit(), + Content::None => visitor.visit_none(), + Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), + Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)), + Content::Seq(v) => visit_content_seq(v, visitor), + Content::Map(v) => visit_content_map(v, visitor), + } + } + + fn deserialize_bool(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Bool(v) => visitor.visit_bool(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_i8(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i16(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u8(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u16(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_f32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_f64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::F64(v) => visitor.visit_f64(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_char(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Char(v) => visitor.visit_char(v), + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_str(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_string(visitor) + } + + fn deserialize_string(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(v) => visitor.visit_byte_buf(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_bytes(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_byte_buf(visitor) + } + + fn deserialize_byte_buf(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(v) => visitor.visit_byte_buf(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Seq(v) => visit_content_seq(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::None => visitor.visit_none(), + Content::Some(v) => visitor.visit_some(ContentDeserializer::new(*v)), + Content::Unit => visitor.visit_unit(), + _ => visitor.visit_some(self), + } + } + + fn deserialize_unit(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Unit => visitor.visit_unit(), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_unit_struct( + self, + _name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + match self.content { + // As a special case, allow deserializing untagged newtype + // variant containing unit struct. + // + // #[derive(Deserialize)] + // struct Info; + // + // #[derive(Deserialize)] + // #[serde(tag = "topic")] + // enum Message { + // Info(Info), + // } + // + // We want {"topic":"Info"} to deserialize even though + // ordinarily unit structs do not deserialize from empty map. + Content::Map(ref v) if v.is_empty() => visitor.visit_unit(), + _ => self.deserialize_any(visitor), + } + } + + fn deserialize_newtype_struct( + self, + _name: &str, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Newtype(v) => visitor.visit_newtype_struct(ContentDeserializer::new(*v)), + _ => visitor.visit_newtype_struct(self), + } + } + + fn deserialize_seq(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Seq(v) => visit_content_seq(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_tuple(self, _len: usize, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_seq(visitor) + } + + fn deserialize_tuple_struct( + self, + _name: &'static str, + _len: usize, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + self.deserialize_seq(visitor) + } + + fn deserialize_map(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Map(v) => visit_content_map(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_struct( + self, + _name: &'static str, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::Seq(v) => visit_content_seq(v, visitor), + Content::Map(v) => visit_content_map(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + let (variant, value) = match self.content { + Content::Map(value) => { + let mut iter = value.into_iter(); + let (variant, value) = match iter.next() { + Some(v) => v, + None => { + return Err(de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + )); + } + }; + // enums are encoded in json as maps with a single key:value pair + if iter.next().is_some() { + return Err(de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + )); + } + (variant, Some(value)) + } + s @ Content::String(_) | s @ Content::Str(_) => (s, None), + other => { + return Err(de::Error::invalid_type( + other.unexpected(), + &"string or map", + )); + } + }; + + visitor.visit_enum(EnumDeserializer::new(variant, value)) + } + + fn deserialize_identifier(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match self.content { + Content::String(v) => visitor.visit_string(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(v) => visitor.visit_byte_buf(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::U8(v) => visitor.visit_u8(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_ignored_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + drop(self); + visitor.visit_unit() + } + } + + impl<'de, E> ContentDeserializer<'de, E> { + /// private API, don't use + pub fn new(content: Content<'de>) -> Self { + ContentDeserializer { + content: content, + err: PhantomData, + } + } + } + + pub struct EnumDeserializer<'de, E> + where + E: de::Error, + { + variant: Content<'de>, + value: Option>, + err: PhantomData, + } + + impl<'de, E> EnumDeserializer<'de, E> + where + E: de::Error, + { + pub fn new(variant: Content<'de>, value: Option>) -> EnumDeserializer<'de, E> { + EnumDeserializer { + variant: variant, + value: value, + err: PhantomData, + } + } + } + + impl<'de, E> de::EnumAccess<'de> for EnumDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + type Variant = VariantDeserializer<'de, Self::Error>; + + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), E> + where + V: de::DeserializeSeed<'de>, + { + let visitor = VariantDeserializer { + value: self.value, + err: PhantomData, + }; + seed.deserialize(ContentDeserializer::new(self.variant)) + .map(|v| (v, visitor)) + } + } + + pub struct VariantDeserializer<'de, E> + where + E: de::Error, + { + value: Option>, + err: PhantomData, + } + + impl<'de, E> de::VariantAccess<'de> for VariantDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn unit_variant(self) -> Result<(), E> { + match self.value { + Some(value) => de::Deserialize::deserialize(ContentDeserializer::new(value)), + None => Ok(()), + } + } + + fn newtype_variant_seed(self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value { + Some(value) => seed.deserialize(ContentDeserializer::new(value)), + None => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"newtype variant", + )), + } + } + + fn tuple_variant(self, _len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(Content::Seq(v)) => { + de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type( + other.unexpected(), + &"tuple variant", + )), + None => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"tuple variant", + )), + } + } + + fn struct_variant( + self, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(Content::Map(v)) => { + de::Deserializer::deserialize_any(MapDeserializer::new(v), visitor) + } + Some(Content::Seq(v)) => { + de::Deserializer::deserialize_any(SeqDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type( + other.unexpected(), + &"struct variant", + )), + _ => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"struct variant", + )), + } + } + } + + struct SeqDeserializer<'de, E> + where + E: de::Error, + { + iter: > as IntoIterator>::IntoIter, + err: PhantomData, + } + + impl<'de, E> SeqDeserializer<'de, E> + where + E: de::Error, + { + fn new(vec: Vec>) -> Self { + SeqDeserializer { + iter: vec.into_iter(), + err: PhantomData, + } + } + } + + impl<'de, E> de::Deserializer<'de> for SeqDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let len = self.iter.len(); + if len == 0 { + visitor.visit_unit() + } else { + let ret = try!(visitor.visit_seq(&mut self)); + let remaining = self.iter.len(); + if remaining == 0 { + Ok(ret) + } else { + Err(de::Error::invalid_length(len, &"fewer elements in array")) + } + } + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, E> de::SeqAccess<'de> for SeqDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(value) => seed.deserialize(ContentDeserializer::new(value)).map(Some), + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + struct MapDeserializer<'de, E> + where + E: de::Error, + { + iter: , Content<'de>)> as IntoIterator>::IntoIter, + value: Option>, + err: PhantomData, + } + + impl<'de, E> MapDeserializer<'de, E> + where + E: de::Error, + { + fn new(map: Vec<(Content<'de>, Content<'de>)>) -> Self { + MapDeserializer { + iter: map.into_iter(), + value: None, + err: PhantomData, + } + } + } + + impl<'de, E> de::MapAccess<'de> for MapDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some((key, value)) => { + self.value = Some(value); + seed.deserialize(ContentDeserializer::new(key)).map(Some) + } + None => Ok(None), + } + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value.take() { + Some(value) => seed.deserialize(ContentDeserializer::new(value)), + None => Err(de::Error::custom("value is missing")), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + impl<'de, E> de::Deserializer<'de> for MapDeserializer<'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_map(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + /// Not public API. + pub struct ContentRefDeserializer<'a, 'de: 'a, E> { + content: &'a Content<'de>, + err: PhantomData, + } + + impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + #[cold] + fn invalid_type(self, exp: &Expected) -> E { + de::Error::invalid_type(self.content.unexpected(), exp) + } + + fn deserialize_integer(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + } + + fn visit_content_seq_ref<'a, 'de, V, E>( + content: &'a [Content<'de>], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + E: de::Error, + { + let seq = content.iter().map(ContentRefDeserializer::new); + let mut seq_visitor = de::value::SeqDeserializer::new(seq); + let value = try!(visitor.visit_seq(&mut seq_visitor)); + try!(seq_visitor.end()); + Ok(value) + } + + fn visit_content_map_ref<'a, 'de, V, E>( + content: &'a [(Content<'de>, Content<'de>)], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + E: de::Error, + { + let map = content.iter().map(|&(ref k, ref v)| { + ( + ContentRefDeserializer::new(k), + ContentRefDeserializer::new(v), + ) + }); + let mut map_visitor = de::value::MapDeserializer::new(map); + let value = try!(visitor.visit_map(&mut map_visitor)); + try!(map_visitor.end()); + Ok(value) + } + + /// Used when deserializing an untagged enum because the content may need + /// to be used more than once. + impl<'de, 'a, E> Deserializer<'de> for ContentRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Bool(v) => visitor.visit_bool(v), + Content::U8(v) => visitor.visit_u8(v), + Content::U16(v) => visitor.visit_u16(v), + Content::U32(v) => visitor.visit_u32(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I8(v) => visitor.visit_i8(v), + Content::I16(v) => visitor.visit_i16(v), + Content::I32(v) => visitor.visit_i32(v), + Content::I64(v) => visitor.visit_i64(v), + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::Char(v) => visitor.visit_char(v), + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(ref v) => visitor.visit_bytes(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Unit => visitor.visit_unit(), + Content::None => visitor.visit_none(), + Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), + Content::Newtype(ref v) => { + visitor.visit_newtype_struct(ContentRefDeserializer::new(v)) + } + Content::Seq(ref v) => visit_content_seq_ref(v, visitor), + Content::Map(ref v) => visit_content_map_ref(v, visitor), + } + } + + fn deserialize_bool(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Bool(v) => visitor.visit_bool(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_i8(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i16(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_i64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u8(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u16(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_u64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_integer(visitor) + } + + fn deserialize_f32(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::F32(v) => visitor.visit_f32(v), + Content::F64(v) => visitor.visit_f64(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_f64(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::F64(v) => visitor.visit_f64(v), + Content::U64(v) => visitor.visit_u64(v), + Content::I64(v) => visitor.visit_i64(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_char(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Char(v) => visitor.visit_char(v), + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_str(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(ref v) => visitor.visit_bytes(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_string(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_str(visitor) + } + + fn deserialize_bytes(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(ref v) => visitor.visit_bytes(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::Seq(ref v) => visit_content_seq_ref(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_byte_buf(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_bytes(visitor) + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::None => visitor.visit_none(), + Content::Some(ref v) => visitor.visit_some(ContentRefDeserializer::new(v)), + Content::Unit => visitor.visit_unit(), + _ => visitor.visit_some(self), + } + } + + fn deserialize_unit(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Unit => visitor.visit_unit(), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_unit_struct( + self, + _name: &'static str, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + self.deserialize_unit(visitor) + } + + fn deserialize_newtype_struct(self, _name: &str, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Newtype(ref v) => { + visitor.visit_newtype_struct(ContentRefDeserializer::new(v)) + } + _ => visitor.visit_newtype_struct(self), + } + } + + fn deserialize_seq(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Seq(ref v) => visit_content_seq_ref(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_tuple(self, _len: usize, visitor: V) -> Result + where + V: Visitor<'de>, + { + self.deserialize_seq(visitor) + } + + fn deserialize_tuple_struct( + self, + _name: &'static str, + _len: usize, + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + self.deserialize_seq(visitor) + } + + fn deserialize_map(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Map(ref v) => visit_content_map_ref(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_struct( + self, + _name: &'static str, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::Seq(ref v) => visit_content_seq_ref(v, visitor), + Content::Map(ref v) => visit_content_map_ref(v, visitor), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_enum( + self, + _name: &str, + _variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + let (variant, value) = match *self.content { + Content::Map(ref value) => { + let mut iter = value.iter(); + let &(ref variant, ref value) = match iter.next() { + Some(v) => v, + None => { + return Err(de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + )); + } + }; + // enums are encoded in json as maps with a single key:value pair + if iter.next().is_some() { + return Err(de::Error::invalid_value( + de::Unexpected::Map, + &"map with a single key", + )); + } + (variant, Some(value)) + } + ref s @ Content::String(_) | ref s @ Content::Str(_) => (s, None), + ref other => { + return Err(de::Error::invalid_type( + other.unexpected(), + &"string or map", + )); + } + }; + + visitor.visit_enum(EnumRefDeserializer { + variant: variant, + value: value, + err: PhantomData, + }) + } + + fn deserialize_identifier(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match *self.content { + Content::String(ref v) => visitor.visit_str(v), + Content::Str(v) => visitor.visit_borrowed_str(v), + Content::ByteBuf(ref v) => visitor.visit_bytes(v), + Content::Bytes(v) => visitor.visit_borrowed_bytes(v), + Content::U8(v) => visitor.visit_u8(v), + _ => Err(self.invalid_type(&visitor)), + } + } + + fn deserialize_ignored_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_unit() + } + } + + impl<'a, 'de, E> ContentRefDeserializer<'a, 'de, E> { + /// private API, don't use + pub fn new(content: &'a Content<'de>) -> Self { + ContentRefDeserializer { + content: content, + err: PhantomData, + } + } + } + + struct EnumRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + variant: &'a Content<'de>, + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'de, 'a, E> de::EnumAccess<'de> for EnumRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + type Variant = VariantRefDeserializer<'a, 'de, Self::Error>; + + fn variant_seed(self, seed: V) -> Result<(V::Value, Self::Variant), Self::Error> + where + V: de::DeserializeSeed<'de>, + { + let visitor = VariantRefDeserializer { + value: self.value, + err: PhantomData, + }; + seed.deserialize(ContentRefDeserializer::new(self.variant)) + .map(|v| (v, visitor)) + } + } + + struct VariantRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'de, 'a, E> de::VariantAccess<'de> for VariantRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn unit_variant(self) -> Result<(), E> { + match self.value { + Some(value) => de::Deserialize::deserialize(ContentRefDeserializer::new(value)), + None => Ok(()), + } + } + + fn newtype_variant_seed(self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"newtype variant", + )), + } + } + + fn tuple_variant(self, _len: usize, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(&Content::Seq(ref v)) => { + de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type( + other.unexpected(), + &"tuple variant", + )), + None => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"tuple variant", + )), + } + } + + fn struct_variant( + self, + _fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + match self.value { + Some(&Content::Map(ref v)) => { + de::Deserializer::deserialize_any(MapRefDeserializer::new(v), visitor) + } + Some(&Content::Seq(ref v)) => { + de::Deserializer::deserialize_any(SeqRefDeserializer::new(v), visitor) + } + Some(other) => Err(de::Error::invalid_type( + other.unexpected(), + &"struct variant", + )), + _ => Err(de::Error::invalid_type( + de::Unexpected::UnitVariant, + &"struct variant", + )), + } + } + } + + struct SeqRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + iter: <&'a [Content<'de>] as IntoIterator>::IntoIter, + err: PhantomData, + } + + impl<'a, 'de, E> SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + fn new(slice: &'a [Content<'de>]) -> Self { + SeqRefDeserializer { + iter: slice.iter(), + err: PhantomData, + } + } + } + + impl<'de, 'a, E> de::Deserializer<'de> for SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + let len = self.iter.len(); + if len == 0 { + visitor.visit_unit() + } else { + let ret = try!(visitor.visit_seq(&mut self)); + let remaining = self.iter.len(); + if remaining == 0 { + Ok(ret) + } else { + Err(de::Error::invalid_length(len, &"fewer elements in array")) + } + } + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, 'a, E> de::SeqAccess<'de> for SeqRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_element_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(value) => seed + .deserialize(ContentRefDeserializer::new(value)) + .map(Some), + None => Ok(None), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + struct MapRefDeserializer<'a, 'de: 'a, E> + where + E: de::Error, + { + iter: <&'a [(Content<'de>, Content<'de>)] as IntoIterator>::IntoIter, + value: Option<&'a Content<'de>>, + err: PhantomData, + } + + impl<'a, 'de, E> MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + fn new(map: &'a [(Content<'de>, Content<'de>)]) -> Self { + MapRefDeserializer { + iter: map.iter(), + value: None, + err: PhantomData, + } + } + } + + impl<'de, 'a, E> de::MapAccess<'de> for MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: de::DeserializeSeed<'de>, + { + match self.iter.next() { + Some(&(ref key, ref value)) => { + self.value = Some(value); + seed.deserialize(ContentRefDeserializer::new(key)).map(Some) + } + None => Ok(None), + } + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: de::DeserializeSeed<'de>, + { + match self.value.take() { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => Err(de::Error::custom("value is missing")), + } + } + + fn size_hint(&self) -> Option { + size_hint::from_bounds(&self.iter) + } + } + + impl<'de, 'a, E> de::Deserializer<'de> for MapRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Error = E; + + #[inline] + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_map(self) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } + } + + impl<'de, E> de::IntoDeserializer<'de, E> for ContentDeserializer<'de, E> + where + E: de::Error, + { + type Deserializer = Self; + + fn into_deserializer(self) -> Self { + self + } + } + + impl<'de, 'a, E> de::IntoDeserializer<'de, E> for ContentRefDeserializer<'a, 'de, E> + where + E: de::Error, + { + type Deserializer = Self; + + fn into_deserializer(self) -> Self { + self + } + } + + /// Visitor for deserializing an internally tagged unit variant. + /// + /// Not public API. + pub struct InternallyTaggedUnitVisitor<'a> { + type_name: &'a str, + variant_name: &'a str, + } + + impl<'a> InternallyTaggedUnitVisitor<'a> { + /// Not public API. + pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { + InternallyTaggedUnitVisitor { + type_name: type_name, + variant_name: variant_name, + } + } + } + + impl<'de, 'a> Visitor<'de> for InternallyTaggedUnitVisitor<'a> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!( + formatter, + "unit variant {}::{}", + self.type_name, self.variant_name + ) + } + + fn visit_seq(self, _: S) -> Result<(), S::Error> + where + S: SeqAccess<'de>, + { + Ok(()) + } + + fn visit_map(self, mut access: M) -> Result<(), M::Error> + where + M: MapAccess<'de>, + { + while let Some(_) = try!(access.next_entry::()) {} + Ok(()) + } + } + + /// Visitor for deserializing an untagged unit variant. + /// + /// Not public API. + pub struct UntaggedUnitVisitor<'a> { + type_name: &'a str, + variant_name: &'a str, + } + + impl<'a> UntaggedUnitVisitor<'a> { + /// Not public API. + pub fn new(type_name: &'a str, variant_name: &'a str) -> Self { + UntaggedUnitVisitor { + type_name: type_name, + variant_name: variant_name, + } + } + } + + impl<'de, 'a> Visitor<'de> for UntaggedUnitVisitor<'a> { + type Value = (); + + fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + write!( + formatter, + "unit variant {}::{}", + self.type_name, self.variant_name + ) + } + + fn visit_unit(self) -> Result<(), E> + where + E: de::Error, + { + Ok(()) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +// Like `IntoDeserializer` but also implemented for `&[u8]`. This is used for +// the newtype fallthrough case of `field_identifier`. +// +// #[derive(Deserialize)] +// #[serde(field_identifier)] +// enum F { +// A, +// B, +// Other(String), // deserialized using IdentifierDeserializer +// } +pub trait IdentifierDeserializer<'de, E: Error> { + type Deserializer: Deserializer<'de, Error = E>; + + fn from(self) -> Self::Deserializer; +} + +impl<'de, E> IdentifierDeserializer<'de, E> for u32 +where + E: Error, +{ + type Deserializer = >::Deserializer; + + fn from(self) -> Self::Deserializer { + self.into_deserializer() + } +} + +pub struct StrDeserializer<'a, E> { + value: &'a str, + marker: PhantomData, +} + +impl<'a, E> IdentifierDeserializer<'a, E> for &'a str +where + E: Error, +{ + type Deserializer = StrDeserializer<'a, E>; + + fn from(self) -> Self::Deserializer { + StrDeserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, 'a, E> Deserializer<'de> for StrDeserializer<'a, E> +where + E: Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_str(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } +} + +pub struct BytesDeserializer<'a, E> { + value: &'a [u8], + marker: PhantomData, +} + +impl<'a, E> IdentifierDeserializer<'a, E> for &'a [u8] +where + E: Error, +{ + type Deserializer = BytesDeserializer<'a, E>; + + fn from(self) -> Self::Deserializer { + BytesDeserializer { + value: self, + marker: PhantomData, + } + } +} + +impl<'de, 'a, E> Deserializer<'de> for BytesDeserializer<'a, E> +where + E: Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_bytes(self.value) + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 i128 u8 u16 u32 u64 u128 f32 f64 char str string + bytes byte_buf option unit unit_struct newtype_struct seq tuple + tuple_struct map struct enum identifier ignored_any + } +} + +/// A DeserializeSeed helper for implementing deserialize_in_place Visitors. +/// +/// Wraps a mutable reference and calls deserialize_in_place on it. +pub struct InPlaceSeed<'a, T: 'a>(pub &'a mut T); + +impl<'a, 'de, T> DeserializeSeed<'de> for InPlaceSeed<'a, T> +where + T: Deserialize<'de>, +{ + type Value = (); + fn deserialize(self, deserializer: D) -> Result + where + D: Deserializer<'de>, + { + T::deserialize_in_place(deserializer, self.0) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapDeserializer<'a, 'de: 'a, E>( + pub &'a mut Vec, Content<'de>)>>, + pub PhantomData, +); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> FlatMapDeserializer<'a, 'de, E> +where + E: Error, +{ + fn deserialize_other() -> Result { + Err(Error::custom("can only flatten structs and maps")) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! forward_to_deserialize_other { + ($($func:ident ( $($arg:ty),* ))*) => { + $( + fn $func(self, $(_: $arg,)* _visitor: V) -> Result + where + V: Visitor<'de>, + { + Self::deserialize_other() + } + )* + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> Deserializer<'de> for FlatMapDeserializer<'a, 'de, E> +where + E: Error, +{ + type Error = E; + + fn deserialize_any(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_map(FlatInternallyTaggedAccess { + iter: self.0.iter_mut(), + pending: None, + _marker: PhantomData, + }) + } + + fn deserialize_enum( + self, + name: &'static str, + variants: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + for item in self.0.iter_mut() { + // items in the vector are nulled out when used. So we can only use + // an item if it's still filled in and if the field is one we care + // about. + let use_item = match *item { + None => false, + Some((ref c, _)) => c.as_str().map_or(false, |x| variants.contains(&x)), + }; + + if use_item { + let (key, value) = item.take().unwrap(); + return visitor.visit_enum(EnumDeserializer::new(key, Some(value))); + } + } + + Err(Error::custom(format_args!( + "no variant of enum {} found in flattened data", + name + ))) + } + + fn deserialize_map(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_map(FlatMapAccess::new(self.0.iter())) + } + + fn deserialize_struct( + self, + _: &'static str, + fields: &'static [&'static str], + visitor: V, + ) -> Result + where + V: Visitor<'de>, + { + visitor.visit_map(FlatStructAccess::new(self.0.iter_mut(), fields)) + } + + fn deserialize_newtype_struct(self, _name: &str, visitor: V) -> Result + where + V: Visitor<'de>, + { + visitor.visit_newtype_struct(self) + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: Visitor<'de>, + { + match visitor.__private_visit_untagged_option(self) { + Ok(value) => Ok(value), + Err(()) => Self::deserialize_other(), + } + } + + forward_to_deserialize_other! { + deserialize_bool() + deserialize_i8() + deserialize_i16() + deserialize_i32() + deserialize_i64() + deserialize_u8() + deserialize_u16() + deserialize_u32() + deserialize_u64() + deserialize_f32() + deserialize_f64() + deserialize_char() + deserialize_str() + deserialize_string() + deserialize_bytes() + deserialize_byte_buf() + deserialize_unit() + deserialize_unit_struct(&'static str) + deserialize_seq() + deserialize_tuple(usize) + deserialize_tuple_struct(&'static str, usize) + deserialize_identifier() + deserialize_ignored_any() + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapAccess<'a, 'de: 'a, E> { + iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>, + pending_content: Option<&'a Content<'de>>, + _marker: PhantomData, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> FlatMapAccess<'a, 'de, E> { + fn new( + iter: slice::Iter<'a, Option<(Content<'de>, Content<'de>)>>, + ) -> FlatMapAccess<'a, 'de, E> { + FlatMapAccess { + iter: iter, + pending_content: None, + _marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> MapAccess<'de> for FlatMapAccess<'a, 'de, E> +where + E: Error, +{ + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>, + { + while let Some(item) = self.iter.next() { + // Items in the vector are nulled out when used by a struct. + if let Some((ref key, ref content)) = *item { + self.pending_content = Some(content); + return seed.deserialize(ContentRefDeserializer::new(key)).map(Some); + } + } + Ok(None) + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: DeserializeSeed<'de>, + { + match self.pending_content.take() { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => Err(Error::custom("value is missing")), + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatStructAccess<'a, 'de: 'a, E> { + iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>, + pending_content: Option>, + fields: &'static [&'static str], + _marker: PhantomData, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> FlatStructAccess<'a, 'de, E> { + fn new( + iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>, + fields: &'static [&'static str], + ) -> FlatStructAccess<'a, 'de, E> { + FlatStructAccess { + iter: iter, + pending_content: None, + fields: fields, + _marker: PhantomData, + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> MapAccess<'de> for FlatStructAccess<'a, 'de, E> +where + E: Error, +{ + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>, + { + while let Some(item) = self.iter.next() { + // items in the vector are nulled out when used. So we can only use + // an item if it's still filled in and if the field is one we care + // about. In case we do not know which fields we want, we take them all. + let use_item = match *item { + None => false, + Some((ref c, _)) => c.as_str().map_or(false, |key| self.fields.contains(&key)), + }; + + if use_item { + let (key, content) = item.take().unwrap(); + self.pending_content = Some(content); + return seed.deserialize(ContentDeserializer::new(key)).map(Some); + } + } + Ok(None) + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: DeserializeSeed<'de>, + { + match self.pending_content.take() { + Some(value) => seed.deserialize(ContentDeserializer::new(value)), + None => Err(Error::custom("value is missing")), + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatInternallyTaggedAccess<'a, 'de: 'a, E> { + iter: slice::IterMut<'a, Option<(Content<'de>, Content<'de>)>>, + pending: Option<&'a Content<'de>>, + _marker: PhantomData, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, 'de, E> MapAccess<'de> for FlatInternallyTaggedAccess<'a, 'de, E> +where + E: Error, +{ + type Error = E; + + fn next_key_seed(&mut self, seed: T) -> Result, Self::Error> + where + T: DeserializeSeed<'de>, + { + while let Some(item) = self.iter.next() { + if let Some((ref key, ref content)) = *item { + // Do not take(), instead borrow this entry. The internally tagged + // enum does its own buffering so we can't tell whether this entry + // is going to be consumed. Borrowing here leaves the entry + // available for later flattened fields. + self.pending = Some(content); + return seed.deserialize(ContentRefDeserializer::new(key)).map(Some); + } + } + Ok(None) + } + + fn next_value_seed(&mut self, seed: T) -> Result + where + T: DeserializeSeed<'de>, + { + match self.pending.take() { + Some(value) => seed.deserialize(ContentRefDeserializer::new(value)), + None => panic!("value is missing"), + } + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/private/macros.rs b/vendor/registry-40351f815f426200/serde/src/private/macros.rs new file mode 100644 index 000000000..4f7054f5d --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/private/macros.rs @@ -0,0 +1,140 @@ +#[doc(hidden)] +#[macro_export] +macro_rules! __private_serialize { + () => { + trait Serialize { + fn serialize(&self, serializer: S) -> Result + where + S: $crate::Serializer; + } + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __private_deserialize { + () => { + trait Deserialize<'de>: Sized { + fn deserialize(deserializer: D) -> Result + where + D: $crate::Deserializer<'de>; + } + }; +} + +/// Used only by Serde doc tests. Not public API. +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! __serialize_unimplemented { + ($($func:ident)*) => { + $( + __serialize_unimplemented_helper!($func); + )* + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __serialize_unimplemented_method { + ($func:ident $(<$t:ident>)* ($($arg:ty),*) -> $ret:ident) => { + fn $func $(<$t: ?Sized + $crate::Serialize>)* (self $(, _: $arg)*) -> $crate::export::Result { + unimplemented!() + } + }; +} + +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! __serialize_unimplemented_helper { + (bool) => { + __serialize_unimplemented_method!(serialize_bool(bool) -> Ok); + }; + (i8) => { + __serialize_unimplemented_method!(serialize_i8(i8) -> Ok); + }; + (i16) => { + __serialize_unimplemented_method!(serialize_i16(i16) -> Ok); + }; + (i32) => { + __serialize_unimplemented_method!(serialize_i32(i32) -> Ok); + }; + (i64) => { + __serialize_unimplemented_method!(serialize_i64(i64) -> Ok); + }; + (u8) => { + __serialize_unimplemented_method!(serialize_u8(u8) -> Ok); + }; + (u16) => { + __serialize_unimplemented_method!(serialize_u16(u16) -> Ok); + }; + (u32) => { + __serialize_unimplemented_method!(serialize_u32(u32) -> Ok); + }; + (u64) => { + __serialize_unimplemented_method!(serialize_u64(u64) -> Ok); + }; + (f32) => { + __serialize_unimplemented_method!(serialize_f32(f32) -> Ok); + }; + (f64) => { + __serialize_unimplemented_method!(serialize_f64(f64) -> Ok); + }; + (char) => { + __serialize_unimplemented_method!(serialize_char(char) -> Ok); + }; + (str) => { + __serialize_unimplemented_method!(serialize_str(&str) -> Ok); + }; + (bytes) => { + __serialize_unimplemented_method!(serialize_bytes(&[u8]) -> Ok); + }; + (none) => { + __serialize_unimplemented_method!(serialize_none() -> Ok); + }; + (some) => { + __serialize_unimplemented_method!(serialize_some(&T) -> Ok); + }; + (unit) => { + __serialize_unimplemented_method!(serialize_unit() -> Ok); + }; + (unit_struct) => { + __serialize_unimplemented_method!(serialize_unit_struct(&str) -> Ok); + }; + (unit_variant) => { + __serialize_unimplemented_method!(serialize_unit_variant(&str, u32, &str) -> Ok); + }; + (newtype_struct) => { + __serialize_unimplemented_method!(serialize_newtype_struct(&str, &T) -> Ok); + }; + (newtype_variant) => { + __serialize_unimplemented_method!(serialize_newtype_variant(&str, u32, &str, &T) -> Ok); + }; + (seq) => { + type SerializeSeq = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_seq(Option) -> SerializeSeq); + }; + (tuple) => { + type SerializeTuple = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple(usize) -> SerializeTuple); + }; + (tuple_struct) => { + type SerializeTupleStruct = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple_struct(&str, usize) -> SerializeTupleStruct); + }; + (tuple_variant) => { + type SerializeTupleVariant = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_tuple_variant(&str, u32, &str, usize) -> SerializeTupleVariant); + }; + (map) => { + type SerializeMap = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_map(Option) -> SerializeMap); + }; + (struct) => { + type SerializeStruct = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_struct(&str, usize) -> SerializeStruct); + }; + (struct_variant) => { + type SerializeStructVariant = $crate::ser::Impossible; + __serialize_unimplemented_method!(serialize_struct_variant(&str, u32, &str, usize) -> SerializeStructVariant); + }; +} diff --git a/vendor/registry-40351f815f426200/serde/src/private/mod.rs b/vendor/registry-40351f815f426200/serde/src/private/mod.rs new file mode 100644 index 000000000..79e0a7d00 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/private/mod.rs @@ -0,0 +1,4 @@ +mod macros; + +pub mod de; +pub mod ser; diff --git a/vendor/registry-40351f815f426200/serde/src/private/ser.rs b/vendor/registry-40351f815f426200/serde/src/private/ser.rs new file mode 100644 index 000000000..05f7e40af --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/private/ser.rs @@ -0,0 +1,1326 @@ +use lib::*; + +use ser::{self, Impossible, Serialize, SerializeMap, SerializeStruct, Serializer}; + +#[cfg(any(feature = "std", feature = "alloc"))] +use self::content::{ + Content, ContentSerializer, SerializeStructVariantAsMapValue, SerializeTupleVariantAsMapValue, +}; + +/// Used to check that serde(getter) attributes return the expected type. +/// Not public API. +pub fn constrain(t: &T) -> &T { + t +} + +/// Not public API. +pub fn serialize_tagged_newtype( + serializer: S, + type_ident: &'static str, + variant_ident: &'static str, + tag: &'static str, + variant_name: &'static str, + value: &T, +) -> Result +where + S: Serializer, + T: Serialize, +{ + value.serialize(TaggedSerializer { + type_ident: type_ident, + variant_ident: variant_ident, + tag: tag, + variant_name: variant_name, + delegate: serializer, + }) +} + +struct TaggedSerializer { + type_ident: &'static str, + variant_ident: &'static str, + tag: &'static str, + variant_name: &'static str, + delegate: S, +} + +enum Unsupported { + Boolean, + Integer, + Float, + Char, + String, + ByteArray, + Optional, + Unit, + #[cfg(any(feature = "std", feature = "alloc"))] + UnitStruct, + Sequence, + Tuple, + TupleStruct, + Enum, +} + +impl Display for Unsupported { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match *self { + Unsupported::Boolean => formatter.write_str("a boolean"), + Unsupported::Integer => formatter.write_str("an integer"), + Unsupported::Float => formatter.write_str("a float"), + Unsupported::Char => formatter.write_str("a char"), + Unsupported::String => formatter.write_str("a string"), + Unsupported::ByteArray => formatter.write_str("a byte array"), + Unsupported::Optional => formatter.write_str("an optional"), + Unsupported::Unit => formatter.write_str("unit"), + #[cfg(any(feature = "std", feature = "alloc"))] + Unsupported::UnitStruct => formatter.write_str("unit struct"), + Unsupported::Sequence => formatter.write_str("a sequence"), + Unsupported::Tuple => formatter.write_str("a tuple"), + Unsupported::TupleStruct => formatter.write_str("a tuple struct"), + Unsupported::Enum => formatter.write_str("an enum"), + } + } +} + +impl TaggedSerializer +where + S: Serializer, +{ + fn bad_type(self, what: Unsupported) -> S::Error { + ser::Error::custom(format_args!( + "cannot serialize tagged newtype variant {}::{} containing {}", + self.type_ident, self.variant_ident, what + )) + } +} + +impl Serializer for TaggedSerializer +where + S: Serializer, +{ + type Ok = S::Ok; + type Error = S::Error; + + type SerializeSeq = Impossible; + type SerializeTuple = Impossible; + type SerializeTupleStruct = Impossible; + type SerializeMap = S::SerializeMap; + type SerializeStruct = S::SerializeStruct; + + #[cfg(not(any(feature = "std", feature = "alloc")))] + type SerializeTupleVariant = Impossible; + #[cfg(any(feature = "std", feature = "alloc"))] + type SerializeTupleVariant = SerializeTupleVariantAsMapValue; + + #[cfg(not(any(feature = "std", feature = "alloc")))] + type SerializeStructVariant = Impossible; + #[cfg(any(feature = "std", feature = "alloc"))] + type SerializeStructVariant = SerializeStructVariantAsMapValue; + + fn serialize_bool(self, _: bool) -> Result { + Err(self.bad_type(Unsupported::Boolean)) + } + + fn serialize_i8(self, _: i8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i16(self, _: i16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i32(self, _: i32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i64(self, _: i64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u8(self, _: u8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u16(self, _: u16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u32(self, _: u32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u64(self, _: u64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_f32(self, _: f32) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_f64(self, _: f64) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_char(self, _: char) -> Result { + Err(self.bad_type(Unsupported::Char)) + } + + fn serialize_str(self, _: &str) -> Result { + Err(self.bad_type(Unsupported::String)) + } + + fn serialize_bytes(self, _: &[u8]) -> Result { + Err(self.bad_type(Unsupported::ByteArray)) + } + + fn serialize_none(self) -> Result { + Err(self.bad_type(Unsupported::Optional)) + } + + fn serialize_some(self, _: &T) -> Result + where + T: Serialize, + { + Err(self.bad_type(Unsupported::Optional)) + } + + fn serialize_unit(self) -> Result { + Err(self.bad_type(Unsupported::Unit)) + } + + fn serialize_unit_struct(self, _: &'static str) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(1))); + try!(map.serialize_entry(self.tag, self.variant_name)); + map.end() + } + + fn serialize_unit_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_entry(inner_variant, &())); + map.end() + } + + fn serialize_newtype_struct( + self, + _: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + value.serialize(self) + } + + fn serialize_newtype_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + inner_value: &T, + ) -> Result + where + T: Serialize, + { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_entry(inner_variant, inner_value)); + map.end() + } + + fn serialize_seq(self, _: Option) -> Result { + Err(self.bad_type(Unsupported::Sequence)) + } + + fn serialize_tuple(self, _: usize) -> Result { + Err(self.bad_type(Unsupported::Tuple)) + } + + fn serialize_tuple_struct( + self, + _: &'static str, + _: usize, + ) -> Result { + Err(self.bad_type(Unsupported::TupleStruct)) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn serialize_tuple_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + _: usize, + ) -> Result { + // Lack of push-based serialization means we need to buffer the content + // of the tuple variant, so it requires std. + Err(self.bad_type(Unsupported::Enum)) + } + + #[cfg(any(feature = "std", feature = "alloc"))] + fn serialize_tuple_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + len: usize, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_key(inner_variant)); + Ok(SerializeTupleVariantAsMapValue::new( + map, + inner_variant, + len, + )) + } + + fn serialize_map(self, len: Option) -> Result { + let mut map = try!(self.delegate.serialize_map(len.map(|len| len + 1))); + try!(map.serialize_entry(self.tag, self.variant_name)); + Ok(map) + } + + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + let mut state = try!(self.delegate.serialize_struct(name, len + 1)); + try!(state.serialize_field(self.tag, self.variant_name)); + Ok(state) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn serialize_struct_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + _: usize, + ) -> Result { + // Lack of push-based serialization means we need to buffer the content + // of the struct variant, so it requires std. + Err(self.bad_type(Unsupported::Enum)) + } + + #[cfg(any(feature = "std", feature = "alloc"))] + fn serialize_struct_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + len: usize, + ) -> Result { + let mut map = try!(self.delegate.serialize_map(Some(2))); + try!(map.serialize_entry(self.tag, self.variant_name)); + try!(map.serialize_key(inner_variant)); + Ok(SerializeStructVariantAsMapValue::new( + map, + inner_variant, + len, + )) + } + + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn collect_str(self, _: &T) -> Result + where + T: Display, + { + Err(self.bad_type(Unsupported::String)) + } +} + +/// Used only by Serde doc tests. Not public API. +#[doc(hidden)] +#[derive(Debug)] +pub struct Error; + +impl ser::Error for Error { + fn custom(_: T) -> Self + where + T: Display, + { + unimplemented!() + } +} + +#[cfg(feature = "std")] +impl error::Error for Error { + fn description(&self) -> &str { + unimplemented!() + } +} + +impl Display for Error { + fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result { + unimplemented!() + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +mod content { + use lib::*; + + use ser::{self, Serialize, Serializer}; + + pub struct SerializeTupleVariantAsMapValue { + map: M, + name: &'static str, + fields: Vec, + } + + impl SerializeTupleVariantAsMapValue { + pub fn new(map: M, name: &'static str, len: usize) -> Self { + SerializeTupleVariantAsMapValue { + map: map, + name: name, + fields: Vec::with_capacity(len), + } + } + } + + impl ser::SerializeTupleVariant for SerializeTupleVariantAsMapValue + where + M: ser::SerializeMap, + { + type Ok = M::Ok; + type Error = M::Error; + + fn serialize_field(&mut self, value: &T) -> Result<(), M::Error> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(mut self) -> Result { + try!(self + .map + .serialize_value(&Content::TupleStruct(self.name, self.fields))); + self.map.end() + } + } + + pub struct SerializeStructVariantAsMapValue { + map: M, + name: &'static str, + fields: Vec<(&'static str, Content)>, + } + + impl SerializeStructVariantAsMapValue { + pub fn new(map: M, name: &'static str, len: usize) -> Self { + SerializeStructVariantAsMapValue { + map: map, + name: name, + fields: Vec::with_capacity(len), + } + } + } + + impl ser::SerializeStructVariant for SerializeStructVariantAsMapValue + where + M: ser::SerializeMap, + { + type Ok = M::Ok; + type Error = M::Error; + + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), M::Error> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(mut self) -> Result { + try!(self + .map + .serialize_value(&Content::Struct(self.name, self.fields))); + self.map.end() + } + } + + #[derive(Debug)] + pub enum Content { + Bool(bool), + + U8(u8), + U16(u16), + U32(u32), + U64(u64), + + I8(i8), + I16(i16), + I32(i32), + I64(i64), + + F32(f32), + F64(f64), + + Char(char), + String(String), + Bytes(Vec), + + None, + Some(Box), + + Unit, + UnitStruct(&'static str), + UnitVariant(&'static str, u32, &'static str), + NewtypeStruct(&'static str, Box), + NewtypeVariant(&'static str, u32, &'static str, Box), + + Seq(Vec), + Tuple(Vec), + TupleStruct(&'static str, Vec), + TupleVariant(&'static str, u32, &'static str, Vec), + Map(Vec<(Content, Content)>), + Struct(&'static str, Vec<(&'static str, Content)>), + StructVariant( + &'static str, + u32, + &'static str, + Vec<(&'static str, Content)>, + ), + } + + impl Serialize for Content { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Content::Bool(b) => serializer.serialize_bool(b), + Content::U8(u) => serializer.serialize_u8(u), + Content::U16(u) => serializer.serialize_u16(u), + Content::U32(u) => serializer.serialize_u32(u), + Content::U64(u) => serializer.serialize_u64(u), + Content::I8(i) => serializer.serialize_i8(i), + Content::I16(i) => serializer.serialize_i16(i), + Content::I32(i) => serializer.serialize_i32(i), + Content::I64(i) => serializer.serialize_i64(i), + Content::F32(f) => serializer.serialize_f32(f), + Content::F64(f) => serializer.serialize_f64(f), + Content::Char(c) => serializer.serialize_char(c), + Content::String(ref s) => serializer.serialize_str(s), + Content::Bytes(ref b) => serializer.serialize_bytes(b), + Content::None => serializer.serialize_none(), + Content::Some(ref c) => serializer.serialize_some(&**c), + Content::Unit => serializer.serialize_unit(), + Content::UnitStruct(n) => serializer.serialize_unit_struct(n), + Content::UnitVariant(n, i, v) => serializer.serialize_unit_variant(n, i, v), + Content::NewtypeStruct(n, ref c) => serializer.serialize_newtype_struct(n, &**c), + Content::NewtypeVariant(n, i, v, ref c) => { + serializer.serialize_newtype_variant(n, i, v, &**c) + } + Content::Seq(ref elements) => elements.serialize(serializer), + Content::Tuple(ref elements) => { + use ser::SerializeTuple; + let mut tuple = try!(serializer.serialize_tuple(elements.len())); + for e in elements { + try!(tuple.serialize_element(e)); + } + tuple.end() + } + Content::TupleStruct(n, ref fields) => { + use ser::SerializeTupleStruct; + let mut ts = try!(serializer.serialize_tuple_struct(n, fields.len())); + for f in fields { + try!(ts.serialize_field(f)); + } + ts.end() + } + Content::TupleVariant(n, i, v, ref fields) => { + use ser::SerializeTupleVariant; + let mut tv = try!(serializer.serialize_tuple_variant(n, i, v, fields.len())); + for f in fields { + try!(tv.serialize_field(f)); + } + tv.end() + } + Content::Map(ref entries) => { + use ser::SerializeMap; + let mut map = try!(serializer.serialize_map(Some(entries.len()))); + for &(ref k, ref v) in entries { + try!(map.serialize_entry(k, v)); + } + map.end() + } + Content::Struct(n, ref fields) => { + use ser::SerializeStruct; + let mut s = try!(serializer.serialize_struct(n, fields.len())); + for &(k, ref v) in fields { + try!(s.serialize_field(k, v)); + } + s.end() + } + Content::StructVariant(n, i, v, ref fields) => { + use ser::SerializeStructVariant; + let mut sv = try!(serializer.serialize_struct_variant(n, i, v, fields.len())); + for &(k, ref v) in fields { + try!(sv.serialize_field(k, v)); + } + sv.end() + } + } + } + } + + pub struct ContentSerializer { + error: PhantomData, + } + + impl ContentSerializer { + pub fn new() -> Self { + ContentSerializer { error: PhantomData } + } + } + + impl Serializer for ContentSerializer + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + type SerializeSeq = SerializeSeq; + type SerializeTuple = SerializeTuple; + type SerializeTupleStruct = SerializeTupleStruct; + type SerializeTupleVariant = SerializeTupleVariant; + type SerializeMap = SerializeMap; + type SerializeStruct = SerializeStruct; + type SerializeStructVariant = SerializeStructVariant; + + fn serialize_bool(self, v: bool) -> Result { + Ok(Content::Bool(v)) + } + + fn serialize_i8(self, v: i8) -> Result { + Ok(Content::I8(v)) + } + + fn serialize_i16(self, v: i16) -> Result { + Ok(Content::I16(v)) + } + + fn serialize_i32(self, v: i32) -> Result { + Ok(Content::I32(v)) + } + + fn serialize_i64(self, v: i64) -> Result { + Ok(Content::I64(v)) + } + + fn serialize_u8(self, v: u8) -> Result { + Ok(Content::U8(v)) + } + + fn serialize_u16(self, v: u16) -> Result { + Ok(Content::U16(v)) + } + + fn serialize_u32(self, v: u32) -> Result { + Ok(Content::U32(v)) + } + + fn serialize_u64(self, v: u64) -> Result { + Ok(Content::U64(v)) + } + + fn serialize_f32(self, v: f32) -> Result { + Ok(Content::F32(v)) + } + + fn serialize_f64(self, v: f64) -> Result { + Ok(Content::F64(v)) + } + + fn serialize_char(self, v: char) -> Result { + Ok(Content::Char(v)) + } + + fn serialize_str(self, value: &str) -> Result { + Ok(Content::String(value.to_owned())) + } + + fn serialize_bytes(self, value: &[u8]) -> Result { + Ok(Content::Bytes(value.to_owned())) + } + + fn serialize_none(self) -> Result { + Ok(Content::None) + } + + fn serialize_some(self, value: &T) -> Result + where + T: Serialize, + { + Ok(Content::Some(Box::new(try!(value.serialize(self))))) + } + + fn serialize_unit(self) -> Result { + Ok(Content::Unit) + } + + fn serialize_unit_struct(self, name: &'static str) -> Result { + Ok(Content::UnitStruct(name)) + } + + fn serialize_unit_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + ) -> Result { + Ok(Content::UnitVariant(name, variant_index, variant)) + } + + fn serialize_newtype_struct( + self, + name: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + Ok(Content::NewtypeStruct( + name, + Box::new(try!(value.serialize(self))), + )) + } + + fn serialize_newtype_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + Ok(Content::NewtypeVariant( + name, + variant_index, + variant, + Box::new(try!(value.serialize(self))), + )) + } + + fn serialize_seq(self, len: Option) -> Result { + Ok(SerializeSeq { + elements: Vec::with_capacity(len.unwrap_or(0)), + error: PhantomData, + }) + } + + fn serialize_tuple(self, len: usize) -> Result { + Ok(SerializeTuple { + elements: Vec::with_capacity(len), + error: PhantomData, + }) + } + + fn serialize_tuple_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + Ok(SerializeTupleStruct { + name: name, + fields: Vec::with_capacity(len), + error: PhantomData, + }) + } + + fn serialize_tuple_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result { + Ok(SerializeTupleVariant { + name: name, + variant_index: variant_index, + variant: variant, + fields: Vec::with_capacity(len), + error: PhantomData, + }) + } + + fn serialize_map(self, len: Option) -> Result { + Ok(SerializeMap { + entries: Vec::with_capacity(len.unwrap_or(0)), + key: None, + error: PhantomData, + }) + } + + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result { + Ok(SerializeStruct { + name: name, + fields: Vec::with_capacity(len), + error: PhantomData, + }) + } + + fn serialize_struct_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result { + Ok(SerializeStructVariant { + name: name, + variant_index: variant_index, + variant: variant, + fields: Vec::with_capacity(len), + error: PhantomData, + }) + } + } + + pub struct SerializeSeq { + elements: Vec, + error: PhantomData, + } + + impl ser::SerializeSeq for SerializeSeq + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_element(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.elements.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Seq(self.elements)) + } + } + + pub struct SerializeTuple { + elements: Vec, + error: PhantomData, + } + + impl ser::SerializeTuple for SerializeTuple + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_element(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.elements.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Tuple(self.elements)) + } + } + + pub struct SerializeTupleStruct { + name: &'static str, + fields: Vec, + error: PhantomData, + } + + impl ser::SerializeTupleStruct for SerializeTupleStruct + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::TupleStruct(self.name, self.fields)) + } + } + + pub struct SerializeTupleVariant { + name: &'static str, + variant_index: u32, + variant: &'static str, + fields: Vec, + error: PhantomData, + } + + impl ser::SerializeTupleVariant for SerializeTupleVariant + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push(value); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::TupleVariant( + self.name, + self.variant_index, + self.variant, + self.fields, + )) + } + } + + pub struct SerializeMap { + entries: Vec<(Content, Content)>, + key: Option, + error: PhantomData, + } + + impl ser::SerializeMap for SerializeMap + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_key(&mut self, key: &T) -> Result<(), E> + where + T: Serialize, + { + let key = try!(key.serialize(ContentSerializer::::new())); + self.key = Some(key); + Ok(()) + } + + fn serialize_value(&mut self, value: &T) -> Result<(), E> + where + T: Serialize, + { + let key = self + .key + .take() + .expect("serialize_value called before serialize_key"); + let value = try!(value.serialize(ContentSerializer::::new())); + self.entries.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Map(self.entries)) + } + + fn serialize_entry(&mut self, key: &K, value: &V) -> Result<(), E> + where + K: Serialize, + V: Serialize, + { + let key = try!(key.serialize(ContentSerializer::::new())); + let value = try!(value.serialize(ContentSerializer::::new())); + self.entries.push((key, value)); + Ok(()) + } + } + + pub struct SerializeStruct { + name: &'static str, + fields: Vec<(&'static str, Content)>, + error: PhantomData, + } + + impl ser::SerializeStruct for SerializeStruct + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::Struct(self.name, self.fields)) + } + } + + pub struct SerializeStructVariant { + name: &'static str, + variant_index: u32, + variant: &'static str, + fields: Vec<(&'static str, Content)>, + error: PhantomData, + } + + impl ser::SerializeStructVariant for SerializeStructVariant + where + E: ser::Error, + { + type Ok = Content; + type Error = E; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), E> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(self) -> Result { + Ok(Content::StructVariant( + self.name, + self.variant_index, + self.variant, + self.fields, + )) + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapSerializer<'a, M: 'a>(pub &'a mut M); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> FlatMapSerializer<'a, M> +where + M: SerializeMap + 'a, +{ + fn bad_type(self, what: Unsupported) -> M::Error { + ser::Error::custom(format_args!( + "can only flatten structs and maps (got {})", + what + )) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> Serializer for FlatMapSerializer<'a, M> +where + M: SerializeMap + 'a, +{ + type Ok = (); + type Error = M::Error; + + type SerializeSeq = Impossible; + type SerializeTuple = Impossible; + type SerializeTupleStruct = Impossible; + type SerializeMap = FlatMapSerializeMap<'a, M>; + type SerializeStruct = FlatMapSerializeStruct<'a, M>; + type SerializeTupleVariant = Impossible; + type SerializeStructVariant = FlatMapSerializeStructVariantAsMapValue<'a, M>; + + fn serialize_bool(self, _: bool) -> Result { + Err(self.bad_type(Unsupported::Boolean)) + } + + fn serialize_i8(self, _: i8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i16(self, _: i16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i32(self, _: i32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_i64(self, _: i64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u8(self, _: u8) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u16(self, _: u16) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u32(self, _: u32) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_u64(self, _: u64) -> Result { + Err(self.bad_type(Unsupported::Integer)) + } + + fn serialize_f32(self, _: f32) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_f64(self, _: f64) -> Result { + Err(self.bad_type(Unsupported::Float)) + } + + fn serialize_char(self, _: char) -> Result { + Err(self.bad_type(Unsupported::Char)) + } + + fn serialize_str(self, _: &str) -> Result { + Err(self.bad_type(Unsupported::String)) + } + + fn serialize_bytes(self, _: &[u8]) -> Result { + Err(self.bad_type(Unsupported::ByteArray)) + } + + fn serialize_none(self) -> Result { + Ok(()) + } + + fn serialize_some(self, value: &T) -> Result + where + T: Serialize, + { + value.serialize(self) + } + + fn serialize_unit(self) -> Result { + Err(self.bad_type(Unsupported::Unit)) + } + + fn serialize_unit_struct(self, _: &'static str) -> Result { + Err(self.bad_type(Unsupported::UnitStruct)) + } + + fn serialize_unit_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + ) -> Result { + Err(self.bad_type(Unsupported::Enum)) + } + + fn serialize_newtype_struct( + self, + _: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + value.serialize(self) + } + + fn serialize_newtype_variant( + self, + _: &'static str, + _: u32, + variant: &'static str, + value: &T, + ) -> Result + where + T: Serialize, + { + try!(self.0.serialize_key(variant)); + self.0.serialize_value(value) + } + + fn serialize_seq(self, _: Option) -> Result { + Err(self.bad_type(Unsupported::Sequence)) + } + + fn serialize_tuple(self, _: usize) -> Result { + Err(self.bad_type(Unsupported::Tuple)) + } + + fn serialize_tuple_struct( + self, + _: &'static str, + _: usize, + ) -> Result { + Err(self.bad_type(Unsupported::TupleStruct)) + } + + fn serialize_tuple_variant( + self, + _: &'static str, + _: u32, + _: &'static str, + _: usize, + ) -> Result { + Err(self.bad_type(Unsupported::Enum)) + } + + fn serialize_map(self, _: Option) -> Result { + Ok(FlatMapSerializeMap(self.0)) + } + + fn serialize_struct( + self, + _: &'static str, + _: usize, + ) -> Result { + Ok(FlatMapSerializeStruct(self.0)) + } + + fn serialize_struct_variant( + self, + _: &'static str, + _: u32, + inner_variant: &'static str, + _: usize, + ) -> Result { + try!(self.0.serialize_key(inner_variant)); + Ok(FlatMapSerializeStructVariantAsMapValue::new( + self.0, + inner_variant, + )) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapSerializeMap<'a, M: 'a>(&'a mut M); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> ser::SerializeMap for FlatMapSerializeMap<'a, M> +where + M: SerializeMap + 'a, +{ + type Ok = (); + type Error = M::Error; + + fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error> + where + T: Serialize, + { + self.0.serialize_key(key) + } + + fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize, + { + self.0.serialize_value(value) + } + + fn end(self) -> Result<(), Self::Error> { + Ok(()) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapSerializeStruct<'a, M: 'a>(&'a mut M); + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> ser::SerializeStruct for FlatMapSerializeStruct<'a, M> +where + M: SerializeMap + 'a, +{ + type Ok = (); + type Error = M::Error; + + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize, + { + self.0.serialize_entry(key, value) + } + + fn end(self) -> Result<(), Self::Error> { + Ok(()) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +pub struct FlatMapSerializeStructVariantAsMapValue<'a, M: 'a> { + map: &'a mut M, + name: &'static str, + fields: Vec<(&'static str, Content)>, +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> FlatMapSerializeStructVariantAsMapValue<'a, M> +where + M: SerializeMap + 'a, +{ + fn new(map: &'a mut M, name: &'static str) -> FlatMapSerializeStructVariantAsMapValue<'a, M> { + FlatMapSerializeStructVariantAsMapValue { + map: map, + name: name, + fields: Vec::new(), + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl<'a, M> ser::SerializeStructVariant for FlatMapSerializeStructVariantAsMapValue<'a, M> +where + M: SerializeMap + 'a, +{ + type Ok = (); + type Error = M::Error; + + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize, + { + let value = try!(value.serialize(ContentSerializer::::new())); + self.fields.push((key, value)); + Ok(()) + } + + fn end(self) -> Result<(), Self::Error> { + try!(self + .map + .serialize_value(&Content::Struct(self.name, self.fields))); + Ok(()) + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/ser/impls.rs b/vendor/registry-40351f815f426200/serde/src/ser/impls.rs new file mode 100644 index 000000000..49b7477a4 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/ser/impls.rs @@ -0,0 +1,840 @@ +use lib::*; + +use ser::{Error, Serialize, SerializeTuple, Serializer}; + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! primitive_impl { + ($ty:ident, $method:ident $($cast:tt)*) => { + impl Serialize for $ty { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.$method(*self $($cast)*) + } + } + } +} + +primitive_impl!(bool, serialize_bool); +primitive_impl!(isize, serialize_i64 as i64); +primitive_impl!(i8, serialize_i8); +primitive_impl!(i16, serialize_i16); +primitive_impl!(i32, serialize_i32); +primitive_impl!(i64, serialize_i64); +primitive_impl!(usize, serialize_u64 as u64); +primitive_impl!(u8, serialize_u8); +primitive_impl!(u16, serialize_u16); +primitive_impl!(u32, serialize_u32); +primitive_impl!(u64, serialize_u64); +primitive_impl!(f32, serialize_f32); +primitive_impl!(f64, serialize_f64); +primitive_impl!(char, serialize_char); + +serde_if_integer128! { + primitive_impl!(i128, serialize_i128); + primitive_impl!(u128, serialize_u128); +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for str { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(self) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +impl Serialize for String { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(self) + } +} + +impl<'a> Serialize for fmt::Arguments<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_str(self) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for CStr { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(self.to_bytes()) + } +} + +#[cfg(feature = "std")] +impl Serialize for CString { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bytes(self.to_bytes()) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for Option +where + T: Serialize, +{ + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Some(ref value) => serializer.serialize_some(value), + None => serializer.serialize_none(), + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for PhantomData { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_unit_struct("PhantomData") + } +} + +//////////////////////////////////////////////////////////////////////////////// + +// Does not require T: Serialize. +impl Serialize for [T; 0] { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + try!(serializer.serialize_tuple(0)).end() + } +} + +macro_rules! array_impls { + ($($len:tt)+) => { + $( + impl Serialize for [T; $len] + where + T: Serialize, + { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut seq = try!(serializer.serialize_tuple($len)); + for e in self { + try!(seq.serialize_element(e)); + } + seq.end() + } + } + )+ + } +} + +array_impls! { + 01 02 03 04 05 06 07 08 09 10 + 11 12 13 14 15 16 17 18 19 20 + 21 22 23 24 25 26 27 28 29 30 + 31 32 +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for [T] +where + T: Serialize, +{ + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_seq(self) + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! seq_impl { + ($ty:ident < T $(: $tbound1:ident $(+ $tbound2:ident)*)* $(, $typaram:ident : $bound:ident)* >) => { + impl Serialize for $ty + where + T: Serialize $(+ $tbound1 $(+ $tbound2)*)*, + $($typaram: $bound,)* + { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_seq(self) + } + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(BinaryHeap); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(BTreeSet); + +#[cfg(feature = "std")] +seq_impl!(HashSet); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(LinkedList); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(Vec); + +#[cfg(any(feature = "std", feature = "alloc"))] +seq_impl!(VecDeque); + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for Range +where + Idx: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use super::SerializeStruct; + let mut state = try!(serializer.serialize_struct("Range", 2)); + try!(state.serialize_field("start", &self.start)); + try!(state.serialize_field("end", &self.end)); + state.end() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(range_inclusive)] +impl Serialize for RangeInclusive +where + Idx: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use super::SerializeStruct; + let mut state = try!(serializer.serialize_struct("RangeInclusive", 2)); + try!(state.serialize_field("start", &self.start())); + try!(state.serialize_field("end", &self.end())); + state.end() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(ops_bound, collections_bound))] +impl Serialize for Bound +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Bound::Unbounded => serializer.serialize_unit_variant("Bound", 0, "Unbounded"), + Bound::Included(ref value) => { + serializer.serialize_newtype_variant("Bound", 1, "Included", value) + } + Bound::Excluded(ref value) => { + serializer.serialize_newtype_variant("Bound", 2, "Excluded", value) + } + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for () { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_unit() + } +} + +#[cfg(feature = "unstable")] +impl Serialize for ! { + fn serialize(&self, _serializer: S) -> Result + where + S: Serializer, + { + *self + } +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! tuple_impls { + ($($len:expr => ($($n:tt $name:ident)+))+) => { + $( + impl<$($name),+> Serialize for ($($name,)+) + where + $($name: Serialize,)+ + { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut tuple = try!(serializer.serialize_tuple($len)); + $( + try!(tuple.serialize_element(&self.$n)); + )+ + tuple.end() + } + } + )+ + } +} + +tuple_impls! { + 1 => (0 T0) + 2 => (0 T0 1 T1) + 3 => (0 T0 1 T1 2 T2) + 4 => (0 T0 1 T1 2 T2 3 T3) + 5 => (0 T0 1 T1 2 T2 3 T3 4 T4) + 6 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5) + 7 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6) + 8 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7) + 9 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8) + 10 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9) + 11 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10) + 12 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11) + 13 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12) + 14 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13) + 15 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14) + 16 => (0 T0 1 T1 2 T2 3 T3 4 T4 5 T5 6 T6 7 T7 8 T8 9 T9 10 T10 11 T11 12 T12 13 T13 14 T14 15 T15) +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "std", feature = "alloc"))] +macro_rules! map_impl { + ($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => { + impl Serialize for $ty + where + K: Serialize $(+ $kbound1 $(+ $kbound2)*)*, + V: Serialize, + $($typaram: $bound,)* + { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.collect_map(self) + } + } + } +} + +#[cfg(any(feature = "std", feature = "alloc"))] +map_impl!(BTreeMap); + +#[cfg(feature = "std")] +map_impl!(HashMap); + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! deref_impl { + ( + $(#[doc = $doc:tt])* + <$($desc:tt)+ + ) => { + $(#[doc = $doc])* + impl <$($desc)+ { + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + (**self).serialize(serializer) + } + } + }; +} + +deref_impl!(<'a, T: ?Sized> Serialize for &'a T where T: Serialize); +deref_impl!(<'a, T: ?Sized> Serialize for &'a mut T where T: Serialize); + +#[cfg(any(feature = "std", feature = "alloc"))] +deref_impl!( Serialize for Box where T: Serialize); + +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +deref_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Serializing a data structure containing `Rc` will serialize a copy of + /// the contents of the `Rc` each time the `Rc` is referenced within the + /// data structure. Serialization will not attempt to deduplicate these + /// repeated data. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + Serialize for Rc where T: Serialize +} + +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +deref_impl! { + /// This impl requires the [`"rc"`] Cargo feature of Serde. + /// + /// Serializing a data structure containing `Arc` will serialize a copy of + /// the contents of the `Arc` each time the `Arc` is referenced within the + /// data structure. Serialization will not attempt to deduplicate these + /// repeated data. + /// + /// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc + Serialize for Arc where T: Serialize +} + +#[cfg(any(feature = "std", feature = "alloc"))] +deref_impl!(<'a, T: ?Sized> Serialize for Cow<'a, T> where T: Serialize + ToOwned); + +//////////////////////////////////////////////////////////////////////////////// + +/// This impl requires the [`"rc"`] Cargo feature of Serde. +/// +/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +impl Serialize for RcWeak +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.upgrade().serialize(serializer) + } +} + +/// This impl requires the [`"rc"`] Cargo feature of Serde. +/// +/// [`"rc"`]: https://serde.rs/feature-flags.html#-features-rc +#[cfg(all(feature = "rc", any(feature = "std", feature = "alloc")))] +impl Serialize for ArcWeak +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.upgrade().serialize(serializer) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! nonzero_integers { + ( $( $T: ident, )+ ) => { + $( + #[cfg(num_nonzero)] + impl Serialize for num::$T { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.get().serialize(serializer) + } + } + )+ + } +} + +nonzero_integers! { + // Not including signed NonZeroI* since they might be removed + NonZeroU8, + NonZeroU16, + NonZeroU32, + NonZeroU64, + NonZeroUsize, +} + +// Currently 128-bit integers do not work on Emscripten targets so we need an +// additional `#[cfg]` +serde_if_integer128! { + nonzero_integers! { + NonZeroU128, + } +} + +impl Serialize for Cell +where + T: Serialize + Copy, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.get().serialize(serializer) + } +} + +impl Serialize for RefCell +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self.try_borrow() { + Ok(value) => value.serialize(serializer), + Err(_) => Err(S::Error::custom("already mutably borrowed")), + } + } +} + +#[cfg(feature = "std")] +impl Serialize for Mutex +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self.lock() { + Ok(locked) => locked.serialize(serializer), + Err(_) => Err(S::Error::custom("lock poison error while serializing")), + } + } +} + +#[cfg(feature = "std")] +impl Serialize for RwLock +where + T: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self.read() { + Ok(locked) => locked.serialize(serializer), + Err(_) => Err(S::Error::custom("lock poison error while serializing")), + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +impl Serialize for Result +where + T: Serialize, + E: Serialize, +{ + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match *self { + Result::Ok(ref value) => serializer.serialize_newtype_variant("Result", 0, "Ok", value), + Result::Err(ref value) => { + serializer.serialize_newtype_variant("Result", 1, "Err", value) + } + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(core_duration, feature = "std"))] +impl Serialize for Duration { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use super::SerializeStruct; + let mut state = try!(serializer.serialize_struct("Duration", 2)); + try!(state.serialize_field("secs", &self.as_secs())); + try!(state.serialize_field("nanos", &self.subsec_nanos())); + state.end() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for SystemTime { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use super::SerializeStruct; + let duration_since_epoch = self + .duration_since(UNIX_EPOCH) + .expect("SystemTime must be later than UNIX_EPOCH"); + let mut state = try!(serializer.serialize_struct("SystemTime", 2)); + try!(state.serialize_field("secs_since_epoch", &duration_since_epoch.as_secs())); + try!(state.serialize_field("nanos_since_epoch", &duration_since_epoch.subsec_nanos())); + state.end() + } +} + +//////////////////////////////////////////////////////////////////////////////// + +/// Serialize a value that implements `Display` as a string, when that string is +/// statically known to never have more than a constant `MAX_LEN` bytes. +/// +/// Panics if the `Display` impl tries to write more than `MAX_LEN` bytes. +#[cfg(feature = "std")] +macro_rules! serialize_display_bounded_length { + ($value:expr, $max:expr, $serializer:expr) => {{ + let mut buffer: [u8; $max] = unsafe { mem::uninitialized() }; + let remaining_len = { + let mut remaining = &mut buffer[..]; + write!(remaining, "{}", $value).unwrap(); + remaining.len() + }; + let written_len = buffer.len() - remaining_len; + let written = &buffer[..written_len]; + + // write! only provides fmt::Formatter to Display implementations, which + // has methods write_str and write_char but no method to write arbitrary + // bytes. Therefore `written` must be valid UTF-8. + let written_str = unsafe { str::from_utf8_unchecked(written) }; + $serializer.serialize_str(written_str) + }}; +} + +#[cfg(feature = "std")] +impl Serialize for net::IpAddr { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + match *self { + net::IpAddr::V4(ref a) => a.serialize(serializer), + net::IpAddr::V6(ref a) => a.serialize(serializer), + } + } else { + match *self { + net::IpAddr::V4(ref a) => { + serializer.serialize_newtype_variant("IpAddr", 0, "V4", a) + } + net::IpAddr::V6(ref a) => { + serializer.serialize_newtype_variant("IpAddr", 1, "V6", a) + } + } + } + } +} + +#[cfg(feature = "std")] +impl Serialize for net::Ipv4Addr { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + const MAX_LEN: usize = 15; + debug_assert_eq!(MAX_LEN, "101.102.103.104".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + self.octets().serialize(serializer) + } + } +} + +#[cfg(feature = "std")] +impl Serialize for net::Ipv6Addr { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + const MAX_LEN: usize = 39; + debug_assert_eq!(MAX_LEN, "1001:1002:1003:1004:1005:1006:1007:1008".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + self.octets().serialize(serializer) + } + } +} + +#[cfg(feature = "std")] +impl Serialize for net::SocketAddr { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + match *self { + net::SocketAddr::V4(ref addr) => addr.serialize(serializer), + net::SocketAddr::V6(ref addr) => addr.serialize(serializer), + } + } else { + match *self { + net::SocketAddr::V4(ref addr) => { + serializer.serialize_newtype_variant("SocketAddr", 0, "V4", addr) + } + net::SocketAddr::V6(ref addr) => { + serializer.serialize_newtype_variant("SocketAddr", 1, "V6", addr) + } + } + } + } +} + +#[cfg(feature = "std")] +impl Serialize for net::SocketAddrV4 { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + const MAX_LEN: usize = 21; + debug_assert_eq!(MAX_LEN, "101.102.103.104:65000".len()); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + (self.ip(), self.port()).serialize(serializer) + } + } +} + +#[cfg(feature = "std")] +impl Serialize for net::SocketAddrV6 { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + if serializer.is_human_readable() { + const MAX_LEN: usize = 47; + debug_assert_eq!( + MAX_LEN, + "[1001:1002:1003:1004:1005:1006:1007:1008]:65000".len() + ); + serialize_display_bounded_length!(self, MAX_LEN, serializer) + } else { + (self.ip(), self.port()).serialize(serializer) + } + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for Path { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self.to_str() { + Some(s) => s.serialize(serializer), + None => Err(Error::custom("path contains invalid UTF-8 characters")), + } + } +} + +#[cfg(feature = "std")] +impl Serialize for PathBuf { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_path().serialize(serializer) + } +} + +#[cfg(all(feature = "std", any(unix, windows)))] +impl Serialize for OsStr { + #[cfg(unix)] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use std::os::unix::ffi::OsStrExt; + serializer.serialize_newtype_variant("OsString", 0, "Unix", self.as_bytes()) + } + + #[cfg(windows)] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use std::os::windows::ffi::OsStrExt; + let val = self.encode_wide().collect::>(); + serializer.serialize_newtype_variant("OsString", 1, "Windows", &val) + } +} + +#[cfg(all(feature = "std", any(unix, windows)))] +impl Serialize for OsString { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.as_os_str().serialize(serializer) + } +} + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(feature = "std")] +impl Serialize for Wrapping +where + T: Serialize, +{ + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.0.serialize(serializer) + } +} + +#[cfg(core_reverse)] +impl Serialize for Reverse +where + T: Serialize, +{ + #[inline] + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + self.0.serialize(serializer) + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/ser/impossible.rs b/vendor/registry-40351f815f426200/serde/src/ser/impossible.rs new file mode 100644 index 000000000..90bab29a0 --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/ser/impossible.rs @@ -0,0 +1,216 @@ +//! This module contains `Impossible` serializer and its implementations. + +use lib::*; + +use ser::{ + self, Serialize, SerializeMap, SerializeSeq, SerializeStruct, SerializeStructVariant, + SerializeTuple, SerializeTupleStruct, SerializeTupleVariant, +}; + +/// Helper type for implementing a `Serializer` that does not support +/// serializing one of the compound types. +/// +/// This type cannot be instantiated, but implements every one of the traits +/// corresponding to the [`Serializer`] compound types: [`SerializeSeq`], +/// [`SerializeTuple`], [`SerializeTupleStruct`], [`SerializeTupleVariant`], +/// [`SerializeMap`], [`SerializeStruct`], and [`SerializeStructVariant`]. +/// +/// ```edition2018 +/// # use serde::ser::{Serializer, Impossible}; +/// # use serde::private::ser::Error; +/// # +/// # struct MySerializer; +/// # +/// impl Serializer for MySerializer { +/// type Ok = (); +/// type Error = Error; +/// +/// type SerializeSeq = Impossible<(), Error>; +/// /* other associated types */ +/// +/// /// This data format does not support serializing sequences. +/// fn serialize_seq(self, +/// len: Option) +/// -> Result { +/// // Given Impossible cannot be instantiated, the only +/// // thing we can do here is to return an error. +/// # stringify! { +/// Err(...) +/// # }; +/// # unimplemented!() +/// } +/// +/// /* other Serializer methods */ +/// # serde::__serialize_unimplemented! { +/// # bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str bytes none some +/// # unit unit_struct unit_variant newtype_struct newtype_variant +/// # tuple tuple_struct tuple_variant map struct struct_variant +/// # } +/// } +/// ``` +/// +/// [`Serializer`]: trait.Serializer.html +/// [`SerializeSeq`]: trait.SerializeSeq.html +/// [`SerializeTuple`]: trait.SerializeTuple.html +/// [`SerializeTupleStruct`]: trait.SerializeTupleStruct.html +/// [`SerializeTupleVariant`]: trait.SerializeTupleVariant.html +/// [`SerializeMap`]: trait.SerializeMap.html +/// [`SerializeStruct`]: trait.SerializeStruct.html +/// [`SerializeStructVariant`]: trait.SerializeStructVariant.html +pub struct Impossible { + void: Void, + ok: PhantomData, + error: PhantomData, +} + +enum Void {} + +impl SerializeSeq for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_element(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeTuple for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_element(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeTupleStruct for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_field(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeTupleVariant for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_field(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeMap for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_key(&mut self, key: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; + match self.void {} + } + + fn serialize_value(&mut self, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeStruct for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} + +impl SerializeStructVariant for Impossible +where + Error: ser::Error, +{ + type Ok = Ok; + type Error = Error; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<(), Error> + where + T: Serialize, + { + let _ = key; + let _ = value; + match self.void {} + } + + fn end(self) -> Result { + match self.void {} + } +} diff --git a/vendor/registry-40351f815f426200/serde/src/ser/mod.rs b/vendor/registry-40351f815f426200/serde/src/ser/mod.rs new file mode 100644 index 000000000..318b3799a --- /dev/null +++ b/vendor/registry-40351f815f426200/serde/src/ser/mod.rs @@ -0,0 +1,1988 @@ +//! Generic data structure serialization framework. +//! +//! The two most important traits in this module are [`Serialize`] and +//! [`Serializer`]. +//! +//! - **A type that implements `Serialize` is a data structure** that can be +//! serialized to any data format supported by Serde, and conversely +//! - **A type that implements `Serializer` is a data format** that can +//! serialize any data structure supported by Serde. +//! +//! # The Serialize trait +//! +//! Serde provides [`Serialize`] implementations for many Rust primitive and +//! standard library types. The complete list is below. All of these can be +//! serialized using Serde out of the box. +//! +//! Additionally, Serde provides a procedural macro called [`serde_derive`] to +//! automatically generate [`Serialize`] implementations for structs and enums +//! in your program. See the [derive section of the manual] for how to use this. +//! +//! In rare cases it may be necessary to implement [`Serialize`] manually for +//! some type in your program. See the [Implementing `Serialize`] section of the +//! manual for more about this. +//! +//! Third-party crates may provide [`Serialize`] implementations for types that +//! they expose. For example the [`linked-hash-map`] crate provides a +//! [`LinkedHashMap`] type that is serializable by Serde because the crate +//! provides an implementation of [`Serialize`] for it. +//! +//! # The Serializer trait +//! +//! [`Serializer`] implementations are provided by third-party crates, for +//! example [`serde_json`], [`serde_yaml`] and [`bincode`]. +//! +//! A partial list of well-maintained formats is given on the [Serde +//! website][data formats]. +//! +//! # Implementations of Serialize provided by Serde +//! +//! - **Primitive types**: +//! - bool +//! - i8, i16, i32, i64, i128, isize +//! - u8, u16, u32, u64, u128, usize +//! - f32, f64 +//! - char +//! - str +//! - &T and &mut T +//! - **Compound types**: +//! - \[T\] +//! - \[T; 0\] through \[T; 32\] +//! - tuples up to size 16 +//! - **Common standard library types**: +//! - String +//! - Option\ +//! - Result\ +//! - PhantomData\ +//! - **Wrapper types**: +//! - Box\ +//! - Cow\<'a, T\> +//! - Cell\ +//! - RefCell\ +//! - Mutex\ +//! - RwLock\ +//! - Rc\ *(if* features = ["rc"] *is enabled)* +//! - Arc\ *(if* features = ["rc"] *is enabled)* +//! - **Collection types**: +//! - BTreeMap\ +//! - BTreeSet\ +//! - BinaryHeap\ +//! - HashMap\ +//! - HashSet\ +//! - LinkedList\ +//! - VecDeque\ +//! - Vec\ +//! - **FFI types**: +//! - CStr +//! - CString +//! - OsStr +//! - OsString +//! - **Miscellaneous standard library types**: +//! - Duration +//! - SystemTime +//! - Path +//! - PathBuf +//! - Range\ +//! - RangeInclusive\ +//! - Bound\ +//! - num::NonZero* +//! - `!` *(unstable)* +//! - **Net types**: +//! - IpAddr +//! - Ipv4Addr +//! - Ipv6Addr +//! - SocketAddr +//! - SocketAddrV4 +//! - SocketAddrV6 +//! +//! [Implementing `Serialize`]: https://serde.rs/impl-serialize.html +//! [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +//! [`Serialize`]: ../trait.Serialize.html +//! [`Serializer`]: ../trait.Serializer.html +//! [`bincode`]: https://github.com/TyOverby/bincode +//! [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +//! [`serde_derive`]: https://crates.io/crates/serde_derive +//! [`serde_json`]: https://github.com/serde-rs/json +//! [`serde_yaml`]: https://github.com/dtolnay/serde-yaml +//! [derive section of the manual]: https://serde.rs/derive.html +//! [data formats]: https://serde.rs/#data-formats + +use lib::*; + +mod impls; +mod impossible; + +pub use self::impossible::Impossible; + +//////////////////////////////////////////////////////////////////////////////// + +macro_rules! declare_error_trait { + (Error: Sized $(+ $($supertrait:ident)::+)*) => { + /// Trait used by `Serialize` implementations to generically construct + /// errors belonging to the `Serializer` against which they are + /// currently running. + /// + /// # Example implementation + /// + /// The [example data format] presented on the website shows an error + /// type appropriate for a basic JSON data format. + /// + /// [example data format]: https://serde.rs/data-format.html + pub trait Error: Sized $(+ $($supertrait)::+)* { + /// Used when a [`Serialize`] implementation encounters any error + /// while serializing a type. + /// + /// The message should not be capitalized and should not end with a + /// period. + /// + /// For example, a filesystem [`Path`] may refuse to serialize + /// itself if it contains invalid UTF-8 data. + /// + /// ```edition2018 + /// # struct Path; + /// # + /// # impl Path { + /// # fn to_str(&self) -> Option<&str> { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{self, Serialize, Serializer}; + /// + /// impl Serialize for Path { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match self.to_str() { + /// Some(s) => serializer.serialize_str(s), + /// None => Err(ser::Error::custom("path contains invalid UTF-8 characters")), + /// } + /// } + /// } + /// ``` + /// + /// [`Path`]: https://doc.rust-lang.org/std/path/struct.Path.html + /// [`Serialize`]: ../trait.Serialize.html + fn custom(msg: T) -> Self + where + T: Display; + } + } +} + +#[cfg(feature = "std")] +declare_error_trait!(Error: Sized + error::Error); + +#[cfg(not(feature = "std"))] +declare_error_trait!(Error: Sized + Debug + Display); + +//////////////////////////////////////////////////////////////////////////////// + +/// A **data structure** that can be serialized into any data format supported +/// by Serde. +/// +/// Serde provides `Serialize` implementations for many Rust primitive and +/// standard library types. The complete list is [here][ser]. All of these can +/// be serialized using Serde out of the box. +/// +/// Additionally, Serde provides a procedural macro called [`serde_derive`] to +/// automatically generate `Serialize` implementations for structs and enums in +/// your program. See the [derive section of the manual] for how to use this. +/// +/// In rare cases it may be necessary to implement `Serialize` manually for some +/// type in your program. See the [Implementing `Serialize`] section of the +/// manual for more about this. +/// +/// Third-party crates may provide `Serialize` implementations for types that +/// they expose. For example the [`linked-hash-map`] crate provides a +/// [`LinkedHashMap`] type that is serializable by Serde because the crate +/// provides an implementation of `Serialize` for it. +/// +/// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html +/// [`LinkedHashMap`]: https://docs.rs/linked-hash-map/*/linked_hash_map/struct.LinkedHashMap.html +/// [`linked-hash-map`]: https://crates.io/crates/linked-hash-map +/// [`serde_derive`]: https://crates.io/crates/serde_derive +/// [derive section of the manual]: https://serde.rs/derive.html +/// [ser]: https://docs.serde.rs/serde/ser/index.html +pub trait Serialize { + /// Serialize this value into the given Serde serializer. + /// + /// See the [Implementing `Serialize`] section of the manual for more + /// information about how to implement this method. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeStruct, Serializer}; + /// + /// struct Person { + /// name: String, + /// age: u8, + /// phones: Vec, + /// } + /// + /// // This is what #[derive(Serialize)] would generate. + /// impl Serialize for Person { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut s = serializer.serialize_struct("Person", 3)?; + /// s.serialize_field("name", &self.name)?; + /// s.serialize_field("age", &self.age)?; + /// s.serialize_field("phones", &self.phones)?; + /// s.end() + /// } + /// } + /// ``` + /// + /// [Implementing `Serialize`]: https://serde.rs/impl-serialize.html + fn serialize(&self, serializer: S) -> Result + where + S: Serializer; +} + +//////////////////////////////////////////////////////////////////////////////// + +/// A **data format** that can serialize any data structure supported by Serde. +/// +/// The role of this trait is to define the serialization half of the [Serde +/// data model], which is a way to categorize every Rust data structure into one +/// of 29 possible types. Each method of the `Serializer` trait corresponds to +/// one of the types of the data model. +/// +/// Implementations of `Serialize` map themselves into this data model by +/// invoking exactly one of the `Serializer` methods. +/// +/// The types that make up the Serde data model are: +/// +/// - **14 primitive types** +/// - bool +/// - i8, i16, i32, i64, i128 +/// - u8, u16, u32, u64, u128 +/// - f32, f64 +/// - char +/// - **string** +/// - UTF-8 bytes with a length and no null terminator. +/// - When serializing, all strings are handled equally. When deserializing, +/// there are three flavors of strings: transient, owned, and borrowed. +/// - **byte array** - \[u8\] +/// - Similar to strings, during deserialization byte arrays can be +/// transient, owned, or borrowed. +/// - **option** +/// - Either none or some value. +/// - **unit** +/// - The type of `()` in Rust. It represents an anonymous value containing +/// no data. +/// - **unit_struct** +/// - For example `struct Unit` or `PhantomData`. It represents a named +/// value containing no data. +/// - **unit_variant** +/// - For example the `E::A` and `E::B` in `enum E { A, B }`. +/// - **newtype_struct** +/// - For example `struct Millimeters(u8)`. +/// - **newtype_variant** +/// - For example the `E::N` in `enum E { N(u8) }`. +/// - **seq** +/// - A variably sized heterogeneous sequence of values, for example +/// `Vec` or `HashSet`. When serializing, the length may or may not +/// be known before iterating through all the data. When deserializing, +/// the length is determined by looking at the serialized data. +/// - **tuple** +/// - A statically sized heterogeneous sequence of values for which the +/// length will be known at deserialization time without looking at the +/// serialized data, for example `(u8,)` or `(String, u64, Vec)` or +/// `[u64; 10]`. +/// - **tuple_struct** +/// - A named tuple, for example `struct Rgb(u8, u8, u8)`. +/// - **tuple_variant** +/// - For example the `E::T` in `enum E { T(u8, u8) }`. +/// - **map** +/// - A heterogeneous key-value pairing, for example `BTreeMap`. +/// - **struct** +/// - A heterogeneous key-value pairing in which the keys are strings and +/// will be known at deserialization time without looking at the +/// serialized data, for example `struct S { r: u8, g: u8, b: u8 }`. +/// - **struct_variant** +/// - For example the `E::S` in `enum E { S { r: u8, g: u8, b: u8 } }`. +/// +/// Many Serde serializers produce text or binary data as output, for example +/// JSON or Bincode. This is not a requirement of the `Serializer` trait, and +/// there are serializers that do not produce text or binary output. One example +/// is the `serde_json::value::Serializer` (distinct from the main `serde_json` +/// serializer) that produces a `serde_json::Value` data structure in memory as +/// output. +/// +/// [Serde data model]: https://serde.rs/data-model.html +/// +/// # Example implementation +/// +/// The [example data format] presented on the website contains example code for +/// a basic JSON `Serializer`. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait Serializer: Sized { + /// The output type produced by this `Serializer` during successful + /// serialization. Most serializers that produce text or binary output + /// should set `Ok = ()` and serialize into an [`io::Write`] or buffer + /// contained within the `Serializer` instance. Serializers that build + /// in-memory data structures may be simplified by using `Ok` to propagate + /// the data structure around. + /// + /// [`io::Write`]: https://doc.rust-lang.org/std/io/trait.Write.html + type Ok; + + /// The error type when some error occurs during serialization. + type Error: Error; + + /// Type returned from [`serialize_seq`] for serializing the content of the + /// sequence. + /// + /// [`serialize_seq`]: #tymethod.serialize_seq + type SerializeSeq: SerializeSeq; + + /// Type returned from [`serialize_tuple`] for serializing the content of + /// the tuple. + /// + /// [`serialize_tuple`]: #tymethod.serialize_tuple + type SerializeTuple: SerializeTuple; + + /// Type returned from [`serialize_tuple_struct`] for serializing the + /// content of the tuple struct. + /// + /// [`serialize_tuple_struct`]: #tymethod.serialize_tuple_struct + type SerializeTupleStruct: SerializeTupleStruct; + + /// Type returned from [`serialize_tuple_variant`] for serializing the + /// content of the tuple variant. + /// + /// [`serialize_tuple_variant`]: #tymethod.serialize_tuple_variant + type SerializeTupleVariant: SerializeTupleVariant; + + /// Type returned from [`serialize_map`] for serializing the content of the + /// map. + /// + /// [`serialize_map`]: #tymethod.serialize_map + type SerializeMap: SerializeMap; + + /// Type returned from [`serialize_struct`] for serializing the content of + /// the struct. + /// + /// [`serialize_struct`]: #tymethod.serialize_struct + type SerializeStruct: SerializeStruct; + + /// Type returned from [`serialize_struct_variant`] for serializing the + /// content of the struct variant. + /// + /// [`serialize_struct_variant`]: #tymethod.serialize_struct_variant + type SerializeStructVariant: SerializeStructVariant; + + /// Serialize a `bool` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for bool { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_bool(*self) + /// } + /// } + /// ``` + fn serialize_bool(self, v: bool) -> Result; + + /// Serialize an `i8` value. + /// + /// If the format does not differentiate between `i8` and `i64`, a + /// reasonable implementation would be to cast the value to `i64` and + /// forward to `serialize_i64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for i8 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_i8(*self) + /// } + /// } + /// ``` + fn serialize_i8(self, v: i8) -> Result; + + /// Serialize an `i16` value. + /// + /// If the format does not differentiate between `i16` and `i64`, a + /// reasonable implementation would be to cast the value to `i64` and + /// forward to `serialize_i64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for i16 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_i16(*self) + /// } + /// } + /// ``` + fn serialize_i16(self, v: i16) -> Result; + + /// Serialize an `i32` value. + /// + /// If the format does not differentiate between `i32` and `i64`, a + /// reasonable implementation would be to cast the value to `i64` and + /// forward to `serialize_i64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for i32 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_i32(*self) + /// } + /// } + /// ``` + fn serialize_i32(self, v: i32) -> Result; + + /// Serialize an `i64` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for i64 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_i64(*self) + /// } + /// } + /// ``` + fn serialize_i64(self, v: i64) -> Result; + + serde_if_integer128! { + /// Serialize an `i128` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for i128 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_i128(*self) + /// } + /// } + /// ``` + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default behavior unconditionally returns an error. + fn serialize_i128(self, v: i128) -> Result { + let _ = v; + Err(Error::custom("i128 is not supported")) + } + } + + /// Serialize a `u8` value. + /// + /// If the format does not differentiate between `u8` and `u64`, a + /// reasonable implementation would be to cast the value to `u64` and + /// forward to `serialize_u64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for u8 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_u8(*self) + /// } + /// } + /// ``` + fn serialize_u8(self, v: u8) -> Result; + + /// Serialize a `u16` value. + /// + /// If the format does not differentiate between `u16` and `u64`, a + /// reasonable implementation would be to cast the value to `u64` and + /// forward to `serialize_u64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for u16 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_u16(*self) + /// } + /// } + /// ``` + fn serialize_u16(self, v: u16) -> Result; + + /// Serialize a `u32` value. + /// + /// If the format does not differentiate between `u32` and `u64`, a + /// reasonable implementation would be to cast the value to `u64` and + /// forward to `serialize_u64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for u32 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_u32(*self) + /// } + /// } + /// ``` + fn serialize_u32(self, v: u32) -> Result; + + /// Serialize a `u64` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for u64 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_u64(*self) + /// } + /// } + /// ``` + fn serialize_u64(self, v: u64) -> Result; + + serde_if_integer128! { + /// Serialize a `u128` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for u128 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_u128(*self) + /// } + /// } + /// ``` + /// + /// This method is available only on Rust compiler versions >=1.26. The + /// default behavior unconditionally returns an error. + fn serialize_u128(self, v: u128) -> Result { + let _ = v; + Err(Error::custom("u128 is not supported")) + } + } + + /// Serialize an `f32` value. + /// + /// If the format does not differentiate between `f32` and `f64`, a + /// reasonable implementation would be to cast the value to `f64` and + /// forward to `serialize_f64`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for f32 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_f32(*self) + /// } + /// } + /// ``` + fn serialize_f32(self, v: f32) -> Result; + + /// Serialize an `f64` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for f64 { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_f64(*self) + /// } + /// } + /// ``` + fn serialize_f64(self, v: f64) -> Result; + + /// Serialize a character. + /// + /// If the format does not support characters, it is reasonable to serialize + /// it as a single element `str` or a `u32`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for char { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_char(*self) + /// } + /// } + /// ``` + fn serialize_char(self, v: char) -> Result; + + /// Serialize a `&str`. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for str { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_str(self) + /// } + /// } + /// ``` + fn serialize_str(self, v: &str) -> Result; + + /// Serialize a chunk of raw byte data. + /// + /// Enables serializers to serialize byte slices more compactly or more + /// efficiently than other types of slices. If no efficient implementation + /// is available, a reasonable implementation would be to forward to + /// `serialize_seq`. If forwarded, the implementation looks usually just + /// like this: + /// + /// ```edition2018 + /// # use serde::ser::{Serializer, SerializeSeq}; + /// # use serde::private::ser::Error; + /// # + /// # struct MySerializer; + /// # + /// # impl Serializer for MySerializer { + /// # type Ok = (); + /// # type Error = Error; + /// # + /// fn serialize_bytes(self, v: &[u8]) -> Result { + /// let mut seq = self.serialize_seq(Some(v.len()))?; + /// for b in v { + /// seq.serialize_element(b)?; + /// } + /// seq.end() + /// } + /// # + /// # serde::__serialize_unimplemented! { + /// # bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str none some + /// # unit unit_struct unit_variant newtype_struct newtype_variant + /// # seq tuple tuple_struct tuple_variant map struct struct_variant + /// # } + /// # } + /// ``` + fn serialize_bytes(self, v: &[u8]) -> Result; + + /// Serialize a [`None`] value. + /// + /// ```edition2018 + /// # use serde::{Serialize, Serializer}; + /// # + /// # enum Option { + /// # Some(T), + /// # None, + /// # } + /// # + /// # use self::Option::{Some, None}; + /// # + /// impl Serialize for Option + /// where + /// T: Serialize, + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// Some(ref value) => serializer.serialize_some(value), + /// None => serializer.serialize_none(), + /// } + /// } + /// } + /// # + /// # fn main() {} + /// ``` + /// + /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None + fn serialize_none(self) -> Result; + + /// Serialize a [`Some(T)`] value. + /// + /// ```edition2018 + /// # use serde::{Serialize, Serializer}; + /// # + /// # enum Option { + /// # Some(T), + /// # None, + /// # } + /// # + /// # use self::Option::{Some, None}; + /// # + /// impl Serialize for Option + /// where + /// T: Serialize, + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// Some(ref value) => serializer.serialize_some(value), + /// None => serializer.serialize_none(), + /// } + /// } + /// } + /// # + /// # fn main() {} + /// ``` + /// + /// [`Some(T)`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.Some + fn serialize_some(self, value: &T) -> Result + where + T: Serialize; + + /// Serialize a `()` value. + /// + /// ```edition2018 + /// # use serde::Serializer; + /// # + /// # serde::__private_serialize!(); + /// # + /// impl Serialize for () { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_unit() + /// } + /// } + /// ``` + fn serialize_unit(self) -> Result; + + /// Serialize a unit struct like `struct Unit` or `PhantomData`. + /// + /// A reasonable implementation would be to forward to `serialize_unit`. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// + /// struct Nothing; + /// + /// impl Serialize for Nothing { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_unit_struct("Nothing") + /// } + /// } + /// ``` + fn serialize_unit_struct(self, name: &'static str) -> Result; + + /// Serialize a unit variant like `E::A` in `enum E { A, B }`. + /// + /// The `name` is the name of the enum, the `variant_index` is the index of + /// this variant within the enum, and the `variant` is the name of the + /// variant. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// + /// enum E { + /// A, + /// B, + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// E::A => serializer.serialize_unit_variant("E", 0, "A"), + /// E::B => serializer.serialize_unit_variant("E", 1, "B"), + /// } + /// } + /// } + /// ``` + fn serialize_unit_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + ) -> Result; + + /// Serialize a newtype struct like `struct Millimeters(u8)`. + /// + /// Serializers are encouraged to treat newtype structs as insignificant + /// wrappers around the data they contain. A reasonable implementation would + /// be to forward to `value.serialize(self)`. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// + /// struct Millimeters(u8); + /// + /// impl Serialize for Millimeters { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.serialize_newtype_struct("Millimeters", &self.0) + /// } + /// } + /// ``` + fn serialize_newtype_struct( + self, + name: &'static str, + value: &T, + ) -> Result + where + T: Serialize; + + /// Serialize a newtype variant like `E::N` in `enum E { N(u8) }`. + /// + /// The `name` is the name of the enum, the `variant_index` is the index of + /// this variant within the enum, and the `variant` is the name of the + /// variant. The `value` is the data contained within this newtype variant. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// + /// enum E { + /// M(String), + /// N(u8), + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// E::M(ref s) => serializer.serialize_newtype_variant("E", 0, "M", s), + /// E::N(n) => serializer.serialize_newtype_variant("E", 1, "N", &n), + /// } + /// } + /// } + /// ``` + fn serialize_newtype_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + value: &T, + ) -> Result + where + T: Serialize; + + /// Begin to serialize a variably sized sequence. This call must be + /// followed by zero or more calls to `serialize_element`, then a call to + /// `end`. + /// + /// The argument is the number of elements in the sequence, which may or may + /// not be computable before the sequence is iterated. Some serializers only + /// support sequences whose length is known up front. + /// + /// ```edition2018 + /// # use std::marker::PhantomData; + /// # + /// # struct Vec(PhantomData); + /// # + /// # impl Vec { + /// # fn len(&self) -> usize { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # impl<'a, T> IntoIterator for &'a Vec { + /// # type Item = &'a T; + /// # type IntoIter = Box>; + /// # + /// # fn into_iter(self) -> Self::IntoIter { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{Serialize, Serializer, SerializeSeq}; + /// + /// impl Serialize for Vec + /// where + /// T: Serialize, + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut seq = serializer.serialize_seq(Some(self.len()))?; + /// for element in self { + /// seq.serialize_element(element)?; + /// } + /// seq.end() + /// } + /// } + /// ``` + fn serialize_seq(self, len: Option) -> Result; + + /// Begin to serialize a statically sized sequence whose length will be + /// known at deserialization time without looking at the serialized data. + /// This call must be followed by zero or more calls to `serialize_element`, + /// then a call to `end`. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, Serializer, SerializeTuple}; + /// + /// # mod fool { + /// # trait Serialize {} + /// impl Serialize for (A, B, C) + /// # {} + /// # } + /// # + /// # struct Tuple3(A, B, C); + /// # + /// # impl Serialize for Tuple3 + /// where + /// A: Serialize, + /// B: Serialize, + /// C: Serialize, + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut tup = serializer.serialize_tuple(3)?; + /// tup.serialize_element(&self.0)?; + /// tup.serialize_element(&self.1)?; + /// tup.serialize_element(&self.2)?; + /// tup.end() + /// } + /// } + /// ``` + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeTuple, Serializer}; + /// + /// const VRAM_SIZE: usize = 386; + /// struct Vram([u16; VRAM_SIZE]); + /// + /// impl Serialize for Vram { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut seq = serializer.serialize_tuple(VRAM_SIZE)?; + /// for element in &self.0[..] { + /// seq.serialize_element(element)?; + /// } + /// seq.end() + /// } + /// } + /// ``` + fn serialize_tuple(self, len: usize) -> Result; + + /// Begin to serialize a tuple struct like `struct Rgb(u8, u8, u8)`. This + /// call must be followed by zero or more calls to `serialize_field`, then a + /// call to `end`. + /// + /// The `name` is the name of the tuple struct and the `len` is the number + /// of data fields that will be serialized. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeTupleStruct, Serializer}; + /// + /// struct Rgb(u8, u8, u8); + /// + /// impl Serialize for Rgb { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; + /// ts.serialize_field(&self.0)?; + /// ts.serialize_field(&self.1)?; + /// ts.serialize_field(&self.2)?; + /// ts.end() + /// } + /// } + /// ``` + fn serialize_tuple_struct( + self, + name: &'static str, + len: usize, + ) -> Result; + + /// Begin to serialize a tuple variant like `E::T` in `enum E { T(u8, u8) + /// }`. This call must be followed by zero or more calls to + /// `serialize_field`, then a call to `end`. + /// + /// The `name` is the name of the enum, the `variant_index` is the index of + /// this variant within the enum, the `variant` is the name of the variant, + /// and the `len` is the number of data fields that will be serialized. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeTupleVariant, Serializer}; + /// + /// enum E { + /// T(u8, u8), + /// U(String, u32, u32), + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// E::T(ref a, ref b) => { + /// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; + /// tv.serialize_field(a)?; + /// tv.serialize_field(b)?; + /// tv.end() + /// } + /// E::U(ref a, ref b, ref c) => { + /// let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?; + /// tv.serialize_field(a)?; + /// tv.serialize_field(b)?; + /// tv.serialize_field(c)?; + /// tv.end() + /// } + /// } + /// } + /// } + /// ``` + fn serialize_tuple_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result; + + /// Begin to serialize a map. This call must be followed by zero or more + /// calls to `serialize_key` and `serialize_value`, then a call to `end`. + /// + /// The argument is the number of elements in the map, which may or may not + /// be computable before the map is iterated. Some serializers only support + /// maps whose length is known up front. + /// + /// ```edition2018 + /// # use std::marker::PhantomData; + /// # + /// # struct HashMap(PhantomData, PhantomData); + /// # + /// # impl HashMap { + /// # fn len(&self) -> usize { + /// # unimplemented!() + /// # } + /// # } + /// # + /// # impl<'a, K, V> IntoIterator for &'a HashMap { + /// # type Item = (&'a K, &'a V); + /// # type IntoIter = Box>; + /// # + /// # fn into_iter(self) -> Self::IntoIter { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::ser::{Serialize, Serializer, SerializeMap}; + /// + /// impl Serialize for HashMap + /// where + /// K: Serialize, + /// V: Serialize, + /// { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut map = serializer.serialize_map(Some(self.len()))?; + /// for (k, v) in self { + /// map.serialize_entry(k, v)?; + /// } + /// map.end() + /// } + /// } + /// ``` + fn serialize_map(self, len: Option) -> Result; + + /// Begin to serialize a struct like `struct Rgb { r: u8, g: u8, b: u8 }`. + /// This call must be followed by zero or more calls to `serialize_field`, + /// then a call to `end`. + /// + /// The `name` is the name of the struct and the `len` is the number of + /// data fields that will be serialized. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeStruct, Serializer}; + /// + /// struct Rgb { + /// r: u8, + /// g: u8, + /// b: u8, + /// } + /// + /// impl Serialize for Rgb { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// let mut rgb = serializer.serialize_struct("Rgb", 3)?; + /// rgb.serialize_field("r", &self.r)?; + /// rgb.serialize_field("g", &self.g)?; + /// rgb.serialize_field("b", &self.b)?; + /// rgb.end() + /// } + /// } + /// ``` + fn serialize_struct( + self, + name: &'static str, + len: usize, + ) -> Result; + + /// Begin to serialize a struct variant like `E::S` in `enum E { S { r: u8, + /// g: u8, b: u8 } }`. This call must be followed by zero or more calls to + /// `serialize_field`, then a call to `end`. + /// + /// The `name` is the name of the enum, the `variant_index` is the index of + /// this variant within the enum, the `variant` is the name of the variant, + /// and the `len` is the number of data fields that will be serialized. + /// + /// ```edition2018 + /// use serde::ser::{Serialize, SerializeStructVariant, Serializer}; + /// + /// enum E { + /// S { r: u8, g: u8, b: u8 }, + /// } + /// + /// impl Serialize for E { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// match *self { + /// E::S { + /// ref r, + /// ref g, + /// ref b, + /// } => { + /// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; + /// sv.serialize_field("r", r)?; + /// sv.serialize_field("g", g)?; + /// sv.serialize_field("b", b)?; + /// sv.end() + /// } + /// } + /// } + /// } + /// ``` + fn serialize_struct_variant( + self, + name: &'static str, + variant_index: u32, + variant: &'static str, + len: usize, + ) -> Result; + + /// Collect an iterator as a sequence. + /// + /// The default implementation serializes each item yielded by the iterator + /// using [`serialize_seq`]. Implementors should not need to override this + /// method. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// + /// struct SecretlyOneHigher { + /// data: Vec, + /// } + /// + /// impl Serialize for SecretlyOneHigher { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.collect_seq(self.data.iter().map(|x| x + 1)) + /// } + /// } + /// ``` + /// + /// [`serialize_seq`]: #tymethod.serialize_seq + fn collect_seq(self, iter: I) -> Result + where + I: IntoIterator, + ::Item: Serialize, + { + let iter = iter.into_iter(); + let mut serializer = try!(self.serialize_seq(iter.len_hint())); + for item in iter { + try!(serializer.serialize_element(&item)); + } + serializer.end() + } + + /// Collect an iterator as a map. + /// + /// The default implementation serializes each pair yielded by the iterator + /// using [`serialize_map`]. Implementors should not need to override this + /// method. + /// + /// ```edition2018 + /// use serde::{Serialize, Serializer}; + /// use std::collections::BTreeSet; + /// + /// struct MapToUnit { + /// keys: BTreeSet, + /// } + /// + /// // Serializes as a map in which the values are all unit. + /// impl Serialize for MapToUnit { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.collect_map(self.keys.iter().map(|k| (k, ()))) + /// } + /// } + /// ``` + /// + /// [`serialize_map`]: #tymethod.serialize_map + fn collect_map(self, iter: I) -> Result + where + K: Serialize, + V: Serialize, + I: IntoIterator, + { + let iter = iter.into_iter(); + let mut serializer = try!(self.serialize_map(iter.len_hint())); + for (key, value) in iter { + try!(serializer.serialize_entry(&key, &value)); + } + serializer.end() + } + + /// Serialize a string produced by an implementation of `Display`. + /// + /// The default implementation builds a heap-allocated [`String`] and + /// delegates to [`serialize_str`]. Serializers are encouraged to provide a + /// more efficient implementation if possible. + /// + /// ```edition2018 + /// # struct DateTime; + /// # + /// # impl DateTime { + /// # fn naive_local(&self) -> () { () } + /// # fn offset(&self) -> () { () } + /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// + /// impl Serialize for DateTime { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.collect_str(&format_args!("{:?}{:?}", + /// self.naive_local(), + /// self.offset())) + /// } + /// } + /// ``` + /// + /// [`String`]: https://doc.rust-lang.org/std/string/struct.String.html + /// [`serialize_str`]: #tymethod.serialize_str + #[cfg(any(feature = "std", feature = "alloc"))] + fn collect_str(self, value: &T) -> Result + where + T: Display, + { + use lib::fmt::Write; + let mut string = String::new(); + write!(string, "{}", value).unwrap(); + self.serialize_str(&string) + } + + /// Serialize a string produced by an implementation of `Display`. + /// + /// Serializers that use `no_std` are required to provide an implementation + /// of this method. If no more sensible behavior is possible, the + /// implementation is expected to return an error. + /// + /// ```edition2018 + /// # struct DateTime; + /// # + /// # impl DateTime { + /// # fn naive_local(&self) -> () { () } + /// # fn offset(&self) -> () { () } + /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// + /// impl Serialize for DateTime { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// serializer.collect_str(&format_args!("{:?}{:?}", + /// self.naive_local(), + /// self.offset())) + /// } + /// } + /// ``` + #[cfg(not(any(feature = "std", feature = "alloc")))] + fn collect_str(self, value: &T) -> Result + where + T: Display; + + /// Determine whether `Serialize` implementations should serialize in + /// human-readable form. + /// + /// Some types have a human-readable form that may be somewhat expensive to + /// construct, as well as a binary form that is compact and efficient. + /// Generally text-based formats like JSON and YAML will prefer to use the + /// human-readable one and binary formats like Bincode will prefer the + /// compact one. + /// + /// ```edition2018 + /// # use std::fmt::{self, Display}; + /// # + /// # struct Timestamp; + /// # + /// # impl Timestamp { + /// # fn seconds_since_epoch(&self) -> u64 { unimplemented!() } + /// # } + /// # + /// # impl Display for Timestamp { + /// # fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + /// # unimplemented!() + /// # } + /// # } + /// # + /// use serde::{Serialize, Serializer}; + /// + /// impl Serialize for Timestamp { + /// fn serialize(&self, serializer: S) -> Result + /// where + /// S: Serializer, + /// { + /// if serializer.is_human_readable() { + /// // Serialize to a human-readable string "2015-05-15T17:01:00Z". + /// self.to_string().serialize(serializer) + /// } else { + /// // Serialize to a compact binary representation. + /// self.seconds_since_epoch().serialize(serializer) + /// } + /// } + /// } + /// ``` + /// + /// The default implementation of this method returns `true`. Data formats + /// may override this to `false` to request a compact form for types that + /// support one. Note that modifying this method to change a format from + /// human-readable to compact or vice versa should be regarded as a breaking + /// change, as a value serialized in human-readable mode is not required to + /// deserialize from the same data in compact mode. + #[inline] + fn is_human_readable(&self) -> bool { + true + } +} + +/// Returned from `Serializer::serialize_seq`. +/// +/// # Example use +/// +/// ```edition2018 +/// # use std::marker::PhantomData; +/// # +/// # struct Vec(PhantomData); +/// # +/// # impl Vec { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, T> IntoIterator for &'a Vec { +/// # type Item = &'a T; +/// # type IntoIter = Box>; +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeSeq}; +/// +/// impl Serialize for Vec +/// where +/// T: Serialize, +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut seq = serializer.serialize_seq(Some(self.len()))?; +/// for element in self { +/// seq.serialize_element(element)?; +/// } +/// seq.end() +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeSeq` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeSeq { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a sequence element. + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Finish serializing a sequence. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_tuple`. +/// +/// # Example use +/// +/// ```edition2018 +/// use serde::ser::{Serialize, Serializer, SerializeTuple}; +/// +/// # mod fool { +/// # trait Serialize {} +/// impl Serialize for (A, B, C) +/// # {} +/// # } +/// # +/// # struct Tuple3(A, B, C); +/// # +/// # impl Serialize for Tuple3 +/// where +/// A: Serialize, +/// B: Serialize, +/// C: Serialize, +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut tup = serializer.serialize_tuple(3)?; +/// tup.serialize_element(&self.0)?; +/// tup.serialize_element(&self.1)?; +/// tup.serialize_element(&self.2)?; +/// tup.end() +/// } +/// } +/// ``` +/// +/// ```edition2018 +/// # use std::marker::PhantomData; +/// # +/// # struct Array(PhantomData); +/// # +/// # impl Array { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, T> IntoIterator for &'a Array { +/// # type Item = &'a T; +/// # type IntoIter = Box>; +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeTuple}; +/// +/// # mod fool { +/// # trait Serialize {} +/// impl Serialize for [T; 16] +/// # {} +/// # } +/// # +/// # impl Serialize for Array +/// where +/// T: Serialize, +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut seq = serializer.serialize_tuple(16)?; +/// for element in self { +/// seq.serialize_element(element)?; +/// } +/// seq.end() +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeTuple` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeTuple { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a tuple element. + fn serialize_element(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Finish serializing a tuple. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_tuple_struct`. +/// +/// # Example use +/// +/// ```edition2018 +/// use serde::ser::{Serialize, SerializeTupleStruct, Serializer}; +/// +/// struct Rgb(u8, u8, u8); +/// +/// impl Serialize for Rgb { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut ts = serializer.serialize_tuple_struct("Rgb", 3)?; +/// ts.serialize_field(&self.0)?; +/// ts.serialize_field(&self.1)?; +/// ts.serialize_field(&self.2)?; +/// ts.end() +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeTupleStruct` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeTupleStruct { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a tuple struct field. + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Finish serializing a tuple struct. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_tuple_variant`. +/// +/// # Example use +/// +/// ```edition2018 +/// use serde::ser::{Serialize, SerializeTupleVariant, Serializer}; +/// +/// enum E { +/// T(u8, u8), +/// U(String, u32, u32), +/// } +/// +/// impl Serialize for E { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// match *self { +/// E::T(ref a, ref b) => { +/// let mut tv = serializer.serialize_tuple_variant("E", 0, "T", 2)?; +/// tv.serialize_field(a)?; +/// tv.serialize_field(b)?; +/// tv.end() +/// } +/// E::U(ref a, ref b, ref c) => { +/// let mut tv = serializer.serialize_tuple_variant("E", 1, "U", 3)?; +/// tv.serialize_field(a)?; +/// tv.serialize_field(b)?; +/// tv.serialize_field(c)?; +/// tv.end() +/// } +/// } +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeTupleVariant` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeTupleVariant { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a tuple variant field. + fn serialize_field(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Finish serializing a tuple variant. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_map`. +/// +/// # Example use +/// +/// ```edition2018 +/// # use std::marker::PhantomData; +/// # +/// # struct HashMap(PhantomData, PhantomData); +/// # +/// # impl HashMap { +/// # fn len(&self) -> usize { +/// # unimplemented!() +/// # } +/// # } +/// # +/// # impl<'a, K, V> IntoIterator for &'a HashMap { +/// # type Item = (&'a K, &'a V); +/// # type IntoIter = Box>; +/// # +/// # fn into_iter(self) -> Self::IntoIter { +/// # unimplemented!() +/// # } +/// # } +/// # +/// use serde::ser::{Serialize, Serializer, SerializeMap}; +/// +/// impl Serialize for HashMap +/// where +/// K: Serialize, +/// V: Serialize, +/// { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut map = serializer.serialize_map(Some(self.len()))?; +/// for (k, v) in self { +/// map.serialize_entry(k, v)?; +/// } +/// map.end() +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeMap` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeMap { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a map key. + /// + /// If possible, `Serialize` implementations are encouraged to use + /// `serialize_entry` instead as it may be implemented more efficiently in + /// some formats compared to a pair of calls to `serialize_key` and + /// `serialize_value`. + fn serialize_key(&mut self, key: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Serialize a map value. + /// + /// # Panics + /// + /// Calling `serialize_value` before `serialize_key` is incorrect and is + /// allowed to panic or produce bogus results. + fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> + where + T: Serialize; + + /// Serialize a map entry consisting of a key and a value. + /// + /// Some [`Serialize`] types are not able to hold a key and value in memory + /// at the same time so `SerializeMap` implementations are required to + /// support [`serialize_key`] and [`serialize_value`] individually. The + /// `serialize_entry` method allows serializers to optimize for the case + /// where key and value are both available. [`Serialize`] implementations + /// are encouraged to use `serialize_entry` if possible. + /// + /// The default implementation delegates to [`serialize_key`] and + /// [`serialize_value`]. This is appropriate for serializers that do not + /// care about performance or are not able to optimize `serialize_entry` any + /// better than this. + /// + /// [`Serialize`]: ../trait.Serialize.html + /// [`serialize_key`]: #tymethod.serialize_key + /// [`serialize_value`]: #tymethod.serialize_value + fn serialize_entry( + &mut self, + key: &K, + value: &V, + ) -> Result<(), Self::Error> + where + K: Serialize, + V: Serialize, + { + try!(self.serialize_key(key)); + self.serialize_value(value) + } + + /// Finish serializing a map. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_struct`. +/// +/// # Example use +/// +/// ```edition2018 +/// use serde::ser::{Serialize, SerializeStruct, Serializer}; +/// +/// struct Rgb { +/// r: u8, +/// g: u8, +/// b: u8, +/// } +/// +/// impl Serialize for Rgb { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// let mut rgb = serializer.serialize_struct("Rgb", 3)?; +/// rgb.serialize_field("r", &self.r)?; +/// rgb.serialize_field("g", &self.g)?; +/// rgb.serialize_field("b", &self.b)?; +/// rgb.end() +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeStruct` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeStruct { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a struct field. + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize; + + /// Indicate that a struct field has been skipped. + #[inline] + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { + let _ = key; + Ok(()) + } + + /// Finish serializing a struct. + fn end(self) -> Result; +} + +/// Returned from `Serializer::serialize_struct_variant`. +/// +/// # Example use +/// +/// ```edition2018 +/// use serde::ser::{Serialize, SerializeStructVariant, Serializer}; +/// +/// enum E { +/// S { r: u8, g: u8, b: u8 }, +/// } +/// +/// impl Serialize for E { +/// fn serialize(&self, serializer: S) -> Result +/// where +/// S: Serializer, +/// { +/// match *self { +/// E::S { +/// ref r, +/// ref g, +/// ref b, +/// } => { +/// let mut sv = serializer.serialize_struct_variant("E", 0, "S", 3)?; +/// sv.serialize_field("r", r)?; +/// sv.serialize_field("g", g)?; +/// sv.serialize_field("b", b)?; +/// sv.end() +/// } +/// } +/// } +/// } +/// ``` +/// +/// # Example implementation +/// +/// The [example data format] presented on the website demonstrates an +/// implementation of `SerializeStructVariant` for a basic JSON data format. +/// +/// [example data format]: https://serde.rs/data-format.html +pub trait SerializeStructVariant { + /// Must match the `Ok` type of our `Serializer`. + type Ok; + + /// Must match the `Error` type of our `Serializer`. + type Error: Error; + + /// Serialize a struct variant field. + fn serialize_field( + &mut self, + key: &'static str, + value: &T, + ) -> Result<(), Self::Error> + where + T: Serialize; + + /// Indicate that a struct variant field has been skipped. + #[inline] + fn skip_field(&mut self, key: &'static str) -> Result<(), Self::Error> { + let _ = key; + Ok(()) + } + + /// Finish serializing a struct variant. + fn end(self) -> Result; +} + +trait LenHint: Iterator { + fn len_hint(&self) -> Option; +} + +impl LenHint for I +where + I: Iterator, +{ + #[cfg(not(feature = "unstable"))] + fn len_hint(&self) -> Option { + iterator_len_hint(self) + } + + #[cfg(feature = "unstable")] + default fn len_hint(&self) -> Option { + iterator_len_hint(self) + } +} + +#[cfg(feature = "unstable")] +impl LenHint for I +where + I: ExactSizeIterator, +{ + fn len_hint(&self) -> Option { + Some(self.len()) + } +} + +fn iterator_len_hint(iter: &I) -> Option +where + I: Iterator, +{ + match iter.size_hint() { + (lo, Some(hi)) if lo == hi => Some(lo), + _ => None, + } +} diff --git a/vendor/registry-40351f815f426200/strsim/.cargo-checksum.json b/vendor/registry-40351f815f426200/strsim/.cargo-checksum.json new file mode 100644 index 000000000..34f406bf3 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"CHANGELOG.md":"5f3e55f36768b2d2e40ee54702d6298175b7736e9b8918ca03592011f053c25f","Cargo.toml":"ff9b4b5bd80560ed36b14313261763d321cfb9e3f212896ec565fb872e26c3f0","LICENSE":"9b60c5838cbe7953b84bb2206835cb2bc898802da4c449e4442cf23e3ad4841e","README.md":"1778e287c6788197322a352721414f7ceab0c84ee0918513bb9f5382d3e40bc6","appveyor.yml":"b41eae9798a9bb250f6046509d9bbd6e63bac9ad2655d342b3d9c8975584f0c0","dev":"498932c7296d8abeb9e432e797a579787a85a052fa514325b873c4fe3200ec67","src/lib.rs":"a79164ec2334c477ca9d25e10c161e0e9bb8ae8670eb22976948c2a574b40985","tests/lib.rs":"43c707f9c9d35fafa07b34f61418ac877687daba5a0790d87e47b3d2c8bad274"},"package":"b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/strsim/CHANGELOG.md b/vendor/registry-40351f815f426200/strsim/CHANGELOG.md new file mode 100644 index 000000000..2570cbdc9 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/CHANGELOG.md @@ -0,0 +1,103 @@ +# Change Log +This project attempts to adhere to [Semantic Versioning](http://semver.org). + +## [0.6.0] - (2016-12-26) +### Added +- Add optimal string alignment distance + +### Fixed +- Fix Damerau-Levenshtein implementation (previous implementation was actually +optimal string alignment; see this [Damerau-Levenshtein explanation]) + +## [0.5.2] - (2016-11-21) +### Changed +- Remove Cargo generated documentation in favor of a [docs.rs] link + +## [0.5.1] - (2016-08-23) +### Added +- Add Cargo generated documentation + +### Fixed +- Fix panic when Jaro or Jaro-Winkler are given strings both with a length of +one + +## [0.5.0] - (2016-08-11) +### Changed +- Make Hamming faster (thanks @IBUzPE9) when the two strings have the same +length but slower when they have different lengths + +## [0.4.1] - (2016-04-18) +### Added +- Add Vagrant setup for development +- Add AppVeyor configuration for Windows CI + +### Fixed +- Fix metrics when given strings with multibyte characters (thanks @WanzenBug) + +## [0.4.0] - (2015-06-10) +### Added +- For each metric, add a function that takes a vector of strings and returns a +vector of results (thanks @ovarene) + +## [0.3.0] - (2015-04-30) +### Changed +- Remove usage of unstable Rust features + +## [0.2.5] - (2015-04-24) +### Fixed +- Remove unnecessary `Float` import from doc tests + +## [0.2.4] - (2015-04-15) +### Fixed +- Remove unused `core` feature flag + +## [0.2.3] - (2015-04-01) +### Fixed +- Remove now unnecessary `Float` import + +## [0.2.2] - (2015-03-29) +### Fixed +- Remove usage of `char_at` (marked as unstable) + +## [0.2.1] - (2015-02-20) +### Fixed +- Update bit vector import to match Rust update + +## [0.2.0] - (2015-02-19) +### Added +- Implement Damerau-Levenshtein +- Add tests in docs + +## [0.1.1] - (2015-02-10) +### Added +- Configure Travis for CI +- Add rustdoc comments + +### Fixed +- Limit Jaro-Winkler return value to a maximum of 1.0 +- Fix float comparsions in tests + +## [0.1.0] - (2015-02-09) +### Added +- Implement Hamming, Jaro, Jaro-Winkler, and Levenshtein + +[Unreleased]: https://github.com/dguo/strsim-rs/compare/0.6.0...HEAD +[0.6.0]: https://github.com/dguo/strsim-rs/compare/0.5.2...0.6.0 +[0.5.2]: https://github.com/dguo/strsim-rs/compare/0.5.1...0.5.2 +[0.5.1]: https://github.com/dguo/strsim-rs/compare/0.5.0...0.5.1 +[0.5.0]: https://github.com/dguo/strsim-rs/compare/0.4.1...0.5.0 +[0.4.1]: https://github.com/dguo/strsim-rs/compare/0.4.0...0.4.1 +[0.4.0]: https://github.com/dguo/strsim-rs/compare/0.3.0...0.4.0 +[0.3.0]: https://github.com/dguo/strsim-rs/compare/0.2.5...0.3.0 +[0.2.5]: https://github.com/dguo/strsim-rs/compare/0.2.4...0.2.5 +[0.2.4]: https://github.com/dguo/strsim-rs/compare/0.2.3...0.2.4 +[0.2.3]: https://github.com/dguo/strsim-rs/compare/0.2.2...0.2.3 +[0.2.2]: https://github.com/dguo/strsim-rs/compare/0.2.1...0.2.2 +[0.2.1]: https://github.com/dguo/strsim-rs/compare/0.2.0...0.2.1 +[0.2.0]: https://github.com/dguo/strsim-rs/compare/0.1.1...0.2.0 +[0.1.1]: https://github.com/dguo/strsim-rs/compare/0.1.0...0.1.1 +[0.1.0]: https://github.com/dguo/strsim-rs/compare/fabad4...0.1.0 +[docs.rs]: https://docs.rs/strsim/ +[Damerau-Levenshtein explanation]: +http://scarcitycomputing.blogspot.com/2013/04/damerau-levenshtein-edit-distance.html + diff --git a/vendor/registry-40351f815f426200/strsim/Cargo.toml b/vendor/registry-40351f815f426200/strsim/Cargo.toml new file mode 100644 index 000000000..1db488204 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/Cargo.toml @@ -0,0 +1,17 @@ +[package] + +name = "strsim" +version = "0.6.0" +authors = ["Danny Guo "] +description = """ +Implementations of string similarity metrics. +Includes Hamming, Levenshtein, Damerau-Levenshtein, Jaro, and Jaro-Winkler. +""" +license = "MIT" +readme = "README.md" +keywords = ["string", "similarity", "Hamming", + "Levenshtein", "Jaro"] +homepage = "https://github.com/dguo/strsim-rs" +repository = "https://github.com/dguo/strsim-rs" +documentation = "http://dannyguo.com/strsim-rs/" + diff --git a/vendor/registry-40351f815f426200/strsim/LICENSE b/vendor/registry-40351f815f426200/strsim/LICENSE new file mode 100644 index 000000000..d35e62c38 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Danny Guo + +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/vendor/registry-40351f815f426200/strsim/README.md b/vendor/registry-40351f815f426200/strsim/README.md new file mode 100644 index 000000000..dc0a1e33e --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/README.md @@ -0,0 +1,95 @@ +# strsim-rs [![Crates.io](https://img.shields.io/crates/v/strsim.svg)](https://crates.io/crates/strsim) [![Crates.io](https://img.shields.io/crates/l/strsim.svg?maxAge=2592000)](https://github.com/dguo/strsim-rs/blob/master/LICENSE) [![Linux build status](https://travis-ci.org/dguo/strsim-rs.svg?branch=master)](https://travis-ci.org/dguo/strsim-rs) [![Windows build status](https://ci.appveyor.com/api/projects/status/ggue6i785618a39w?svg=true)](https://ci.appveyor.com/project/dguo/strsim-rs) + +[Rust](https://www.rust-lang.org) implementations of [string similarity metrics]: + - [Hamming] + - [Levenshtein] + - [Optimal string alignment] + - [Damerau-Levenshtein] + - [Jaro and Jaro-Winkler] - this implementation of Jaro-Winkler does not limit the common prefix length + +### Installation +```toml +# Cargo.toml +[dependencies] +strsim = "0.6.0" +``` + +### [Documentation](https://docs.rs/strsim/) +You can change the version in the url to see the documentation for an older +version in the +[changelog](https://github.com/dguo/strsim-rs/blob/master/CHANGELOG.md). + +### Usage +```rust +extern crate strsim; + +use strsim::{hamming, levenshtein, osa_distance, damerau_levenshtein, jaro, + jaro_winkler, levenshtein_against_vec, osa_distance_against_vec, + damerau_levenshtein_against_vec, jaro_against_vec, + jaro_winkler_against_vec}; + +fn main() { + match hamming("hamming", "hammers") { + Ok(distance) => assert_eq!(3, distance), + Err(why) => panic!("{:?}", why) + } + + assert_eq!(3, levenshtein("kitten", "sitting")); + + assert_eq!(3, osa_distance("ac", "cba")); + + assert_eq!(2, damerau_levenshtein("ac", "cba")); + + assert!((0.392 - jaro("Friedrich Nietzsche", "Jean-Paul Sartre")).abs() < + 0.001); + + assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() < + 0.001); + + // get vectors of values back + let v = vec!["test", "test1", "test12", "test123", "", "tset", "tsvet"]; + + assert_eq!(levenshtein_against_vec("test", &v), + vec![0, 1, 2, 3, 4, 2, 3]); + + assert_eq!(osa_distance_against_vec("test", &v), + vec![0, 1, 2, 3, 4, 1, 3]); + + assert_eq!(damerau_levenshtein_against_vec("test", &v), + vec![0, 1, 2, 3, 4, 1, 2]); + + let jaro_distances = jaro_against_vec("test", &v); + let jaro_expected = vec![1.0, 0.933333, 0.888889, 0.857143, 0.0, 0.916667]; + let jaro_delta: f64 = jaro_distances.iter() + .zip(jaro_expected.iter()) + .map(|(x, y)| (x - y).abs() as f64) + .fold(0.0, |x, y| x + y as f64); + assert!(jaro_delta < 0.0001); + + let jaro_winkler_distances = jaro_winkler_against_vec("test", &v); + let jaro_winkler_expected = vec![1.0, 0.96, 0.933333, 0.914286, 0.0, 0.925]; + let jaro_winkler_delta = jaro_winkler_distances.iter() + .zip(jaro_winkler_expected.iter()) + .map(|(x, y)| (x - y).abs() as f64) + .fold(0.0, |x, y| x + y as f64); + assert!(jaro_winkler_delta < 0.0001); +} +``` + +### Development +If you don't want to install Rust itself, you can install [Docker], and run +`$ ./dev`. This should bring up a temporary container from which you can run +[cargo] commands. + +### License +[MIT](https://github.com/dguo/strsim-rs/blob/master/LICENSE) + +[string similarity metrics]:http://en.wikipedia.org/wiki/String_metric +[Damerau-Levenshtein]:http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance +[Jaro and Jaro-Winkler]:http://en.wikipedia.org/wiki/Jaro%E2%80%93Winkler_distance +[Levenshtein]:http://en.wikipedia.org/wiki/Levenshtein_distance +[Hamming]:http://en.wikipedia.org/wiki/Hamming_distance +[Optimal string alignment]:https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance#Optimal_string_alignment_distance +[Docker]:https://docs.docker.com/engine/installation/ +[cargo]:https://github.com/rust-lang/cargo + diff --git a/vendor/registry-40351f815f426200/strsim/appveyor.yml b/vendor/registry-40351f815f426200/strsim/appveyor.yml new file mode 100644 index 000000000..fb992db82 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/appveyor.yml @@ -0,0 +1,13 @@ +install: + - ps: Start-FileDownload 'https://static.rust-lang.org/dist/rust-beta-x86_64-pc-windows-gnu.exe' + - rust-beta-x86_64-pc-windows-gnu.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust" + - SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin + - rustc -V + - cargo -V + +build: false + +test_script: + - cargo build + - cargo test --verbose + diff --git a/vendor/registry-40351f815f426200/strsim/dev b/vendor/registry-40351f815f426200/strsim/dev new file mode 100755 index 000000000..0e32354d0 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/dev @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +from __future__ import print_function + +import os +from subprocess import call +import sys + +try: + call(['docker', 'run', '-it', '--rm', '-v', os.getcwd() + ':/source', + 'jimmycuadra/rust:1.14.0']) +except OSError: + print('Please install Docker.', file=sys.stderr) + diff --git a/vendor/registry-40351f815f426200/strsim/src/lib.rs b/vendor/registry-40351f815f426200/strsim/src/lib.rs new file mode 100644 index 000000000..3cf285bbe --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/src/lib.rs @@ -0,0 +1,911 @@ +//! This library implements string similarity metrics. + +use std::char; +use std::cmp::{max, min}; +use std::collections::HashMap; + +#[derive(Debug, PartialEq)] +pub enum StrSimError { + DifferentLengthArgs +} + +pub type HammingResult = Result; + +/// Calculates the number of positions in the two strings where the characters +/// differ. Returns an error if the strings have different lengths. +/// +/// ``` +/// use strsim::hamming; +/// +/// match hamming("hamming", "hammers") { +/// Ok(distance) => assert_eq!(3, distance), +/// Err(why) => panic!("{:?}", why) +/// } +/// ``` +pub fn hamming(a: &str, b: &str) -> HammingResult { + let (mut ita, mut itb, mut count) = (a.chars(), b.chars(), 0); + loop { + match (ita.next(), itb.next()){ + (Some(x), Some(y)) => if x != y { count += 1 }, + (None, None) => return Ok(count), + _ => return Err(StrSimError::DifferentLengthArgs), + } + } +} + +/// Calculates the Jaro similarity between two strings. The returned value +/// is between 0.0 and 1.0 (higher value means more similar). +/// +/// ``` +/// use strsim::jaro; +/// +/// assert!((0.392 - jaro("Friedrich Nietzsche", "Jean-Paul Sartre")).abs() < +/// 0.001); +/// ``` +pub fn jaro(a: &str, b: &str) -> f64 { + if a == b { return 1.0; } + + let a_len = a.chars().count(); + let b_len = b.chars().count(); + + // The check for lengths of one here is to prevent integer overflow when + // calculating the search range. + if a_len == 0 || b_len == 0 || (a_len == 1 && b_len == 1) { + return 0.0; + } + + let search_range = (max(a_len, b_len) / 2) - 1; + + let mut b_consumed = Vec::with_capacity(b_len); + for _ in 0..b_len { + b_consumed.push(false); + } + let mut matches = 0.0; + + let mut transpositions = 0.0; + let mut b_match_index = 0; + + for (i, a_char) in a.chars().enumerate() { + let min_bound = + // prevent integer wrapping + if i > search_range { + max(0, i - search_range) + } else { + 0 + }; + + let max_bound = min(b_len - 1, i + search_range); + + if min_bound > max_bound { + continue; + } + + for (j, b_char) in b.chars().enumerate() { + if min_bound <= j && j <= max_bound && a_char == b_char && + !b_consumed[j] { + b_consumed[j] = true; + matches += 1.0; + + if j < b_match_index { + transpositions += 1.0; + } + b_match_index = j; + + break; + } + } + } + + if matches == 0.0 { + 0.0 + } else { + (1.0 / 3.0) * ((matches / a_len as f64) + + (matches / b_len as f64) + + ((matches - transpositions) / matches)) + } +} + +/// Calculates the Jaro distance between a string and each string in a vector. +/// Returns a vector of corresponding values between 0.0 and 1.0 (higher value +/// means more similar). +/// +/// ``` +/// use strsim::jaro_against_vec; +/// +/// let v = vec!["test", "test1", "test12", "test123", "", "tset"]; +/// let result = jaro_against_vec("test", &v); +/// let expected = vec![1.0, 0.933333, 0.888889, 0.857143, 0.0, 0.916667]; +/// let delta: f64 = result.iter() +/// .zip(expected.iter()) +/// .map(|(x, y)| (x - y).abs() as f64) +/// .fold(0.0, |x, y| x + y as f64); +/// assert!(delta.abs() < 0.0001); +/// ``` +pub fn jaro_against_vec(a: &str, v: &[&str]) -> Vec { + v.iter().map(|b| jaro(a, b)).collect() +} + +/// Like Jaro but gives a boost to strings that have a common prefix. +/// +/// ``` +/// use strsim::jaro_winkler; +/// +/// assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() < +/// 0.001); +/// ``` +pub fn jaro_winkler(a: &str, b: &str) -> f64 { + let jaro_distance = jaro(a, b); + + // Don't limit the length of the common prefix + let prefix_length = a.chars() + .zip(b.chars()) + .take_while(|&(a_char, b_char)| a_char == b_char) + .count(); + + let jaro_winkler_distance = + jaro_distance + (0.1 * prefix_length as f64 * (1.0 - jaro_distance)); + + if jaro_winkler_distance <= 1.0 { + jaro_winkler_distance + } else { + 1.0 + } +} + +/// Calculates the Jaro-Winkler distances between a string and each string +/// in a vector. Returns a vector of corresponding values. +/// +/// ``` +/// use strsim::jaro_winkler_against_vec; +/// +/// let v = vec!["test", "test1", "test12", "test123", "", "tset"]; +/// let result = jaro_winkler_against_vec("test", &v); +/// let expected = vec![1.0, 0.96, 0.933333, 0.914286, 0.0, 0.925]; +/// let delta: f64 = result.iter() +/// .zip(expected.iter()) +/// .map(|(x, y)| (x - y).abs() as f64) +/// .fold(0.0, |x, y| x + y as f64); +/// assert!(delta.abs() < 0.0001); +/// ``` +pub fn jaro_winkler_against_vec(a: &str, v: &[&str]) -> Vec { + v.iter().map(|b| jaro_winkler(a, b)).collect() +} + +/// Calculates the minimum number of insertions, deletions, and substitutions +/// required to change one string into the other. +/// +/// ``` +/// use strsim::levenshtein; +/// +/// assert_eq!(3, levenshtein("kitten", "sitting")); +/// ``` +pub fn levenshtein(a: &str, b: &str) -> usize { + let a_len = a.chars().count(); + let b_len = b.chars().count(); + if a == b { return 0; } + else if a_len == 0 { return b_len; } + else if b_len == 0 { return a_len; } + + let mut prev_distances: Vec = Vec::with_capacity(b_len + 1); + let mut curr_distances: Vec = Vec::with_capacity(b_len + 1); + + for i in 0..(b_len + 1) { + prev_distances.push(i); + curr_distances.push(0); + } + + for (i, a_char) in a.chars().enumerate() { + curr_distances[0] = i + 1; + + for (j, b_char) in b.chars().enumerate() { + let cost = if a_char == b_char { 0 } else { 1 }; + curr_distances[j + 1] = min(curr_distances[j] + 1, + min(prev_distances[j + 1] + 1, + prev_distances[j] + cost)); + } + + prev_distances.clone_from(&curr_distances); + } + + curr_distances[b_len] +} + +/// Calculates the Levenshtein distance between a string and each string in a +/// vector. Returns a vector of corresponding values. +/// +/// ``` +/// use strsim::levenshtein_against_vec; +/// +/// let v = vec!["test", "test1", "test12", "test123", "", "tset"]; +/// let result = levenshtein_against_vec("test", &v); +/// let expected = vec![0, 1, 2, 3, 4, 2]; +/// assert_eq!(expected, result); +/// ``` +pub fn levenshtein_against_vec(a: &str, v: &[&str]) -> Vec { + v.iter().map(|b| levenshtein(a, b)).collect() +} + +/// Like Levenshtein but allows for adjacent transpositions. Each substring can +/// only be edited once. +/// +/// ``` +/// use strsim::osa_distance; +/// +/// assert_eq!(3, osa_distance("ab", "bca")); +/// ``` +pub fn osa_distance(a: &str, b: &str) -> usize { + let a_len = a.chars().count(); + let b_len = b.chars().count(); + if a == b { return 0; } + else if a_len == 0 { return b_len; } + else if b_len == 0 { return a_len; } + + let mut prev_two_distances: Vec = Vec::with_capacity(b_len + 1); + let mut prev_distances: Vec = Vec::with_capacity(b_len + 1); + let mut curr_distances: Vec = Vec::with_capacity(b_len + 1); + + let mut prev_a_char = char::MAX; + let mut prev_b_char = char::MAX; + + for i in 0..(b_len + 1) { + prev_two_distances.push(i); + prev_distances.push(i); + curr_distances.push(0); + } + + for (i, a_char) in a.chars().enumerate() { + curr_distances[0] = i + 1; + + for (j, b_char) in b.chars().enumerate() { + let cost = if a_char == b_char { 0 } else { 1 }; + curr_distances[j + 1] = min(curr_distances[j] + 1, + min(prev_distances[j + 1] + 1, + prev_distances[j] + cost)); + if i > 0 && j > 0 && a_char != b_char && + a_char == prev_b_char && b_char == prev_a_char { + curr_distances[j + 1] = min(curr_distances[j + 1], + prev_two_distances[j - 1] + 1); + } + + prev_b_char = b_char; + } + + prev_two_distances.clone_from(&prev_distances); + prev_distances.clone_from(&curr_distances); + prev_a_char = a_char; + } + + curr_distances[b_len] + +} + +/// Calculates the optimal string alignment distance between a string and each +/// string in a vector. Returns a vector of corresponding values. +/// +/// ``` +/// use strsim::osa_distance_against_vec; +/// +/// let v = vec!["test", "test1", "test12", "test123", "", "tset"]; +/// let result = osa_distance_against_vec("test", &v); +/// let expected = vec![0, 1, 2, 3, 4, 1]; +/// assert_eq!(expected, result); +/// ``` +pub fn osa_distance_against_vec(a: &str, v: &[&str]) -> Vec { + v.iter().map(|b| osa_distance(a, b)).collect() +} + +/// Like optimal string alignment, but substrings can be edited an unlimited +/// number of times, and the triangle inequality holds. +/// +/// ``` +/// use strsim::damerau_levenshtein; +/// +/// assert_eq!(2, damerau_levenshtein("ab", "bca")); +/// ``` +pub fn damerau_levenshtein(a: &str, b: &str) -> usize { + if a == b { return 0; } + + let a_chars: Vec = a.chars().collect(); + let b_chars: Vec = b.chars().collect(); + let a_len = a_chars.len(); + let b_len = b_chars.len(); + + if a_len == 0 { return b_len; } + if b_len == 0 { return a_len; } + + let mut distances = vec![vec![0; b_len + 2]; a_len + 2]; + let max_distance = a_len + b_len; + distances[0][0] = max_distance; + + for i in 0..(a_len + 1) { + distances[i + 1][0] = max_distance; + distances[i + 1][1] = i; + } + + for j in 0..(b_len + 1) { + distances[0][j + 1] = max_distance; + distances[1][j + 1] = j; + } + + let mut chars: HashMap = HashMap::new(); + + for i in 1..(a_len + 1) { + let mut db = 0; + + for j in 1..(b_len + 1) { + let k = match chars.get(&b_chars[j - 1]) { + Some(value) => value.clone(), + None => 0 + }; + + let l = db; + + let mut cost = 1; + if a_chars[i - 1] == b_chars[j - 1] { + cost = 0; + db = j; + } + + let substitution_cost = distances[i][j] + cost; + let insertion_cost = distances[i][j + 1] + 1; + let deletion_cost = distances[i + 1][j] + 1; + let transposition_cost = distances[k][l] + (i - k - 1) + 1 + + (j - l - 1); + + distances[i + 1][j + 1] = min(substitution_cost, + min(insertion_cost, + min(deletion_cost, + transposition_cost))); + } + + chars.insert(a_chars[i - 1], i); + } + + distances[a_len + 1][b_len + 1] +} + +/// Calculates the Damerau-Levenshtein distance between a string and each string +/// in a vector. Returns a vector of corresponding values. +/// +/// ``` +/// use strsim::damerau_levenshtein_against_vec; +/// +/// let v = vec!["test", "test1", "test12", "test123", "", "tset"]; +/// let result = damerau_levenshtein_against_vec("test", &v); +/// let expected = vec![0, 1, 2, 3, 4, 1]; +/// assert_eq!(expected, result); +/// ``` +pub fn damerau_levenshtein_against_vec(a: &str, v: &[&str]) -> Vec { + v.iter().map(|b| damerau_levenshtein(a, b)).collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn hamming_empty() { + match hamming("", "") { + Ok(distance) => { assert_eq!(0, distance); }, + Err(why) => { panic!("{:?}", why); } + } + } + + #[test] + fn hamming_same() { + match hamming("hamming", "hamming") { + Ok(distance) => { assert_eq!(0, distance); }, + Err(why) => { panic!("{:?}", why); } + } + } + + #[test] + fn hamming_diff() { + match hamming("hamming", "hammers") { + Ok(distance) => { assert_eq!(3, distance); }, + Err(why) => { panic!("{:?}", why); } + } + } + + #[test] + fn hamming_diff_multibyte() { + match hamming("hamming", "h香mmüng") { + Ok(distance) => { assert_eq!(2, distance); }, + Err(why) => { panic!("{:?}", why); } + } + } + + #[test] + fn hamming_unequal_length() { + match hamming("ham", "hamming") { + Ok(_) => { panic!(); }, + Err(why) => { assert_eq!(why, StrSimError::DifferentLengthArgs); } + } + } + + #[test] + fn hamming_names() { + match hamming("Friedrich Nietzs", "Jean-Paul Sartre") { + Ok(distance) => { assert_eq!(14, distance); }, + Err(why) => { panic!("{:?}", why); } + } + } + + #[test] + fn jaro_both_empty() { + assert_eq!(1.0, jaro("", "")); + } + + #[test] + fn jaro_first_empty() { + assert_eq!(0.0, jaro("", "jaro")); + } + + #[test] + fn jaro_second_empty() { + assert_eq!(0.0, jaro("distance", "")); + } + + #[test] + fn jaro_same() { + assert_eq!(1.0, jaro("jaro", "jaro")); + } + + #[test] + fn jaro_multibyte() { + assert!((0.818 - jaro("testabctest", "testöঙ香test")) < 0.001); + assert!((0.818 - jaro("testöঙ香test", "testabctest")) < 0.001); + } + + #[test] + fn jaro_diff_short() { + assert!((0.767 - jaro("dixon", "dicksonx")).abs() < 0.001); + } + + #[test] + fn jaro_diff_one_character() { + assert_eq!(0.0, jaro("a", "b")); + } + + #[test] + fn jaro_diff_one_and_two() { + assert!((0.83 - jaro("a", "ab")).abs() < 0.01); + } + + #[test] + fn jaro_diff_two_and_one() { + assert!((0.83 - jaro("ab", "a")).abs() < 0.01); + } + + #[test] + fn jaro_diff_no_transposition() { + assert!((0.822 - jaro("dwayne", "duane")).abs() < 0.001); + } + + #[test] + fn jaro_diff_with_transposition() { + assert!((0.944 - jaro("martha", "marhta")).abs() < 0.001); + } + + #[test] + fn jaro_names() { + assert!((0.392 - jaro("Friedrich Nietzsche", + "Jean-Paul Sartre")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_both_empty() { + assert_eq!(1.0, jaro_winkler("", "")); + } + + #[test] + fn jaro_winkler_first_empty() { + assert_eq!(0.0, jaro_winkler("", "jaro-winkler")); + } + + #[test] + fn jaro_winkler_second_empty() { + assert_eq!(0.0, jaro_winkler("distance", "")); + } + + #[test] + fn jaro_winkler_same() { + assert_eq!(1.0, jaro_winkler("Jaro-Winkler", "Jaro-Winkler")); + } + + #[test] + fn jaro_winkler_multibyte() { + assert!((0.89 - jaro_winkler("testabctest", "testöঙ香test")).abs() < + 0.001); + assert!((0.89 - jaro_winkler("testöঙ香test", "testabctest")).abs() < + 0.001); + } + + #[test] + fn jaro_winkler_diff_short() { + assert!((0.813 - jaro_winkler("dixon", "dicksonx")).abs() < 0.001); + assert!((0.813 - jaro_winkler("dicksonx", "dixon")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_diff_one_character() { + assert_eq!(0.0, jaro_winkler("a", "b")); + } + + #[test] + fn jaro_winkler_diff_no_transposition() { + assert!((0.840 - jaro_winkler("dwayne", "duane")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_diff_with_transposition() { + assert!((0.961 - jaro_winkler("martha", "marhta")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_names() { + assert!((0.562 - jaro_winkler("Friedrich Nietzsche", + "Fran-Paul Sartre")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_long_prefix() { + assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() < + 0.001); + } + + #[test] + fn jaro_winkler_more_names() { + assert!((0.868 - jaro_winkler("Thorkel", "Thorgier")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_length_of_one() { + assert!((0.738 - jaro_winkler("Dinsdale", "D")).abs() < 0.001); + } + + #[test] + fn jaro_winkler_very_long_prefix() { + assert!((1.0 - jaro_winkler("thequickbrownfoxjumpedoverx", + "thequickbrownfoxjumpedovery")).abs() < + 0.001); + } + + #[test] + fn levenshtein_empty() { + assert_eq!(0, levenshtein("", "")); + } + + #[test] + fn levenshtein_same() { + assert_eq!(0, levenshtein("levenshtein", "levenshtein")); + } + + #[test] + fn levenshtein_diff_short() { + assert_eq!(3, levenshtein("kitten", "sitting")); + } + + #[test] + fn levenshtein_diff_with_space() { + assert_eq!(5, levenshtein("hello, world", "bye, world")); + } + + #[test] + fn levenshtein_diff_multibyte() { + assert_eq!(3, levenshtein("öঙ香", "abc")); + assert_eq!(3, levenshtein("abc", "öঙ香")); + } + + #[test] + fn levenshtein_diff_longer() { + let a = "The quick brown fox jumped over the angry dog."; + let b = "Lorem ipsum dolor sit amet, dicta latine an eam."; + assert_eq!(37, levenshtein(a, b)); + } + + #[test] + fn levenshtein_first_empty() { + assert_eq!(7, levenshtein("", "sitting")); + } + + #[test] + fn levenshtein_second_empty() { + assert_eq!(6, levenshtein("kitten", "")); + } + + #[test] + fn osa_distance_empty() { + assert_eq!(0, osa_distance("", "")); + } + + #[test] + fn osa_distance_same() { + assert_eq!(0, osa_distance("damerau", "damerau")); + } + + #[test] + fn osa_distance_first_empty() { + assert_eq!(7, osa_distance("", "damerau")); + } + + #[test] + fn osa_distance_second_empty() { + assert_eq!(7, osa_distance("damerau", "")); + } + + #[test] + fn osa_distance_diff() { + assert_eq!(3, osa_distance("ca", "abc")); + } + + #[test] + fn osa_distance_diff_short() { + assert_eq!(3, osa_distance("damerau", "aderua")); + } + + #[test] + fn osa_distance_diff_reversed() { + assert_eq!(3, osa_distance("aderua", "damerau")); + } + + #[test] + fn osa_distance_diff_multibyte() { + assert_eq!(3, osa_distance("öঙ香", "abc")); + assert_eq!(3, osa_distance("abc", "öঙ香")); + } + + #[test] + fn osa_distance_diff_unequal_length() { + assert_eq!(6, osa_distance("damerau", "aderuaxyz")); + } + + #[test] + fn osa_distance_diff_unequal_length_reversed() { + assert_eq!(6, osa_distance("aderuaxyz", "damerau")); + } + + #[test] + fn osa_distance_diff_comedians() { + assert_eq!(5, osa_distance("Stewart", "Colbert")); + } + + #[test] + fn osa_distance_many_transpositions() { + assert_eq!(4, osa_distance("abcdefghijkl", "bacedfgihjlk")); + } + + #[test] + fn osa_distance_diff_longer() { + let a = "The quick brown fox jumped over the angry dog."; + let b = "Lehem ipsum dolor sit amet, dicta latine an eam."; + assert_eq!(36, osa_distance(a, b)); + } + + #[test] + fn osa_distance_beginning_transposition() { + assert_eq!(1, osa_distance("foobar", "ofobar")); + } + + #[test] + fn osa_distance_end_transposition() { + assert_eq!(1, osa_distance("specter", "spectre")); + } + + #[test] + fn osa_distance_restricted_edit() { + assert_eq!(4, osa_distance("a cat", "an abct")); + } + + #[test] + fn damerau_levenshtein_empty() { + assert_eq!(0, damerau_levenshtein("", "")); + } + + #[test] + fn damerau_levenshtein_same() { + assert_eq!(0, damerau_levenshtein("damerau", "damerau")); + } + + #[test] + fn damerau_levenshtein_first_empty() { + assert_eq!(7, damerau_levenshtein("", "damerau")); + } + + #[test] + fn damerau_levenshtein_second_empty() { + assert_eq!(7, damerau_levenshtein("damerau", "")); + } + + #[test] + fn damerau_levenshtein_diff() { + assert_eq!(2, damerau_levenshtein("ca", "abc")); + } + + #[test] + fn damerau_levenshtein_diff_short() { + assert_eq!(3, damerau_levenshtein("damerau", "aderua")); + } + + #[test] + fn damerau_levenshtein_diff_reversed() { + assert_eq!(3, damerau_levenshtein("aderua", "damerau")); + } + + #[test] + fn damerau_levenshtein_diff_multibyte() { + assert_eq!(3, damerau_levenshtein("öঙ香", "abc")); + assert_eq!(3, damerau_levenshtein("abc", "öঙ香")); + } + + #[test] + fn damerau_levenshtein_diff_unequal_length() { + assert_eq!(6, damerau_levenshtein("damerau", "aderuaxyz")); + } + + #[test] + fn damerau_levenshtein_diff_unequal_length_reversed() { + assert_eq!(6, damerau_levenshtein("aderuaxyz", "damerau")); + } + + #[test] + fn damerau_levenshtein_diff_comedians() { + assert_eq!(5, damerau_levenshtein("Stewart", "Colbert")); + } + + #[test] + fn damerau_levenshtein_many_transpositions() { + assert_eq!(4, damerau_levenshtein("abcdefghijkl", "bacedfgihjlk")); + } + + #[test] + fn damerau_levenshtein_diff_longer() { + let a = "The quick brown fox jumped over the angry dog."; + let b = "Lehem ipsum dolor sit amet, dicta latine an eam."; + assert_eq!(36, damerau_levenshtein(a, b)); + } + + #[test] + fn damerau_levenshtein_beginning_transposition() { + assert_eq!(1, damerau_levenshtein("foobar", "ofobar")); + } + + #[test] + fn damerau_levenshtein_end_transposition() { + assert_eq!(1, damerau_levenshtein("specter", "spectre")); + } + + #[test] + fn damerau_levenshtein_unrestricted_edit() { + assert_eq!(3, damerau_levenshtein("a cat", "an abct")); + } + + #[test] + fn levenshtein_against_vec_empty() { + let v = Vec::new(); + let result = levenshtein_against_vec("test", &v); + let expected: Vec = Vec::new(); + assert_eq!(expected, result); + } + + #[test] + fn levenshtein_against_vec_one() { + let v = vec!["testy"]; + let result = levenshtein_against_vec("test", &v); + let expected = vec![1]; + assert_eq!(expected, result); + } + + #[test] + fn levenshtein_against_vec_many() { + let v = vec!["test", "test1", "test12", "test123", "", "tset"]; + let result = levenshtein_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 2]; + assert_eq!(expected, result); + } + + #[test] + fn osa_distance_against_vec_empty() { + let v = Vec::new(); + let result = osa_distance_against_vec("test", &v); + let expected: Vec = Vec::new(); + assert_eq!(expected, result); + } + + #[test] + fn osa_distance_against_vec_one() { + let v = vec!["etst"]; + let result = osa_distance_against_vec("test", &v); + let expected = vec![1]; + assert_eq!(expected, result); + } + + #[test] + fn osa_distance_against_vec_many() { + let v = vec!["test", "test1", "test12", "test123", "", "tsvet"]; + let result = osa_distance_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 3]; + assert_eq!(expected, result); + } + + #[test] + fn damerau_levenshtein_against_vec_empty() { + let v = Vec::new(); + let result = damerau_levenshtein_against_vec("test", &v); + let expected: Vec = Vec::new(); + assert_eq!(expected, result); + } + + #[test] + fn damerau_levenshtein_against_vec_one() { + let v = vec!["etst"]; + let result = damerau_levenshtein_against_vec("test", &v); + let expected = vec![1]; + assert_eq!(expected, result); + } + + #[test] + fn damerau_levenshtein_against_vec_many() { + let v = vec!["test", "test1", "test12", "test123", "", "tsvet"]; + let result = damerau_levenshtein_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 2]; + assert_eq!(expected, result); + } + + fn equal_float_vecs(a: Vec, b: Vec) -> bool { + let delta: f64 = a.iter() + .zip(b.iter()) + .map(|(x, y)| (x - y).abs() as f64) + .fold(0.0, |x, y| x + y as f64); + delta < 0.0001 + } + + #[test] + fn jaro_against_vec_empty() { + let v = Vec::new(); + let result = jaro_against_vec("test", &v); + let expected: Vec = Vec::new(); + assert_eq!(expected, result); + } + + #[test] + fn jaro_against_vec_one() { + let v = vec!["test1"]; + let result = jaro_against_vec("test", &v); + let expected = vec![0.93333]; + assert!(equal_float_vecs(result, expected)); + } + + #[test] + fn jaro_against_vec_many() { + let v = vec!["test", "test1", "test12", "test123", "", "tset"]; + let result = jaro_against_vec("test", &v); + let expected = vec![1.0, 0.933333, 0.888889, 0.857143, 0.0, 0.916667]; + assert!(equal_float_vecs(result, expected)); + } + + #[test] + fn jaro_winkler_against_vec_empty() { + let v = Vec::new(); + let result = jaro_winkler_against_vec("test", &v); + let expected: Vec = Vec::new(); + assert_eq!(expected, result); + } + + #[test] + fn jaro_winkler_against_vec_one() { + let v = vec!["test123"]; + let result = jaro_winkler_against_vec("test", &v); + let expected = vec![0.914286]; + assert!(equal_float_vecs(result, expected)); + } + + #[test] + fn jaro_winkler_against_vec_many() { + let v = vec!["test", "test1", "test12", "test123", "", "tset"]; + let result = jaro_winkler_against_vec("test", &v); + let expected = vec![1.0, 0.96, 0.933333, 0.914286, 0.0, 0.925]; + assert!(equal_float_vecs(result, expected)); + } +} + diff --git a/vendor/registry-40351f815f426200/strsim/tests/lib.rs b/vendor/registry-40351f815f426200/strsim/tests/lib.rs new file mode 100644 index 000000000..956d0f567 --- /dev/null +++ b/vendor/registry-40351f815f426200/strsim/tests/lib.rs @@ -0,0 +1,89 @@ +extern crate strsim; + +use strsim::{hamming, levenshtein, osa_distance, damerau_levenshtein, jaro, + jaro_winkler, levenshtein_against_vec, osa_distance_against_vec, + damerau_levenshtein_against_vec, jaro_against_vec, + jaro_winkler_against_vec}; + +#[test] +fn hamming_works() { + match hamming("hamming", "hammers") { + Ok(distance) => assert_eq!(3, distance), + Err(why) => panic!("{:?}", why) + } +} + +#[test] +fn levenshtein_works() { + assert_eq!(3, levenshtein("kitten", "sitting")); +} + +#[test] +fn osa_distance_works() { + assert_eq!(3, osa_distance("ac", "cba")); +} + +#[test] +fn damerau_levenshtein_works() { + assert_eq!(2, damerau_levenshtein("ac", "cba")); +} + +#[test] +fn jaro_works() { + assert!((0.392 - jaro("Friedrich Nietzsche", "Jean-Paul Sartre")).abs() < + 0.001); +} + +#[test] +fn jaro_winkler_works() { + assert!((0.911 - jaro_winkler("cheeseburger", "cheese fries")).abs() < + 0.001); +} + +#[test] +fn levenshtein_against_vec_works() { + let v = vec!["test", "test1", "test12", "test123", "", "tset", "tsvet"]; + let result = levenshtein_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 2, 3]; + assert_eq!(expected, result); +} + +#[test] +fn osa_distance_against_vec_works() { + let v = vec!["test", "test1", "test12", "test123", "", "tset", "tsvet"]; + let result = osa_distance_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 1, 3]; + assert_eq!(expected, result); +} + +#[test] +fn damerau_levenshtein_against_vec_works() { + let v = vec!["test", "test1", "test12", "test123", "", "tset", "tsvet"]; + let result = damerau_levenshtein_against_vec("test", &v); + let expected = vec![0, 1, 2, 3, 4, 1, 2]; + assert_eq!(expected, result); +} + +#[test] +fn jaro_against_vec_works() { + let v = vec!["test", "test1", "test12", "test123", "", "tset"]; + let result = jaro_against_vec("test", &v); + let expected = vec![1.0, 0.933333, 0.888889, 0.857143, 0.0, 0.916667]; + let delta: f64 = result.iter() + .zip(expected.iter()) + .map(|(x, y)| (x - y).abs() as f64) + .fold(0.0, |x, y| x + y as f64); + assert!(delta.abs() < 0.0001); +} + +#[test] +fn jaro_winkler_against_vec_works() { + let v = vec!["test", "test1", "test12", "test123", "", "tset"]; + let result = jaro_winkler_against_vec("test", &v); + let expected = vec![1.0, 0.96, 0.933333, 0.914286, 0.0, 0.925]; + let delta: f64 = result.iter() + .zip(expected.iter()) + .map(|(x, y)| (x - y).abs() as f64) + .fold(0.0, |x, y| x + y as f64); + assert!(delta.abs() < 0.0001); +} diff --git a/vendor/registry-40351f815f426200/syn/.cargo-checksum.json b/vendor/registry-40351f815f426200/syn/.cargo-checksum.json new file mode 100644 index 000000000..ff5013296 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"652fc79e709ad760ee389ed3d4c18b624f7b8004a65297db26e9ce8ca31de559","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"3f3d105c0f1bae3bdb5ed3cc32a8e5a02f3de6f62a9f17f5ba03af3f813d0881","build.rs":"17c8493aed4032c8cd0d2f2ab8929b7e49e8e2664953658ba3d96a54324902ce","src/attr.rs":"2eb9cf2f094f861fff0ae339e378f6aea8683d2dcfad99700d5287989f458378","src/buffer.rs":"fac77febe022ab4982078c73ca502f9d698a402b3eca0f8e9c7a2796af01e5f4","src/custom_keyword.rs":"f68d4b9c0aa97a481154d4df763099c2ad81fd1993111543ecfc59d766f3044f","src/custom_punctuation.rs":"f1944db8df2d2958ebf285eee3ec5ecdfcd4802e827e08ebf6f1873bb10a0fa7","src/data.rs":"54ee54c3c650bc5e200d4bea947d6e89093a39f2444cd43e8861f5852975e0bc","src/derive.rs":"eb041b47a73bace73c2872cd9a8e190de7e2b3b57cd57213770f088ec19ab3c6","src/error.rs":"aac440c1d58549036343be2cc844d5322aafd917db58bc882d5a48efc5864a23","src/export.rs":"1f7e017dac9426e91c796445e733c390c408c808ba9c21cb7df7799b67352fde","src/expr.rs":"6dc3dcdf4e3e93e5d8762c155f0a895f0f742989fcfe8b191f69f031769c9f30","src/ext.rs":"49d40f09ad2d2748bc3d1a200026886d1c5997000c3b027bdd066605689e15e5","src/file.rs":"abb9f5e71a8a6b52649c15da21d3f99e25a727d87c2f87d2744ac3970c1d683f","src/gen/fold.rs":"5507dde16c41e4f11b8903938a5f442fff9f94468afccbf0a37a4fa14f2eddde","src/gen/visit.rs":"4c8f499d1fd988b9c9ff820ef76c0c93b1e5ee91e6a94e0892298f5e6f424893","src/gen/visit_mut.rs":"d1f905b2b5afd685ace07532b6cbc67175e2d104508c7ed86ed4e9d1567c7c7b","src/gen_helper.rs":"644b1d31987919c0239891d8f90c09f3bf541a71fb85e744438e4814cc6dff89","src/generics.rs":"6ee5bba532b95f7de7c6bbe8caadabc6a71c45e7f8d7636d823075ff27f28937","src/group.rs":"03487f75d0abd302f06e50eb09d14ab83fb60c67e1f2602be53ca3f28a833b90","src/ident.rs":"bd7884de0031d942c556f929905532dd8799f8ca2450e65b8e4e8dfa78cf4fee","src/item.rs":"80251894ac0421f96579afe7fe3189ad429892e3fbb942c42fd0efc1e19dd984","src/keyword.rs":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/lib.rs":"b097487be9b790712e0b6d020bc52d0d840abc6b9204a4df3bb62621cd78b274","src/lifetime.rs":"7912a4c77ee805e912fb28c7f434836ea82540263d549877cd5edfbe32d1bf95","src/lit.rs":"bc034e4443a32f2066b41f62e05946143f60397fbbd05016c0020c4818e0a0f8","src/lookahead.rs":"5a6a4adf75c442ec9a312e64ee9dca75da4772e774a7f095bdb2f91fc790178e","src/mac.rs":"a91623ed9c1de7b18ef752db79a242002e95156497a52a1790a75069915d22ee","src/macros.rs":"2f91e07a1aec4b385986c0a0f66274e8de1c1aa81f95d398a5cd364b3c451bb4","src/op.rs":"01edb1e07b6d60b266797ca4b30788b0a511452228e04073a11f0b61f106a0e7","src/parse.rs":"f9250de07bc32e8278a3063bb705018d32994787f9afc697bcfa9e97ce4d5fb5","src/parse_macro_input.rs":"8df7b4c1b361171f3fefb0490dec570ad29c024c04e35184b296725f97f2002c","src/parse_quote.rs":"d5784e14e0b2954077ce4fe4628af8e7bf9176b74dc0b2c2627abb26c5ac9fc1","src/path.rs":"822ec427f134df85b65677f0a0f1743ba6b21a35478773e9a2e42919c06adf3a","src/print.rs":"7ebb68123898f2ebbae12abf028747c05bea7b08f1e96b17164f1dcebdab7355","src/punctuated.rs":"ccfd763c273fd1e6b6a7a551669e8aad47da6d13f700a53ad55b9f58f2f396da","src/sealed.rs":"896a495a5340eec898527f18bd4ddca408ea03ea0ee3af30074ff48deace778d","src/span.rs":"748c51c6feb223c26d3b1701f5bb98aee823666c775c98106cfa24fe29d8cec1","src/spanned.rs":"83b4ab1e2138ac9340eaa8234ad1d9f7468b450ddf3a852e574cac18e4f766b8","src/thread.rs":"ac3f4aa972b0dee5b9ae5202c5cd6bef46823fc91ff83787a3fe1bdfb8f79135","src/token.rs":"5009af54aff85a5019c8532b63cc3e9419d00fb85ac6849d86fd8cb1e4dcd78d","src/tt.rs":"b3d99cbd68cd50749f26f4afa138e6366d327099ed566b30c315ccb58fa26ded","src/ty.rs":"52cea4f3b094d36f3be7f94c63f1eff1add168d036fce8a0dcacfb6ab5c54926"},"package":"a1393e4a97a19c01e900df2aec855a29f71cf02c402e2f443b8d2747c25c5dbe"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/syn/Cargo.toml b/vendor/registry-40351f815f426200/syn/Cargo.toml new file mode 100644 index 000000000..f71d675a5 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/Cargo.toml @@ -0,0 +1,68 @@ +# 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 = "syn" +version = "0.15.34" +authors = ["David Tolnay "] +include = ["/build.rs", "/Cargo.toml", "/LICENSE-APACHE", "/LICENSE-MIT", "/README.md", "/src/**/*.rs"] +description = "Parser for Rust source code" +documentation = "https://docs.rs/syn" +readme = "README.md" +categories = ["development-tools::procedural-macro-helpers"] +license = "MIT/Apache-2.0" +repository = "https://github.com/dtolnay/syn" +[package.metadata.docs.rs] +all-features = true + +[package.metadata.playground] +all-features = true +[dependencies.proc-macro2] +version = "0.4.4" +default-features = false + +[dependencies.quote] +version = "0.6" +optional = true +default-features = false + +[dependencies.unicode-xid] +version = "0.1" +[dev-dependencies.colored] +version = "1.7" + +[dev-dependencies.insta] +version = "0.7" + +[dev-dependencies.rayon] +version = "1.0" + +[dev-dependencies.regex] +version = "1.0" + +[dev-dependencies.walkdir] +version = "2.1" + +[features] +clone-impls = [] +default = ["derive", "parsing", "printing", "clone-impls", "proc-macro"] +derive = [] +extra-traits = [] +fold = [] +full = [] +parsing = [] +printing = ["quote"] +proc-macro = ["proc-macro2/proc-macro", "quote/proc-macro"] +visit = [] +visit-mut = [] +[badges.travis-ci] +repository = "dtolnay/syn" diff --git a/vendor/registry-40351f815f426200/syn/LICENSE-APACHE b/vendor/registry-40351f815f426200/syn/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/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/vendor/registry-40351f815f426200/syn/LICENSE-MIT b/vendor/registry-40351f815f426200/syn/LICENSE-MIT new file mode 100644 index 000000000..31aa79387 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/LICENSE-MIT @@ -0,0 +1,23 @@ +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/vendor/registry-40351f815f426200/syn/README.md b/vendor/registry-40351f815f426200/syn/README.md new file mode 100644 index 000000000..ecc6eb878 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/README.md @@ -0,0 +1,256 @@ +Parser for Rust source code +=========================== + +[![Build Status](https://api.travis-ci.org/dtolnay/syn.svg?branch=master)](https://travis-ci.org/dtolnay/syn) +[![Latest Version](https://img.shields.io/crates/v/syn.svg)](https://crates.io/crates/syn) +[![Rust Documentation](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/syn/0.15/syn/) +[![Rustc Version 1.15+](https://img.shields.io/badge/rustc-1.15+-lightgray.svg)](https://blog.rust-lang.org/2017/02/02/Rust-1.15.html) + +Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree +of Rust source code. + +Currently this library is geared toward use in Rust procedural macros, but +contains some APIs that may be useful more generally. + +[custom derive]: https://github.com/rust-lang/rfcs/blob/master/text/1681-macros-1.1.md + +- **Data structures** — Syn provides a complete syntax tree that can represent + any valid Rust source code. The syntax tree is rooted at [`syn::File`] which + represents a full source file, but there are other entry points that may be + useful to procedural macros including [`syn::Item`], [`syn::Expr`] and + [`syn::Type`]. + +- **Custom derives** — Of particular interest to custom derives is + [`syn::DeriveInput`] which is any of the three legal input items to a derive + macro. An example below shows using this type in a library that can derive + implementations of a trait of your own. + +- **Parsing** — Parsing in Syn is built around [parser functions] with the + signature `fn(ParseStream) -> Result`. Every syntax tree node defined by + Syn is individually parsable and may be used as a building block for custom + syntaxes, or you may dream up your own brand new syntax without involving any + of our syntax tree types. + +- **Location information** — Every token parsed by Syn is associated with a + `Span` that tracks line and column information back to the source of that + token. These spans allow a procedural macro to display detailed error messages + pointing to all the right places in the user's code. There is an example of + this below. + +- **Feature flags** — Functionality is aggressively feature gated so your + procedural macros enable only what they need, and do not pay in compile time + for all the rest. + +[`syn::File`]: https://docs.rs/syn/0.15/syn/struct.File.html +[`syn::Item`]: https://docs.rs/syn/0.15/syn/enum.Item.html +[`syn::Expr`]: https://docs.rs/syn/0.15/syn/enum.Expr.html +[`syn::Type`]: https://docs.rs/syn/0.15/syn/enum.Type.html +[`syn::DeriveInput`]: https://docs.rs/syn/0.15/syn/struct.DeriveInput.html +[parser functions]: https://docs.rs/syn/0.15/syn/parse/index.html + +If you get stuck with anything involving procedural macros in Rust I am happy to +provide help even if the issue is not related to Syn. Please file a ticket in +this repo. + +*Version requirement: Syn supports any compiler version back to Rust's very +first support for procedural macros in Rust 1.15.0. Some features especially +around error reporting are only available in newer compilers or on the nightly +channel.* + +[*Release notes*](https://github.com/dtolnay/syn/releases) + +## Example of a custom derive + +The canonical custom derive using Syn looks like this. We write an ordinary Rust +function tagged with a `proc_macro_derive` attribute and the name of the trait +we are deriving. Any time that derive appears in the user's code, the Rust +compiler passes their data structure as tokens into our macro. We get to execute +arbitrary Rust code to figure out what to do with those tokens, then hand some +tokens back to the compiler to compile into the user's crate. + +[`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html + +```toml +[dependencies] +syn = "0.15" +quote = "0.6" + +[lib] +proc-macro = true +``` + +```rust +extern crate proc_macro; + +use proc_macro::TokenStream; +use quote::quote; +use syn::{parse_macro_input, DeriveInput}; + +#[proc_macro_derive(MyMacro)] +pub fn my_macro(input: TokenStream) -> TokenStream { + // Parse the input tokens into a syntax tree + let input = parse_macro_input!(input as DeriveInput); + + // Build the output, possibly using quasi-quotation + let expanded = quote! { + // ... + }; + + // Hand the output tokens back to the compiler + TokenStream::from(expanded) +} +``` + +The [`heapsize`] example directory shows a complete working Macros 1.1 +implementation of a custom derive. It works on any Rust compiler 1.15+. The +example derives a `HeapSize` trait which computes an estimate of the amount of +heap memory owned by a value. + +[`heapsize`]: examples/heapsize + +```rust +pub trait HeapSize { + /// Total number of bytes of heap memory owned by `self`. + fn heap_size_of_children(&self) -> usize; +} +``` + +The custom derive allows users to write `#[derive(HeapSize)]` on data structures +in their program. + +```rust +#[derive(HeapSize)] +struct Demo<'a, T: ?Sized> { + a: Box, + b: u8, + c: &'a str, + d: String, +} +``` + +## Spans and error reporting + +The token-based procedural macro API provides great control over where the +compiler's error messages are displayed in user code. Consider the error the +user sees if one of their field types does not implement `HeapSize`. + +```rust +#[derive(HeapSize)] +struct Broken { + ok: String, + bad: std::thread::Thread, +} +``` + +By tracking span information all the way through the expansion of a procedural +macro as shown in the `heapsize` example, token-based macros in Syn are able to +trigger errors that directly pinpoint the source of the problem. + +``` +error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied + --> src/main.rs:7:5 + | +7 | bad: std::thread::Thread, + | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `std::thread::Thread` +``` + +## Parsing a custom syntax + +The [`lazy-static`] example directory shows the implementation of a +`functionlike!(...)` procedural macro in which the input tokens are parsed using +Syn's parsing API. + +[`lazy-static`]: examples/lazy-static + +The example reimplements the popular `lazy_static` crate from crates.io as a +procedural macro. + +``` +lazy_static! { + static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap(); +} +``` + +The implementation shows how to trigger custom warnings and error messages on +the macro input. + +``` +warning: come on, pick a more creative name + --> src/main.rs:10:16 + | +10 | static ref FOO: String = "lazy_static".to_owned(); + | ^^^ +``` + +## Debugging + +When developing a procedural macro it can be helpful to look at what the +generated code looks like. Use `cargo rustc -- -Zunstable-options +--pretty=expanded` or the [`cargo expand`] subcommand. + +[`cargo expand`]: https://github.com/dtolnay/cargo-expand + +To show the expanded code for some crate that uses your procedural macro, run +`cargo expand` from that crate. To show the expanded code for one of your own +test cases, run `cargo expand --test the_test_case` where the last argument is +the name of the test file without the `.rs` extension. + +This write-up by Brandon W Maister discusses debugging in more detail: +[Debugging Rust's new Custom Derive system][debugging]. + +[debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/ + +## Optional features + +Syn puts a lot of functionality behind optional features in order to optimize +compile time for the most common use cases. The following features are +available. + +- **`derive`** *(enabled by default)* — Data structures for representing the + possible input to a custom derive, including structs and enums and types. +- **`full`** — Data structures for representing the syntax tree of all valid + Rust source code, including items and expressions. +- **`parsing`** *(enabled by default)* — Ability to parse input tokens into a + syntax tree node of a chosen type. +- **`printing`** *(enabled by default)* — Ability to print a syntax tree node as + tokens of Rust source code. +- **`visit`** — Trait for traversing a syntax tree. +- **`visit-mut`** — Trait for traversing and mutating in place a syntax tree. +- **`fold`** — Trait for transforming an owned syntax tree. +- **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree + types. +- **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree + types. +- **`proc-macro`** *(enabled by default)* — Runtime dependency on the dynamic + library libproc_macro from rustc toolchain. + +## Proc macro shim + +Syn uses the [proc-macro2] crate to emulate the compiler's procedural macro API +in a stable way that works all the way back to Rust 1.15.0. This shim makes it +possible to write code without regard for whether the current compiler version +supports the features we use. + +In general all of your code should be written against proc-macro2 rather than +proc-macro. The one exception is in the signatures of procedural macro entry +points, which are required by the language to use `proc_macro::TokenStream`. + +The proc-macro2 crate will automatically detect and use the compiler's data +structures on sufficiently new compilers. + +[proc-macro2]: https://github.com/alexcrichton/proc-macro2 + +## 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 this crate 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/vendor/registry-40351f815f426200/syn/build.rs b/vendor/registry-40351f815f426200/syn/build.rs new file mode 100644 index 000000000..2b2a41964 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/build.rs @@ -0,0 +1,72 @@ +use std::env; +use std::process::Command; +use std::str::{self, FromStr}; + +// The rustc-cfg strings below are *not* public API. Please let us know by +// opening a GitHub issue if your build environment requires some way to enable +// these cfgs other than by executing our build script. +fn main() { + let compiler = match rustc_version() { + Some(compiler) => compiler, + None => return, + }; + + if compiler.minor >= 19 { + println!("cargo:rustc-cfg=syn_can_use_thread_id"); + } + + if compiler.minor >= 20 { + println!("cargo:rustc-cfg=syn_can_use_associated_constants"); + } + + // Macro modularization allows re-exporting the `quote!` macro in 1.30+. + if compiler.minor >= 30 { + println!("cargo:rustc-cfg=syn_can_call_macro_by_path"); + } + + if !compiler.nightly { + println!("cargo:rustc-cfg=syn_disable_nightly_tests"); + } +} + +struct Compiler { + minor: u32, + nightly: bool, +} + +fn rustc_version() -> Option { + let rustc = match env::var_os("RUSTC") { + Some(rustc) => rustc, + None => return None, + }; + + let output = match Command::new(rustc).arg("--version").output() { + Ok(output) => output, + Err(_) => return None, + }; + + let version = match str::from_utf8(&output.stdout) { + Ok(version) => version, + Err(_) => return None, + }; + + let mut pieces = version.split('.'); + if pieces.next() != Some("rustc 1") { + return None; + } + + let next = match pieces.next() { + Some(next) => next, + None => return None, + }; + + let minor = match u32::from_str(next) { + Ok(minor) => minor, + Err(_) => return None, + }; + + Some(Compiler { + minor: minor, + nightly: version.contains("nightly"), + }) +} diff --git a/vendor/registry-40351f815f426200/syn/src/attr.rs b/vendor/registry-40351f815f426200/syn/src/attr.rs new file mode 100644 index 000000000..ae90eaa3a --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/attr.rs @@ -0,0 +1,681 @@ +use super::*; +use punctuated::Punctuated; + +use std::iter; + +use proc_macro2::TokenStream; +#[cfg(not(feature = "parsing"))] +use proc_macro2::{Delimiter, Spacing, TokenTree}; + +#[cfg(feature = "parsing")] +use parse::{ParseStream, Result}; +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +#[cfg(feature = "extra-traits")] +use tt::TokenStreamHelper; + +ast_struct! { + /// An attribute like `#[repr(transparent)]`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax + /// + /// Rust has six types of attributes. + /// + /// - Outer attributes like `#[repr(transparent)]`. These appear outside or + /// in front of the item they describe. + /// - Inner attributes like `#![feature(proc_macro)]`. These appear inside + /// of the item they describe, usually a module. + /// - Outer doc comments like `/// # Example`. + /// - Inner doc comments like `//! Please file an issue`. + /// - Outer block comments `/** # Example */`. + /// - Inner block comments `/*! Please file an issue */`. + /// + /// The `style` field of type `AttrStyle` distinguishes whether an attribute + /// is outer or inner. Doc comments and block comments are promoted to + /// attributes, as this is how they are processed by the compiler and by + /// `macro_rules!` macros. + /// + /// The `path` field gives the possibly colon-delimited path against which + /// the attribute is resolved. It is equal to `"doc"` for desugared doc + /// comments. The `tts` field contains the rest of the attribute body as + /// tokens. + /// + /// ```text + /// #[derive(Copy)] #[crate::precondition x < 5] + /// ^^^^^^~~~~~~ ^^^^^^^^^^^^^^^^^^^ ~~~~~ + /// path tts path tts + /// ``` + /// + /// Use the [`parse_meta`] method to try parsing the tokens of an attribute + /// into the structured representation that is used by convention across + /// most Rust libraries. + /// + /// [`parse_meta`]: #method.parse_meta + /// + /// # Parsing + /// + /// This type does not implement the [`Parse`] trait and thus cannot be + /// parsed directly by [`ParseStream::parse`]. Instead use + /// [`ParseStream::call`] with one of the two parser functions + /// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on + /// which you intend to parse. + /// + /// [`Parse`]: parse/trait.Parse.html + /// [`ParseStream::parse`]: parse/struct.ParseBuffer.html#method.parse + /// [`ParseStream::call`]: parse/struct.ParseBuffer.html#method.call + /// [`Attribute::parse_outer`]: #method.parse_outer + /// [`Attribute::parse_inner`]: #method.parse_inner + /// + /// ```edition2018 + /// use syn::{Attribute, Ident, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // Parses a unit struct with attributes. + /// // + /// // #[path = "s.tmpl"] + /// // struct S; + /// struct UnitStruct { + /// attrs: Vec, + /// struct_token: Token![struct], + /// name: Ident, + /// semi_token: Token![;], + /// } + /// + /// impl Parse for UnitStruct { + /// fn parse(input: ParseStream) -> Result { + /// Ok(UnitStruct { + /// attrs: input.call(Attribute::parse_outer)?, + /// struct_token: input.parse()?, + /// name: input.parse()?, + /// semi_token: input.parse()?, + /// }) + /// } + /// } + /// ``` + pub struct Attribute #manual_extra_traits { + pub pound_token: Token![#], + pub style: AttrStyle, + pub bracket_token: token::Bracket, + pub path: Path, + pub tts: TokenStream, + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for Attribute {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for Attribute { + fn eq(&self, other: &Self) -> bool { + self.style == other.style + && self.pound_token == other.pound_token + && self.bracket_token == other.bracket_token + && self.path == other.path + && TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for Attribute { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + self.style.hash(state); + self.pound_token.hash(state); + self.bracket_token.hash(state); + self.path.hash(state); + TokenStreamHelper(&self.tts).hash(state); + } +} + +impl Attribute { + /// Parses the content of the attribute, consisting of the path and tts, as + /// a [`Meta`](enum.Meta.html) if possible. + /// + /// Deprecated; use `parse_meta` instead. + #[doc(hidden)] + pub fn interpret_meta(&self) -> Option { + #[cfg(feature = "parsing")] + { + self.parse_meta().ok() + } + + #[cfg(not(feature = "parsing"))] + { + let name = if self.path.segments.len() == 1 { + &self.path.segments.first().unwrap().value().ident + } else { + return None; + }; + + if self.tts.is_empty() { + return Some(Meta::Word(name.clone())); + } + + let tts = self.tts.clone().into_iter().collect::>(); + + if tts.len() == 1 { + if let Some(meta) = Attribute::extract_meta_list(name.clone(), &tts[0]) { + return Some(meta); + } + } + + if tts.len() == 2 { + if let Some(meta) = Attribute::extract_name_value(name.clone(), &tts[0], &tts[1]) { + return Some(meta); + } + } + + None + } + } + + /// Parses the content of the attribute, consisting of the path and tts, as + /// a [`Meta`](enum.Meta.html) if possible. + #[cfg(feature = "parsing")] + pub fn parse_meta(&self) -> Result { + if let Some(ref colon) = self.path.leading_colon { + return Err(Error::new(colon.spans[0], "expected meta identifier")); + } + + let first_segment = self + .path + .segments + .first() + .expect("paths have at least one segment"); + if let Some(colon) = first_segment.punct() { + return Err(Error::new(colon.spans[0], "expected meta value")); + } + let ident = first_segment.value().ident.clone(); + + let parser = |input: ParseStream| parsing::parse_meta_after_ident(ident, input); + parse::Parser::parse2(parser, self.tts.clone()) + } + + /// Parses zero or more outer attributes from the stream. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_outer(input: ParseStream) -> Result> { + let mut attrs = Vec::new(); + while input.peek(Token![#]) { + attrs.push(input.call(parsing::single_parse_outer)?); + } + Ok(attrs) + } + + /// Parses zero or more inner attributes from the stream. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_inner(input: ParseStream) -> Result> { + let mut attrs = Vec::new(); + while input.peek(Token![#]) && input.peek2(Token![!]) { + attrs.push(input.call(parsing::single_parse_inner)?); + } + Ok(attrs) + } + + #[cfg(not(feature = "parsing"))] + fn extract_meta_list(ident: Ident, tt: &TokenTree) -> Option { + let g = match *tt { + TokenTree::Group(ref g) => g, + _ => return None, + }; + if g.delimiter() != Delimiter::Parenthesis { + return None; + } + let tokens = g.stream().clone().into_iter().collect::>(); + let nested = match list_of_nested_meta_items_from_tokens(&tokens) { + Some(n) => n, + None => return None, + }; + Some(Meta::List(MetaList { + paren_token: token::Paren(g.span()), + ident: ident, + nested: nested, + })) + } + + #[cfg(not(feature = "parsing"))] + fn extract_name_value(ident: Ident, a: &TokenTree, b: &TokenTree) -> Option { + let a = match *a { + TokenTree::Punct(ref o) => o, + _ => return None, + }; + if a.spacing() != Spacing::Alone { + return None; + } + if a.as_char() != '=' { + return None; + } + + match *b { + TokenTree::Literal(ref l) if !l.to_string().starts_with('/') => { + Some(Meta::NameValue(MetaNameValue { + ident: ident, + eq_token: Token![=]([a.span()]), + lit: Lit::new(l.clone()), + })) + } + TokenTree::Ident(ref v) => match &v.to_string()[..] { + v @ "true" | v @ "false" => Some(Meta::NameValue(MetaNameValue { + ident: ident, + eq_token: Token![=]([a.span()]), + lit: Lit::Bool(LitBool { + value: v == "true", + span: b.span(), + }), + })), + _ => None, + }, + _ => None, + } + } +} + +#[cfg(not(feature = "parsing"))] +fn nested_meta_item_from_tokens(tts: &[TokenTree]) -> Option<(NestedMeta, &[TokenTree])> { + assert!(!tts.is_empty()); + + match tts[0] { + TokenTree::Literal(ref lit) => { + if lit.to_string().starts_with('/') { + None + } else { + let lit = Lit::new(lit.clone()); + Some((NestedMeta::Literal(lit), &tts[1..])) + } + } + + TokenTree::Ident(ref ident) => { + if tts.len() >= 3 { + if let Some(meta) = Attribute::extract_name_value(ident.clone(), &tts[1], &tts[2]) { + return Some((NestedMeta::Meta(meta), &tts[3..])); + } + } + + if tts.len() >= 2 { + if let Some(meta) = Attribute::extract_meta_list(ident.clone(), &tts[1]) { + return Some((NestedMeta::Meta(meta), &tts[2..])); + } + } + + let nested_meta = if ident == "true" || ident == "false" { + NestedMeta::Literal(Lit::Bool(LitBool { + value: ident == "true", + span: ident.span(), + })) + } else { + NestedMeta::Meta(Meta::Word(ident.clone())) + }; + Some((nested_meta, &tts[1..])) + } + + _ => None, + } +} + +#[cfg(not(feature = "parsing"))] +fn list_of_nested_meta_items_from_tokens( + mut tts: &[TokenTree], +) -> Option> { + let mut nested_meta_items = Punctuated::new(); + let mut first = true; + + while !tts.is_empty() { + let prev_comma = if first { + first = false; + None + } else if let TokenTree::Punct(ref op) = tts[0] { + if op.spacing() != Spacing::Alone { + return None; + } + if op.as_char() != ',' { + return None; + } + let tok = Token![,]([op.span()]); + tts = &tts[1..]; + if tts.is_empty() { + break; + } + Some(tok) + } else { + return None; + }; + let (nested, rest) = match nested_meta_item_from_tokens(tts) { + Some(pair) => pair, + None => return None, + }; + if let Some(comma) = prev_comma { + nested_meta_items.push_punct(comma); + } + nested_meta_items.push_value(nested); + tts = rest; + } + + Some(nested_meta_items) +} + +ast_enum! { + /// Distinguishes between attributes that decorate an item and attributes + /// that are contained within an item. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Outer attributes + /// + /// - `#[repr(transparent)]` + /// - `/// # Example` + /// - `/** Please file an issue */` + /// + /// # Inner attributes + /// + /// - `#![feature(proc_macro)]` + /// - `//! # Example` + /// - `/*! Please file an issue */` + #[cfg_attr(feature = "clone-impls", derive(Copy))] + pub enum AttrStyle { + Outer, + Inner(Token![!]), + } +} + +ast_enum_of_structs! { + /// Content of a compile-time structured attribute. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// ## Word + /// + /// A meta word is like the `test` in `#[test]`. + /// + /// ## List + /// + /// A meta list is like the `derive(Copy)` in `#[derive(Copy)]`. + /// + /// ## NameValue + /// + /// A name-value meta is like the `path = "..."` in `#[path = + /// "sys/windows.rs"]`. + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Meta { + pub Word(Ident), + /// A structured list within an attribute, like `derive(Copy, Clone)`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub List(MetaList { + pub ident: Ident, + pub paren_token: token::Paren, + pub nested: Punctuated, + }), + /// A name-value pair within an attribute, like `feature = "nightly"`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub NameValue(MetaNameValue { + pub ident: Ident, + pub eq_token: Token![=], + pub lit: Lit, + }), + } +} + +impl Meta { + /// Returns the identifier that begins this structured meta item. + /// + /// For example this would return the `test` in `#[test]`, the `derive` in + /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`. + pub fn name(&self) -> Ident { + match *self { + Meta::Word(ref meta) => meta.clone(), + Meta::List(ref meta) => meta.ident.clone(), + Meta::NameValue(ref meta) => meta.ident.clone(), + } + } +} + +ast_enum_of_structs! { + /// Element of a compile-time attribute list. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum NestedMeta { + /// A structured meta item, like the `Copy` in `#[derive(Copy)]` which + /// would be a nested `Meta::Word`. + pub Meta(Meta), + + /// A Rust literal, like the `"new_name"` in `#[rename("new_name")]`. + pub Literal(Lit), + } +} + +/// Conventional argument type associated with an invocation of an attribute +/// macro. +/// +/// For example if we are developing an attribute macro that is intended to be +/// invoked on function items as follows: +/// +/// ```edition2018 +/// # const IGNORE: &str = stringify! { +/// #[my_attribute(path = "/v1/refresh")] +/// # }; +/// pub fn refresh() { +/// /* ... */ +/// } +/// ``` +/// +/// The implementation of this macro would want to parse its attribute arguments +/// as type `AttributeArgs`. +/// +/// ```edition2018 +/// extern crate proc_macro; +/// +/// use proc_macro::TokenStream; +/// use syn::{parse_macro_input, AttributeArgs, ItemFn}; +/// +/// # const IGNORE: &str = stringify! { +/// #[proc_macro_attribute] +/// # }; +/// pub fn my_attribute(args: TokenStream, input: TokenStream) -> TokenStream { +/// let args = parse_macro_input!(args as AttributeArgs); +/// let input = parse_macro_input!(input as ItemFn); +/// +/// /* ... */ +/// # "".parse().unwrap() +/// } +/// ``` +pub type AttributeArgs = Vec; + +pub trait FilterAttrs<'a> { + type Ret: Iterator; + + fn outer(self) -> Self::Ret; + fn inner(self) -> Self::Ret; +} + +impl<'a, T> FilterAttrs<'a> for T +where + T: IntoIterator, +{ + type Ret = iter::Filter bool>; + + fn outer(self) -> Self::Ret { + #[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] + fn is_outer(attr: &&Attribute) -> bool { + match attr.style { + AttrStyle::Outer => true, + _ => false, + } + } + self.into_iter().filter(is_outer) + } + + fn inner(self) -> Self::Ret { + #[cfg_attr(feature = "cargo-clippy", allow(trivially_copy_pass_by_ref))] + fn is_inner(attr: &&Attribute) -> bool { + match attr.style { + AttrStyle::Inner(_) => true, + _ => false, + } + } + self.into_iter().filter(is_inner) + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use ext::IdentExt; + use parse::{Parse, ParseStream, Result}; + #[cfg(feature = "full")] + use private; + + pub fn single_parse_inner(input: ParseStream) -> Result { + let content; + Ok(Attribute { + pound_token: input.parse()?, + style: AttrStyle::Inner(input.parse()?), + bracket_token: bracketed!(content in input), + path: content.call(Path::parse_mod_style)?, + tts: content.parse()?, + }) + } + + pub fn single_parse_outer(input: ParseStream) -> Result { + let content; + Ok(Attribute { + pound_token: input.parse()?, + style: AttrStyle::Outer, + bracket_token: bracketed!(content in input), + path: content.call(Path::parse_mod_style)?, + tts: content.parse()?, + }) + } + + #[cfg(feature = "full")] + impl private { + pub fn attrs(outer: Vec, inner: Vec) -> Vec { + let mut attrs = outer; + attrs.extend(inner); + attrs + } + } + + impl Parse for Meta { + fn parse(input: ParseStream) -> Result { + let ident = input.call(Ident::parse_any)?; + parse_meta_after_ident(ident, input) + } + } + + impl Parse for MetaList { + fn parse(input: ParseStream) -> Result { + let ident = input.call(Ident::parse_any)?; + parse_meta_list_after_ident(ident, input) + } + } + + impl Parse for MetaNameValue { + fn parse(input: ParseStream) -> Result { + let ident = input.call(Ident::parse_any)?; + parse_meta_name_value_after_ident(ident, input) + } + } + + impl Parse for NestedMeta { + fn parse(input: ParseStream) -> Result { + let ahead = input.fork(); + + if ahead.peek(Lit) && !(ahead.peek(LitBool) && ahead.peek2(Token![=])) { + input.parse().map(NestedMeta::Literal) + } else if ahead.call(Ident::parse_any).is_ok() { + input.parse().map(NestedMeta::Meta) + } else { + Err(input.error("expected identifier or literal")) + } + } + } + + pub fn parse_meta_after_ident(ident: Ident, input: ParseStream) -> Result { + if input.peek(token::Paren) { + parse_meta_list_after_ident(ident, input).map(Meta::List) + } else if input.peek(Token![=]) { + parse_meta_name_value_after_ident(ident, input).map(Meta::NameValue) + } else { + Ok(Meta::Word(ident)) + } + } + + fn parse_meta_list_after_ident(ident: Ident, input: ParseStream) -> Result { + let content; + Ok(MetaList { + ident: ident, + paren_token: parenthesized!(content in input), + nested: content.parse_terminated(NestedMeta::parse)?, + }) + } + + fn parse_meta_name_value_after_ident( + ident: Ident, + input: ParseStream, + ) -> Result { + Ok(MetaNameValue { + ident: ident, + eq_token: input.parse()?, + lit: input.parse()?, + }) + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + use proc_macro2::TokenStream; + use quote::ToTokens; + + impl ToTokens for Attribute { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.pound_token.to_tokens(tokens); + if let AttrStyle::Inner(ref b) = self.style { + b.to_tokens(tokens); + } + self.bracket_token.surround(tokens, |tokens| { + self.path.to_tokens(tokens); + self.tts.to_tokens(tokens); + }); + } + } + + impl ToTokens for MetaList { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.paren_token.surround(tokens, |tokens| { + self.nested.to_tokens(tokens); + }) + } + } + + impl ToTokens for MetaNameValue { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.lit.to_tokens(tokens); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/buffer.rs b/vendor/registry-40351f815f426200/syn/src/buffer.rs new file mode 100644 index 000000000..8c326451e --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/buffer.rs @@ -0,0 +1,366 @@ +//! A stably addressed token buffer supporting efficient traversal based on a +//! cheaply copyable cursor. +//! +//! *This module is available if Syn is built with the `"parsing"` feature.* + +// This module is heavily commented as it contains most of the unsafe code in +// Syn, and caution should be used when editing it. The public-facing interface +// is 100% safe but the implementation is fragile internally. + +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" +))] +use proc_macro as pm; +use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; + +use std::marker::PhantomData; +use std::ptr; + +use private; +use Lifetime; + +/// Internal type which is used instead of `TokenTree` to represent a token tree +/// within a `TokenBuffer`. +enum Entry { + // Mimicking types from proc-macro. + Group(Group, TokenBuffer), + Ident(Ident), + Punct(Punct), + Literal(Literal), + // End entries contain a raw pointer to the entry from the containing + // token tree, or null if this is the outermost level. + End(*const Entry), +} + +/// A buffer that can be efficiently traversed multiple times, unlike +/// `TokenStream` which requires a deep copy in order to traverse more than +/// once. +/// +/// *This type is available if Syn is built with the `"parsing"` feature.* +pub struct TokenBuffer { + // NOTE: Do not derive clone on this - there are raw pointers inside which + // will be messed up. Moving the `TokenBuffer` itself is safe as the actual + // backing slices won't be moved. + data: Box<[Entry]>, +} + +impl TokenBuffer { + // NOTE: DO NOT MUTATE THE `Vec` RETURNED FROM THIS FUNCTION ONCE IT + // RETURNS, THE ADDRESS OF ITS BACKING MEMORY MUST REMAIN STABLE. + fn inner_new(stream: TokenStream, up: *const Entry) -> TokenBuffer { + // Build up the entries list, recording the locations of any Groups + // in the list to be processed later. + let mut entries = Vec::new(); + let mut seqs = Vec::new(); + for tt in stream { + match tt { + TokenTree::Ident(sym) => { + entries.push(Entry::Ident(sym)); + } + TokenTree::Punct(op) => { + entries.push(Entry::Punct(op)); + } + TokenTree::Literal(l) => { + entries.push(Entry::Literal(l)); + } + TokenTree::Group(g) => { + // Record the index of the interesting entry, and store an + // `End(null)` there temporarially. + seqs.push((entries.len(), g)); + entries.push(Entry::End(ptr::null())); + } + } + } + // Add an `End` entry to the end with a reference to the enclosing token + // stream which was passed in. + entries.push(Entry::End(up)); + + // NOTE: This is done to ensure that we don't accidentally modify the + // length of the backing buffer. The backing buffer must remain at a + // constant address after this point, as we are going to store a raw + // pointer into it. + let mut entries = entries.into_boxed_slice(); + for (idx, group) in seqs { + // We know that this index refers to one of the temporary + // `End(null)` entries, and we know that the last entry is + // `End(up)`, so the next index is also valid. + let seq_up = &entries[idx + 1] as *const Entry; + + // The end entry stored at the end of this Entry::Group should + // point to the Entry which follows the Group in the list. + let inner = Self::inner_new(group.stream(), seq_up); + entries[idx] = Entry::Group(group, inner); + } + + TokenBuffer { data: entries } + } + + /// Creates a `TokenBuffer` containing all the tokens from the input + /// `TokenStream`. + /// + /// *This method is available if Syn is built with both the `"parsing"` and + /// `"proc-macro"` features.* + #[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" + ))] + pub fn new(stream: pm::TokenStream) -> TokenBuffer { + Self::new2(stream.into()) + } + + /// Creates a `TokenBuffer` containing all the tokens from the input + /// `TokenStream`. + pub fn new2(stream: TokenStream) -> TokenBuffer { + Self::inner_new(stream, ptr::null()) + } + + /// Creates a cursor referencing the first token in the buffer and able to + /// traverse until the end of the buffer. + pub fn begin(&self) -> Cursor { + unsafe { Cursor::create(&self.data[0], &self.data[self.data.len() - 1]) } + } +} + +/// A cheaply copyable cursor into a `TokenBuffer`. +/// +/// This cursor holds a shared reference into the immutable data which is used +/// internally to represent a `TokenStream`, and can be efficiently manipulated +/// and copied around. +/// +/// An empty `Cursor` can be created directly, or one may create a `TokenBuffer` +/// object and get a cursor to its first token with `begin()`. +/// +/// Two cursors are equal if they have the same location in the same input +/// stream, and have the same scope. +/// +/// *This type is available if Syn is built with the `"parsing"` feature.* +#[derive(Copy, Clone, Eq, PartialEq)] +pub struct Cursor<'a> { + // The current entry which the `Cursor` is pointing at. + ptr: *const Entry, + // This is the only `Entry::End(..)` object which this cursor is allowed to + // point at. All other `End` objects are skipped over in `Cursor::create`. + scope: *const Entry, + // Cursor is covariant in 'a. This field ensures that our pointers are still + // valid. + marker: PhantomData<&'a Entry>, +} + +impl<'a> Cursor<'a> { + /// Creates a cursor referencing a static empty TokenStream. + pub fn empty() -> Self { + // It's safe in this situation for us to put an `Entry` object in global + // storage, despite it not actually being safe to send across threads + // (`Ident` is a reference into a thread-local table). This is because + // this entry never includes a `Ident` object. + // + // This wrapper struct allows us to break the rules and put a `Sync` + // object in global storage. + struct UnsafeSyncEntry(Entry); + unsafe impl Sync for UnsafeSyncEntry {} + static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0 as *const Entry)); + + Cursor { + ptr: &EMPTY_ENTRY.0, + scope: &EMPTY_ENTRY.0, + marker: PhantomData, + } + } + + /// This create method intelligently exits non-explicitly-entered + /// `None`-delimited scopes when the cursor reaches the end of them, + /// allowing for them to be treated transparently. + unsafe fn create(mut ptr: *const Entry, scope: *const Entry) -> Self { + // NOTE: If we're looking at a `End(..)`, we want to advance the cursor + // past it, unless `ptr == scope`, which means that we're at the edge of + // our cursor's scope. We should only have `ptr != scope` at the exit + // from None-delimited groups entered with `ignore_none`. + while let Entry::End(exit) = *ptr { + if ptr == scope { + break; + } + ptr = exit; + } + + Cursor { + ptr: ptr, + scope: scope, + marker: PhantomData, + } + } + + /// Get the current entry. + fn entry(self) -> &'a Entry { + unsafe { &*self.ptr } + } + + /// Bump the cursor to point at the next token after the current one. This + /// is undefined behavior if the cursor is currently looking at an + /// `Entry::End`. + unsafe fn bump(self) -> Cursor<'a> { + Cursor::create(self.ptr.offset(1), self.scope) + } + + /// If the cursor is looking at a `None`-delimited group, move it to look at + /// the first token inside instead. If the group is empty, this will move + /// the cursor past the `None`-delimited group. + /// + /// WARNING: This mutates its argument. + fn ignore_none(&mut self) { + if let Entry::Group(ref group, ref buf) = *self.entry() { + if group.delimiter() == Delimiter::None { + // NOTE: We call `Cursor::create` here to make sure that + // situations where we should immediately exit the span after + // entering it are handled correctly. + unsafe { + *self = Cursor::create(&buf.data[0], self.scope); + } + } + } + } + + /// Checks whether the cursor is currently pointing at the end of its valid + /// scope. + #[inline] + pub fn eof(self) -> bool { + // We're at eof if we're at the end of our scope. + self.ptr == self.scope + } + + /// If the cursor is pointing at a `Group` with the given delimiter, returns + /// a cursor into that group and one pointing to the next `TokenTree`. + pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, Span, Cursor<'a>)> { + // If we're not trying to enter a none-delimited group, we want to + // ignore them. We have to make sure to _not_ ignore them when we want + // to enter them, of course. For obvious reasons. + if delim != Delimiter::None { + self.ignore_none(); + } + + if let Entry::Group(ref group, ref buf) = *self.entry() { + if group.delimiter() == delim { + return Some((buf.begin(), group.span(), unsafe { self.bump() })); + } + } + + None + } + + /// If the cursor is pointing at a `Ident`, returns it along with a cursor + /// pointing at the next `TokenTree`. + pub fn ident(mut self) -> Option<(Ident, Cursor<'a>)> { + self.ignore_none(); + match *self.entry() { + Entry::Ident(ref ident) => Some((ident.clone(), unsafe { self.bump() })), + _ => None, + } + } + + /// If the cursor is pointing at an `Punct`, returns it along with a cursor + /// pointing at the next `TokenTree`. + pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> { + self.ignore_none(); + match *self.entry() { + Entry::Punct(ref op) if op.as_char() != '\'' => { + Some((op.clone(), unsafe { self.bump() })) + } + _ => None, + } + } + + /// If the cursor is pointing at a `Literal`, return it along with a cursor + /// pointing at the next `TokenTree`. + pub fn literal(mut self) -> Option<(Literal, Cursor<'a>)> { + self.ignore_none(); + match *self.entry() { + Entry::Literal(ref lit) => Some((lit.clone(), unsafe { self.bump() })), + _ => None, + } + } + + /// If the cursor is pointing at a `Lifetime`, returns it along with a + /// cursor pointing at the next `TokenTree`. + pub fn lifetime(mut self) -> Option<(Lifetime, Cursor<'a>)> { + self.ignore_none(); + match *self.entry() { + Entry::Punct(ref op) if op.as_char() == '\'' && op.spacing() == Spacing::Joint => { + let next = unsafe { self.bump() }; + match next.ident() { + Some((ident, rest)) => { + let lifetime = Lifetime { + apostrophe: op.span(), + ident: ident, + }; + Some((lifetime, rest)) + } + None => None, + } + } + _ => None, + } + } + + /// Copies all remaining tokens visible from this cursor into a + /// `TokenStream`. + pub fn token_stream(self) -> TokenStream { + let mut tts = Vec::new(); + let mut cursor = self; + while let Some((tt, rest)) = cursor.token_tree() { + tts.push(tt); + cursor = rest; + } + tts.into_iter().collect() + } + + /// If the cursor is pointing at a `TokenTree`, returns it along with a + /// cursor pointing at the next `TokenTree`. + /// + /// Returns `None` if the cursor has reached the end of its stream. + /// + /// This method does not treat `None`-delimited groups as transparent, and + /// will return a `Group(None, ..)` if the cursor is looking at one. + pub fn token_tree(self) -> Option<(TokenTree, Cursor<'a>)> { + let tree = match *self.entry() { + Entry::Group(ref group, _) => group.clone().into(), + Entry::Literal(ref lit) => lit.clone().into(), + Entry::Ident(ref ident) => ident.clone().into(), + Entry::Punct(ref op) => op.clone().into(), + Entry::End(..) => { + return None; + } + }; + + Some((tree, unsafe { self.bump() })) + } + + /// Returns the `Span` of the current token, or `Span::call_site()` if this + /// cursor points to eof. + pub fn span(self) -> Span { + match *self.entry() { + Entry::Group(ref group, _) => group.span(), + Entry::Literal(ref l) => l.span(), + Entry::Ident(ref t) => t.span(), + Entry::Punct(ref o) => o.span(), + Entry::End(..) => Span::call_site(), + } + } +} + +impl private { + #[cfg(procmacro2_semver_exempt)] + pub fn open_span_of_group(cursor: Cursor) -> Span { + match *cursor.entry() { + Entry::Group(ref group, _) => group.span_open(), + _ => cursor.span(), + } + } + + #[cfg(procmacro2_semver_exempt)] + pub fn close_span_of_group(cursor: Cursor) -> Span { + match *cursor.entry() { + Entry::Group(ref group, _) => group.span_close(), + _ => cursor.span(), + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/custom_keyword.rs b/vendor/registry-40351f815f426200/syn/src/custom_keyword.rs new file mode 100644 index 000000000..ab3d5b64f --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/custom_keyword.rs @@ -0,0 +1,252 @@ +/// Define a type that supports parsing and printing a given identifier as if it +/// were a keyword. +/// +/// # Usage +/// +/// As a convention, it is recommended that this macro be invoked within a +/// module called `kw` or `keyword` and that the resulting parser be invoked +/// with a `kw::` or `keyword::` prefix. +/// +/// ```edition2018 +/// mod kw { +/// syn::custom_keyword!(whatever); +/// } +/// ``` +/// +/// The generated syntax tree node supports the following operations just like +/// any built-in keyword token. +/// +/// - [Peeking] — `input.peek(kw::whatever)` +/// +/// - [Parsing] — `input.parse::()?` +/// +/// - [Printing] — `quote!( ... #whatever_token ... )` +/// +/// - Construction from a [`Span`] — `let whatever_token = kw::whatever(sp)` +/// +/// - Field access to its span — `let sp = whatever_token.span` +/// +/// [Peeking]: parse/struct.ParseBuffer.html#method.peek +/// [Parsing]: parse/struct.ParseBuffer.html#method.parse +/// [Printing]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html +/// [`Span`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html +/// +/// # Example +/// +/// This example parses input that looks like `bool = true` or `str = "value"`. +/// The key must be either the identifier `bool` or the identifier `str`. If +/// `bool`, the value may be either `true` or `false`. If `str`, the value may +/// be any string literal. +/// +/// The symbols `bool` and `str` are not reserved keywords in Rust so these are +/// not considered keywords in the `syn::token` module. Like any other +/// identifier that is not a keyword, these can be declared as custom keywords +/// by crates that need to use them as such. +/// +/// ```edition2018 +/// use syn::{LitBool, LitStr, Result, Token}; +/// use syn::parse::{Parse, ParseStream}; +/// +/// mod kw { +/// syn::custom_keyword!(bool); +/// syn::custom_keyword!(str); +/// } +/// +/// enum Argument { +/// Bool { +/// bool_token: kw::bool, +/// eq_token: Token![=], +/// value: LitBool, +/// }, +/// Str { +/// str_token: kw::str, +/// eq_token: Token![=], +/// value: LitStr, +/// }, +/// } +/// +/// impl Parse for Argument { +/// fn parse(input: ParseStream) -> Result { +/// let lookahead = input.lookahead1(); +/// if lookahead.peek(kw::bool) { +/// Ok(Argument::Bool { +/// bool_token: input.parse::()?, +/// eq_token: input.parse()?, +/// value: input.parse()?, +/// }) +/// } else if lookahead.peek(kw::str) { +/// Ok(Argument::Str { +/// str_token: input.parse::()?, +/// eq_token: input.parse()?, +/// value: input.parse()?, +/// }) +/// } else { +/// Err(lookahead.error()) +/// } +/// } +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! custom_keyword { + ($ident:ident) => { + #[allow(non_camel_case_types)] + pub struct $ident { + pub span: $crate::export::Span, + } + + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $ident<__S: $crate::export::IntoSpans<[$crate::export::Span; 1]>>( + span: __S, + ) -> $ident { + $ident { + span: $crate::export::IntoSpans::into_spans(span)[0], + } + } + + impl $crate::export::Default for $ident { + fn default() -> Self { + $ident { + span: $crate::export::Span::call_site(), + } + } + } + + impl_parse_for_custom_keyword!($ident); + impl_to_tokens_for_custom_keyword!($ident); + impl_clone_for_custom_keyword!($ident); + impl_extra_traits_for_custom_keyword!($ident); + }; +} + +// Not public API. +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_parse_for_custom_keyword { + ($ident:ident) => { + // For peek. + impl $crate::token::CustomToken for $ident { + fn peek(cursor: $crate::buffer::Cursor) -> $crate::export::bool { + if let Some((ident, _rest)) = cursor.ident() { + ident == stringify!($ident) + } else { + false + } + } + + fn display() -> &'static $crate::export::str { + concat!("`", stringify!($ident), "`") + } + } + + impl $crate::parse::Parse for $ident { + fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> { + input.step(|cursor| { + if let $crate::export::Some((ident, rest)) = cursor.ident() { + if ident == stringify!($ident) { + return $crate::export::Ok(($ident { span: ident.span() }, rest)); + } + } + $crate::export::Err(cursor.error(concat!( + "expected `", + stringify!($ident), + "`" + ))) + }) + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "parsing"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_parse_for_custom_keyword { + ($ident:ident) => {}; +} + +// Not public API. +#[cfg(feature = "printing")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_to_tokens_for_custom_keyword { + ($ident:ident) => { + impl $crate::export::ToTokens for $ident { + fn to_tokens(&self, tokens: &mut $crate::export::TokenStream2) { + let ident = $crate::Ident::new(stringify!($ident), self.span); + $crate::export::TokenStreamExt::append(tokens, ident); + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "printing"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_to_tokens_for_custom_keyword { + ($ident:ident) => {}; +} + +// Not public API. +#[cfg(feature = "clone-impls")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_clone_for_custom_keyword { + ($ident:ident) => { + impl $crate::export::Copy for $ident {} + + impl $crate::export::Clone for $ident { + fn clone(&self) -> Self { + *self + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "clone-impls"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_clone_for_custom_keyword { + ($ident:ident) => {}; +} + +// Not public API. +#[cfg(feature = "extra-traits")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_extra_traits_for_custom_keyword { + ($ident:ident) => { + impl $crate::export::Debug for $ident { + fn fmt(&self, f: &mut $crate::export::Formatter) -> $crate::export::fmt::Result { + $crate::export::Formatter::write_str( + f, + concat!("Keyword [", stringify!($ident), "]"), + ) + } + } + + impl $crate::export::Eq for $ident {} + + impl $crate::export::PartialEq for $ident { + fn eq(&self, _other: &Self) -> $crate::export::bool { + true + } + } + + impl $crate::export::Hash for $ident { + fn hash<__H: $crate::export::Hasher>(&self, _state: &mut __H) {} + } + }; +} + +// Not public API. +#[cfg(not(feature = "extra-traits"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_extra_traits_for_custom_keyword { + ($ident:ident) => {}; +} diff --git a/vendor/registry-40351f815f426200/syn/src/custom_punctuation.rs b/vendor/registry-40351f815f426200/syn/src/custom_punctuation.rs new file mode 100644 index 000000000..8d7d4443f --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/custom_punctuation.rs @@ -0,0 +1,309 @@ +/// Define a type that supports parsing and printing a multi-character symbol +/// as if it were a punctuation token. +/// +/// # Usage +/// +/// ```edition2018 +/// syn::custom_punctuation!(LeftRightArrow, <=>); +/// ``` +/// +/// The generated syntax tree node supports the following operations just like +/// any built-in punctuation token. +/// +/// - [Peeking] — `input.peek(LeftRightArrow)` +/// +/// - [Parsing] — `input.parse::()?` +/// +/// - [Printing] — `quote!( ... #lrarrow ... )` +/// +/// - Construction from a [`Span`] — `let lrarrow = LeftRightArrow(sp)` +/// +/// - Construction from multiple [`Span`] — `let lrarrow = LeftRightArrow([sp, sp, sp])` +/// +/// - Field access to its spans — `let spans = lrarrow.spans` +/// +/// [Peeking]: parse/struct.ParseBuffer.html#method.peek +/// [Parsing]: parse/struct.ParseBuffer.html#method.parse +/// [Printing]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html +/// [`Span`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html +/// +/// # Example +/// +/// ```edition2018 +/// use proc_macro2::{TokenStream, TokenTree}; +/// use syn::parse::{Parse, ParseStream, Peek, Result}; +/// use syn::punctuated::Punctuated; +/// use syn::Expr; +/// +/// syn::custom_punctuation!(PathSeparator, ); +/// +/// // expr expr expr ... +/// struct PathSegments { +/// segments: Punctuated, +/// } +/// +/// impl Parse for PathSegments { +/// fn parse(input: ParseStream) -> Result { +/// let mut segments = Punctuated::new(); +/// +/// let first = parse_until(input, PathSeparator)?; +/// segments.push_value(syn::parse2(first)?); +/// +/// while input.peek(PathSeparator) { +/// segments.push_punct(input.parse()?); +/// +/// let next = parse_until(input, PathSeparator)?; +/// segments.push_value(syn::parse2(next)?); +/// } +/// +/// Ok(PathSegments { segments }) +/// } +/// } +/// +/// fn parse_until(input: ParseStream, end: E) -> Result { +/// let mut tokens = TokenStream::new(); +/// while !input.is_empty() && !input.peek(end) { +/// let next: TokenTree = input.parse()?; +/// tokens.extend(Some(next)); +/// } +/// Ok(tokens) +/// } +/// +/// fn main() { +/// let input = r#" a::b c::d::e "#; +/// let _: PathSegments = syn::parse_str(input).unwrap(); +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! custom_punctuation { + ($ident:ident, $($tt:tt)+) => { + pub struct $ident { + pub spans: custom_punctuation_repr!($($tt)+), + } + + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $ident<__S: $crate::export::IntoSpans>( + spans: __S, + ) -> $ident { + let _validate_len = 0 $(+ custom_punctuation_len!(strict, $tt))*; + $ident { + spans: $crate::export::IntoSpans::into_spans(spans) + } + } + + impl $crate::export::Default for $ident { + fn default() -> Self { + $ident($crate::export::Span::call_site()) + } + } + + impl_parse_for_custom_punctuation!($ident, $($tt)+); + impl_to_tokens_for_custom_punctuation!($ident, $($tt)+); + impl_clone_for_custom_punctuation!($ident, $($tt)+); + impl_extra_traits_for_custom_punctuation!($ident, $($tt)+); + }; +} + +// Not public API. +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! impl_parse_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => { + impl $crate::token::CustomToken for $ident { + fn peek(cursor: $crate::buffer::Cursor) -> bool { + $crate::token::parsing::peek_punct(cursor, stringify_punct!($($tt)+)) + } + + fn display() -> &'static $crate::export::str { + custom_punctuation_concat!("`", stringify_punct!($($tt)+), "`") + } + } + + impl $crate::parse::Parse for $ident { + fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> { + let spans: custom_punctuation_repr!($($tt)+) = + $crate::token::parsing::punct(input, stringify_punct!($($tt)+))?; + Ok($ident(spans)) + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "parsing"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_parse_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => {}; +} + +// Not public API. +#[cfg(feature = "printing")] +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! impl_to_tokens_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => { + impl $crate::export::ToTokens for $ident { + fn to_tokens(&self, tokens: &mut $crate::export::TokenStream2) { + $crate::token::printing::punct(stringify_punct!($($tt)+), &self.spans, tokens) + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "printing"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_to_tokens_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => {}; +} + +// Not public API. +#[cfg(feature = "clone-impls")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_clone_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => { + impl $crate::export::Copy for $ident {} + + impl $crate::export::Clone for $ident { + fn clone(&self) -> Self { + *self + } + } + }; +} + +// Not public API. +#[cfg(not(feature = "clone-impls"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_clone_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => {}; +} + +// Not public API. +#[cfg(feature = "extra-traits")] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_extra_traits_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => { + impl $crate::export::Debug for $ident { + fn fmt(&self, f: &mut $crate::export::Formatter) -> $crate::export::fmt::Result { + $crate::export::Formatter::write_str(f, stringify!($ident)) + } + } + + impl $crate::export::Eq for $ident {} + + impl $crate::export::PartialEq for $ident { + fn eq(&self, _other: &Self) -> $crate::export::bool { + true + } + } + + impl $crate::export::Hash for $ident { + fn hash<__H: $crate::export::Hasher>(&self, _state: &mut __H) {} + } + }; +} + +// Not public API. +#[cfg(not(feature = "extra-traits"))] +#[doc(hidden)] +#[macro_export] +macro_rules! impl_extra_traits_for_custom_punctuation { + ($ident:ident, $($tt:tt)+) => {}; +} + +// Not public API. +#[doc(hidden)] +#[macro_export(local_inner_macros)] +macro_rules! custom_punctuation_repr { + ($($tt:tt)+) => { + [$crate::export::Span; 0 $(+ custom_punctuation_len!(lenient, $tt))+] + }; +} + +// Not public API. +#[doc(hidden)] +#[macro_export(local_inner_macros)] +#[cfg_attr(rustfmt, rustfmt_skip)] +macro_rules! custom_punctuation_len { + ($mode:ident, +) => { 1 }; + ($mode:ident, +=) => { 2 }; + ($mode:ident, &) => { 1 }; + ($mode:ident, &&) => { 2 }; + ($mode:ident, &=) => { 2 }; + ($mode:ident, @) => { 1 }; + ($mode:ident, !) => { 1 }; + ($mode:ident, ^) => { 1 }; + ($mode:ident, ^=) => { 2 }; + ($mode:ident, :) => { 1 }; + ($mode:ident, ::) => { 2 }; + ($mode:ident, ,) => { 1 }; + ($mode:ident, /) => { 1 }; + ($mode:ident, /=) => { 2 }; + ($mode:ident, .) => { 1 }; + ($mode:ident, ..) => { 2 }; + ($mode:ident, ...) => { 3 }; + ($mode:ident, ..=) => { 3 }; + ($mode:ident, =) => { 1 }; + ($mode:ident, ==) => { 2 }; + ($mode:ident, >=) => { 2 }; + ($mode:ident, >) => { 1 }; + ($mode:ident, <=) => { 2 }; + ($mode:ident, <) => { 1 }; + ($mode:ident, *=) => { 2 }; + ($mode:ident, !=) => { 2 }; + ($mode:ident, |) => { 1 }; + ($mode:ident, |=) => { 2 }; + ($mode:ident, ||) => { 2 }; + ($mode:ident, #) => { 1 }; + ($mode:ident, ?) => { 1 }; + ($mode:ident, ->) => { 2 }; + ($mode:ident, <-) => { 2 }; + ($mode:ident, %) => { 1 }; + ($mode:ident, %=) => { 2 }; + ($mode:ident, =>) => { 2 }; + ($mode:ident, ;) => { 1 }; + ($mode:ident, <<) => { 2 }; + ($mode:ident, <<=) => { 3 }; + ($mode:ident, >>) => { 2 }; + ($mode:ident, >>=) => { 3 }; + ($mode:ident, *) => { 1 }; + ($mode:ident, -) => { 1 }; + ($mode:ident, -=) => { 2 }; + ($mode:ident, ~) => { 1 }; + (lenient, $tt:tt) => { 0 }; + (strict, $tt:tt) => {{ custom_punctuation_unexpected!($tt); 0 }}; +} + +// Not public API. +#[doc(hidden)] +#[macro_export] +macro_rules! custom_punctuation_unexpected { + () => {}; +} + +// Not public API. +#[doc(hidden)] +#[macro_export] +macro_rules! stringify_punct { + ($($tt:tt)+) => { + concat!($(stringify!($tt)),+) + }; +} + +// Not public API. +// Without this, local_inner_macros breaks when looking for concat! +#[doc(hidden)] +#[macro_export] +macro_rules! custom_punctuation_concat { + ($($tt:tt)*) => { + concat!($($tt)*) + }; +} diff --git a/vendor/registry-40351f815f426200/syn/src/data.rs b/vendor/registry-40351f815f426200/syn/src/data.rs new file mode 100644 index 000000000..f54f5b9af --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/data.rs @@ -0,0 +1,384 @@ +use super::*; +use punctuated::Punctuated; + +ast_struct! { + /// An enum variant. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Variant { + /// Attributes tagged on the variant. + pub attrs: Vec, + + /// Name of the variant. + pub ident: Ident, + + /// Content stored in the variant. + pub fields: Fields, + + /// Explicit discriminant: `Variant = 1` + pub discriminant: Option<(Token![=], Expr)>, + } +} + +ast_enum_of_structs! { + /// Data stored within an enum variant or struct. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Fields { + /// Named fields of a struct or struct variant such as `Point { x: f64, + /// y: f64 }`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Named(FieldsNamed { + pub brace_token: token::Brace, + pub named: Punctuated, + }), + + /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Unnamed(FieldsUnnamed { + pub paren_token: token::Paren, + pub unnamed: Punctuated, + }), + + /// Unit struct or unit variant such as `None`. + pub Unit, + } +} + +impl Fields { + /// Get an iterator over the borrowed [`Field`] items in this object. This + /// iterator can be used to iterate over a named or unnamed struct or + /// variant's fields uniformly. + /// + /// [`Field`]: struct.Field.html + pub fn iter(&self) -> punctuated::Iter { + match *self { + Fields::Unit => private::empty_punctuated_iter(), + Fields::Named(ref f) => f.named.iter(), + Fields::Unnamed(ref f) => f.unnamed.iter(), + } + } + + /// Get an iterator over the mutably borrowed [`Field`] items in this + /// object. This iterator can be used to iterate over a named or unnamed + /// struct or variant's fields uniformly. + /// + /// [`Field`]: struct.Field.html + pub fn iter_mut(&mut self) -> punctuated::IterMut { + match *self { + Fields::Unit => private::empty_punctuated_iter_mut(), + Fields::Named(ref mut f) => f.named.iter_mut(), + Fields::Unnamed(ref mut f) => f.unnamed.iter_mut(), + } + } +} + +impl<'a> IntoIterator for &'a Fields { + type Item = &'a Field; + type IntoIter = punctuated::Iter<'a, Field>; + + fn into_iter(self) -> Self::IntoIter { + self.iter() + } +} + +impl<'a> IntoIterator for &'a mut Fields { + type Item = &'a mut Field; + type IntoIter = punctuated::IterMut<'a, Field>; + + fn into_iter(self) -> Self::IntoIter { + self.iter_mut() + } +} + +ast_struct! { + /// A field of a struct or enum variant. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Field { + /// Attributes tagged on the field. + pub attrs: Vec, + + /// Visibility of the field. + pub vis: Visibility, + + /// Name of the field, if any. + /// + /// Fields of tuple structs have no names. + pub ident: Option, + + pub colon_token: Option, + + /// Type of the field. + pub ty: Type, + } +} + +ast_enum_of_structs! { + /// The visibility level of an item: inherited or `pub` or + /// `pub(restricted)`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Visibility { + /// A public visibility level: `pub`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Public(VisPublic { + pub pub_token: Token![pub], + }), + + /// A crate-level visibility: `crate`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Crate(VisCrate { + pub crate_token: Token![crate], + }), + + /// A visibility level restricted to some path: `pub(self)` or + /// `pub(super)` or `pub(crate)` or `pub(in some::module)`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Restricted(VisRestricted { + pub pub_token: Token![pub], + pub paren_token: token::Paren, + pub in_token: Option, + pub path: Box, + }), + + /// An inherited visibility, which usually means private. + pub Inherited, + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use ext::IdentExt; + use parse::{Parse, ParseStream, Result}; + + impl Parse for Variant { + fn parse(input: ParseStream) -> Result { + Ok(Variant { + attrs: input.call(Attribute::parse_outer)?, + ident: input.parse()?, + fields: { + if input.peek(token::Brace) { + Fields::Named(input.parse()?) + } else if input.peek(token::Paren) { + Fields::Unnamed(input.parse()?) + } else { + Fields::Unit + } + }, + discriminant: { + if input.peek(Token![=]) { + let eq_token: Token![=] = input.parse()?; + let discriminant: Expr = input.parse()?; + Some((eq_token, discriminant)) + } else { + None + } + }, + }) + } + } + + impl Parse for FieldsNamed { + fn parse(input: ParseStream) -> Result { + let content; + Ok(FieldsNamed { + brace_token: braced!(content in input), + named: content.parse_terminated(Field::parse_named)?, + }) + } + } + + impl Parse for FieldsUnnamed { + fn parse(input: ParseStream) -> Result { + let content; + Ok(FieldsUnnamed { + paren_token: parenthesized!(content in input), + unnamed: content.parse_terminated(Field::parse_unnamed)?, + }) + } + } + + impl Field { + /// Parses a named (braced struct) field. + pub fn parse_named(input: ParseStream) -> Result { + Ok(Field { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + ident: Some(input.parse()?), + colon_token: Some(input.parse()?), + ty: input.parse()?, + }) + } + + /// Parses an unnamed (tuple struct) field. + pub fn parse_unnamed(input: ParseStream) -> Result { + Ok(Field { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + ident: None, + colon_token: None, + ty: input.parse()?, + }) + } + } + + impl Parse for Visibility { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![pub]) { + Self::parse_pub(input) + } else if input.peek(Token![crate]) { + Self::parse_crate(input) + } else { + Ok(Visibility::Inherited) + } + } + } + + impl Visibility { + fn parse_pub(input: ParseStream) -> Result { + let pub_token = input.parse::()?; + + if input.peek(token::Paren) { + let ahead = input.fork(); + let mut content; + parenthesized!(content in ahead); + + if content.peek(Token![crate]) + || content.peek(Token![self]) + || content.peek(Token![super]) + { + return Ok(Visibility::Restricted(VisRestricted { + pub_token: pub_token, + paren_token: parenthesized!(content in input), + in_token: None, + path: Box::new(Path::from(content.call(Ident::parse_any)?)), + })); + } else if content.peek(Token![in]) { + return Ok(Visibility::Restricted(VisRestricted { + pub_token: pub_token, + paren_token: parenthesized!(content in input), + in_token: Some(content.parse()?), + path: Box::new(content.call(Path::parse_mod_style)?), + })); + } + } + + Ok(Visibility::Public(VisPublic { + pub_token: pub_token, + })) + } + + fn parse_crate(input: ParseStream) -> Result { + if input.peek2(Token![::]) { + Ok(Visibility::Inherited) + } else { + Ok(Visibility::Crate(VisCrate { + crate_token: input.parse()?, + })) + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::{ToTokens, TokenStreamExt}; + + use print::TokensOrDefault; + + impl ToTokens for Variant { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(&self.attrs); + self.ident.to_tokens(tokens); + self.fields.to_tokens(tokens); + if let Some((ref eq_token, ref disc)) = self.discriminant { + eq_token.to_tokens(tokens); + disc.to_tokens(tokens); + } + } + } + + impl ToTokens for FieldsNamed { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.brace_token.surround(tokens, |tokens| { + self.named.to_tokens(tokens); + }); + } + } + + impl ToTokens for FieldsUnnamed { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.paren_token.surround(tokens, |tokens| { + self.unnamed.to_tokens(tokens); + }); + } + } + + impl ToTokens for Field { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(&self.attrs); + self.vis.to_tokens(tokens); + if let Some(ref ident) = self.ident { + ident.to_tokens(tokens); + TokensOrDefault(&self.colon_token).to_tokens(tokens); + } + self.ty.to_tokens(tokens); + } + } + + impl ToTokens for VisPublic { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.pub_token.to_tokens(tokens) + } + } + + impl ToTokens for VisCrate { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.crate_token.to_tokens(tokens); + } + } + + impl ToTokens for VisRestricted { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.pub_token.to_tokens(tokens); + self.paren_token.surround(tokens, |tokens| { + // TODO: If we have a path which is not "self" or "super" or + // "crate", automatically add the "in" token. + self.in_token.to_tokens(tokens); + self.path.to_tokens(tokens); + }); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/derive.rs b/vendor/registry-40351f815f426200/syn/src/derive.rs new file mode 100644 index 000000000..48ae7e46e --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/derive.rs @@ -0,0 +1,255 @@ +use super::*; +use punctuated::Punctuated; + +ast_struct! { + /// Data structure sent to a `proc_macro_derive` macro. + /// + /// *This type is available if Syn is built with the `"derive"` feature.* + pub struct DeriveInput { + /// Attributes tagged on the whole struct or enum. + pub attrs: Vec, + + /// Visibility of the struct or enum. + pub vis: Visibility, + + /// Name of the struct or enum. + pub ident: Ident, + + /// Generics required to complete the definition. + pub generics: Generics, + + /// Data within the struct or enum. + pub data: Data, + } +} + +ast_enum_of_structs! { + /// The storage of a struct, enum or union data structure. + /// + /// *This type is available if Syn is built with the `"derive"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Data { + /// A struct input to a `proc_macro_derive` macro. + /// + /// *This type is available if Syn is built with the `"derive"` + /// feature.* + pub Struct(DataStruct { + pub struct_token: Token![struct], + pub fields: Fields, + pub semi_token: Option, + }), + + /// An enum input to a `proc_macro_derive` macro. + /// + /// *This type is available if Syn is built with the `"derive"` + /// feature.* + pub Enum(DataEnum { + pub enum_token: Token![enum], + pub brace_token: token::Brace, + pub variants: Punctuated, + }), + + /// A tagged union input to a `proc_macro_derive` macro. + /// + /// *This type is available if Syn is built with the `"derive"` + /// feature.* + pub Union(DataUnion { + pub union_token: Token![union], + pub fields: FieldsNamed, + }), + } + + do_not_generate_to_tokens +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + + impl Parse for DeriveInput { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis = input.parse::()?; + + let lookahead = input.lookahead1(); + if lookahead.peek(Token![struct]) { + let struct_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, fields, semi) = data_struct(input)?; + Ok(DeriveInput { + attrs: attrs, + vis: vis, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + data: Data::Struct(DataStruct { + struct_token: struct_token, + fields: fields, + semi_token: semi, + }), + }) + } else if lookahead.peek(Token![enum]) { + let enum_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, brace, variants) = data_enum(input)?; + Ok(DeriveInput { + attrs: attrs, + vis: vis, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + data: Data::Enum(DataEnum { + enum_token: enum_token, + brace_token: brace, + variants: variants, + }), + }) + } else if lookahead.peek(Token![union]) { + let union_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, fields) = data_union(input)?; + Ok(DeriveInput { + attrs: attrs, + vis: vis, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + data: Data::Union(DataUnion { + union_token: union_token, + fields: fields, + }), + }) + } else { + Err(lookahead.error()) + } + } + } + + pub fn data_struct( + input: ParseStream, + ) -> Result<(Option, Fields, Option)> { + let mut lookahead = input.lookahead1(); + let mut where_clause = None; + if lookahead.peek(Token![where]) { + where_clause = Some(input.parse()?); + lookahead = input.lookahead1(); + } + + if where_clause.is_none() && lookahead.peek(token::Paren) { + let fields = input.parse()?; + + lookahead = input.lookahead1(); + if lookahead.peek(Token![where]) { + where_clause = Some(input.parse()?); + lookahead = input.lookahead1(); + } + + if lookahead.peek(Token![;]) { + let semi = input.parse()?; + Ok((where_clause, Fields::Unnamed(fields), Some(semi))) + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(token::Brace) { + let fields = input.parse()?; + Ok((where_clause, Fields::Named(fields), None)) + } else if lookahead.peek(Token![;]) { + let semi = input.parse()?; + Ok((where_clause, Fields::Unit, Some(semi))) + } else { + Err(lookahead.error()) + } + } + + pub fn data_enum( + input: ParseStream, + ) -> Result<( + Option, + token::Brace, + Punctuated, + )> { + let where_clause = input.parse()?; + + let content; + let brace = braced!(content in input); + let variants = content.parse_terminated(Variant::parse)?; + + Ok((where_clause, brace, variants)) + } + + pub fn data_union(input: ParseStream) -> Result<(Option, FieldsNamed)> { + let where_clause = input.parse()?; + let fields = input.parse()?; + Ok((where_clause, fields)) + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::ToTokens; + + use attr::FilterAttrs; + use print::TokensOrDefault; + + impl ToTokens for DeriveInput { + fn to_tokens(&self, tokens: &mut TokenStream) { + for attr in self.attrs.outer() { + attr.to_tokens(tokens); + } + self.vis.to_tokens(tokens); + match self.data { + Data::Struct(ref d) => d.struct_token.to_tokens(tokens), + Data::Enum(ref d) => d.enum_token.to_tokens(tokens), + Data::Union(ref d) => d.union_token.to_tokens(tokens), + } + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + match self.data { + Data::Struct(ref data) => match data.fields { + Fields::Named(ref fields) => { + self.generics.where_clause.to_tokens(tokens); + fields.to_tokens(tokens); + } + Fields::Unnamed(ref fields) => { + fields.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + TokensOrDefault(&data.semi_token).to_tokens(tokens); + } + Fields::Unit => { + self.generics.where_clause.to_tokens(tokens); + TokensOrDefault(&data.semi_token).to_tokens(tokens); + } + }, + Data::Enum(ref data) => { + self.generics.where_clause.to_tokens(tokens); + data.brace_token.surround(tokens, |tokens| { + data.variants.to_tokens(tokens); + }); + } + Data::Union(ref data) => { + self.generics.where_clause.to_tokens(tokens); + data.fields.to_tokens(tokens); + } + } + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/error.rs b/vendor/registry-40351f815f426200/syn/src/error.rs new file mode 100644 index 000000000..097a6b84a --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/error.rs @@ -0,0 +1,221 @@ +use std; +use std::fmt::{self, Debug, Display}; +use std::iter::FromIterator; + +use proc_macro2::{ + Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, +}; +#[cfg(feature = "printing")] +use quote::ToTokens; + +#[cfg(feature = "parsing")] +use buffer::Cursor; +#[cfg(all(procmacro2_semver_exempt, feature = "parsing"))] +use private; +use thread::ThreadBound; + +/// The result of a Syn parser. +pub type Result = std::result::Result; + +/// Error returned when a Syn parser cannot parse the input tokens. +/// +/// Refer to the [module documentation] for details about parsing in Syn. +/// +/// [module documentation]: index.html +/// +/// *This type is available if Syn is built with the `"parsing"` feature.* +pub struct Error { + // Span is implemented as an index into a thread-local interner to keep the + // size small. It is not safe to access from a different thread. We want + // errors to be Send and Sync to play nicely with the Failure crate, so pin + // the span we're given to its original thread and assume it is + // Span::call_site if accessed from any other thread. + start_span: ThreadBound, + end_span: ThreadBound, + message: String, +} + +#[cfg(test)] +struct _Test +where + Error: Send + Sync; + +impl Error { + /// Usually the [`ParseStream::error`] method will be used instead, which + /// automatically uses the correct span from the current position of the + /// parse stream. + /// + /// Use `Error::new` when the error needs to be triggered on some span other + /// than where the parse stream is currently positioned. + /// + /// [`ParseStream::error`]: struct.ParseBuffer.html#method.error + /// + /// # Example + /// + /// ```edition2018 + /// use syn::{Error, Ident, LitStr, Result, Token}; + /// use syn::parse::ParseStream; + /// + /// // Parses input that looks like `name = "string"` where the key must be + /// // the identifier `name` and the value may be any string literal. + /// // Returns the string literal. + /// fn parse_name(input: ParseStream) -> Result { + /// let name_token: Ident = input.parse()?; + /// if name_token != "name" { + /// // Trigger an error not on the current position of the stream, + /// // but on the position of the unexpected identifier. + /// return Err(Error::new(name_token.span(), "expected `name`")); + /// } + /// input.parse::()?; + /// let s: LitStr = input.parse()?; + /// Ok(s) + /// } + /// ``` + pub fn new(span: Span, message: T) -> Self { + Error { + start_span: ThreadBound::new(span), + end_span: ThreadBound::new(span), + message: message.to_string(), + } + } + + /// Creates an error with the specified message spanning the given syntax + /// tree node. + /// + /// Unlike the `Error::new` constructor, this constructor takes an argument + /// `tokens` which is a syntax tree node. This allows the resulting `Error` + /// to attempt to span all tokens inside of `tokens`. While you would + /// typically be able to use the `Spanned` trait with the above `Error::new` + /// constructor, implementation limitations today mean that + /// `Error::new_spanned` may provide a higher-quality error message on + /// stable Rust. + /// + /// When in doubt it's recommended to stick to `Error::new` (or + /// `ParseStream::error`)! + #[cfg(feature = "printing")] + pub fn new_spanned(tokens: T, message: U) -> Self { + let mut iter = tokens.into_token_stream().into_iter(); + let start = iter.next().map_or_else(Span::call_site, |t| t.span()); + let end = iter.last().map_or(start, |t| t.span()); + Error { + start_span: ThreadBound::new(start), + end_span: ThreadBound::new(end), + message: message.to_string(), + } + } + + /// The source location of the error. + /// + /// Spans are not thread-safe so this function returns `Span::call_site()` + /// if called from a different thread than the one on which the `Error` was + /// originally created. + pub fn span(&self) -> Span { + let start = match self.start_span.get() { + Some(span) => *span, + None => return Span::call_site(), + }; + + #[cfg(procmacro2_semver_exempt)] + { + let end = match self.end_span.get() { + Some(span) => *span, + None => return Span::call_site(), + }; + start.join(end).unwrap_or(start) + } + #[cfg(not(procmacro2_semver_exempt))] + { + start + } + } + + /// Render the error as an invocation of [`compile_error!`]. + /// + /// The [`parse_macro_input!`] macro provides a convenient way to invoke + /// this method correctly in a procedural macro. + /// + /// [`compile_error!`]: https://doc.rust-lang.org/std/macro.compile_error.html + /// [`parse_macro_input!`]: ../macro.parse_macro_input.html + pub fn to_compile_error(&self) -> TokenStream { + let start = self + .start_span + .get() + .cloned() + .unwrap_or_else(Span::call_site); + let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site); + + // compile_error!($message) + TokenStream::from_iter(vec![ + TokenTree::Ident(Ident::new("compile_error", start)), + TokenTree::Punct({ + let mut punct = Punct::new('!', Spacing::Alone); + punct.set_span(start); + punct + }), + TokenTree::Group({ + let mut group = Group::new(Delimiter::Brace, { + TokenStream::from_iter(vec![TokenTree::Literal({ + let mut string = Literal::string(&self.message); + string.set_span(end); + string + })]) + }); + group.set_span(end); + group + }), + ]) + } +} + +#[cfg(feature = "parsing")] +pub fn new_at(scope: Span, cursor: Cursor, message: T) -> Error { + if cursor.eof() { + Error::new(scope, format!("unexpected end of input, {}", message)) + } else { + #[cfg(procmacro2_semver_exempt)] + let span = private::open_span_of_group(cursor); + #[cfg(not(procmacro2_semver_exempt))] + let span = cursor.span(); + Error::new(span, message) + } +} + +impl Debug for Error { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.debug_tuple("Error").field(&self.message).finish() + } +} + +impl Display for Error { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + formatter.write_str(&self.message) + } +} + +impl Clone for Error { + fn clone(&self) -> Self { + let start = self + .start_span + .get() + .cloned() + .unwrap_or_else(Span::call_site); + let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site); + Error { + start_span: ThreadBound::new(start), + end_span: ThreadBound::new(end), + message: self.message.clone(), + } + } +} + +impl std::error::Error for Error { + fn description(&self) -> &str { + "parse error" + } +} + +impl From for Error { + fn from(err: LexError) -> Self { + Error::new(Span::call_site(), format!("{:?}", err)) + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/export.rs b/vendor/registry-40351f815f426200/syn/src/export.rs new file mode 100644 index 000000000..8e270bd01 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/export.rs @@ -0,0 +1,35 @@ +pub use std::clone::Clone; +pub use std::cmp::{Eq, PartialEq}; +pub use std::convert::From; +pub use std::default::Default; +pub use std::fmt::{self, Debug, Formatter}; +pub use std::hash::{Hash, Hasher}; +pub use std::marker::Copy; +pub use std::option::Option::{None, Some}; +pub use std::result::Result::{Err, Ok}; + +#[cfg(feature = "printing")] +pub extern crate quote; + +pub use proc_macro2::{Span, TokenStream as TokenStream2}; + +pub use span::IntoSpans; + +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" +))] +pub use proc_macro::TokenStream; + +#[cfg(feature = "printing")] +pub use quote::{ToTokens, TokenStreamExt}; + +#[allow(non_camel_case_types)] +pub type bool = help::Bool; +#[allow(non_camel_case_types)] +pub type str = help::Str; + +mod help { + pub type Bool = bool; + pub type Str = str; +} diff --git a/vendor/registry-40351f815f426200/syn/src/expr.rs b/vendor/registry-40351f815f426200/syn/src/expr.rs new file mode 100644 index 000000000..8889be886 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/expr.rs @@ -0,0 +1,3816 @@ +use super::*; +use proc_macro2::{Span, TokenStream}; +use punctuated::Punctuated; +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +#[cfg(all(feature = "parsing", feature = "full"))] +use std::mem; +#[cfg(feature = "extra-traits")] +use tt::TokenStreamHelper; + +ast_enum_of_structs! { + /// A Rust expression. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enums + /// + /// This type is a syntax tree enum. In Syn this and other syntax tree enums + /// are designed to be traversed using the following rebinding idiom. + /// + /// ```edition2018 + /// # use syn::Expr; + /// # + /// # fn example(expr: Expr) { + /// # const IGNORE: &str = stringify! { + /// let expr: Expr = /* ... */; + /// # }; + /// match expr { + /// Expr::MethodCall(expr) => { + /// /* ... */ + /// } + /// Expr::Cast(expr) => { + /// /* ... */ + /// } + /// Expr::If(expr) => { + /// /* ... */ + /// } + /// + /// /* ... */ + /// # _ => {} + /// # } + /// # } + /// ``` + /// + /// We begin with a variable `expr` of type `Expr` that has no fields + /// (because it is an enum), and by matching on it and rebinding a variable + /// with the same name `expr` we effectively imbue our variable with all of + /// the data fields provided by the variant that it turned out to be. So for + /// example above if we ended up in the `MethodCall` case then we get to use + /// `expr.receiver`, `expr.args` etc; if we ended up in the `If` case we get + /// to use `expr.cond`, `expr.then_branch`, `expr.else_branch`. + /// + /// This approach avoids repeating the variant names twice on every line. + /// + /// ```edition2018 + /// # use syn::{Expr, ExprMethodCall}; + /// # + /// # fn example(expr: Expr) { + /// // Repetitive; recommend not doing this. + /// match expr { + /// Expr::MethodCall(ExprMethodCall { method, args, .. }) => { + /// # } + /// # _ => {} + /// # } + /// # } + /// ``` + /// + /// In general, the name to which a syntax tree enum variant is bound should + /// be a suitable name for the complete syntax tree enum type. + /// + /// ```edition2018 + /// # use syn::{Expr, ExprField}; + /// # + /// # fn example(discriminant: ExprField) { + /// // Binding is called `base` which is the name I would use if I were + /// // assigning `*discriminant.base` without an `if let`. + /// if let Expr::Tuple(base) = *discriminant.base { + /// # } + /// # } + /// ``` + /// + /// A sign that you may not be choosing the right variable names is if you + /// see names getting repeated in your code, like accessing + /// `receiver.receiver` or `pat.pat` or `cond.cond`. + pub enum Expr { + /// A box expression: `box f`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Box(ExprBox #full { + pub attrs: Vec, + pub box_token: Token![box], + pub expr: Box, + }), + + /// A placement expression: `place <- value`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub InPlace(ExprInPlace #full { + pub attrs: Vec, + pub place: Box, + pub arrow_token: Token![<-], + pub value: Box, + }), + + /// A slice literal expression: `[a, b, c, d]`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Array(ExprArray #full { + pub attrs: Vec, + pub bracket_token: token::Bracket, + pub elems: Punctuated, + }), + + /// A function call expression: `invoke(a, b)`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Call(ExprCall { + pub attrs: Vec, + pub func: Box, + pub paren_token: token::Paren, + pub args: Punctuated, + }), + + /// A method call expression: `x.foo::(a, b)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub MethodCall(ExprMethodCall #full { + pub attrs: Vec, + pub receiver: Box, + pub dot_token: Token![.], + pub method: Ident, + pub turbofish: Option, + pub paren_token: token::Paren, + pub args: Punctuated, + }), + + /// A tuple expression: `(a, b, c, d)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Tuple(ExprTuple #full { + pub attrs: Vec, + pub paren_token: token::Paren, + pub elems: Punctuated, + }), + + /// A binary operation: `a + b`, `a * b`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Binary(ExprBinary { + pub attrs: Vec, + pub left: Box, + pub op: BinOp, + pub right: Box, + }), + + /// A unary operation: `!x`, `*x`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Unary(ExprUnary { + pub attrs: Vec, + pub op: UnOp, + pub expr: Box, + }), + + /// A literal in place of an expression: `1`, `"foo"`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Lit(ExprLit { + pub attrs: Vec, + pub lit: Lit, + }), + + /// A cast expression: `foo as f64`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Cast(ExprCast { + pub attrs: Vec, + pub expr: Box, + pub as_token: Token![as], + pub ty: Box, + }), + + /// A type ascription expression: `foo: f64`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Type(ExprType #full { + pub attrs: Vec, + pub expr: Box, + pub colon_token: Token![:], + pub ty: Box, + }), + + /// A `let` guard: `let Some(x) = opt`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Let(ExprLet #full { + pub attrs: Vec, + pub let_token: Token![let], + pub pats: Punctuated, + pub eq_token: Token![=], + pub expr: Box, + }), + + /// An `if` expression with an optional `else` block: `if expr { ... } + /// else { ... }`. + /// + /// The `else` branch expression may only be an `If` or `Block` + /// expression, not any of the other types of expression. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub If(ExprIf #full { + pub attrs: Vec, + pub if_token: Token![if], + pub cond: Box, + pub then_branch: Block, + pub else_branch: Option<(Token![else], Box)>, + }), + + /// A while loop: `while expr { ... }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub While(ExprWhile #full { + pub attrs: Vec, + pub label: Option::B::C` and `::B::C` can only legally refer to + /// associated constants. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Path(PatPath { + pub qself: Option, + pub path: Path, + }), + + /// A tuple pattern: `(a, b)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Tuple(PatTuple { + pub paren_token: token::Paren, + pub front: Punctuated, + pub dot2_token: Option, + pub comma_token: Option, + pub back: Punctuated, + }), + + /// A box pattern: `box v`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Box(PatBox { + pub box_token: Token![box], + pub pat: Box, + }), + + /// A reference pattern: `&mut (first, second)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Ref(PatRef { + pub and_token: Token![&], + pub mutability: Option, + pub pat: Box, + }), + + /// A literal pattern: `0`. + /// + /// This holds an `Expr` rather than a `Lit` because negative numbers + /// are represented as an `Expr::Unary`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Lit(PatLit { + pub expr: Box, + }), + + /// A range pattern: `1..=2`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Range(PatRange { + pub lo: Box, + pub limits: RangeLimits, + pub hi: Box, + }), + + /// A dynamically sized slice pattern: `[a, b, i.., y, z]`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Slice(PatSlice { + pub bracket_token: token::Bracket, + pub front: Punctuated, + pub middle: Option>, + pub dot2_token: Option, + pub comma_token: Option, + pub back: Punctuated, + }), + + /// A macro in expression position. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro(PatMacro { + pub mac: Macro, + }), + + /// Tokens in pattern position not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Verbatim(PatVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(all(feature = "full", feature = "extra-traits"))] +impl Eq for PatVerbatim {} + +#[cfg(all(feature = "full", feature = "extra-traits"))] +impl PartialEq for PatVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(all(feature = "full", feature = "extra-traits"))] +impl Hash for PatVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +#[cfg(feature = "full")] +ast_struct! { + /// One arm of a `match` expression: `0...10 => { return true; }`. + /// + /// As in: + /// + /// ```edition2018 + /// # fn f() -> bool { + /// # let n = 0; + /// match n { + /// 0...10 => { + /// return true; + /// } + /// // ... + /// # _ => {} + /// } + /// # false + /// # } + /// ``` + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub struct Arm { + pub attrs: Vec, + pub leading_vert: Option, + pub pats: Punctuated, + pub guard: Option<(Token![if], Box)>, + pub fat_arrow_token: Token![=>], + pub body: Box, + pub comma: Option, + } +} + +#[cfg(feature = "full")] +ast_enum! { + /// Limit types of a range, inclusive or exclusive. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + #[cfg_attr(feature = "clone-impls", derive(Copy))] + pub enum RangeLimits { + /// Inclusive at the beginning, exclusive at the end. + HalfOpen(Token![..]), + /// Inclusive at the beginning and end. + Closed(Token![..=]), + } +} + +#[cfg(feature = "full")] +ast_struct! { + /// A single field in a struct pattern. + /// + /// Patterns like the fields of Foo `{ x, ref y, ref mut z }` are treated + /// the same as `x: x, y: ref y, z: ref mut z` but there is no colon token. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub struct FieldPat { + pub attrs: Vec, + pub member: Member, + pub colon_token: Option, + pub pat: Box, + } +} + +#[cfg(any(feature = "parsing", feature = "printing"))] +#[cfg(feature = "full")] +fn requires_terminator(expr: &Expr) -> bool { + // see https://github.com/rust-lang/rust/blob/eb8f2586e/src/libsyntax/parse/classify.rs#L17-L37 + match *expr { + Expr::Unsafe(..) + | Expr::Block(..) + | Expr::If(..) + | Expr::Match(..) + | Expr::While(..) + | Expr::Loop(..) + | Expr::ForLoop(..) + | Expr::Async(..) + | Expr::TryBlock(..) => false, + _ => true, + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + #[cfg(feature = "full")] + use ext::IdentExt; + use parse::{Parse, ParseStream, Result}; + use path; + + // When we're parsing expressions which occur before blocks, like in an if + // statement's condition, we cannot parse a struct literal. + // + // Struct literals are ambiguous in certain positions + // https://github.com/rust-lang/rfcs/pull/92 + #[derive(Copy, Clone)] + pub struct AllowStruct(bool); + + #[derive(Copy, Clone, PartialEq, PartialOrd)] + enum Precedence { + Any, + Assign, + Placement, + Range, + Or, + And, + Compare, + BitOr, + BitXor, + BitAnd, + Shift, + Arithmetic, + Term, + Cast, + } + + impl Precedence { + fn of(op: &BinOp) -> Self { + match *op { + BinOp::Add(_) | BinOp::Sub(_) => Precedence::Arithmetic, + BinOp::Mul(_) | BinOp::Div(_) | BinOp::Rem(_) => Precedence::Term, + BinOp::And(_) => Precedence::And, + BinOp::Or(_) => Precedence::Or, + BinOp::BitXor(_) => Precedence::BitXor, + BinOp::BitAnd(_) => Precedence::BitAnd, + BinOp::BitOr(_) => Precedence::BitOr, + BinOp::Shl(_) | BinOp::Shr(_) => Precedence::Shift, + BinOp::Eq(_) + | BinOp::Lt(_) + | BinOp::Le(_) + | BinOp::Ne(_) + | BinOp::Ge(_) + | BinOp::Gt(_) => Precedence::Compare, + BinOp::AddEq(_) + | BinOp::SubEq(_) + | BinOp::MulEq(_) + | BinOp::DivEq(_) + | BinOp::RemEq(_) + | BinOp::BitXorEq(_) + | BinOp::BitAndEq(_) + | BinOp::BitOrEq(_) + | BinOp::ShlEq(_) + | BinOp::ShrEq(_) => Precedence::Assign, + } + } + } + + impl Parse for Expr { + fn parse(input: ParseStream) -> Result { + ambiguous_expr(input, AllowStruct(true)) + } + } + + #[cfg(feature = "full")] + fn expr_no_struct(input: ParseStream) -> Result { + ambiguous_expr(input, AllowStruct(false)) + } + + #[cfg(feature = "full")] + fn parse_expr( + input: ParseStream, + mut lhs: Expr, + allow_struct: AllowStruct, + base: Precedence, + ) -> Result { + loop { + if input + .fork() + .parse::() + .ok() + .map_or(false, |op| Precedence::of(&op) >= base) + { + let op: BinOp = input.parse()?; + let precedence = Precedence::of(&op); + let mut rhs = unary_expr(input, allow_struct)?; + loop { + let next = peek_precedence(input); + if next > precedence || next == precedence && precedence == Precedence::Assign { + rhs = parse_expr(input, rhs, allow_struct, next)?; + } else { + break; + } + } + lhs = if precedence == Precedence::Assign { + Expr::AssignOp(ExprAssignOp { + attrs: Vec::new(), + left: Box::new(lhs), + op: op, + right: Box::new(rhs), + }) + } else { + Expr::Binary(ExprBinary { + attrs: Vec::new(), + left: Box::new(lhs), + op: op, + right: Box::new(rhs), + }) + }; + } else if Precedence::Assign >= base + && input.peek(Token![=]) + && !input.peek(Token![==]) + && !input.peek(Token![=>]) + { + let eq_token: Token![=] = input.parse()?; + let mut rhs = unary_expr(input, allow_struct)?; + loop { + let next = peek_precedence(input); + if next >= Precedence::Assign { + rhs = parse_expr(input, rhs, allow_struct, next)?; + } else { + break; + } + } + lhs = Expr::Assign(ExprAssign { + attrs: Vec::new(), + left: Box::new(lhs), + eq_token: eq_token, + right: Box::new(rhs), + }); + } else if Precedence::Placement >= base && input.peek(Token![<-]) { + let arrow_token: Token![<-] = input.parse()?; + let mut rhs = unary_expr(input, allow_struct)?; + loop { + let next = peek_precedence(input); + if next > Precedence::Placement { + rhs = parse_expr(input, rhs, allow_struct, next)?; + } else { + break; + } + } + lhs = Expr::InPlace(ExprInPlace { + attrs: Vec::new(), + place: Box::new(lhs), + arrow_token: arrow_token, + value: Box::new(rhs), + }); + } else if Precedence::Range >= base && input.peek(Token![..]) { + let limits: RangeLimits = input.parse()?; + let rhs = if input.is_empty() + || input.peek(Token![,]) + || input.peek(Token![;]) + || !allow_struct.0 && input.peek(token::Brace) + { + None + } else { + let mut rhs = unary_expr(input, allow_struct)?; + loop { + let next = peek_precedence(input); + if next > Precedence::Range { + rhs = parse_expr(input, rhs, allow_struct, next)?; + } else { + break; + } + } + Some(rhs) + }; + lhs = Expr::Range(ExprRange { + attrs: Vec::new(), + from: Some(Box::new(lhs)), + limits: limits, + to: rhs.map(Box::new), + }); + } else if Precedence::Cast >= base && input.peek(Token![as]) { + let as_token: Token![as] = input.parse()?; + let ty = input.call(Type::without_plus)?; + lhs = Expr::Cast(ExprCast { + attrs: Vec::new(), + expr: Box::new(lhs), + as_token: as_token, + ty: Box::new(ty), + }); + } else if Precedence::Cast >= base && input.peek(Token![:]) && !input.peek(Token![::]) { + let colon_token: Token![:] = input.parse()?; + let ty = input.call(Type::without_plus)?; + lhs = Expr::Type(ExprType { + attrs: Vec::new(), + expr: Box::new(lhs), + colon_token: colon_token, + ty: Box::new(ty), + }); + } else { + break; + } + } + Ok(lhs) + } + + #[cfg(not(feature = "full"))] + fn parse_expr( + input: ParseStream, + mut lhs: Expr, + allow_struct: AllowStruct, + base: Precedence, + ) -> Result { + loop { + if input + .fork() + .parse::() + .ok() + .map_or(false, |op| Precedence::of(&op) >= base) + { + let op: BinOp = input.parse()?; + let precedence = Precedence::of(&op); + let mut rhs = unary_expr(input, allow_struct)?; + loop { + let next = peek_precedence(input); + if next > precedence || next == precedence && precedence == Precedence::Assign { + rhs = parse_expr(input, rhs, allow_struct, next)?; + } else { + break; + } + } + lhs = Expr::Binary(ExprBinary { + attrs: Vec::new(), + left: Box::new(lhs), + op: op, + right: Box::new(rhs), + }); + } else if Precedence::Cast >= base && input.peek(Token![as]) { + let as_token: Token![as] = input.parse()?; + let ty = input.call(Type::without_plus)?; + lhs = Expr::Cast(ExprCast { + attrs: Vec::new(), + expr: Box::new(lhs), + as_token: as_token, + ty: Box::new(ty), + }); + } else { + break; + } + } + Ok(lhs) + } + + fn peek_precedence(input: ParseStream) -> Precedence { + if let Ok(op) = input.fork().parse() { + Precedence::of(&op) + } else if input.peek(Token![=]) && !input.peek(Token![=>]) { + Precedence::Assign + } else if input.peek(Token![<-]) { + Precedence::Placement + } else if input.peek(Token![..]) { + Precedence::Range + } else if input.peek(Token![as]) || input.peek(Token![:]) && !input.peek(Token![::]) { + Precedence::Cast + } else { + Precedence::Any + } + } + + // Parse an arbitrary expression. + fn ambiguous_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + let lhs = unary_expr(input, allow_struct)?; + parse_expr(input, lhs, allow_struct, Precedence::Any) + } + + // + // & + // &mut + // box + #[cfg(feature = "full")] + fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + if ahead.peek(Token![&]) + || ahead.peek(Token![box]) + || ahead.peek(Token![*]) + || ahead.peek(Token![!]) + || ahead.peek(Token![-]) + { + let attrs = input.call(Attribute::parse_outer)?; + if input.peek(Token![&]) { + Ok(Expr::Reference(ExprReference { + attrs: attrs, + and_token: input.parse()?, + mutability: input.parse()?, + expr: Box::new(unary_expr(input, allow_struct)?), + })) + } else if input.peek(Token![box]) { + Ok(Expr::Box(ExprBox { + attrs: attrs, + box_token: input.parse()?, + expr: Box::new(unary_expr(input, allow_struct)?), + })) + } else { + Ok(Expr::Unary(ExprUnary { + attrs: attrs, + op: input.parse()?, + expr: Box::new(unary_expr(input, allow_struct)?), + })) + } + } else { + trailer_expr(input, allow_struct) + } + } + + #[cfg(not(feature = "full"))] + fn unary_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + if ahead.peek(Token![*]) || ahead.peek(Token![!]) || ahead.peek(Token![-]) { + Ok(Expr::Unary(ExprUnary { + attrs: input.call(Attribute::parse_outer)?, + op: input.parse()?, + expr: Box::new(unary_expr(input, allow_struct)?), + })) + } else { + trailer_expr(input, allow_struct) + } + } + + // (..) ... + // . (..) ... + // . ... + // . ... + // [ ] ... + // ? ... + #[cfg(feature = "full")] + fn trailer_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + if input.peek(token::Group) { + return input.call(expr_group).map(Expr::Group); + } + + let outer_attrs = input.call(Attribute::parse_outer)?; + + let atom = atom_expr(input, allow_struct)?; + let mut e = trailer_helper(input, atom)?; + + let inner_attrs = e.replace_attrs(Vec::new()); + let attrs = private::attrs(outer_attrs, inner_attrs); + e.replace_attrs(attrs); + Ok(e) + } + + #[cfg(feature = "full")] + fn trailer_helper(input: ParseStream, mut e: Expr) -> Result { + loop { + if input.peek(token::Paren) { + let content; + e = Expr::Call(ExprCall { + attrs: Vec::new(), + func: Box::new(e), + paren_token: parenthesized!(content in input), + args: content.parse_terminated(Expr::parse)?, + }); + } else if input.peek(Token![.]) && !input.peek(Token![..]) { + let dot_token: Token![.] = input.parse()?; + let member: Member = input.parse()?; + let turbofish = if member.is_named() && input.peek(Token![::]) { + Some(MethodTurbofish { + colon2_token: input.parse()?, + lt_token: input.parse()?, + args: { + let mut args = Punctuated::new(); + loop { + if input.peek(Token![>]) { + break; + } + let value = input.call(generic_method_argument)?; + args.push_value(value); + if input.peek(Token![>]) { + break; + } + let punct = input.parse()?; + args.push_punct(punct); + } + args + }, + gt_token: input.parse()?, + }) + } else { + None + }; + + if turbofish.is_some() || input.peek(token::Paren) { + if let Member::Named(method) = member { + let content; + e = Expr::MethodCall(ExprMethodCall { + attrs: Vec::new(), + receiver: Box::new(e), + dot_token: dot_token, + method: method, + turbofish: turbofish, + paren_token: parenthesized!(content in input), + args: content.parse_terminated(Expr::parse)?, + }); + continue; + } + } + + e = Expr::Field(ExprField { + attrs: Vec::new(), + base: Box::new(e), + dot_token: dot_token, + member: member, + }); + } else if input.peek(token::Bracket) { + let content; + e = Expr::Index(ExprIndex { + attrs: Vec::new(), + expr: Box::new(e), + bracket_token: bracketed!(content in input), + index: content.parse()?, + }); + } else if input.peek(Token![?]) { + e = Expr::Try(ExprTry { + attrs: Vec::new(), + expr: Box::new(e), + question_token: input.parse()?, + }); + } else { + break; + } + } + Ok(e) + } + + #[cfg(not(feature = "full"))] + fn trailer_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + let mut e = atom_expr(input, allow_struct)?; + + loop { + if input.peek(token::Paren) { + let content; + e = Expr::Call(ExprCall { + attrs: Vec::new(), + func: Box::new(e), + paren_token: parenthesized!(content in input), + args: content.parse_terminated(Expr::parse)?, + }); + } else if input.peek(Token![.]) { + e = Expr::Field(ExprField { + attrs: Vec::new(), + base: Box::new(e), + dot_token: input.parse()?, + member: input.parse()?, + }); + } else if input.peek(token::Bracket) { + let content; + e = Expr::Index(ExprIndex { + attrs: Vec::new(), + expr: Box::new(e), + bracket_token: bracketed!(content in input), + index: content.parse()?, + }); + } else { + break; + } + } + + Ok(e) + } + + // Parse all atomic expressions which don't have to worry about precedence + // interactions, as they are fully contained. + #[cfg(feature = "full")] + fn atom_expr(input: ParseStream, allow_struct: AllowStruct) -> Result { + if input.peek(token::Group) { + input.call(expr_group).map(Expr::Group) + } else if input.peek(Lit) { + input.parse().map(Expr::Lit) + } else if input.peek(Token![async]) + && (input.peek2(token::Brace) || input.peek2(Token![move]) && input.peek3(token::Brace)) + { + input.call(expr_async).map(Expr::Async) + } else if input.peek(Token![try]) && input.peek2(token::Brace) { + input.call(expr_try_block).map(Expr::TryBlock) + } else if input.peek(Token![|]) + || input.peek(Token![async]) && (input.peek2(Token![|]) || input.peek2(Token![move])) + || input.peek(Token![static]) + || input.peek(Token![move]) + { + expr_closure(input, allow_struct).map(Expr::Closure) + } else if input.peek(Ident) + || input.peek(Token![::]) + || input.peek(Token![<]) + || input.peek(Token![self]) + || input.peek(Token![Self]) + || input.peek(Token![super]) + || input.peek(Token![extern]) + || input.peek(Token![crate]) + { + path_or_macro_or_struct(input, allow_struct) + } else if input.peek(token::Paren) { + paren_or_tuple(input) + } else if input.peek(Token![break]) { + expr_break(input, allow_struct).map(Expr::Break) + } else if input.peek(Token![continue]) { + input.call(expr_continue).map(Expr::Continue) + } else if input.peek(Token![return]) { + expr_ret(input, allow_struct).map(Expr::Return) + } else if input.peek(token::Bracket) { + array_or_repeat(input) + } else if input.peek(Token![let]) { + input.call(expr_let).map(Expr::Let) + } else if input.peek(Token![if]) { + input.parse().map(Expr::If) + } else if input.peek(Token![while]) { + input.parse().map(Expr::While) + } else if input.peek(Token![for]) { + input.parse().map(Expr::ForLoop) + } else if input.peek(Token![loop]) { + input.parse().map(Expr::Loop) + } else if input.peek(Token![match]) { + input.parse().map(Expr::Match) + } else if input.peek(Token![yield]) { + input.call(expr_yield).map(Expr::Yield) + } else if input.peek(Token![unsafe]) { + input.call(expr_unsafe).map(Expr::Unsafe) + } else if input.peek(token::Brace) { + input.call(expr_block).map(Expr::Block) + } else if input.peek(Token![..]) { + expr_range(input, allow_struct).map(Expr::Range) + } else if input.peek(Lifetime) { + let the_label: Label = input.parse()?; + let mut expr = if input.peek(Token![while]) { + Expr::While(input.parse()?) + } else if input.peek(Token![for]) { + Expr::ForLoop(input.parse()?) + } else if input.peek(Token![loop]) { + Expr::Loop(input.parse()?) + } else if input.peek(token::Brace) { + Expr::Block(input.call(expr_block)?) + } else { + return Err(input.error("expected loop or block expression")); + }; + match expr { + Expr::While(ExprWhile { ref mut label, .. }) + | Expr::ForLoop(ExprForLoop { ref mut label, .. }) + | Expr::Loop(ExprLoop { ref mut label, .. }) + | Expr::Block(ExprBlock { ref mut label, .. }) => *label = Some(the_label), + _ => unreachable!(), + } + Ok(expr) + } else { + Err(input.error("expected expression")) + } + } + + #[cfg(not(feature = "full"))] + fn atom_expr(input: ParseStream, _allow_struct: AllowStruct) -> Result { + if input.peek(Lit) { + input.parse().map(Expr::Lit) + } else if input.peek(token::Paren) { + input.call(expr_paren).map(Expr::Paren) + } else if input.peek(Ident) + || input.peek(Token![::]) + || input.peek(Token![<]) + || input.peek(Token![self]) + || input.peek(Token![Self]) + || input.peek(Token![super]) + || input.peek(Token![extern]) + || input.peek(Token![crate]) + { + input.parse().map(Expr::Path) + } else { + Err(input.error("unsupported expression; enable syn's features=[\"full\"]")) + } + } + + #[cfg(feature = "full")] + fn path_or_macro_or_struct(input: ParseStream, allow_struct: AllowStruct) -> Result { + let expr: ExprPath = input.parse()?; + if expr.qself.is_some() { + return Ok(Expr::Path(expr)); + } + + if input.peek(Token![!]) && !input.peek(Token![!=]) { + let mut contains_arguments = false; + for segment in &expr.path.segments { + match segment.arguments { + PathArguments::None => {} + PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => { + contains_arguments = true; + } + } + } + + if !contains_arguments { + let bang_token: Token![!] = input.parse()?; + let (delimiter, tts) = mac::parse_delimiter(input)?; + return Ok(Expr::Macro(ExprMacro { + attrs: Vec::new(), + mac: Macro { + path: expr.path, + bang_token: bang_token, + delimiter: delimiter, + tts: tts, + }, + })); + } + } + + if allow_struct.0 && input.peek(token::Brace) { + let outer_attrs = Vec::new(); + expr_struct_helper(input, outer_attrs, expr.path).map(Expr::Struct) + } else { + Ok(Expr::Path(expr)) + } + } + + #[cfg(feature = "full")] + fn paren_or_tuple(input: ParseStream) -> Result { + let content; + let paren_token = parenthesized!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + if content.is_empty() { + return Ok(Expr::Tuple(ExprTuple { + attrs: inner_attrs, + paren_token: paren_token, + elems: Punctuated::new(), + })); + } + + let first: Expr = content.parse()?; + if content.is_empty() { + return Ok(Expr::Paren(ExprParen { + attrs: inner_attrs, + paren_token: paren_token, + expr: Box::new(first), + })); + } + + let mut elems = Punctuated::new(); + elems.push_value(first); + while !content.is_empty() { + let punct = content.parse()?; + elems.push_punct(punct); + if content.is_empty() { + break; + } + let value = content.parse()?; + elems.push_value(value); + } + Ok(Expr::Tuple(ExprTuple { + attrs: inner_attrs, + paren_token: paren_token, + elems: elems, + })) + } + + #[cfg(feature = "full")] + fn array_or_repeat(input: ParseStream) -> Result { + let content; + let bracket_token = bracketed!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + if content.is_empty() { + return Ok(Expr::Array(ExprArray { + attrs: inner_attrs, + bracket_token: bracket_token, + elems: Punctuated::new(), + })); + } + + let first: Expr = content.parse()?; + if content.is_empty() || content.peek(Token![,]) { + let mut elems = Punctuated::new(); + elems.push_value(first); + while !content.is_empty() { + let punct = content.parse()?; + elems.push_punct(punct); + if content.is_empty() { + break; + } + let value = content.parse()?; + elems.push_value(value); + } + Ok(Expr::Array(ExprArray { + attrs: inner_attrs, + bracket_token: bracket_token, + elems: elems, + })) + } else if content.peek(Token![;]) { + let semi_token: Token![;] = content.parse()?; + let len: Expr = content.parse()?; + Ok(Expr::Repeat(ExprRepeat { + attrs: inner_attrs, + bracket_token: bracket_token, + expr: Box::new(first), + semi_token: semi_token, + len: Box::new(len), + })) + } else { + Err(content.error("expected `,` or `;`")) + } + } + + #[cfg(feature = "full")] + fn expr_early(input: ParseStream) -> Result { + let mut attrs = input.call(Attribute::parse_outer)?; + let mut expr = if input.peek(Token![if]) { + Expr::If(input.parse()?) + } else if input.peek(Token![while]) { + Expr::While(input.parse()?) + } else if input.peek(Token![for]) { + Expr::ForLoop(input.parse()?) + } else if input.peek(Token![loop]) { + Expr::Loop(input.parse()?) + } else if input.peek(Token![match]) { + Expr::Match(input.parse()?) + } else if input.peek(Token![try]) && input.peek2(token::Brace) { + Expr::TryBlock(input.call(expr_try_block)?) + } else if input.peek(Token![unsafe]) { + Expr::Unsafe(input.call(expr_unsafe)?) + } else if input.peek(token::Brace) { + Expr::Block(input.call(expr_block)?) + } else { + let allow_struct = AllowStruct(true); + let mut expr = unary_expr(input, allow_struct)?; + + attrs.extend(expr.replace_attrs(Vec::new())); + expr.replace_attrs(attrs); + + return parse_expr(input, expr, allow_struct, Precedence::Any); + }; + + if input.peek(Token![.]) || input.peek(Token![?]) { + expr = trailer_helper(input, expr)?; + + attrs.extend(expr.replace_attrs(Vec::new())); + expr.replace_attrs(attrs); + + let allow_struct = AllowStruct(true); + return parse_expr(input, expr, allow_struct, Precedence::Any); + } + + attrs.extend(expr.replace_attrs(Vec::new())); + expr.replace_attrs(attrs); + Ok(expr) + } + + impl Parse for ExprLit { + fn parse(input: ParseStream) -> Result { + Ok(ExprLit { + attrs: Vec::new(), + lit: input.parse()?, + }) + } + } + + #[cfg(feature = "full")] + fn expr_group(input: ParseStream) -> Result { + let group = private::parse_group(input)?; + Ok(ExprGroup { + attrs: Vec::new(), + group_token: group.token, + expr: group.content.parse()?, + }) + } + + #[cfg(not(feature = "full"))] + fn expr_paren(input: ParseStream) -> Result { + let content; + Ok(ExprParen { + attrs: Vec::new(), + paren_token: parenthesized!(content in input), + expr: content.parse()?, + }) + } + + #[cfg(feature = "full")] + fn generic_method_argument(input: ParseStream) -> Result { + // TODO parse const generics as well + input.parse().map(GenericMethodArgument::Type) + } + + #[cfg(feature = "full")] + fn expr_let(input: ParseStream) -> Result { + Ok(ExprLet { + attrs: Vec::new(), + let_token: input.parse()?, + pats: { + let mut pats = Punctuated::new(); + input.parse::>()?; + let value: Pat = input.parse()?; + pats.push_value(value); + while input.peek(Token![|]) && !input.peek(Token![||]) && !input.peek(Token![|=]) { + let punct = input.parse()?; + pats.push_punct(punct); + let value: Pat = input.parse()?; + pats.push_value(value); + } + pats + }, + eq_token: input.parse()?, + expr: Box::new(input.call(expr_no_struct)?), + }) + } + + #[cfg(feature = "full")] + impl Parse for ExprIf { + fn parse(input: ParseStream) -> Result { + Ok(ExprIf { + attrs: Vec::new(), + if_token: input.parse()?, + cond: Box::new(input.call(expr_no_struct)?), + then_branch: input.parse()?, + else_branch: { + if input.peek(Token![else]) { + Some(input.call(else_block)?) + } else { + None + } + }, + }) + } + } + + #[cfg(feature = "full")] + fn else_block(input: ParseStream) -> Result<(Token![else], Box)> { + let else_token: Token![else] = input.parse()?; + + let lookahead = input.lookahead1(); + let else_branch = if input.peek(Token![if]) { + input.parse().map(Expr::If)? + } else if input.peek(token::Brace) { + Expr::Block(ExprBlock { + attrs: Vec::new(), + label: None, + block: input.parse()?, + }) + } else { + return Err(lookahead.error()); + }; + + Ok((else_token, Box::new(else_branch))) + } + + #[cfg(feature = "full")] + impl Parse for ExprForLoop { + fn parse(input: ParseStream) -> Result { + let label: OptionTypeParam> + /// over the type parameters in `self.params`. + pub fn type_params(&self) -> TypeParams { + TypeParams(self.params.iter()) + } + + /// Returns an + /// Iterator<Item = &mut TypeParam> + /// over the type parameters in `self.params`. + pub fn type_params_mut(&mut self) -> TypeParamsMut { + TypeParamsMut(self.params.iter_mut()) + } + + /// Returns an + /// Iterator<Item = &LifetimeDef> + /// over the lifetime parameters in `self.params`. + pub fn lifetimes(&self) -> Lifetimes { + Lifetimes(self.params.iter()) + } + + /// Returns an + /// Iterator<Item = &mut LifetimeDef> + /// over the lifetime parameters in `self.params`. + pub fn lifetimes_mut(&mut self) -> LifetimesMut { + LifetimesMut(self.params.iter_mut()) + } + + /// Returns an + /// Iterator<Item = &ConstParam> + /// over the constant parameters in `self.params`. + pub fn const_params(&self) -> ConstParams { + ConstParams(self.params.iter()) + } + + /// Returns an + /// Iterator<Item = &mut ConstParam> + /// over the constant parameters in `self.params`. + pub fn const_params_mut(&mut self) -> ConstParamsMut { + ConstParamsMut(self.params.iter_mut()) + } + + /// Initializes an empty `where`-clause if there is not one present already. + pub fn make_where_clause(&mut self) -> &mut WhereClause { + // This is Option::get_or_insert_with in Rust 1.20. + if self.where_clause.is_none() { + self.where_clause = Some(WhereClause { + where_token: ::default(), + predicates: Punctuated::new(), + }); + } + match self.where_clause { + Some(ref mut where_clause) => where_clause, + None => unreachable!(), + } + } +} + +pub struct TypeParams<'a>(Iter<'a, GenericParam>); + +impl<'a> Iterator for TypeParams<'a> { + type Item = &'a TypeParam; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Type(ref type_param) = *next { + Some(type_param) + } else { + self.next() + } + } +} + +pub struct TypeParamsMut<'a>(IterMut<'a, GenericParam>); + +impl<'a> Iterator for TypeParamsMut<'a> { + type Item = &'a mut TypeParam; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Type(ref mut type_param) = *next { + Some(type_param) + } else { + self.next() + } + } +} + +pub struct Lifetimes<'a>(Iter<'a, GenericParam>); + +impl<'a> Iterator for Lifetimes<'a> { + type Item = &'a LifetimeDef; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Lifetime(ref lifetime) = *next { + Some(lifetime) + } else { + self.next() + } + } +} + +pub struct LifetimesMut<'a>(IterMut<'a, GenericParam>); + +impl<'a> Iterator for LifetimesMut<'a> { + type Item = &'a mut LifetimeDef; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Lifetime(ref mut lifetime) = *next { + Some(lifetime) + } else { + self.next() + } + } +} + +pub struct ConstParams<'a>(Iter<'a, GenericParam>); + +impl<'a> Iterator for ConstParams<'a> { + type Item = &'a ConstParam; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Const(ref const_param) = *next { + Some(const_param) + } else { + self.next() + } + } +} + +pub struct ConstParamsMut<'a>(IterMut<'a, GenericParam>); + +impl<'a> Iterator for ConstParamsMut<'a> { + type Item = &'a mut ConstParam; + + fn next(&mut self) -> Option { + let next = match self.0.next() { + Some(item) => item, + None => return None, + }; + if let GenericParam::Const(ref mut const_param) = *next { + Some(const_param) + } else { + self.next() + } + } +} + +/// Returned by `Generics::split_for_impl`. +/// +/// *This type is available if Syn is built with the `"derive"` or `"full"` +/// feature and the `"printing"` feature.* +#[cfg(feature = "printing")] +#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] +#[cfg_attr(feature = "clone-impls", derive(Clone))] +pub struct ImplGenerics<'a>(&'a Generics); + +/// Returned by `Generics::split_for_impl`. +/// +/// *This type is available if Syn is built with the `"derive"` or `"full"` +/// feature and the `"printing"` feature.* +#[cfg(feature = "printing")] +#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] +#[cfg_attr(feature = "clone-impls", derive(Clone))] +pub struct TypeGenerics<'a>(&'a Generics); + +/// Returned by `TypeGenerics::as_turbofish`. +/// +/// *This type is available if Syn is built with the `"derive"` or `"full"` +/// feature and the `"printing"` feature.* +#[cfg(feature = "printing")] +#[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] +#[cfg_attr(feature = "clone-impls", derive(Clone))] +pub struct Turbofish<'a>(&'a Generics); + +#[cfg(feature = "printing")] +impl Generics { + /// Split a type's generics into the pieces required for impl'ing a trait + /// for that type. + /// + /// ```edition2018 + /// # use proc_macro2::{Span, Ident}; + /// # use quote::quote; + /// # + /// # fn main() { + /// # let generics: syn::Generics = Default::default(); + /// # let name = Ident::new("MyType", Span::call_site()); + /// # + /// let (impl_generics, ty_generics, where_clause) = generics.split_for_impl(); + /// quote! { + /// impl #impl_generics MyTrait for #name #ty_generics #where_clause { + /// // ... + /// } + /// } + /// # ; + /// # } + /// ``` + /// + /// *This method is available if Syn is built with the `"derive"` or + /// `"full"` feature and the `"printing"` feature.* + pub fn split_for_impl(&self) -> (ImplGenerics, TypeGenerics, Option<&WhereClause>) { + ( + ImplGenerics(self), + TypeGenerics(self), + self.where_clause.as_ref(), + ) + } +} + +#[cfg(feature = "printing")] +impl<'a> TypeGenerics<'a> { + /// Turn a type's generics like `` into a turbofish like `::`. + /// + /// *This method is available if Syn is built with the `"derive"` or + /// `"full"` feature and the `"printing"` feature.* + pub fn as_turbofish(&self) -> Turbofish { + Turbofish(self.0) + } +} + +ast_struct! { + /// A set of bound lifetimes: `for<'a, 'b, 'c>`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + #[derive(Default)] + pub struct BoundLifetimes { + pub for_token: Token![for], + pub lt_token: Token![<], + pub lifetimes: Punctuated, + pub gt_token: Token![>], + } +} + +impl LifetimeDef { + pub fn new(lifetime: Lifetime) -> Self { + LifetimeDef { + attrs: Vec::new(), + lifetime: lifetime, + colon_token: None, + bounds: Punctuated::new(), + } + } +} + +impl From for TypeParam { + fn from(ident: Ident) -> Self { + TypeParam { + attrs: vec![], + ident: ident, + colon_token: None, + bounds: Punctuated::new(), + eq_token: None, + default: None, + } + } +} + +ast_enum_of_structs! { + /// A trait or lifetime used as a bound on a type parameter. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum TypeParamBound { + pub Trait(TraitBound), + pub Lifetime(Lifetime), + } +} + +ast_struct! { + /// A trait used as a bound on a type parameter. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct TraitBound { + pub paren_token: Option, + pub modifier: TraitBoundModifier, + /// The `for<'a>` in `for<'a> Foo<&'a T>` + pub lifetimes: Option, + /// The `Foo<&'a T>` in `for<'a> Foo<&'a T>` + pub path: Path, + } +} + +ast_enum! { + /// A modifier on a trait bound, currently only used for the `?` in + /// `?Sized`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + #[cfg_attr(feature = "clone-impls", derive(Copy))] + pub enum TraitBoundModifier { + None, + Maybe(Token![?]), + } +} + +ast_struct! { + /// A `where` clause in a definition: `where T: Deserialize<'de>, D: + /// 'static`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct WhereClause { + pub where_token: Token![where], + pub predicates: Punctuated, + } +} + +ast_enum_of_structs! { + /// A single predicate in a `where` clause: `T: Deserialize<'de>`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum WherePredicate { + /// A type predicate in a `where` clause: `for<'c> Foo<'c>: Trait<'c>`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Type(PredicateType { + /// Any lifetimes from a `for` binding + pub lifetimes: Option, + /// The type being bounded + pub bounded_ty: Type, + pub colon_token: Token![:], + /// Trait and lifetime bounds (`Clone+Send+'static`) + pub bounds: Punctuated, + }), + + /// A lifetime predicate in a `where` clause: `'a: 'b + 'c`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Lifetime(PredicateLifetime { + pub lifetime: Lifetime, + pub colon_token: Token![:], + pub bounds: Punctuated, + }), + + /// An equality predicate in a `where` clause (unsupported). + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Eq(PredicateEq { + pub lhs_ty: Type, + pub eq_token: Token![=], + pub rhs_ty: Type, + }), + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + + impl Parse for Generics { + fn parse(input: ParseStream) -> Result { + if !input.peek(Token![<]) { + return Ok(Generics::default()); + } + + let lt_token: Token![<] = input.parse()?; + + let mut params = Punctuated::new(); + let mut has_type_param = false; + loop { + if input.peek(Token![>]) { + break; + } + + let attrs = input.call(Attribute::parse_outer)?; + let lookahead = input.lookahead1(); + if !has_type_param && lookahead.peek(Lifetime) { + params.push_value(GenericParam::Lifetime(LifetimeDef { + attrs: attrs, + ..input.parse()? + })); + } else if lookahead.peek(Ident) { + has_type_param = true; + params.push_value(GenericParam::Type(TypeParam { + attrs: attrs, + ..input.parse()? + })); + } else { + return Err(lookahead.error()); + } + + if input.peek(Token![>]) { + break; + } + let punct = input.parse()?; + params.push_punct(punct); + } + + let gt_token: Token![>] = input.parse()?; + + Ok(Generics { + lt_token: Some(lt_token), + params: params, + gt_token: Some(gt_token), + where_clause: None, + }) + } + } + + impl Parse for GenericParam { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + + let lookahead = input.lookahead1(); + if lookahead.peek(Ident) { + Ok(GenericParam::Type(TypeParam { + attrs: attrs, + ..input.parse()? + })) + } else if lookahead.peek(Lifetime) { + Ok(GenericParam::Lifetime(LifetimeDef { + attrs: attrs, + ..input.parse()? + })) + } else if lookahead.peek(Token![const]) { + Ok(GenericParam::Const(ConstParam { + attrs: attrs, + ..input.parse()? + })) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for LifetimeDef { + fn parse(input: ParseStream) -> Result { + let has_colon; + Ok(LifetimeDef { + attrs: input.call(Attribute::parse_outer)?, + lifetime: input.parse()?, + colon_token: { + if input.peek(Token![:]) { + has_colon = true; + Some(input.parse()?) + } else { + has_colon = false; + None + } + }, + bounds: { + let mut bounds = Punctuated::new(); + if has_colon { + loop { + if input.peek(Token![,]) || input.peek(Token![>]) { + break; + } + let value = input.parse()?; + bounds.push_value(value); + if !input.peek(Token![+]) { + break; + } + let punct = input.parse()?; + bounds.push_punct(punct); + } + } + bounds + }, + }) + } + } + + impl Parse for BoundLifetimes { + fn parse(input: ParseStream) -> Result { + Ok(BoundLifetimes { + for_token: input.parse()?, + lt_token: input.parse()?, + lifetimes: { + let mut lifetimes = Punctuated::new(); + while !input.peek(Token![>]) { + lifetimes.push_value(input.parse()?); + if input.peek(Token![>]) { + break; + } + lifetimes.push_punct(input.parse()?); + } + lifetimes + }, + gt_token: input.parse()?, + }) + } + } + + impl Parse for Option { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![for]) { + input.parse().map(Some) + } else { + Ok(None) + } + } + } + + impl Parse for TypeParam { + fn parse(input: ParseStream) -> Result { + let has_colon; + let has_default; + Ok(TypeParam { + attrs: input.call(Attribute::parse_outer)?, + ident: input.parse()?, + colon_token: { + if input.peek(Token![:]) { + has_colon = true; + Some(input.parse()?) + } else { + has_colon = false; + None + } + }, + bounds: { + let mut bounds = Punctuated::new(); + if has_colon { + loop { + if input.peek(Token![,]) + || input.peek(Token![>]) + || input.peek(Token![=]) + { + break; + } + let value = input.parse()?; + bounds.push_value(value); + if !input.peek(Token![+]) { + break; + } + let punct = input.parse()?; + bounds.push_punct(punct); + } + } + bounds + }, + eq_token: { + if input.peek(Token![=]) { + has_default = true; + Some(input.parse()?) + } else { + has_default = false; + None + } + }, + default: { + if has_default { + Some(input.parse()?) + } else { + None + } + }, + }) + } + } + + impl Parse for TypeParamBound { + fn parse(input: ParseStream) -> Result { + if input.peek(Lifetime) { + return input.parse().map(TypeParamBound::Lifetime); + } + + if input.peek(token::Paren) { + let content; + let paren_token = parenthesized!(content in input); + let mut bound: TraitBound = content.parse()?; + bound.paren_token = Some(paren_token); + return Ok(TypeParamBound::Trait(bound)); + } + + input.parse().map(TypeParamBound::Trait) + } + } + + impl Parse for TraitBound { + fn parse(input: ParseStream) -> Result { + let modifier: TraitBoundModifier = input.parse()?; + let lifetimes: Option = input.parse()?; + + let mut path: Path = input.parse()?; + if path.segments.last().unwrap().value().arguments.is_empty() + && input.peek(token::Paren) + { + let parenthesized = PathArguments::Parenthesized(input.parse()?); + path.segments.last_mut().unwrap().value_mut().arguments = parenthesized; + } + + Ok(TraitBound { + paren_token: None, + modifier: modifier, + lifetimes: lifetimes, + path: path, + }) + } + } + + impl Parse for TraitBoundModifier { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![?]) { + input.parse().map(TraitBoundModifier::Maybe) + } else { + Ok(TraitBoundModifier::None) + } + } + } + + impl Parse for ConstParam { + fn parse(input: ParseStream) -> Result { + let mut default = None; + Ok(ConstParam { + attrs: input.call(Attribute::parse_outer)?, + const_token: input.parse()?, + ident: input.parse()?, + colon_token: input.parse()?, + ty: input.parse()?, + eq_token: { + if input.peek(Token![=]) { + let eq_token = input.parse()?; + default = Some(input.parse::()?); + Some(eq_token) + } else { + None + } + }, + default: default, + }) + } + } + + impl Parse for WhereClause { + fn parse(input: ParseStream) -> Result { + Ok(WhereClause { + where_token: input.parse()?, + predicates: { + let mut predicates = Punctuated::new(); + loop { + if input.is_empty() + || input.peek(token::Brace) + || input.peek(Token![,]) + || input.peek(Token![;]) + || input.peek(Token![:]) && !input.peek(Token![::]) + || input.peek(Token![=]) + { + break; + } + let value = input.parse()?; + predicates.push_value(value); + if !input.peek(Token![,]) { + break; + } + let punct = input.parse()?; + predicates.push_punct(punct); + } + predicates + }, + }) + } + } + + impl Parse for Option { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![where]) { + input.parse().map(Some) + } else { + Ok(None) + } + } + } + + impl Parse for WherePredicate { + fn parse(input: ParseStream) -> Result { + if input.peek(Lifetime) && input.peek2(Token![:]) { + Ok(WherePredicate::Lifetime(PredicateLifetime { + lifetime: input.parse()?, + colon_token: input.parse()?, + bounds: { + let mut bounds = Punctuated::new(); + loop { + if input.peek(token::Brace) + || input.peek(Token![,]) + || input.peek(Token![;]) + || input.peek(Token![:]) + || input.peek(Token![=]) + { + break; + } + let value = input.parse()?; + bounds.push_value(value); + if !input.peek(Token![+]) { + break; + } + let punct = input.parse()?; + bounds.push_punct(punct); + } + bounds + }, + })) + } else { + Ok(WherePredicate::Type(PredicateType { + lifetimes: input.parse()?, + bounded_ty: input.parse()?, + colon_token: input.parse()?, + bounds: { + let mut bounds = Punctuated::new(); + loop { + if input.peek(token::Brace) + || input.peek(Token![,]) + || input.peek(Token![;]) + || input.peek(Token![:]) && !input.peek(Token![::]) + || input.peek(Token![=]) + { + break; + } + let value = input.parse()?; + bounds.push_value(value); + if !input.peek(Token![+]) { + break; + } + let punct = input.parse()?; + bounds.push_punct(punct); + } + bounds + }, + })) + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::{ToTokens, TokenStreamExt}; + + use attr::FilterAttrs; + use print::TokensOrDefault; + + impl ToTokens for Generics { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.params.is_empty() { + return; + } + + TokensOrDefault(&self.lt_token).to_tokens(tokens); + + // Print lifetimes before types and consts, regardless of their + // order in self.params. + // + // TODO: ordering rules for const parameters vs type parameters have + // not been settled yet. https://github.com/rust-lang/rust/issues/44580 + let mut trailing_or_empty = true; + for param in self.params.pairs() { + if let GenericParam::Lifetime(_) = **param.value() { + param.to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + } + for param in self.params.pairs() { + match **param.value() { + GenericParam::Type(_) | GenericParam::Const(_) => { + if !trailing_or_empty { + ::default().to_tokens(tokens); + trailing_or_empty = true; + } + param.to_tokens(tokens); + } + GenericParam::Lifetime(_) => {} + } + } + + TokensOrDefault(&self.gt_token).to_tokens(tokens); + } + } + + impl<'a> ToTokens for ImplGenerics<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.0.params.is_empty() { + return; + } + + TokensOrDefault(&self.0.lt_token).to_tokens(tokens); + + // Print lifetimes before types and consts, regardless of their + // order in self.params. + // + // TODO: ordering rules for const parameters vs type parameters have + // not been settled yet. https://github.com/rust-lang/rust/issues/44580 + let mut trailing_or_empty = true; + for param in self.0.params.pairs() { + if let GenericParam::Lifetime(_) = **param.value() { + param.to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + } + for param in self.0.params.pairs() { + if let GenericParam::Lifetime(_) = **param.value() { + continue; + } + if !trailing_or_empty { + ::default().to_tokens(tokens); + trailing_or_empty = true; + } + match **param.value() { + GenericParam::Lifetime(_) => unreachable!(), + GenericParam::Type(ref param) => { + // Leave off the type parameter defaults + tokens.append_all(param.attrs.outer()); + param.ident.to_tokens(tokens); + if !param.bounds.is_empty() { + TokensOrDefault(¶m.colon_token).to_tokens(tokens); + param.bounds.to_tokens(tokens); + } + } + GenericParam::Const(ref param) => { + // Leave off the const parameter defaults + tokens.append_all(param.attrs.outer()); + param.const_token.to_tokens(tokens); + param.ident.to_tokens(tokens); + param.colon_token.to_tokens(tokens); + param.ty.to_tokens(tokens); + } + } + param.punct().to_tokens(tokens); + } + + TokensOrDefault(&self.0.gt_token).to_tokens(tokens); + } + } + + impl<'a> ToTokens for TypeGenerics<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + if self.0.params.is_empty() { + return; + } + + TokensOrDefault(&self.0.lt_token).to_tokens(tokens); + + // Print lifetimes before types and consts, regardless of their + // order in self.params. + // + // TODO: ordering rules for const parameters vs type parameters have + // not been settled yet. https://github.com/rust-lang/rust/issues/44580 + let mut trailing_or_empty = true; + for param in self.0.params.pairs() { + if let GenericParam::Lifetime(ref def) = **param.value() { + // Leave off the lifetime bounds and attributes + def.lifetime.to_tokens(tokens); + param.punct().to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + } + for param in self.0.params.pairs() { + if let GenericParam::Lifetime(_) = **param.value() { + continue; + } + if !trailing_or_empty { + ::default().to_tokens(tokens); + trailing_or_empty = true; + } + match **param.value() { + GenericParam::Lifetime(_) => unreachable!(), + GenericParam::Type(ref param) => { + // Leave off the type parameter defaults + param.ident.to_tokens(tokens); + } + GenericParam::Const(ref param) => { + // Leave off the const parameter defaults + param.ident.to_tokens(tokens); + } + } + param.punct().to_tokens(tokens); + } + + TokensOrDefault(&self.0.gt_token).to_tokens(tokens); + } + } + + impl<'a> ToTokens for Turbofish<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + if !self.0.params.is_empty() { + ::default().to_tokens(tokens); + TypeGenerics(self.0).to_tokens(tokens); + } + } + } + + impl ToTokens for BoundLifetimes { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.for_token.to_tokens(tokens); + self.lt_token.to_tokens(tokens); + self.lifetimes.to_tokens(tokens); + self.gt_token.to_tokens(tokens); + } + } + + impl ToTokens for LifetimeDef { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.lifetime.to_tokens(tokens); + if !self.bounds.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + } + + impl ToTokens for TypeParam { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.ident.to_tokens(tokens); + if !self.bounds.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + if self.default.is_some() { + TokensOrDefault(&self.eq_token).to_tokens(tokens); + self.default.to_tokens(tokens); + } + } + } + + impl ToTokens for TraitBound { + fn to_tokens(&self, tokens: &mut TokenStream) { + let to_tokens = |tokens: &mut TokenStream| { + self.modifier.to_tokens(tokens); + self.lifetimes.to_tokens(tokens); + self.path.to_tokens(tokens); + }; + match self.paren_token { + Some(ref paren) => paren.surround(tokens, to_tokens), + None => to_tokens(tokens), + } + } + } + + impl ToTokens for TraitBoundModifier { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + TraitBoundModifier::None => {} + TraitBoundModifier::Maybe(ref t) => t.to_tokens(tokens), + } + } + } + + impl ToTokens for ConstParam { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.const_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + if self.default.is_some() { + TokensOrDefault(&self.eq_token).to_tokens(tokens); + self.default.to_tokens(tokens); + } + } + } + + impl ToTokens for WhereClause { + fn to_tokens(&self, tokens: &mut TokenStream) { + if !self.predicates.is_empty() { + self.where_token.to_tokens(tokens); + self.predicates.to_tokens(tokens); + } + } + } + + impl ToTokens for PredicateType { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.lifetimes.to_tokens(tokens); + self.bounded_ty.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + + impl ToTokens for PredicateLifetime { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.lifetime.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + + impl ToTokens for PredicateEq { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.lhs_ty.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.rhs_ty.to_tokens(tokens); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/group.rs b/vendor/registry-40351f815f426200/syn/src/group.rs new file mode 100644 index 000000000..272e435f2 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/group.rs @@ -0,0 +1,283 @@ +use proc_macro2::{Delimiter, Span}; + +use error::Result; +use parse::{ParseBuffer, ParseStream}; +use private; +use token; + +// Not public API. +#[doc(hidden)] +pub struct Parens<'a> { + pub token: token::Paren, + pub content: ParseBuffer<'a>, +} + +// Not public API. +#[doc(hidden)] +pub struct Braces<'a> { + pub token: token::Brace, + pub content: ParseBuffer<'a>, +} + +// Not public API. +#[doc(hidden)] +pub struct Brackets<'a> { + pub token: token::Bracket, + pub content: ParseBuffer<'a>, +} + +// Not public API. +#[cfg(any(feature = "full", feature = "derive"))] +#[doc(hidden)] +pub struct Group<'a> { + pub token: token::Group, + pub content: ParseBuffer<'a>, +} + +// Not public API. +#[doc(hidden)] +pub fn parse_parens(input: ParseStream) -> Result { + parse_delimited(input, Delimiter::Parenthesis).map(|(span, content)| Parens { + token: token::Paren(span), + content: content, + }) +} + +// Not public API. +#[doc(hidden)] +pub fn parse_braces(input: ParseStream) -> Result { + parse_delimited(input, Delimiter::Brace).map(|(span, content)| Braces { + token: token::Brace(span), + content: content, + }) +} + +// Not public API. +#[doc(hidden)] +pub fn parse_brackets(input: ParseStream) -> Result { + parse_delimited(input, Delimiter::Bracket).map(|(span, content)| Brackets { + token: token::Bracket(span), + content: content, + }) +} + +#[cfg(any(feature = "full", feature = "derive"))] +impl private { + pub fn parse_group(input: ParseStream) -> Result { + parse_delimited(input, Delimiter::None).map(|(span, content)| Group { + token: token::Group(span), + content: content, + }) + } +} + +fn parse_delimited(input: ParseStream, delimiter: Delimiter) -> Result<(Span, ParseBuffer)> { + input.step(|cursor| { + if let Some((content, span, rest)) = cursor.group(delimiter) { + #[cfg(procmacro2_semver_exempt)] + let scope = private::close_span_of_group(*cursor); + #[cfg(not(procmacro2_semver_exempt))] + let scope = span; + let nested = private::advance_step_cursor(cursor, content); + let unexpected = private::get_unexpected(input); + let content = private::new_parse_buffer(scope, nested, unexpected); + Ok(((span, content), rest)) + } else { + let message = match delimiter { + Delimiter::Parenthesis => "expected parentheses", + Delimiter::Brace => "expected curly braces", + Delimiter::Bracket => "expected square brackets", + Delimiter::None => "expected invisible group", + }; + Err(cursor.error(message)) + } + }) +} + +/// Parse a set of parentheses and expose their content to subsequent parsers. +/// +/// # Example +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// use syn::{parenthesized, token, Ident, Result, Token, Type}; +/// use syn::parse::{Parse, ParseStream}; +/// use syn::punctuated::Punctuated; +/// +/// // Parse a simplified tuple struct syntax like: +/// // +/// // struct S(A, B); +/// struct TupleStruct { +/// struct_token: Token![struct], +/// ident: Ident, +/// paren_token: token::Paren, +/// fields: Punctuated, +/// semi_token: Token![;], +/// } +/// +/// impl Parse for TupleStruct { +/// fn parse(input: ParseStream) -> Result { +/// let content; +/// Ok(TupleStruct { +/// struct_token: input.parse()?, +/// ident: input.parse()?, +/// paren_token: parenthesized!(content in input), +/// fields: content.parse_terminated(Type::parse)?, +/// semi_token: input.parse()?, +/// }) +/// } +/// } +/// # +/// # fn main() { +/// # let input = quote! { +/// # struct S(A, B); +/// # }; +/// # syn::parse2::(input).unwrap(); +/// # } +/// ``` +#[macro_export] +macro_rules! parenthesized { + ($content:ident in $cursor:expr) => { + match $crate::group::parse_parens(&$cursor) { + $crate::export::Ok(parens) => { + $content = parens.content; + parens.token + } + $crate::export::Err(error) => { + return $crate::export::Err(error); + } + } + }; +} + +/// Parse a set of curly braces and expose their content to subsequent parsers. +/// +/// # Example +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// use syn::{braced, token, Ident, Result, Token, Type}; +/// use syn::parse::{Parse, ParseStream}; +/// use syn::punctuated::Punctuated; +/// +/// // Parse a simplified struct syntax like: +/// // +/// // struct S { +/// // a: A, +/// // b: B, +/// // } +/// struct Struct { +/// struct_token: Token![struct], +/// ident: Ident, +/// brace_token: token::Brace, +/// fields: Punctuated, +/// } +/// +/// struct Field { +/// name: Ident, +/// colon_token: Token![:], +/// ty: Type, +/// } +/// +/// impl Parse for Struct { +/// fn parse(input: ParseStream) -> Result { +/// let content; +/// Ok(Struct { +/// struct_token: input.parse()?, +/// ident: input.parse()?, +/// brace_token: braced!(content in input), +/// fields: content.parse_terminated(Field::parse)?, +/// }) +/// } +/// } +/// +/// impl Parse for Field { +/// fn parse(input: ParseStream) -> Result { +/// Ok(Field { +/// name: input.parse()?, +/// colon_token: input.parse()?, +/// ty: input.parse()?, +/// }) +/// } +/// } +/// # +/// # fn main() { +/// # let input = quote! { +/// # struct S { +/// # a: A, +/// # b: B, +/// # } +/// # }; +/// # syn::parse2::(input).unwrap(); +/// # } +/// ``` +#[macro_export] +macro_rules! braced { + ($content:ident in $cursor:expr) => { + match $crate::group::parse_braces(&$cursor) { + $crate::export::Ok(braces) => { + $content = braces.content; + braces.token + } + $crate::export::Err(error) => { + return $crate::export::Err(error); + } + } + }; +} + +/// Parse a set of square brackets and expose their content to subsequent +/// parsers. +/// +/// # Example +/// +/// ```edition2018 +/// # use quote::quote; +/// # +/// use proc_macro2::TokenStream; +/// use syn::{bracketed, token, Result, Token}; +/// use syn::parse::{Parse, ParseStream}; +/// +/// // Parse an outer attribute like: +/// // +/// // #[repr(C, packed)] +/// struct OuterAttribute { +/// pound_token: Token![#], +/// bracket_token: token::Bracket, +/// content: TokenStream, +/// } +/// +/// impl Parse for OuterAttribute { +/// fn parse(input: ParseStream) -> Result { +/// let content; +/// Ok(OuterAttribute { +/// pound_token: input.parse()?, +/// bracket_token: bracketed!(content in input), +/// content: content.parse()?, +/// }) +/// } +/// } +/// # +/// # fn main() { +/// # let input = quote! { +/// # #[repr(C, packed)] +/// # }; +/// # syn::parse2::(input).unwrap(); +/// # } +/// ``` +#[macro_export] +macro_rules! bracketed { + ($content:ident in $cursor:expr) => { + match $crate::group::parse_brackets(&$cursor) { + $crate::export::Ok(brackets) => { + $content = brackets.content; + brackets.token + } + $crate::export::Err(error) => { + return $crate::export::Err(error); + } + } + }; +} diff --git a/vendor/registry-40351f815f426200/syn/src/ident.rs b/vendor/registry-40351f815f426200/syn/src/ident.rs new file mode 100644 index 000000000..f5a76a1de --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/ident.rs @@ -0,0 +1,86 @@ +#[cfg(feature = "parsing")] +use buffer::Cursor; +#[cfg(feature = "parsing")] +use lookahead; +#[cfg(feature = "parsing")] +use parse::{Parse, ParseStream, Result}; +#[cfg(feature = "parsing")] +use token::Token; + +pub use proc_macro2::Ident; + +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[allow(non_snake_case)] +pub fn Ident(marker: lookahead::TokenMarker) -> Ident { + match marker {} +} + +#[cfg(feature = "parsing")] +fn accept_as_ident(ident: &Ident) -> bool { + match ident.to_string().as_str() { + "_" + // Based on https://doc.rust-lang.org/grammar.html#keywords + // and https://github.com/rust-lang/rfcs/blob/master/text/2421-unreservations-2018.md + // and https://github.com/rust-lang/rfcs/blob/master/text/2420-unreserve-proc.md + | "abstract" | "as" | "become" | "box" | "break" | "const" + | "continue" | "crate" | "do" | "else" | "enum" | "extern" | "false" | "final" + | "fn" | "for" | "if" | "impl" | "in" | "let" | "loop" | "macro" | "match" + | "mod" | "move" | "mut" | "override" | "priv" | "pub" + | "ref" | "return" | "Self" | "self" | "static" | "struct" + | "super" | "trait" | "true" | "type" | "typeof" | "unsafe" | "unsized" | "use" + | "virtual" | "where" | "while" | "yield" => false, + _ => true, + } +} + +#[cfg(feature = "parsing")] +impl Parse for Ident { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| { + if let Some((ident, rest)) = cursor.ident() { + if accept_as_ident(&ident) { + return Ok((ident, rest)); + } + } + Err(cursor.error("expected identifier")) + }) + } +} + +#[cfg(feature = "parsing")] +impl Token for Ident { + fn peek(cursor: Cursor) -> bool { + if let Some((ident, _rest)) = cursor.ident() { + accept_as_ident(&ident) + } else { + false + } + } + + fn display() -> &'static str { + "identifier" + } +} + +macro_rules! ident_from_token { + ($token:ident) => { + impl From for Ident { + fn from(token: Token![$token]) -> Ident { + Ident::new(stringify!($token), token.span) + } + } + }; +} + +ident_from_token!(self); +ident_from_token!(Self); +ident_from_token!(super); +ident_from_token!(crate); +ident_from_token!(extern); + +impl From for Ident { + fn from(token: Token![_]) -> Ident { + Ident::new("_", token.span) + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/item.rs b/vendor/registry-40351f815f426200/syn/src/item.rs new file mode 100644 index 000000000..118ed4e17 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/item.rs @@ -0,0 +1,2677 @@ +use super::*; +use derive::{Data, DeriveInput}; +use proc_macro2::TokenStream; +use punctuated::Punctuated; +use token::{Brace, Paren}; + +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +#[cfg(feature = "extra-traits")] +use tt::TokenStreamHelper; + +ast_enum_of_structs! { + /// Things that can appear directly inside of a module or scope. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Item { + /// An `extern crate` item: `extern crate serde`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub ExternCrate(ItemExternCrate { + pub attrs: Vec, + pub vis: Visibility, + pub extern_token: Token![extern], + pub crate_token: Token![crate], + pub ident: Ident, + pub rename: Option<(Token![as], Ident)>, + pub semi_token: Token![;], + }), + + /// A use declaration: `use std::collections::HashMap`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Use(ItemUse { + pub attrs: Vec, + pub vis: Visibility, + pub use_token: Token![use], + pub leading_colon: Option, + pub tree: UseTree, + pub semi_token: Token![;], + }), + + /// A static item: `static BIKE: Shed = Shed(42)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Static(ItemStatic { + pub attrs: Vec, + pub vis: Visibility, + pub static_token: Token![static], + pub mutability: Option, + pub ident: Ident, + pub colon_token: Token![:], + pub ty: Box, + pub eq_token: Token![=], + pub expr: Box, + pub semi_token: Token![;], + }), + + /// A constant item: `const MAX: u16 = 65535`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Const(ItemConst { + pub attrs: Vec, + pub vis: Visibility, + pub const_token: Token![const], + pub ident: Ident, + pub colon_token: Token![:], + pub ty: Box, + pub eq_token: Token![=], + pub expr: Box, + pub semi_token: Token![;], + }), + + /// A free-standing function: `fn process(n: usize) -> Result<()> { ... + /// }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Fn(ItemFn { + pub attrs: Vec, + pub vis: Visibility, + pub constness: Option, + pub unsafety: Option, + pub asyncness: Option, + pub abi: Option, + pub ident: Ident, + pub decl: Box, + pub block: Box, + }), + + /// A module or module declaration: `mod m` or `mod m { ... }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Mod(ItemMod { + pub attrs: Vec, + pub vis: Visibility, + pub mod_token: Token![mod], + pub ident: Ident, + pub content: Option<(token::Brace, Vec)>, + pub semi: Option, + }), + + /// A block of foreign items: `extern "C" { ... }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub ForeignMod(ItemForeignMod { + pub attrs: Vec, + pub abi: Abi, + pub brace_token: token::Brace, + pub items: Vec, + }), + + /// A type alias: `type Result = std::result::Result`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Type(ItemType { + pub attrs: Vec, + pub vis: Visibility, + pub type_token: Token![type], + pub ident: Ident, + pub generics: Generics, + pub eq_token: Token![=], + pub ty: Box, + pub semi_token: Token![;], + }), + + /// An existential type: `existential type Iter: Iterator`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Existential(ItemExistential { + pub attrs: Vec, + pub vis: Visibility, + pub existential_token: Token![existential], + pub type_token: Token![type], + pub ident: Ident, + pub generics: Generics, + pub colon_token: Option, + pub bounds: Punctuated, + pub semi_token: Token![;], + }), + + /// A struct definition: `struct Foo { x: A }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Struct(ItemStruct { + pub attrs: Vec, + pub vis: Visibility, + pub struct_token: Token![struct], + pub ident: Ident, + pub generics: Generics, + pub fields: Fields, + pub semi_token: Option, + }), + + /// An enum definition: `enum Foo { C, D }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Enum(ItemEnum { + pub attrs: Vec, + pub vis: Visibility, + pub enum_token: Token![enum], + pub ident: Ident, + pub generics: Generics, + pub brace_token: token::Brace, + pub variants: Punctuated, + }), + + /// A union definition: `union Foo { x: A, y: B }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Union(ItemUnion { + pub attrs: Vec, + pub vis: Visibility, + pub union_token: Token![union], + pub ident: Ident, + pub generics: Generics, + pub fields: FieldsNamed, + }), + + /// A trait definition: `pub trait Iterator { ... }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Trait(ItemTrait { + pub attrs: Vec, + pub vis: Visibility, + pub unsafety: Option, + pub auto_token: Option, + pub trait_token: Token![trait], + pub ident: Ident, + pub generics: Generics, + pub colon_token: Option, + pub supertraits: Punctuated, + pub brace_token: token::Brace, + pub items: Vec, + }), + + /// A trait alias: `pub trait SharableIterator = Iterator + Sync`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub TraitAlias(ItemTraitAlias { + pub attrs: Vec, + pub vis: Visibility, + pub trait_token: Token![trait], + pub ident: Ident, + pub generics: Generics, + pub eq_token: Token![=], + pub bounds: Punctuated, + pub semi_token: Token![;], + }), + + /// An impl block providing trait or associated items: `impl Trait + /// for Data { ... }`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Impl(ItemImpl { + pub attrs: Vec, + pub defaultness: Option, + pub unsafety: Option, + pub impl_token: Token![impl], + pub generics: Generics, + /// Trait this impl implements. + pub trait_: Option<(Option, Path, Token![for])>, + /// The Self type of the impl. + pub self_ty: Box, + pub brace_token: token::Brace, + pub items: Vec, + }), + + /// A macro invocation, which includes `macro_rules!` definitions. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro(ItemMacro { + pub attrs: Vec, + /// The `example` in `macro_rules! example { ... }`. + pub ident: Option, + pub mac: Macro, + pub semi_token: Option, + }), + + /// A 2.0-style declarative macro introduced by the `macro` keyword. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro2(ItemMacro2 #manual_extra_traits { + pub attrs: Vec, + pub vis: Visibility, + pub macro_token: Token![macro], + pub ident: Ident, + pub paren_token: Paren, + pub args: TokenStream, + pub brace_token: Brace, + pub body: TokenStream, + }), + + /// Tokens forming an item not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Verbatim(ItemVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for ItemMacro2 {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for ItemMacro2 { + fn eq(&self, other: &Self) -> bool { + self.attrs == other.attrs + && self.vis == other.vis + && self.macro_token == other.macro_token + && self.ident == other.ident + && self.paren_token == other.paren_token + && TokenStreamHelper(&self.args) == TokenStreamHelper(&other.args) + && self.brace_token == other.brace_token + && TokenStreamHelper(&self.body) == TokenStreamHelper(&other.body) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for ItemMacro2 { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + self.attrs.hash(state); + self.vis.hash(state); + self.macro_token.hash(state); + self.ident.hash(state); + self.paren_token.hash(state); + TokenStreamHelper(&self.args).hash(state); + self.brace_token.hash(state); + TokenStreamHelper(&self.body).hash(state); + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for ItemVerbatim {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for ItemVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for ItemVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +impl From for Item { + fn from(input: DeriveInput) -> Item { + match input.data { + Data::Struct(data) => Item::Struct(ItemStruct { + attrs: input.attrs, + vis: input.vis, + struct_token: data.struct_token, + ident: input.ident, + generics: input.generics, + fields: data.fields, + semi_token: data.semi_token, + }), + Data::Enum(data) => Item::Enum(ItemEnum { + attrs: input.attrs, + vis: input.vis, + enum_token: data.enum_token, + ident: input.ident, + generics: input.generics, + brace_token: data.brace_token, + variants: data.variants, + }), + Data::Union(data) => Item::Union(ItemUnion { + attrs: input.attrs, + vis: input.vis, + union_token: data.union_token, + ident: input.ident, + generics: input.generics, + fields: data.fields, + }), + } + } +} + +ast_enum_of_structs! { + /// A suffix of an import tree in a `use` item: `Type as Renamed` or `*`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum UseTree { + /// A path prefix of imports in a `use` item: `std::...`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Path(UsePath { + pub ident: Ident, + pub colon2_token: Token![::], + pub tree: Box, + }), + + /// An identifier imported by a `use` item: `HashMap`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Name(UseName { + pub ident: Ident, + }), + + /// An renamed identifier imported by a `use` item: `HashMap as Map`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Rename(UseRename { + pub ident: Ident, + pub as_token: Token![as], + pub rename: Ident, + }), + + /// A glob import in a `use` item: `*`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Glob(UseGlob { + pub star_token: Token![*], + }), + + /// A braced group of imports in a `use` item: `{A, B, C}`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Group(UseGroup { + pub brace_token: token::Brace, + pub items: Punctuated, + }), + } +} + +ast_enum_of_structs! { + /// An item within an `extern` block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum ForeignItem { + /// A foreign function in an `extern` block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Fn(ForeignItemFn { + pub attrs: Vec, + pub vis: Visibility, + pub ident: Ident, + pub decl: Box, + pub semi_token: Token![;], + }), + + /// A foreign static item in an `extern` block: `static ext: u8`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Static(ForeignItemStatic { + pub attrs: Vec, + pub vis: Visibility, + pub static_token: Token![static], + pub mutability: Option, + pub ident: Ident, + pub colon_token: Token![:], + pub ty: Box, + pub semi_token: Token![;], + }), + + /// A foreign type in an `extern` block: `type void`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Type(ForeignItemType { + pub attrs: Vec, + pub vis: Visibility, + pub type_token: Token![type], + pub ident: Ident, + pub semi_token: Token![;], + }), + + /// A macro invocation within an extern block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro(ForeignItemMacro { + pub attrs: Vec, + pub mac: Macro, + pub semi_token: Option, + }), + + /// Tokens in an `extern` block not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Verbatim(ForeignItemVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for ForeignItemVerbatim {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for ForeignItemVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for ForeignItemVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +ast_enum_of_structs! { + /// An item declaration within the definition of a trait. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum TraitItem { + /// An associated constant within the definition of a trait. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Const(TraitItemConst { + pub attrs: Vec, + pub const_token: Token![const], + pub ident: Ident, + pub colon_token: Token![:], + pub ty: Type, + pub default: Option<(Token![=], Expr)>, + pub semi_token: Token![;], + }), + + /// A trait method within the definition of a trait. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Method(TraitItemMethod { + pub attrs: Vec, + pub sig: MethodSig, + pub default: Option, + pub semi_token: Option, + }), + + /// An associated type within the definition of a trait. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Type(TraitItemType { + pub attrs: Vec, + pub type_token: Token![type], + pub ident: Ident, + pub generics: Generics, + pub colon_token: Option, + pub bounds: Punctuated, + pub default: Option<(Token![=], Type)>, + pub semi_token: Token![;], + }), + + /// A macro invocation within the definition of a trait. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro(TraitItemMacro { + pub attrs: Vec, + pub mac: Macro, + pub semi_token: Option, + }), + + /// Tokens within the definition of a trait not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Verbatim(TraitItemVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for TraitItemVerbatim {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for TraitItemVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for TraitItemVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +ast_enum_of_structs! { + /// An item within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum ImplItem { + /// An associated constant within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Const(ImplItemConst { + pub attrs: Vec, + pub vis: Visibility, + pub defaultness: Option, + pub const_token: Token![const], + pub ident: Ident, + pub colon_token: Token![:], + pub ty: Type, + pub eq_token: Token![=], + pub expr: Expr, + pub semi_token: Token![;], + }), + + /// A method within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Method(ImplItemMethod { + pub attrs: Vec, + pub vis: Visibility, + pub defaultness: Option, + pub sig: MethodSig, + pub block: Block, + }), + + /// An associated type within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Type(ImplItemType { + pub attrs: Vec, + pub vis: Visibility, + pub defaultness: Option, + pub type_token: Token![type], + pub ident: Ident, + pub generics: Generics, + pub eq_token: Token![=], + pub ty: Type, + pub semi_token: Token![;], + }), + + /// An existential type within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Existential(ImplItemExistential { + pub attrs: Vec, + pub existential_token: Token![existential], + pub type_token: Token![type], + pub ident: Ident, + pub generics: Generics, + pub colon_token: Option, + pub bounds: Punctuated, + pub semi_token: Token![;], + }), + + /// A macro invocation within an impl block. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Macro(ImplItemMacro { + pub attrs: Vec, + pub mac: Macro, + pub semi_token: Option, + }), + + /// Tokens within an impl block not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Verbatim(ImplItemVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for ImplItemVerbatim {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for ImplItemVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for ImplItemVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +ast_struct! { + /// A method's signature in a trait or implementation: `unsafe fn + /// initialize(&self)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub struct MethodSig { + pub constness: Option, + pub unsafety: Option, + pub asyncness: Option, + pub abi: Option, + pub ident: Ident, + pub decl: FnDecl, + } +} + +ast_struct! { + /// Header of a function declaration, without including the body. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub struct FnDecl { + pub fn_token: Token![fn], + pub generics: Generics, + pub paren_token: token::Paren, + pub inputs: Punctuated, + pub variadic: Option, + pub output: ReturnType, + } +} + +ast_enum_of_structs! { + /// An argument in a function signature: the `n: usize` in `fn f(n: usize)`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum FnArg { + /// Self captured by reference in a function signature: `&self` or `&mut + /// self`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub SelfRef(ArgSelfRef { + pub and_token: Token![&], + pub lifetime: Option, + pub mutability: Option, + pub self_token: Token![self], + }), + + /// Self captured by value in a function signature: `self` or `mut + /// self`. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub SelfValue(ArgSelf { + pub mutability: Option, + pub self_token: Token![self], + }), + + /// An explicitly typed pattern captured by a function signature. + /// + /// *This type is available if Syn is built with the `"full"` feature.* + pub Captured(ArgCaptured { + pub pat: Pat, + pub colon_token: Token![:], + pub ty: Type, + }), + + /// A pattern whose type is inferred captured by a function signature. + pub Inferred(Pat), + /// A type not bound to any pattern in a function signature. + pub Ignored(Type), + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use ext::IdentExt; + use parse::{Parse, ParseStream, Result}; + use proc_macro2::{Punct, Spacing, TokenTree}; + use std::iter::FromIterator; + + impl Parse for Item { + fn parse(input: ParseStream) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + let vis: Visibility = ahead.parse()?; + + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![extern]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![crate]) { + input.parse().map(Item::ExternCrate) + } else if lookahead.peek(Token![fn]) { + input.parse().map(Item::Fn) + } else if lookahead.peek(token::Brace) { + input.parse().map(Item::ForeignMod) + } else if lookahead.peek(LitStr) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(token::Brace) { + input.parse().map(Item::ForeignMod) + } else if lookahead.peek(Token![fn]) { + input.parse().map(Item::Fn) + } else { + Err(lookahead.error()) + } + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![use]) { + input.parse().map(Item::Use) + } else if lookahead.peek(Token![static]) { + input.parse().map(Item::Static) + } else if lookahead.peek(Token![const]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Ident) || lookahead.peek(Token![_]) { + input.parse().map(Item::Const) + } else if lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![async]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(Item::Fn) + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![unsafe]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![trait]) + || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) + { + input.parse().map(Item::Trait) + } else if lookahead.peek(Token![impl]) { + input.parse().map(Item::Impl) + } else if lookahead.peek(Token![async]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(Item::Fn) + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![async]) || lookahead.peek(Token![fn]) { + input.parse().map(Item::Fn) + } else if lookahead.peek(Token![mod]) { + input.parse().map(Item::Mod) + } else if lookahead.peek(Token![type]) { + input.parse().map(Item::Type) + } else if lookahead.peek(Token![existential]) { + input.parse().map(Item::Existential) + } else if lookahead.peek(Token![struct]) { + input.parse().map(Item::Struct) + } else if lookahead.peek(Token![enum]) { + input.parse().map(Item::Enum) + } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) { + input.parse().map(Item::Union) + } else if lookahead.peek(Token![trait]) { + input.call(parse_trait_or_trait_alias) + } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) { + input.parse().map(Item::Trait) + } else if lookahead.peek(Token![impl]) + || lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) + { + input.parse().map(Item::Impl) + } else if lookahead.peek(Token![macro]) { + input.parse().map(Item::Macro2) + } else if vis.is_inherited() + && (lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![::])) + { + input.parse().map(Item::Macro) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for ItemMacro { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let path = input.call(Path::parse_mod_style)?; + let bang_token: Token![!] = input.parse()?; + let ident: Option = input.parse()?; + let (delimiter, tts) = input.call(mac::parse_delimiter)?; + let semi_token: Option = if !delimiter.is_brace() { + Some(input.parse()?) + } else { + None + }; + Ok(ItemMacro { + attrs: attrs, + ident: ident, + mac: Macro { + path: path, + bang_token: bang_token, + delimiter: delimiter, + tts: tts, + }, + semi_token: semi_token, + }) + } + } + + // TODO: figure out the actual grammar; is body required to be braced? + impl Parse for ItemMacro2 { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let macro_token: Token![macro] = input.parse()?; + let ident: Ident = input.parse()?; + + let paren_token; + let args; + let brace_token; + let body; + let lookahead = input.lookahead1(); + if lookahead.peek(token::Paren) { + let paren_content; + paren_token = parenthesized!(paren_content in input); + args = paren_content.parse()?; + + let brace_content; + brace_token = braced!(brace_content in input); + body = brace_content.parse()?; + } else if lookahead.peek(token::Brace) { + // Hack: the ItemMacro2 syntax tree will need to change so that + // we can store None for the args. + // + // https://github.com/dtolnay/syn/issues/548 + // + // For now, store some sentinel tokens that are otherwise + // illegal. + paren_token = token::Paren::default(); + args = TokenStream::from_iter(vec![ + TokenTree::Punct(Punct::new('$', Spacing::Alone)), + TokenTree::Punct(Punct::new('$', Spacing::Alone)), + ]); + + let brace_content; + brace_token = braced!(brace_content in input); + body = brace_content.parse()?; + } else { + return Err(lookahead.error()); + } + + Ok(ItemMacro2 { + attrs: attrs, + vis: vis, + macro_token: macro_token, + ident: ident, + paren_token: paren_token, + args: args, + brace_token: brace_token, + body: body, + }) + } + } + + impl Parse for ItemExternCrate { + fn parse(input: ParseStream) -> Result { + Ok(ItemExternCrate { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + extern_token: input.parse()?, + crate_token: input.parse()?, + ident: { + if input.peek(Token![self]) { + input.call(Ident::parse_any)? + } else { + input.parse()? + } + }, + rename: { + if input.peek(Token![as]) { + let as_token: Token![as] = input.parse()?; + let rename: Ident = input.parse()?; + Some((as_token, rename)) + } else { + None + } + }, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ItemUse { + fn parse(input: ParseStream) -> Result { + Ok(ItemUse { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + use_token: input.parse()?, + leading_colon: input.parse()?, + tree: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for UseTree { + fn parse(input: ParseStream) -> Result { + let lookahead = input.lookahead1(); + if lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![extern]) + { + let ident = input.call(Ident::parse_any)?; + if input.peek(Token![::]) { + Ok(UseTree::Path(UsePath { + ident: ident, + colon2_token: input.parse()?, + tree: Box::new(input.parse()?), + })) + } else if input.peek(Token![as]) { + Ok(UseTree::Rename(UseRename { + ident: ident, + as_token: input.parse()?, + rename: { + if input.peek(Ident) { + input.parse()? + } else if input.peek(Token![_]) { + Ident::from(input.parse::()?) + } else { + return Err(input.error("expected identifier or underscore")); + } + }, + })) + } else { + Ok(UseTree::Name(UseName { ident: ident })) + } + } else if lookahead.peek(Token![*]) { + Ok(UseTree::Glob(UseGlob { + star_token: input.parse()?, + })) + } else if lookahead.peek(token::Brace) { + let content; + Ok(UseTree::Group(UseGroup { + brace_token: braced!(content in input), + items: content.parse_terminated(UseTree::parse)?, + })) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for ItemStatic { + fn parse(input: ParseStream) -> Result { + Ok(ItemStatic { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + static_token: input.parse()?, + mutability: input.parse()?, + ident: input.parse()?, + colon_token: input.parse()?, + ty: input.parse()?, + eq_token: input.parse()?, + expr: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ItemConst { + fn parse(input: ParseStream) -> Result { + Ok(ItemConst { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + const_token: input.parse()?, + ident: { + let lookahead = input.lookahead1(); + if lookahead.peek(Ident) || lookahead.peek(Token![_]) { + input.call(Ident::parse_any)? + } else { + return Err(lookahead.error()); + } + }, + colon_token: input.parse()?, + ty: input.parse()?, + eq_token: input.parse()?, + expr: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ItemFn { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let constness: Option = input.parse()?; + let unsafety: Option = input.parse()?; + let asyncness: Option = input.parse()?; + let abi: Option = input.parse()?; + let fn_token: Token![fn] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + + let content; + let paren_token = parenthesized!(content in input); + let inputs = content.parse_terminated(FnArg::parse)?; + let variadic: Option = match inputs.last() { + Some(punctuated::Pair::End(&FnArg::Captured(ArgCaptured { + ty: Type::Verbatim(TypeVerbatim { ref tts }), + .. + }))) => parse2(tts.clone()).ok(), + _ => None, + }; + + let output: ReturnType = input.parse()?; + let where_clause: Option = input.parse()?; + + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + let stmts = content.call(Block::parse_within)?; + + Ok(ItemFn { + attrs: private::attrs(outer_attrs, inner_attrs), + vis: vis, + constness: constness, + unsafety: unsafety, + asyncness: asyncness, + abi: abi, + ident: ident, + decl: Box::new(FnDecl { + fn_token: fn_token, + paren_token: paren_token, + inputs: inputs, + output: output, + variadic: variadic, + generics: Generics { + where_clause: where_clause, + ..generics + }, + }), + block: Box::new(Block { + brace_token: brace_token, + stmts: stmts, + }), + }) + } + } + + impl Parse for FnArg { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![&]) { + let ahead = input.fork(); + if ahead.call(arg_self_ref).is_ok() && !ahead.peek(Token![:]) { + return input.call(arg_self_ref).map(FnArg::SelfRef); + } + } + + if input.peek(Token![mut]) || input.peek(Token![self]) { + let ahead = input.fork(); + if ahead.call(arg_self).is_ok() && !ahead.peek(Token![:]) { + return input.call(arg_self).map(FnArg::SelfValue); + } + } + + let ahead = input.fork(); + let err = match ahead.call(arg_captured) { + Ok(_) => return input.call(arg_captured).map(FnArg::Captured), + Err(err) => err, + }; + + let ahead = input.fork(); + if ahead.parse::().is_ok() { + return input.parse().map(FnArg::Ignored); + } + + Err(err) + } + } + + fn arg_self_ref(input: ParseStream) -> Result { + Ok(ArgSelfRef { + and_token: input.parse()?, + lifetime: input.parse()?, + mutability: input.parse()?, + self_token: input.parse()?, + }) + } + + fn arg_self(input: ParseStream) -> Result { + Ok(ArgSelf { + mutability: input.parse()?, + self_token: input.parse()?, + }) + } + + fn arg_captured(input: ParseStream) -> Result { + Ok(ArgCaptured { + pat: input.parse()?, + colon_token: input.parse()?, + ty: match input.parse::() { + Ok(dot3) => { + let args = vec![ + TokenTree::Punct(Punct::new('.', Spacing::Joint)), + TokenTree::Punct(Punct::new('.', Spacing::Joint)), + TokenTree::Punct(Punct::new('.', Spacing::Alone)), + ]; + let tokens = TokenStream::from_iter(args.into_iter().zip(&dot3.spans).map( + |(mut arg, span)| { + arg.set_span(*span); + arg + }, + )); + Type::Verbatim(TypeVerbatim { tts: tokens }) + } + Err(_) => input.parse()?, + }, + }) + } + + impl Parse for ItemMod { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let mod_token: Token![mod] = input.parse()?; + let ident: Ident = input.parse()?; + + let lookahead = input.lookahead1(); + if lookahead.peek(Token![;]) { + Ok(ItemMod { + attrs: outer_attrs, + vis: vis, + mod_token: mod_token, + ident: ident, + content: None, + semi: Some(input.parse()?), + }) + } else if lookahead.peek(token::Brace) { + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + + let mut items = Vec::new(); + while !content.is_empty() { + items.push(content.parse()?); + } + + Ok(ItemMod { + attrs: private::attrs(outer_attrs, inner_attrs), + vis: vis, + mod_token: mod_token, + ident: ident, + content: Some((brace_token, items)), + semi: None, + }) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for ItemForeignMod { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let abi: Abi = input.parse()?; + + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + let mut items = Vec::new(); + while !content.is_empty() { + items.push(content.parse()?); + } + + Ok(ItemForeignMod { + attrs: private::attrs(outer_attrs, inner_attrs), + abi: abi, + brace_token: brace_token, + items: items, + }) + } + } + + impl Parse for ForeignItem { + fn parse(input: ParseStream) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + let vis: Visibility = ahead.parse()?; + + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![fn]) { + input.parse().map(ForeignItem::Fn) + } else if lookahead.peek(Token![static]) { + input.parse().map(ForeignItem::Static) + } else if lookahead.peek(Token![type]) { + input.parse().map(ForeignItem::Type) + } else if vis.is_inherited() + && (lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![::])) + { + input.parse().map(ForeignItem::Macro) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for ForeignItemFn { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let fn_token: Token![fn] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + + let content; + let paren_token = parenthesized!(content in input); + let mut inputs = Punctuated::new(); + while !content.is_empty() && !content.peek(Token![...]) { + inputs.push_value(content.parse()?); + if content.is_empty() { + break; + } + inputs.push_punct(content.parse()?); + } + let variadic: Option = if inputs.empty_or_trailing() { + content.parse()? + } else { + None + }; + + let output: ReturnType = input.parse()?; + let where_clause: Option = input.parse()?; + let semi_token: Token![;] = input.parse()?; + + Ok(ForeignItemFn { + attrs: attrs, + vis: vis, + ident: ident, + decl: Box::new(FnDecl { + fn_token: fn_token, + paren_token: paren_token, + inputs: inputs, + output: output, + variadic: variadic, + generics: Generics { + where_clause: where_clause, + ..generics + }, + }), + semi_token: semi_token, + }) + } + } + + impl Parse for ForeignItemStatic { + fn parse(input: ParseStream) -> Result { + Ok(ForeignItemStatic { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + static_token: input.parse()?, + mutability: input.parse()?, + ident: input.parse()?, + colon_token: input.parse()?, + ty: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ForeignItemType { + fn parse(input: ParseStream) -> Result { + Ok(ForeignItemType { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + type_token: input.parse()?, + ident: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ForeignItemMacro { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let mac: Macro = input.parse()?; + let semi_token: Option = if mac.delimiter.is_brace() { + None + } else { + Some(input.parse()?) + }; + Ok(ForeignItemMacro { + attrs: attrs, + mac: mac, + semi_token: semi_token, + }) + } + } + + impl Parse for ItemType { + fn parse(input: ParseStream) -> Result { + Ok(ItemType { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + type_token: input.parse()?, + ident: input.parse()?, + generics: { + let mut generics: Generics = input.parse()?; + generics.where_clause = input.parse()?; + generics + }, + eq_token: input.parse()?, + ty: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ItemExistential { + fn parse(input: ParseStream) -> Result { + Ok(ItemExistential { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + existential_token: input.parse()?, + type_token: input.parse()?, + ident: input.parse()?, + generics: { + let mut generics: Generics = input.parse()?; + generics.where_clause = input.parse()?; + generics + }, + colon_token: Some(input.parse()?), + bounds: { + let mut bounds = Punctuated::new(); + while !input.peek(Token![;]) { + if !bounds.is_empty() { + bounds.push_punct(input.parse()?); + } + bounds.push_value(input.parse()?); + } + bounds + }, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ItemStruct { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis = input.parse::()?; + let struct_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, fields, semi_token) = derive::parsing::data_struct(input)?; + Ok(ItemStruct { + attrs: attrs, + vis: vis, + struct_token: struct_token, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + fields: fields, + semi_token: semi_token, + }) + } + } + + impl Parse for ItemEnum { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis = input.parse::()?; + let enum_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, brace_token, variants) = derive::parsing::data_enum(input)?; + Ok(ItemEnum { + attrs: attrs, + vis: vis, + enum_token: enum_token, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + brace_token: brace_token, + variants: variants, + }) + } + } + + impl Parse for ItemUnion { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis = input.parse::()?; + let union_token = input.parse::()?; + let ident = input.parse::()?; + let generics = input.parse::()?; + let (where_clause, fields) = derive::parsing::data_union(input)?; + Ok(ItemUnion { + attrs: attrs, + vis: vis, + union_token: union_token, + ident: ident, + generics: Generics { + where_clause: where_clause, + ..generics + }, + fields: fields, + }) + } + } + + fn parse_trait_or_trait_alias(input: ParseStream) -> Result { + let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?; + let lookahead = input.lookahead1(); + if lookahead.peek(token::Brace) + || lookahead.peek(Token![:]) + || lookahead.peek(Token![where]) + { + let unsafety = None; + let auto_token = None; + parse_rest_of_trait( + input, + attrs, + vis, + unsafety, + auto_token, + trait_token, + ident, + generics, + ) + .map(Item::Trait) + } else if lookahead.peek(Token![=]) { + parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics) + .map(Item::TraitAlias) + } else { + Err(lookahead.error()) + } + } + + impl Parse for ItemTrait { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let unsafety: Option = input.parse()?; + let auto_token: Option = input.parse()?; + let trait_token: Token![trait] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + parse_rest_of_trait( + input, + attrs, + vis, + unsafety, + auto_token, + trait_token, + ident, + generics, + ) + } + } + + fn parse_rest_of_trait( + input: ParseStream, + attrs: Vec, + vis: Visibility, + unsafety: Option, + auto_token: Option, + trait_token: Token![trait], + ident: Ident, + mut generics: Generics, + ) -> Result { + let colon_token: Option = input.parse()?; + + let mut supertraits = Punctuated::new(); + if colon_token.is_some() { + loop { + supertraits.push_value(input.parse()?); + if input.peek(Token![where]) || input.peek(token::Brace) { + break; + } + supertraits.push_punct(input.parse()?); + if input.peek(Token![where]) || input.peek(token::Brace) { + break; + } + } + } + + generics.where_clause = input.parse()?; + + let content; + let brace_token = braced!(content in input); + let mut items = Vec::new(); + while !content.is_empty() { + items.push(content.parse()?); + } + + Ok(ItemTrait { + attrs: attrs, + vis: vis, + unsafety: unsafety, + auto_token: auto_token, + trait_token: trait_token, + ident: ident, + generics: generics, + colon_token: colon_token, + supertraits: supertraits, + brace_token: brace_token, + items: items, + }) + } + + impl Parse for ItemTraitAlias { + fn parse(input: ParseStream) -> Result { + let (attrs, vis, trait_token, ident, generics) = parse_start_of_trait_alias(input)?; + parse_rest_of_trait_alias(input, attrs, vis, trait_token, ident, generics) + } + } + + fn parse_start_of_trait_alias( + input: ParseStream, + ) -> Result<(Vec, Visibility, Token![trait], Ident, Generics)> { + let attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let trait_token: Token![trait] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + Ok((attrs, vis, trait_token, ident, generics)) + } + + fn parse_rest_of_trait_alias( + input: ParseStream, + attrs: Vec, + vis: Visibility, + trait_token: Token![trait], + ident: Ident, + mut generics: Generics, + ) -> Result { + let eq_token: Token![=] = input.parse()?; + + let mut bounds = Punctuated::new(); + loop { + if input.peek(Token![where]) || input.peek(Token![;]) { + break; + } + bounds.push_value(input.parse()?); + if input.peek(Token![where]) || input.peek(Token![;]) { + break; + } + bounds.push_punct(input.parse()?); + } + + generics.where_clause = input.parse()?; + let semi_token: Token![;] = input.parse()?; + + Ok(ItemTraitAlias { + attrs: attrs, + vis: vis, + trait_token: trait_token, + ident: ident, + generics: generics, + eq_token: eq_token, + bounds: bounds, + semi_token: semi_token, + }) + } + + impl Parse for TraitItem { + fn parse(input: ParseStream) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + + let lookahead = ahead.lookahead1(); + if lookahead.peek(Token![const]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Ident) { + input.parse().map(TraitItem::Const) + } else if lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(TraitItem::Method) + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(TraitItem::Method) + } else if lookahead.peek(Token![type]) { + input.parse().map(TraitItem::Type) + } else if lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![::]) + { + input.parse().map(TraitItem::Macro) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for TraitItemConst { + fn parse(input: ParseStream) -> Result { + Ok(TraitItemConst { + attrs: input.call(Attribute::parse_outer)?, + const_token: input.parse()?, + ident: input.parse()?, + colon_token: input.parse()?, + ty: input.parse()?, + default: { + if input.peek(Token![=]) { + let eq_token: Token![=] = input.parse()?; + let default: Expr = input.parse()?; + Some((eq_token, default)) + } else { + None + } + }, + semi_token: input.parse()?, + }) + } + } + + impl Parse for TraitItemMethod { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let constness: Option = input.parse()?; + let unsafety: Option = input.parse()?; + let abi: Option = input.parse()?; + let fn_token: Token![fn] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + + let content; + let paren_token = parenthesized!(content in input); + let inputs = content.parse_terminated(FnArg::parse)?; + + let output: ReturnType = input.parse()?; + let where_clause: Option = input.parse()?; + + let lookahead = input.lookahead1(); + let (brace_token, inner_attrs, stmts, semi_token) = if lookahead.peek(token::Brace) { + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + let stmts = content.call(Block::parse_within)?; + (Some(brace_token), inner_attrs, stmts, None) + } else if lookahead.peek(Token![;]) { + let semi_token: Token![;] = input.parse()?; + (None, Vec::new(), Vec::new(), Some(semi_token)) + } else { + return Err(lookahead.error()); + }; + + Ok(TraitItemMethod { + attrs: private::attrs(outer_attrs, inner_attrs), + sig: MethodSig { + constness: constness, + unsafety: unsafety, + asyncness: None, + abi: abi, + ident: ident, + decl: FnDecl { + fn_token: fn_token, + paren_token: paren_token, + inputs: inputs, + output: output, + variadic: None, + generics: Generics { + where_clause: where_clause, + ..generics + }, + }, + }, + default: brace_token.map(|brace_token| Block { + brace_token: brace_token, + stmts: stmts, + }), + semi_token: semi_token, + }) + } + } + + impl Parse for TraitItemType { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let type_token: Token![type] = input.parse()?; + let ident: Ident = input.parse()?; + let mut generics: Generics = input.parse()?; + let colon_token: Option = input.parse()?; + + let mut bounds = Punctuated::new(); + if colon_token.is_some() { + while !input.peek(Token![where]) && !input.peek(Token![=]) && !input.peek(Token![;]) + { + if !bounds.is_empty() { + bounds.push_punct(input.parse()?); + } + bounds.push_value(input.parse()?); + } + } + + generics.where_clause = input.parse()?; + let default = if input.peek(Token![=]) { + let eq_token: Token![=] = input.parse()?; + let default: Type = input.parse()?; + Some((eq_token, default)) + } else { + None + }; + let semi_token: Token![;] = input.parse()?; + + Ok(TraitItemType { + attrs: attrs, + type_token: type_token, + ident: ident, + generics: generics, + colon_token: colon_token, + bounds: bounds, + default: default, + semi_token: semi_token, + }) + } + } + + impl Parse for TraitItemMacro { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let mac: Macro = input.parse()?; + let semi_token: Option = if mac.delimiter.is_brace() { + None + } else { + Some(input.parse()?) + }; + Ok(TraitItemMacro { + attrs: attrs, + mac: mac, + semi_token: semi_token, + }) + } + } + + impl Parse for ItemImpl { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let defaultness: Option = input.parse()?; + let unsafety: Option = input.parse()?; + let impl_token: Token![impl] = input.parse()?; + + let has_generics = input.peek(Token![<]) + && (input.peek2(Token![>]) + || input.peek2(Token![#]) + || (input.peek2(Ident) || input.peek2(Lifetime)) + && (input.peek3(Token![:]) + || input.peek3(Token![,]) + || input.peek3(Token![>]))); + let generics: Generics = if has_generics { + input.parse()? + } else { + Generics::default() + }; + + let trait_ = { + let ahead = input.fork(); + if ahead.parse::>().is_ok() + && ahead.parse::().is_ok() + && ahead.parse::().is_ok() + { + let polarity: Option = input.parse()?; + let path: Path = input.parse()?; + let for_token: Token![for] = input.parse()?; + Some((polarity, path, for_token)) + } else { + None + } + }; + let self_ty: Type = input.parse()?; + let where_clause: Option = input.parse()?; + + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + + let mut items = Vec::new(); + while !content.is_empty() { + items.push(content.parse()?); + } + + Ok(ItemImpl { + attrs: private::attrs(outer_attrs, inner_attrs), + defaultness: defaultness, + unsafety: unsafety, + impl_token: impl_token, + generics: Generics { + where_clause: where_clause, + ..generics + }, + trait_: trait_, + self_ty: Box::new(self_ty), + brace_token: brace_token, + items: items, + }) + } + } + + impl Parse for ImplItem { + fn parse(input: ParseStream) -> Result { + let ahead = input.fork(); + ahead.call(Attribute::parse_outer)?; + let vis: Visibility = ahead.parse()?; + + let mut lookahead = ahead.lookahead1(); + let defaultness = if lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) { + let defaultness: Token![default] = ahead.parse()?; + lookahead = ahead.lookahead1(); + Some(defaultness) + } else { + None + }; + + if lookahead.peek(Token![const]) { + ahead.parse::()?; + let lookahead = ahead.lookahead1(); + if lookahead.peek(Ident) { + input.parse().map(ImplItem::Const) + } else if lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![async]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(ImplItem::Method) + } else { + Err(lookahead.error()) + } + } else if lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![async]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![fn]) + { + input.parse().map(ImplItem::Method) + } else if lookahead.peek(Token![type]) { + input.parse().map(ImplItem::Type) + } else if vis.is_inherited() + && defaultness.is_none() + && lookahead.peek(Token![existential]) + { + input.parse().map(ImplItem::Existential) + } else if vis.is_inherited() + && defaultness.is_none() + && (lookahead.peek(Ident) + || lookahead.peek(Token![self]) + || lookahead.peek(Token![super]) + || lookahead.peek(Token![extern]) + || lookahead.peek(Token![crate]) + || lookahead.peek(Token![::])) + { + input.parse().map(ImplItem::Macro) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for ImplItemConst { + fn parse(input: ParseStream) -> Result { + Ok(ImplItemConst { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + defaultness: input.parse()?, + const_token: input.parse()?, + ident: input.parse()?, + colon_token: input.parse()?, + ty: input.parse()?, + eq_token: input.parse()?, + expr: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ImplItemMethod { + fn parse(input: ParseStream) -> Result { + let outer_attrs = input.call(Attribute::parse_outer)?; + let vis: Visibility = input.parse()?; + let defaultness: Option = input.parse()?; + let constness: Option = input.parse()?; + let unsafety: Option = input.parse()?; + let asyncness: Option = input.parse()?; + let abi: Option = input.parse()?; + let fn_token: Token![fn] = input.parse()?; + let ident: Ident = input.parse()?; + let generics: Generics = input.parse()?; + + let content; + let paren_token = parenthesized!(content in input); + let inputs = content.parse_terminated(FnArg::parse)?; + + let output: ReturnType = input.parse()?; + let where_clause: Option = input.parse()?; + + let content; + let brace_token = braced!(content in input); + let inner_attrs = content.call(Attribute::parse_inner)?; + let stmts = content.call(Block::parse_within)?; + + Ok(ImplItemMethod { + attrs: private::attrs(outer_attrs, inner_attrs), + vis: vis, + defaultness: defaultness, + sig: MethodSig { + constness: constness, + unsafety: unsafety, + asyncness: asyncness, + abi: abi, + ident: ident, + decl: FnDecl { + fn_token: fn_token, + paren_token: paren_token, + inputs: inputs, + output: output, + variadic: None, + generics: Generics { + where_clause: where_clause, + ..generics + }, + }, + }, + block: Block { + brace_token: brace_token, + stmts: stmts, + }, + }) + } + } + + impl Parse for ImplItemType { + fn parse(input: ParseStream) -> Result { + Ok(ImplItemType { + attrs: input.call(Attribute::parse_outer)?, + vis: input.parse()?, + defaultness: input.parse()?, + type_token: input.parse()?, + ident: input.parse()?, + generics: { + let mut generics: Generics = input.parse()?; + generics.where_clause = input.parse()?; + generics + }, + eq_token: input.parse()?, + ty: input.parse()?, + semi_token: input.parse()?, + }) + } + } + + impl Parse for ImplItemExistential { + fn parse(input: ParseStream) -> Result { + let ety: ItemExistential = input.parse()?; + Ok(ImplItemExistential { + attrs: ety.attrs, + existential_token: ety.existential_token, + type_token: ety.type_token, + ident: ety.ident, + generics: ety.generics, + colon_token: ety.colon_token, + bounds: ety.bounds, + semi_token: ety.semi_token, + }) + } + } + + impl Parse for ImplItemMacro { + fn parse(input: ParseStream) -> Result { + let attrs = input.call(Attribute::parse_outer)?; + let mac: Macro = input.parse()?; + let semi_token: Option = if mac.delimiter.is_brace() { + None + } else { + Some(input.parse()?) + }; + Ok(ImplItemMacro { + attrs: attrs, + mac: mac, + semi_token: semi_token, + }) + } + } + + impl Visibility { + fn is_inherited(&self) -> bool { + match *self { + Visibility::Inherited => true, + _ => false, + } + } + } + + impl MacroDelimiter { + fn is_brace(&self) -> bool { + match *self { + MacroDelimiter::Brace(_) => true, + MacroDelimiter::Paren(_) | MacroDelimiter::Bracket(_) => false, + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::{ToTokens, TokenStreamExt}; + + use attr::FilterAttrs; + use print::TokensOrDefault; + + impl ToTokens for ItemExternCrate { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.extern_token.to_tokens(tokens); + self.crate_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + if let Some((ref as_token, ref rename)) = self.rename { + as_token.to_tokens(tokens); + rename.to_tokens(tokens); + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemUse { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.use_token.to_tokens(tokens); + self.leading_colon.to_tokens(tokens); + self.tree.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemStatic { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.static_token.to_tokens(tokens); + self.mutability.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.expr.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemConst { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.const_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.expr.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemFn { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.constness.to_tokens(tokens); + self.unsafety.to_tokens(tokens); + self.asyncness.to_tokens(tokens); + self.abi.to_tokens(tokens); + NamedDecl(&self.decl, &self.ident).to_tokens(tokens); + self.block.brace_token.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(&self.block.stmts); + }); + } + } + + impl ToTokens for ItemMod { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.mod_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + if let Some((ref brace, ref items)) = self.content { + brace.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(items); + }); + } else { + TokensOrDefault(&self.semi).to_tokens(tokens); + } + } + } + + impl ToTokens for ItemForeignMod { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.abi.to_tokens(tokens); + self.brace_token.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(&self.items); + }); + } + } + + impl ToTokens for ItemType { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemExistential { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.existential_token.to_tokens(tokens); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + if !self.bounds.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemEnum { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.enum_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.brace_token.surround(tokens, |tokens| { + self.variants.to_tokens(tokens); + }); + } + } + + impl ToTokens for ItemStruct { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.struct_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + match self.fields { + Fields::Named(ref fields) => { + self.generics.where_clause.to_tokens(tokens); + fields.to_tokens(tokens); + } + Fields::Unnamed(ref fields) => { + fields.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + TokensOrDefault(&self.semi_token).to_tokens(tokens); + } + Fields::Unit => { + self.generics.where_clause.to_tokens(tokens); + TokensOrDefault(&self.semi_token).to_tokens(tokens); + } + } + } + } + + impl ToTokens for ItemUnion { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.union_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.fields.to_tokens(tokens); + } + } + + impl ToTokens for ItemTrait { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.unsafety.to_tokens(tokens); + self.auto_token.to_tokens(tokens); + self.trait_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + if !self.supertraits.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.supertraits.to_tokens(tokens); + } + self.generics.where_clause.to_tokens(tokens); + self.brace_token.surround(tokens, |tokens| { + tokens.append_all(&self.items); + }); + } + } + + impl ToTokens for ItemTraitAlias { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.trait_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemImpl { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.defaultness.to_tokens(tokens); + self.unsafety.to_tokens(tokens); + self.impl_token.to_tokens(tokens); + self.generics.to_tokens(tokens); + if let Some((ref polarity, ref path, ref for_token)) = self.trait_ { + polarity.to_tokens(tokens); + path.to_tokens(tokens); + for_token.to_tokens(tokens); + } + self.self_ty.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.brace_token.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(&self.items); + }); + } + } + + impl ToTokens for ItemMacro { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.mac.path.to_tokens(tokens); + self.mac.bang_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + match self.mac.delimiter { + MacroDelimiter::Paren(ref paren) => { + paren.surround(tokens, |tokens| self.mac.tts.to_tokens(tokens)); + } + MacroDelimiter::Brace(ref brace) => { + brace.surround(tokens, |tokens| self.mac.tts.to_tokens(tokens)); + } + MacroDelimiter::Bracket(ref bracket) => { + bracket.surround(tokens, |tokens| self.mac.tts.to_tokens(tokens)); + } + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ItemMacro2 { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.macro_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + + // Hack: see comment in impl Parse for ItemMacro2. + if self.args.to_string() != "$ $" { + self.paren_token.surround(tokens, |tokens| { + self.args.to_tokens(tokens); + }); + } + + self.brace_token.surround(tokens, |tokens| { + self.body.to_tokens(tokens); + }); + } + } + + impl ToTokens for ItemVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.tts.to_tokens(tokens); + } + } + + impl ToTokens for UsePath { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.colon2_token.to_tokens(tokens); + self.tree.to_tokens(tokens); + } + } + + impl ToTokens for UseName { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + } + } + + impl ToTokens for UseRename { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.as_token.to_tokens(tokens); + self.rename.to_tokens(tokens); + } + } + + impl ToTokens for UseGlob { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.star_token.to_tokens(tokens); + } + } + + impl ToTokens for UseGroup { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.brace_token.surround(tokens, |tokens| { + self.items.to_tokens(tokens); + }); + } + } + + impl ToTokens for TraitItemConst { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.const_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + if let Some((ref eq_token, ref default)) = self.default { + eq_token.to_tokens(tokens); + default.to_tokens(tokens); + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for TraitItemMethod { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.sig.to_tokens(tokens); + match self.default { + Some(ref block) => { + block.brace_token.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(&block.stmts); + }); + } + None => { + TokensOrDefault(&self.semi_token).to_tokens(tokens); + } + } + } + } + + impl ToTokens for TraitItemType { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + if !self.bounds.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + self.generics.where_clause.to_tokens(tokens); + if let Some((ref eq_token, ref default)) = self.default { + eq_token.to_tokens(tokens); + default.to_tokens(tokens); + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for TraitItemMacro { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.mac.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for TraitItemVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.tts.to_tokens(tokens); + } + } + + impl ToTokens for ImplItemConst { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.defaultness.to_tokens(tokens); + self.const_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.expr.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ImplItemMethod { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.defaultness.to_tokens(tokens); + self.sig.to_tokens(tokens); + self.block.brace_token.surround(tokens, |tokens| { + tokens.append_all(self.attrs.inner()); + tokens.append_all(&self.block.stmts); + }); + } + } + + impl ToTokens for ImplItemType { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.defaultness.to_tokens(tokens); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ImplItemExistential { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.existential_token.to_tokens(tokens); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.generics.to_tokens(tokens); + self.generics.where_clause.to_tokens(tokens); + if !self.bounds.is_empty() { + TokensOrDefault(&self.colon_token).to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ImplItemMacro { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.mac.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ImplItemVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.tts.to_tokens(tokens); + } + } + + impl ToTokens for ForeignItemFn { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + NamedDecl(&self.decl, &self.ident).to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ForeignItemStatic { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.static_token.to_tokens(tokens); + self.mutability.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ForeignItemType { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.vis.to_tokens(tokens); + self.type_token.to_tokens(tokens); + self.ident.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ForeignItemMacro { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.attrs.outer()); + self.mac.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + } + } + + impl ToTokens for ForeignItemVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.tts.to_tokens(tokens); + } + } + + impl ToTokens for MethodSig { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.constness.to_tokens(tokens); + self.unsafety.to_tokens(tokens); + self.asyncness.to_tokens(tokens); + self.abi.to_tokens(tokens); + NamedDecl(&self.decl, &self.ident).to_tokens(tokens); + } + } + + struct NamedDecl<'a>(&'a FnDecl, &'a Ident); + + impl<'a> ToTokens for NamedDecl<'a> { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.0.fn_token.to_tokens(tokens); + self.1.to_tokens(tokens); + self.0.generics.to_tokens(tokens); + self.0.paren_token.surround(tokens, |tokens| { + self.0.inputs.to_tokens(tokens); + if self.0.variadic.is_some() && !self.0.inputs.empty_or_trailing() { + ::default().to_tokens(tokens); + } + self.0.variadic.to_tokens(tokens); + }); + self.0.output.to_tokens(tokens); + self.0.generics.where_clause.to_tokens(tokens); + } + } + + impl ToTokens for ArgSelfRef { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.and_token.to_tokens(tokens); + self.lifetime.to_tokens(tokens); + self.mutability.to_tokens(tokens); + self.self_token.to_tokens(tokens); + } + } + + impl ToTokens for ArgSelf { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.mutability.to_tokens(tokens); + self.self_token.to_tokens(tokens); + } + } + + impl ToTokens for ArgCaptured { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.pat.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/keyword.rs b/vendor/registry-40351f815f426200/syn/src/keyword.rs new file mode 100644 index 000000000..e69de29bb diff --git a/vendor/registry-40351f815f426200/syn/src/lib.rs b/vendor/registry-40351f815f426200/syn/src/lib.rs new file mode 100644 index 000000000..bfd6db871 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/lib.rs @@ -0,0 +1,727 @@ +//! Syn is a parsing library for parsing a stream of Rust tokens into a syntax +//! tree of Rust source code. +//! +//! Currently this library is geared toward use in Rust procedural macros, but +//! contains some APIs that may be useful more generally. +//! +//! - **Data structures** — Syn provides a complete syntax tree that can +//! represent any valid Rust source code. The syntax tree is rooted at +//! [`syn::File`] which represents a full source file, but there are other +//! entry points that may be useful to procedural macros including +//! [`syn::Item`], [`syn::Expr`] and [`syn::Type`]. +//! +//! - **Custom derives** — Of particular interest to custom derives is +//! [`syn::DeriveInput`] which is any of the three legal input items to a +//! derive macro. An example below shows using this type in a library that can +//! derive implementations of a trait of your own. +//! +//! - **Parsing** — Parsing in Syn is built around [parser functions] with the +//! signature `fn(ParseStream) -> Result`. Every syntax tree node defined +//! by Syn is individually parsable and may be used as a building block for +//! custom syntaxes, or you may dream up your own brand new syntax without +//! involving any of our syntax tree types. +//! +//! - **Location information** — Every token parsed by Syn is associated with a +//! `Span` that tracks line and column information back to the source of that +//! token. These spans allow a procedural macro to display detailed error +//! messages pointing to all the right places in the user's code. There is an +//! example of this below. +//! +//! - **Feature flags** — Functionality is aggressively feature gated so your +//! procedural macros enable only what they need, and do not pay in compile +//! time for all the rest. +//! +//! [`syn::File`]: struct.File.html +//! [`syn::Item`]: enum.Item.html +//! [`syn::Expr`]: enum.Expr.html +//! [`syn::Type`]: enum.Type.html +//! [`syn::DeriveInput`]: struct.DeriveInput.html +//! [parser functions]: parse/index.html +//! +//! *Version requirement: Syn supports any compiler version back to Rust's very +//! first support for procedural macros in Rust 1.15.0. Some features especially +//! around error reporting are only available in newer compilers or on the +//! nightly channel.* +//! +//! ## Example of a custom derive +//! +//! The canonical custom derive using Syn looks like this. We write an ordinary +//! Rust function tagged with a `proc_macro_derive` attribute and the name of +//! the trait we are deriving. Any time that derive appears in the user's code, +//! the Rust compiler passes their data structure as tokens into our macro. We +//! get to execute arbitrary Rust code to figure out what to do with those +//! tokens, then hand some tokens back to the compiler to compile into the +//! user's crate. +//! +//! [`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html +//! +//! ```toml +//! [dependencies] +//! syn = "0.15" +//! quote = "0.6" +//! +//! [lib] +//! proc-macro = true +//! ``` +//! +//! ```edition2018 +//! extern crate proc_macro; +//! +//! use proc_macro::TokenStream; +//! use quote::quote; +//! use syn::{parse_macro_input, DeriveInput}; +//! +//! # const IGNORE_TOKENS: &str = stringify! { +//! #[proc_macro_derive(MyMacro)] +//! # }; +//! pub fn my_macro(input: TokenStream) -> TokenStream { +//! // Parse the input tokens into a syntax tree +//! let input = parse_macro_input!(input as DeriveInput); +//! +//! // Build the output, possibly using quasi-quotation +//! let expanded = quote! { +//! // ... +//! }; +//! +//! // Hand the output tokens back to the compiler +//! TokenStream::from(expanded) +//! } +//! ``` +//! +//! The [`heapsize`] example directory shows a complete working Macros 1.1 +//! implementation of a custom derive. It works on any Rust compiler 1.15+. +//! The example derives a `HeapSize` trait which computes an estimate of the +//! amount of heap memory owned by a value. +//! +//! [`heapsize`]: https://github.com/dtolnay/syn/tree/master/examples/heapsize +//! +//! ```edition2018 +//! pub trait HeapSize { +//! /// Total number of bytes of heap memory owned by `self`. +//! fn heap_size_of_children(&self) -> usize; +//! } +//! ``` +//! +//! The custom derive allows users to write `#[derive(HeapSize)]` on data +//! structures in their program. +//! +//! ```edition2018 +//! # const IGNORE_TOKENS: &str = stringify! { +//! #[derive(HeapSize)] +//! # }; +//! struct Demo<'a, T: ?Sized> { +//! a: Box, +//! b: u8, +//! c: &'a str, +//! d: String, +//! } +//! ``` +//! +//! ## Spans and error reporting +//! +//! The token-based procedural macro API provides great control over where the +//! compiler's error messages are displayed in user code. Consider the error the +//! user sees if one of their field types does not implement `HeapSize`. +//! +//! ```edition2018 +//! # const IGNORE_TOKENS: &str = stringify! { +//! #[derive(HeapSize)] +//! # }; +//! struct Broken { +//! ok: String, +//! bad: std::thread::Thread, +//! } +//! ``` +//! +//! By tracking span information all the way through the expansion of a +//! procedural macro as shown in the `heapsize` example, token-based macros in +//! Syn are able to trigger errors that directly pinpoint the source of the +//! problem. +//! +//! ```text +//! error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied +//! --> src/main.rs:7:5 +//! | +//! 7 | bad: std::thread::Thread, +//! | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `Thread` +//! ``` +//! +//! ## Parsing a custom syntax +//! +//! The [`lazy-static`] example directory shows the implementation of a +//! `functionlike!(...)` procedural macro in which the input tokens are parsed +//! using Syn's parsing API. +//! +//! [`lazy-static`]: https://github.com/dtolnay/syn/tree/master/examples/lazy-static +//! +//! The example reimplements the popular `lazy_static` crate from crates.io as a +//! procedural macro. +//! +//! ```edition2018 +//! # macro_rules! lazy_static { +//! # ($($tt:tt)*) => {} +//! # } +//! # +//! lazy_static! { +//! static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap(); +//! } +//! ``` +//! +//! The implementation shows how to trigger custom warnings and error messages +//! on the macro input. +//! +//! ```text +//! warning: come on, pick a more creative name +//! --> src/main.rs:10:16 +//! | +//! 10 | static ref FOO: String = "lazy_static".to_owned(); +//! | ^^^ +//! ``` +//! +//! ## Debugging +//! +//! When developing a procedural macro it can be helpful to look at what the +//! generated code looks like. Use `cargo rustc -- -Zunstable-options +//! --pretty=expanded` or the [`cargo expand`] subcommand. +//! +//! [`cargo expand`]: https://github.com/dtolnay/cargo-expand +//! +//! To show the expanded code for some crate that uses your procedural macro, +//! run `cargo expand` from that crate. To show the expanded code for one of +//! your own test cases, run `cargo expand --test the_test_case` where the last +//! argument is the name of the test file without the `.rs` extension. +//! +//! This write-up by Brandon W Maister discusses debugging in more detail: +//! [Debugging Rust's new Custom Derive system][debugging]. +//! +//! [debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/ +//! +//! ## Optional features +//! +//! Syn puts a lot of functionality behind optional features in order to +//! optimize compile time for the most common use cases. The following features +//! are available. +//! +//! - **`derive`** *(enabled by default)* — Data structures for representing the +//! possible input to a custom derive, including structs and enums and types. +//! - **`full`** — Data structures for representing the syntax tree of all valid +//! Rust source code, including items and expressions. +//! - **`parsing`** *(enabled by default)* — Ability to parse input tokens into +//! a syntax tree node of a chosen type. +//! - **`printing`** *(enabled by default)* — Ability to print a syntax tree +//! node as tokens of Rust source code. +//! - **`visit`** — Trait for traversing a syntax tree. +//! - **`visit-mut`** — Trait for traversing and mutating in place a syntax +//! tree. +//! - **`fold`** — Trait for transforming an owned syntax tree. +//! - **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree +//! types. +//! - **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree +//! types. +//! - **`proc-macro`** *(enabled by default)* — Runtime dependency on the +//! dynamic library libproc_macro from rustc toolchain. + +// Syn types in rustdoc of other crates get linked to here. +#![doc(html_root_url = "https://docs.rs/syn/0.15.34")] +#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))] +#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))] +// Ignored clippy lints. +#![cfg_attr( + feature = "cargo-clippy", + allow( + block_in_if_condition_stmt, + cognitive_complexity, + const_static_lifetime, + deprecated_cfg_attr, + doc_markdown, + eval_order_dependence, + large_enum_variant, + needless_pass_by_value, + never_loop, + redundant_field_names, + too_many_arguments, + ) +)] +// Ignored clippy_pedantic lints. +#![cfg_attr( + feature = "cargo-clippy", + allow( + cast_possible_truncation, + cast_possible_wrap, + empty_enum, + if_not_else, + items_after_statements, + module_name_repetitions, + shadow_unrelated, + similar_names, + single_match_else, + unseparated_literal_suffix, + use_self, + used_underscore_binding, + ) +)] + +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" +))] +extern crate proc_macro; +extern crate proc_macro2; +extern crate unicode_xid; + +#[cfg(feature = "printing")] +extern crate quote; + +#[macro_use] +mod macros; + +// Not public API. +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[macro_use] +pub mod group; + +#[macro_use] +pub mod token; + +mod ident; +pub use ident::Ident; + +#[cfg(any(feature = "full", feature = "derive"))] +mod attr; +#[cfg(any(feature = "full", feature = "derive"))] +pub use attr::{AttrStyle, Attribute, AttributeArgs, Meta, MetaList, MetaNameValue, NestedMeta}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod data; +#[cfg(any(feature = "full", feature = "derive"))] +pub use data::{ + Field, Fields, FieldsNamed, FieldsUnnamed, Variant, VisCrate, VisPublic, VisRestricted, + Visibility, +}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod expr; +#[cfg(any(feature = "full", feature = "derive"))] +pub use expr::{ + Expr, ExprArray, ExprAssign, ExprAssignOp, ExprAsync, ExprBinary, ExprBlock, ExprBox, + ExprBreak, ExprCall, ExprCast, ExprClosure, ExprContinue, ExprField, ExprForLoop, ExprGroup, + ExprIf, ExprInPlace, ExprIndex, ExprLet, ExprLit, ExprLoop, ExprMacro, ExprMatch, + ExprMethodCall, ExprParen, ExprPath, ExprRange, ExprReference, ExprRepeat, ExprReturn, + ExprStruct, ExprTry, ExprTryBlock, ExprTuple, ExprType, ExprUnary, ExprUnsafe, ExprVerbatim, + ExprWhile, ExprYield, Index, Member, +}; + +#[cfg(feature = "full")] +pub use expr::{ + Arm, Block, FieldPat, FieldValue, GenericMethodArgument, Label, Local, MethodTurbofish, Pat, + PatBox, PatIdent, PatLit, PatMacro, PatPath, PatRange, PatRef, PatSlice, PatStruct, PatTuple, + PatTupleStruct, PatVerbatim, PatWild, RangeLimits, Stmt, +}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod generics; +#[cfg(any(feature = "full", feature = "derive"))] +pub use generics::{ + BoundLifetimes, ConstParam, GenericParam, Generics, LifetimeDef, PredicateEq, + PredicateLifetime, PredicateType, TraitBound, TraitBoundModifier, TypeParam, TypeParamBound, + WhereClause, WherePredicate, +}; +#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))] +pub use generics::{ImplGenerics, Turbofish, TypeGenerics}; + +#[cfg(feature = "full")] +mod item; +#[cfg(feature = "full")] +pub use item::{ + ArgCaptured, ArgSelf, ArgSelfRef, FnArg, FnDecl, ForeignItem, ForeignItemFn, ForeignItemMacro, + ForeignItemStatic, ForeignItemType, ForeignItemVerbatim, ImplItem, ImplItemConst, + ImplItemExistential, ImplItemMacro, ImplItemMethod, ImplItemType, ImplItemVerbatim, Item, + ItemConst, ItemEnum, ItemExistential, ItemExternCrate, ItemFn, ItemForeignMod, ItemImpl, + ItemMacro, ItemMacro2, ItemMod, ItemStatic, ItemStruct, ItemTrait, ItemTraitAlias, ItemType, + ItemUnion, ItemUse, ItemVerbatim, MethodSig, TraitItem, TraitItemConst, TraitItemMacro, + TraitItemMethod, TraitItemType, TraitItemVerbatim, UseGlob, UseGroup, UseName, UsePath, + UseRename, UseTree, +}; + +#[cfg(feature = "full")] +mod file; +#[cfg(feature = "full")] +pub use file::File; + +mod lifetime; +pub use lifetime::Lifetime; + +#[cfg(any(feature = "full", feature = "derive"))] +mod lit; +#[cfg(any(feature = "full", feature = "derive"))] +pub use lit::{ + FloatSuffix, IntSuffix, Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr, + LitVerbatim, StrStyle, +}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod mac; +#[cfg(any(feature = "full", feature = "derive"))] +pub use mac::{Macro, MacroDelimiter}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod derive; +#[cfg(feature = "derive")] +pub use derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod op; +#[cfg(any(feature = "full", feature = "derive"))] +pub use op::{BinOp, UnOp}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod ty; +#[cfg(any(feature = "full", feature = "derive"))] +pub use ty::{ + Abi, BareFnArg, BareFnArgName, ReturnType, Type, TypeArray, TypeBareFn, TypeGroup, + TypeImplTrait, TypeInfer, TypeMacro, TypeNever, TypeParen, TypePath, TypePtr, TypeReference, + TypeSlice, TypeTraitObject, TypeTuple, TypeVerbatim, +}; + +#[cfg(any(feature = "full", feature = "derive"))] +mod path; +#[cfg(any(feature = "full", feature = "derive"))] +pub use path::{ + AngleBracketedGenericArguments, Binding, Constraint, GenericArgument, + ParenthesizedGenericArguments, Path, PathArguments, PathSegment, QSelf, +}; + +#[cfg(feature = "parsing")] +pub mod buffer; +#[cfg(feature = "parsing")] +pub mod ext; +pub mod punctuated; +#[cfg(all(any(feature = "full", feature = "derive"), feature = "extra-traits"))] +mod tt; + +// Not public API except the `parse_quote!` macro. +#[cfg(feature = "parsing")] +#[doc(hidden)] +pub mod parse_quote; + +// Not public API except the `parse_macro_input!` macro. +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "parsing", + feature = "proc-macro" +))] +#[doc(hidden)] +pub mod parse_macro_input; + +#[cfg(all(feature = "parsing", feature = "printing"))] +pub mod spanned; + +mod gen { + /// Syntax tree traversal to walk a shared borrow of a syntax tree. + /// + /// Each method of the [`Visit`] trait is a hook that can be overridden to + /// customize the behavior when visiting the corresponding type of node. By + /// default, every method recursively visits the substructure of the input + /// by invoking the right visitor method of each of its fields. + /// + /// [`Visit`]: trait.Visit.html + /// + /// ```edition2018 + /// # use syn::{Attribute, BinOp, Expr, ExprBinary}; + /// # + /// pub trait Visit<'ast> { + /// /* ... */ + /// + /// fn visit_expr_binary(&mut self, node: &'ast ExprBinary) { + /// for attr in &node.attrs { + /// self.visit_attribute(attr); + /// } + /// self.visit_expr(&*node.left); + /// self.visit_bin_op(&node.op); + /// self.visit_expr(&*node.right); + /// } + /// + /// /* ... */ + /// # fn visit_attribute(&mut self, node: &'ast Attribute); + /// # fn visit_expr(&mut self, node: &'ast Expr); + /// # fn visit_bin_op(&mut self, node: &'ast BinOp); + /// } + /// ``` + /// + /// *This module is available if Syn is built with the `"visit"` feature.* + #[cfg(feature = "visit")] + pub mod visit; + + /// Syntax tree traversal to mutate an exclusive borrow of a syntax tree in + /// place. + /// + /// Each method of the [`VisitMut`] trait is a hook that can be overridden + /// to customize the behavior when mutating the corresponding type of node. + /// By default, every method recursively visits the substructure of the + /// input by invoking the right visitor method of each of its fields. + /// + /// [`VisitMut`]: trait.VisitMut.html + /// + /// ```edition2018 + /// # use syn::{Attribute, BinOp, Expr, ExprBinary}; + /// # + /// pub trait VisitMut { + /// /* ... */ + /// + /// fn visit_expr_binary_mut(&mut self, node: &mut ExprBinary) { + /// for attr in &mut node.attrs { + /// self.visit_attribute_mut(attr); + /// } + /// self.visit_expr_mut(&mut *node.left); + /// self.visit_bin_op_mut(&mut node.op); + /// self.visit_expr_mut(&mut *node.right); + /// } + /// + /// /* ... */ + /// # fn visit_attribute_mut(&mut self, node: &mut Attribute); + /// # fn visit_expr_mut(&mut self, node: &mut Expr); + /// # fn visit_bin_op_mut(&mut self, node: &mut BinOp); + /// } + /// ``` + /// + /// *This module is available if Syn is built with the `"visit-mut"` + /// feature.* + #[cfg(feature = "visit-mut")] + pub mod visit_mut; + + /// Syntax tree traversal to transform the nodes of an owned syntax tree. + /// + /// Each method of the [`Fold`] trait is a hook that can be overridden to + /// customize the behavior when transforming the corresponding type of node. + /// By default, every method recursively visits the substructure of the + /// input by invoking the right visitor method of each of its fields. + /// + /// [`Fold`]: trait.Fold.html + /// + /// ```edition2018 + /// # use syn::{Attribute, BinOp, Expr, ExprBinary}; + /// # + /// pub trait Fold { + /// /* ... */ + /// + /// fn fold_expr_binary(&mut self, node: ExprBinary) -> ExprBinary { + /// ExprBinary { + /// attrs: node.attrs + /// .into_iter() + /// .map(|attr| self.fold_attribute(attr)) + /// .collect(), + /// left: Box::new(self.fold_expr(*node.left)), + /// op: self.fold_bin_op(node.op), + /// right: Box::new(self.fold_expr(*node.right)), + /// } + /// } + /// + /// /* ... */ + /// # fn fold_attribute(&mut self, node: Attribute) -> Attribute; + /// # fn fold_expr(&mut self, node: Expr) -> Expr; + /// # fn fold_bin_op(&mut self, node: BinOp) -> BinOp; + /// } + /// ``` + /// + /// *This module is available if Syn is built with the `"fold"` feature.* + #[cfg(feature = "fold")] + pub mod fold; + + #[cfg(any(feature = "full", feature = "derive"))] + #[path = "../gen_helper.rs"] + mod helper; +} +pub use gen::*; + +// Not public API. +#[doc(hidden)] +pub mod export; + +mod custom_keyword; +mod custom_punctuation; +mod sealed; + +#[cfg(feature = "parsing")] +mod lookahead; + +#[cfg(feature = "parsing")] +pub mod parse; + +mod span; + +#[cfg(all(any(feature = "full", feature = "derive"), feature = "printing"))] +mod print; + +mod thread; + +//////////////////////////////////////////////////////////////////////////////// + +#[cfg(any(feature = "parsing", feature = "full", feature = "derive"))] +#[allow(non_camel_case_types)] +struct private; + +//////////////////////////////////////////////////////////////////////////////// + +mod error; +pub use error::{Error, Result}; + +/// Parse tokens of source code into the chosen syntax tree node. +/// +/// This is preferred over parsing a string because tokens are able to preserve +/// information about where in the user's code they were originally written (the +/// "span" of the token), possibly allowing the compiler to produce better error +/// messages. +/// +/// This function parses a `proc_macro::TokenStream` which is the type used for +/// interop with the compiler in a procedural macro. To parse a +/// `proc_macro2::TokenStream`, use [`syn::parse2`] instead. +/// +/// [`syn::parse2`]: fn.parse2.html +/// +/// *This function is available if Syn is built with both the `"parsing"` and +/// `"proc-macro"` features.* +/// +/// # Examples +/// +/// ```edition2018 +/// extern crate proc_macro; +/// +/// use proc_macro::TokenStream; +/// use quote::quote; +/// use syn::DeriveInput; +/// +/// # const IGNORE_TOKENS: &str = stringify! { +/// #[proc_macro_derive(MyMacro)] +/// # }; +/// pub fn my_macro(input: TokenStream) -> TokenStream { +/// // Parse the tokens into a syntax tree +/// let ast: DeriveInput = syn::parse(input).unwrap(); +/// +/// // Build the output, possibly using quasi-quotation +/// let expanded = quote! { +/// /* ... */ +/// }; +/// +/// // Convert into a token stream and return it +/// expanded.into() +/// } +/// ``` +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "parsing", + feature = "proc-macro" +))] +pub fn parse(tokens: proc_macro::TokenStream) -> Result { + parse::Parser::parse(T::parse, tokens) +} + +/// Parse a proc-macro2 token stream into the chosen syntax tree node. +/// +/// This function parses a `proc_macro2::TokenStream` which is commonly useful +/// when the input comes from a node of the Syn syntax tree, for example the tts +/// of a [`Macro`] node. When in a procedural macro parsing the +/// `proc_macro::TokenStream` provided by the compiler, use [`syn::parse`] +/// instead. +/// +/// [`Macro`]: struct.Macro.html +/// [`syn::parse`]: fn.parse.html +/// +/// *This function is available if Syn is built with the `"parsing"` feature.* +#[cfg(feature = "parsing")] +pub fn parse2(tokens: proc_macro2::TokenStream) -> Result { + parse::Parser::parse2(T::parse, tokens) +} + +/// Parse a string of Rust code into the chosen syntax tree node. +/// +/// *This function is available if Syn is built with the `"parsing"` feature.* +/// +/// # Hygiene +/// +/// Every span in the resulting syntax tree will be set to resolve at the macro +/// call site. +/// +/// # Examples +/// +/// ```edition2018 +/// use syn::{Expr, Result}; +/// +/// fn run() -> Result<()> { +/// let code = "assert_eq!(u8::max_value(), 255)"; +/// let expr = syn::parse_str::(code)?; +/// println!("{:#?}", expr); +/// Ok(()) +/// } +/// # +/// # fn main() { +/// # run().unwrap(); +/// # } +/// ``` +#[cfg(feature = "parsing")] +pub fn parse_str(s: &str) -> Result { + parse::Parser::parse_str(T::parse, s) +} + +// FIXME the name parse_file makes it sound like you might pass in a path to a +// file, rather than the content. +/// Parse the content of a file of Rust code. +/// +/// This is different from `syn::parse_str::(content)` in two ways: +/// +/// - It discards a leading byte order mark `\u{FEFF}` if the file has one. +/// - It preserves the shebang line of the file, such as `#!/usr/bin/env rustx`. +/// +/// If present, either of these would be an error using `from_str`. +/// +/// *This function is available if Syn is built with the `"parsing"` and +/// `"full"` features.* +/// +/// # Examples +/// +/// ```edition2018,no_run +/// use std::error::Error; +/// use std::fs::File; +/// use std::io::Read; +/// +/// fn run() -> Result<(), Box> { +/// let mut file = File::open("path/to/code.rs")?; +/// let mut content = String::new(); +/// file.read_to_string(&mut content)?; +/// +/// let ast = syn::parse_file(&content)?; +/// if let Some(shebang) = ast.shebang { +/// println!("{}", shebang); +/// } +/// println!("{} items", ast.items.len()); +/// +/// Ok(()) +/// } +/// # +/// # fn main() { +/// # run().unwrap(); +/// # } +/// ``` +#[cfg(all(feature = "parsing", feature = "full"))] +pub fn parse_file(mut content: &str) -> Result { + // Strip the BOM if it is present + const BOM: &'static str = "\u{feff}"; + if content.starts_with(BOM) { + content = &content[BOM.len()..]; + } + + let mut shebang = None; + if content.starts_with("#!") && !content.starts_with("#![") { + if let Some(idx) = content.find('\n') { + shebang = Some(content[..idx].to_string()); + content = &content[idx..]; + } else { + shebang = Some(content.to_string()); + content = ""; + } + } + + let mut file: File = parse_str(content)?; + file.shebang = shebang; + Ok(file) +} diff --git a/vendor/registry-40351f815f426200/syn/src/lifetime.rs b/vendor/registry-40351f815f426200/syn/src/lifetime.rs new file mode 100644 index 000000000..461560c91 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/lifetime.rs @@ -0,0 +1,155 @@ +use std::cmp::Ordering; +use std::fmt::{self, Display}; +use std::hash::{Hash, Hasher}; + +use proc_macro2::{Ident, Span}; +use unicode_xid::UnicodeXID; + +#[cfg(feature = "parsing")] +use lookahead; + +/// A Rust lifetime: `'a`. +/// +/// Lifetime names must conform to the following rules: +/// +/// - Must start with an apostrophe. +/// - Must not consist of just an apostrophe: `'`. +/// - Character after the apostrophe must be `_` or a Unicode code point with +/// the XID_Start property. +/// - All following characters must be Unicode code points with the XID_Continue +/// property. +/// +/// *This type is available if Syn is built with the `"derive"` or `"full"` +/// feature.* +#[cfg_attr(feature = "extra-traits", derive(Debug))] +#[derive(Clone)] +pub struct Lifetime { + pub apostrophe: Span, + pub ident: Ident, +} + +impl Lifetime { + /// # Panics + /// + /// Panics if the lifetime does not conform to the bulleted rules above. + /// + /// # Invocation + /// + /// ```edition2018 + /// # use proc_macro2::Span; + /// # use syn::Lifetime; + /// # + /// # fn f() -> Lifetime { + /// Lifetime::new("'a", Span::call_site()) + /// # } + /// ``` + pub fn new(symbol: &str, span: Span) -> Self { + if !symbol.starts_with('\'') { + panic!( + "lifetime name must start with apostrophe as in \"'a\", got {:?}", + symbol + ); + } + + if symbol == "'" { + panic!("lifetime name must not be empty"); + } + + fn xid_ok(symbol: &str) -> bool { + let mut chars = symbol.chars(); + let first = chars.next().unwrap(); + if !(UnicodeXID::is_xid_start(first) || first == '_') { + return false; + } + for ch in chars { + if !UnicodeXID::is_xid_continue(ch) { + return false; + } + } + true + } + + if !xid_ok(&symbol[1..]) { + panic!("{:?} is not a valid lifetime name", symbol); + } + + Lifetime { + apostrophe: span, + ident: Ident::new(&symbol[1..], span), + } + } +} + +impl Display for Lifetime { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + "'".fmt(formatter)?; + self.ident.fmt(formatter) + } +} + +impl PartialEq for Lifetime { + fn eq(&self, other: &Lifetime) -> bool { + self.ident.eq(&other.ident) + } +} + +impl Eq for Lifetime {} + +impl PartialOrd for Lifetime { + fn partial_cmp(&self, other: &Lifetime) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for Lifetime { + fn cmp(&self, other: &Lifetime) -> Ordering { + self.ident.cmp(&other.ident) + } +} + +impl Hash for Lifetime { + fn hash(&self, h: &mut H) { + self.ident.hash(h) + } +} + +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[allow(non_snake_case)] +pub fn Lifetime(marker: lookahead::TokenMarker) -> Lifetime { + match marker {} +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + + impl Parse for Lifetime { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| { + cursor + .lifetime() + .ok_or_else(|| cursor.error("expected lifetime")) + }) + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::{Punct, Spacing, TokenStream}; + use quote::{ToTokens, TokenStreamExt}; + + impl ToTokens for Lifetime { + fn to_tokens(&self, tokens: &mut TokenStream) { + let mut apostrophe = Punct::new('\'', Spacing::Joint); + apostrophe.set_span(self.apostrophe); + tokens.append(apostrophe); + self.ident.to_tokens(tokens); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/lit.rs b/vendor/registry-40351f815f426200/syn/src/lit.rs new file mode 100644 index 000000000..3a66cb763 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/lit.rs @@ -0,0 +1,1103 @@ +use proc_macro2::{Literal, Span}; +use std::str; + +#[cfg(feature = "printing")] +use proc_macro2::Ident; + +#[cfg(feature = "parsing")] +use proc_macro2::TokenStream; + +use proc_macro2::TokenTree; + +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; + +#[cfg(feature = "parsing")] +use lookahead; +#[cfg(feature = "parsing")] +use parse::{Parse, Parser, Result}; + +ast_enum_of_structs! { + /// A Rust literal such as a string or integer or boolean. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Lit { + /// A UTF-8 string literal: `"foo"`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Str(LitStr #manual_extra_traits { + token: Literal, + }), + + /// A byte string literal: `b"foo"`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub ByteStr(LitByteStr #manual_extra_traits { + token: Literal, + }), + + /// A byte literal: `b'f'`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Byte(LitByte #manual_extra_traits { + token: Literal, + }), + + /// A character literal: `'a'`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Char(LitChar #manual_extra_traits { + token: Literal, + }), + + /// An integer literal: `1` or `1u16`. + /// + /// Holds up to 64 bits of data. Use `LitVerbatim` for any larger + /// integer literal. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Int(LitInt #manual_extra_traits { + token: Literal, + }), + + /// A floating point literal: `1f64` or `1.0e10f64`. + /// + /// Must be finite. May not be infinte or NaN. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Float(LitFloat #manual_extra_traits { + token: Literal, + }), + + /// A boolean literal: `true` or `false`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Bool(LitBool #manual_extra_traits { + pub value: bool, + pub span: Span, + }), + + /// A raw token literal not interpreted by Syn, possibly because it + /// represents an integer larger than 64 bits. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Verbatim(LitVerbatim #manual_extra_traits { + pub token: Literal, + }), + } +} + +impl LitStr { + pub fn new(value: &str, span: Span) -> Self { + let mut lit = Literal::string(value); + lit.set_span(span); + LitStr { token: lit } + } + + pub fn value(&self) -> String { + value::parse_lit_str(&self.token.to_string()) + } + + /// Parse a syntax tree node from the content of this string literal. + /// + /// All spans in the syntax tree will point to the span of this `LitStr`. + /// + /// # Example + /// + /// ```edition2018 + /// use proc_macro2::Span; + /// use syn::{Attribute, Error, Ident, Lit, Meta, MetaNameValue, Path, Result}; + /// + /// // Parses the path from an attribute that looks like: + /// // + /// // #[path = "a::b::c"] + /// // + /// // or returns `None` if the input is some other attribute. + /// fn get_path(attr: &Attribute) -> Result> { + /// if !attr.path.is_ident("path") { + /// return Ok(None); + /// } + /// + /// match attr.parse_meta()? { + /// Meta::NameValue(MetaNameValue { lit: Lit::Str(lit_str), .. }) => { + /// lit_str.parse().map(Some) + /// } + /// _ => { + /// let message = "expected #[path = \"...\"]"; + /// Err(Error::new_spanned(attr, message)) + /// } + /// } + /// } + /// ``` + #[cfg(feature = "parsing")] + pub fn parse(&self) -> Result { + self.parse_with(T::parse) + } + + /// Invoke parser on the content of this string literal. + /// + /// All spans in the syntax tree will point to the span of this `LitStr`. + /// + /// # Example + /// + /// ```edition2018 + /// # use proc_macro2::Span; + /// # use syn::{LitStr, Result}; + /// # + /// # fn main() -> Result<()> { + /// # let lit_str = LitStr::new("a::b::c", Span::call_site()); + /// # + /// # const IGNORE: &str = stringify! { + /// let lit_str: LitStr = /* ... */; + /// # }; + /// + /// // Parse a string literal like "a::b::c" into a Path, not allowing + /// // generic arguments on any of the path segments. + /// let basic_path = lit_str.parse_with(syn::Path::parse_mod_style)?; + /// # + /// # Ok(()) + /// # } + /// ``` + #[cfg(feature = "parsing")] + pub fn parse_with(&self, parser: F) -> Result { + use proc_macro2::Group; + + // Token stream with every span replaced by the given one. + fn respan_token_stream(stream: TokenStream, span: Span) -> TokenStream { + stream + .into_iter() + .map(|token| respan_token_tree(token, span)) + .collect() + } + + // Token tree with every span replaced by the given one. + fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree { + match token { + TokenTree::Group(ref mut g) => { + let stream = respan_token_stream(g.stream().clone(), span); + *g = Group::new(g.delimiter(), stream); + g.set_span(span); + } + ref mut other => other.set_span(span), + } + token + } + + // Parse string literal into a token stream with every span equal to the + // original literal's span. + let mut tokens = ::parse_str(&self.value())?; + tokens = respan_token_stream(tokens, self.span()); + + parser.parse2(tokens) + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +impl LitByteStr { + pub fn new(value: &[u8], span: Span) -> Self { + let mut token = Literal::byte_string(value); + token.set_span(span); + LitByteStr { token: token } + } + + pub fn value(&self) -> Vec { + value::parse_lit_byte_str(&self.token.to_string()) + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +impl LitByte { + pub fn new(value: u8, span: Span) -> Self { + let mut token = Literal::u8_suffixed(value); + token.set_span(span); + LitByte { token: token } + } + + pub fn value(&self) -> u8 { + value::parse_lit_byte(&self.token.to_string()) + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +impl LitChar { + pub fn new(value: char, span: Span) -> Self { + let mut token = Literal::character(value); + token.set_span(span); + LitChar { token: token } + } + + pub fn value(&self) -> char { + value::parse_lit_char(&self.token.to_string()) + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +impl LitInt { + pub fn new(value: u64, suffix: IntSuffix, span: Span) -> Self { + let mut token = match suffix { + IntSuffix::Isize => Literal::isize_suffixed(value as isize), + IntSuffix::I8 => Literal::i8_suffixed(value as i8), + IntSuffix::I16 => Literal::i16_suffixed(value as i16), + IntSuffix::I32 => Literal::i32_suffixed(value as i32), + IntSuffix::I64 => Literal::i64_suffixed(value as i64), + IntSuffix::I128 => value::to_literal(&format!("{}i128", value)), + IntSuffix::Usize => Literal::usize_suffixed(value as usize), + IntSuffix::U8 => Literal::u8_suffixed(value as u8), + IntSuffix::U16 => Literal::u16_suffixed(value as u16), + IntSuffix::U32 => Literal::u32_suffixed(value as u32), + IntSuffix::U64 => Literal::u64_suffixed(value), + IntSuffix::U128 => value::to_literal(&format!("{}u128", value)), + IntSuffix::None => Literal::u64_unsuffixed(value), + }; + token.set_span(span); + LitInt { token: token } + } + + pub fn value(&self) -> u64 { + value::parse_lit_int(&self.token.to_string()).unwrap() + } + + pub fn suffix(&self) -> IntSuffix { + let value = self.token.to_string(); + for (s, suffix) in vec![ + ("i8", IntSuffix::I8), + ("i16", IntSuffix::I16), + ("i32", IntSuffix::I32), + ("i64", IntSuffix::I64), + ("i128", IntSuffix::I128), + ("isize", IntSuffix::Isize), + ("u8", IntSuffix::U8), + ("u16", IntSuffix::U16), + ("u32", IntSuffix::U32), + ("u64", IntSuffix::U64), + ("u128", IntSuffix::U128), + ("usize", IntSuffix::Usize), + ] { + if value.ends_with(s) { + return suffix; + } + } + IntSuffix::None + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +impl LitFloat { + pub fn new(value: f64, suffix: FloatSuffix, span: Span) -> Self { + let mut token = match suffix { + FloatSuffix::F32 => Literal::f32_suffixed(value as f32), + FloatSuffix::F64 => Literal::f64_suffixed(value), + FloatSuffix::None => Literal::f64_unsuffixed(value), + }; + token.set_span(span); + LitFloat { token: token } + } + + pub fn value(&self) -> f64 { + value::parse_lit_float(&self.token.to_string()) + } + + pub fn suffix(&self) -> FloatSuffix { + let value = self.token.to_string(); + for (s, suffix) in vec![("f32", FloatSuffix::F32), ("f64", FloatSuffix::F64)] { + if value.ends_with(s) { + return suffix; + } + } + FloatSuffix::None + } + + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +macro_rules! lit_extra_traits { + ($ty:ident, $field:ident) => { + #[cfg(feature = "extra-traits")] + impl Eq for $ty {} + + #[cfg(feature = "extra-traits")] + impl PartialEq for $ty { + fn eq(&self, other: &Self) -> bool { + self.$field.to_string() == other.$field.to_string() + } + } + + #[cfg(feature = "extra-traits")] + impl Hash for $ty { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + self.$field.to_string().hash(state); + } + } + + #[cfg(feature = "parsing")] + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $ty(marker: lookahead::TokenMarker) -> $ty { + match marker {} + } + }; +} + +impl LitVerbatim { + pub fn span(&self) -> Span { + self.token.span() + } + + pub fn set_span(&mut self, span: Span) { + self.token.set_span(span) + } +} + +lit_extra_traits!(LitStr, token); +lit_extra_traits!(LitByteStr, token); +lit_extra_traits!(LitByte, token); +lit_extra_traits!(LitChar, token); +lit_extra_traits!(LitInt, token); +lit_extra_traits!(LitFloat, token); +lit_extra_traits!(LitBool, value); +lit_extra_traits!(LitVerbatim, token); + +ast_enum! { + /// The style of a string literal, either plain quoted or a raw string like + /// `r##"data"##`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum StrStyle #no_visit { + /// An ordinary string like `"data"`. + Cooked, + /// A raw string like `r##"data"##`. + /// + /// The unsigned integer is the number of `#` symbols used. + Raw(usize), + } +} + +ast_enum! { + /// The suffix on an integer literal if any, like the `u8` in `127u8`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum IntSuffix #no_visit { + I8, + I16, + I32, + I64, + I128, + Isize, + U8, + U16, + U32, + U64, + U128, + Usize, + None, + } +} + +ast_enum! { + /// The suffix on a floating point literal if any, like the `f32` in + /// `1.0f32`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum FloatSuffix #no_visit { + F32, + F64, + None, + } +} + +#[cfg(feature = "parsing")] +#[doc(hidden)] +#[allow(non_snake_case)] +pub fn Lit(marker: lookahead::TokenMarker) -> Lit { + match marker {} +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + use parse::{Parse, ParseStream, Result}; + + impl Parse for Lit { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| { + if let Some((lit, rest)) = cursor.literal() { + return Ok((Lit::new(lit), rest)); + } + while let Some((ident, rest)) = cursor.ident() { + let value = if ident == "true" { + true + } else if ident == "false" { + false + } else { + break; + }; + let lit_bool = LitBool { + value: value, + span: ident.span(), + }; + return Ok((Lit::Bool(lit_bool), rest)); + } + Err(cursor.error("expected literal")) + }) + } + } + + impl Parse for LitStr { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Str(lit) => Ok(lit), + _ => Err(head.error("expected string literal")), + } + } + } + + impl Parse for LitByteStr { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::ByteStr(lit) => Ok(lit), + _ => Err(head.error("expected byte string literal")), + } + } + } + + impl Parse for LitByte { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Byte(lit) => Ok(lit), + _ => Err(head.error("expected byte literal")), + } + } + } + + impl Parse for LitChar { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Char(lit) => Ok(lit), + _ => Err(head.error("expected character literal")), + } + } + } + + impl Parse for LitInt { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Int(lit) => Ok(lit), + _ => Err(head.error("expected integer literal")), + } + } + } + + impl Parse for LitFloat { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Float(lit) => Ok(lit), + _ => Err(head.error("expected floating point literal")), + } + } + } + + impl Parse for LitBool { + fn parse(input: ParseStream) -> Result { + let head = input.fork(); + match input.parse()? { + Lit::Bool(lit) => Ok(lit), + _ => Err(head.error("expected boolean literal")), + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + use proc_macro2::TokenStream; + use quote::{ToTokens, TokenStreamExt}; + + impl ToTokens for LitStr { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitByteStr { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitByte { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitChar { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitInt { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitFloat { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } + + impl ToTokens for LitBool { + fn to_tokens(&self, tokens: &mut TokenStream) { + let s = if self.value { "true" } else { "false" }; + tokens.append(Ident::new(s, self.span)); + } + } + + impl ToTokens for LitVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.token.to_tokens(tokens); + } + } +} + +mod value { + use super::*; + use proc_macro2::TokenStream; + use std::char; + use std::ops::{Index, RangeFrom}; + + impl Lit { + /// Interpret a Syn literal from a proc-macro2 literal. + /// + /// Not all proc-macro2 literals are valid Syn literals. In particular, + /// doc comments are considered by proc-macro2 to be literals but in Syn + /// they are [`Attribute`]. + /// + /// [`Attribute`]: struct.Attribute.html + /// + /// # Panics + /// + /// Panics if the input is a doc comment literal. + pub fn new(token: Literal) -> Self { + let value = token.to_string(); + + match value::byte(&value, 0) { + b'"' | b'r' => return Lit::Str(LitStr { token: token }), + b'b' => match value::byte(&value, 1) { + b'"' | b'r' => return Lit::ByteStr(LitByteStr { token: token }), + b'\'' => return Lit::Byte(LitByte { token: token }), + _ => {} + }, + b'\'' => return Lit::Char(LitChar { token: token }), + b'0'...b'9' => { + if number_is_int(&value) { + return Lit::Int(LitInt { token: token }); + } else if number_is_float(&value) { + return Lit::Float(LitFloat { token: token }); + } else { + // number overflow + return Lit::Verbatim(LitVerbatim { token: token }); + } + } + _ => { + if value == "true" || value == "false" { + return Lit::Bool(LitBool { + value: value == "true", + span: token.span(), + }); + } + } + } + + panic!("Unrecognized literal: {}", value); + } + } + + fn number_is_int(value: &str) -> bool { + if number_is_float(value) { + false + } else { + value::parse_lit_int(value).is_some() + } + } + + fn number_is_float(value: &str) -> bool { + if value.contains('.') { + true + } else if value.starts_with("0x") || value.ends_with("size") { + false + } else { + value.contains('e') || value.contains('E') + } + } + + /// Get the byte at offset idx, or a default of `b'\0'` if we're looking + /// past the end of the input buffer. + pub fn byte + ?Sized>(s: &S, idx: usize) -> u8 { + let s = s.as_ref(); + if idx < s.len() { + s[idx] + } else { + 0 + } + } + + fn next_chr(s: &str) -> char { + s.chars().next().unwrap_or('\0') + } + + pub fn parse_lit_str(s: &str) -> String { + match byte(s, 0) { + b'"' => parse_lit_str_cooked(s), + b'r' => parse_lit_str_raw(s), + _ => unreachable!(), + } + } + + // Clippy false positive + // https://github.com/rust-lang-nursery/rust-clippy/issues/2329 + #[cfg_attr(feature = "cargo-clippy", allow(needless_continue))] + fn parse_lit_str_cooked(mut s: &str) -> String { + assert_eq!(byte(s, 0), b'"'); + s = &s[1..]; + + let mut out = String::new(); + 'outer: loop { + let ch = match byte(s, 0) { + b'"' => break, + b'\\' => { + let b = byte(s, 1); + s = &s[2..]; + match b { + b'x' => { + let (byte, rest) = backslash_x(s); + s = rest; + assert!(byte <= 0x80, "Invalid \\x byte in string literal"); + char::from_u32(u32::from(byte)).unwrap() + } + b'u' => { + let (chr, rest) = backslash_u(s); + s = rest; + chr + } + b'n' => '\n', + b'r' => '\r', + b't' => '\t', + b'\\' => '\\', + b'0' => '\0', + b'\'' => '\'', + b'"' => '"', + b'\r' | b'\n' => loop { + let ch = next_chr(s); + if ch.is_whitespace() { + s = &s[ch.len_utf8()..]; + } else { + continue 'outer; + } + }, + b => panic!("unexpected byte {:?} after \\ character in byte literal", b), + } + } + b'\r' => { + assert_eq!(byte(s, 1), b'\n', "Bare CR not allowed in string"); + s = &s[2..]; + '\n' + } + _ => { + let ch = next_chr(s); + s = &s[ch.len_utf8()..]; + ch + } + }; + out.push(ch); + } + + assert_eq!(s, "\""); + out + } + + fn parse_lit_str_raw(mut s: &str) -> String { + assert_eq!(byte(s, 0), b'r'); + s = &s[1..]; + + let mut pounds = 0; + while byte(s, pounds) == b'#' { + pounds += 1; + } + assert_eq!(byte(s, pounds), b'"'); + assert_eq!(byte(s, s.len() - pounds - 1), b'"'); + for end in s[s.len() - pounds..].bytes() { + assert_eq!(end, b'#'); + } + + s[pounds + 1..s.len() - pounds - 1].to_owned() + } + + pub fn parse_lit_byte_str(s: &str) -> Vec { + assert_eq!(byte(s, 0), b'b'); + match byte(s, 1) { + b'"' => parse_lit_byte_str_cooked(s), + b'r' => parse_lit_byte_str_raw(s), + _ => unreachable!(), + } + } + + // Clippy false positive + // https://github.com/rust-lang-nursery/rust-clippy/issues/2329 + #[cfg_attr(feature = "cargo-clippy", allow(needless_continue))] + fn parse_lit_byte_str_cooked(mut s: &str) -> Vec { + assert_eq!(byte(s, 0), b'b'); + assert_eq!(byte(s, 1), b'"'); + s = &s[2..]; + + // We're going to want to have slices which don't respect codepoint boundaries. + let mut s = s.as_bytes(); + + let mut out = Vec::new(); + 'outer: loop { + let byte = match byte(s, 0) { + b'"' => break, + b'\\' => { + let b = byte(s, 1); + s = &s[2..]; + match b { + b'x' => { + let (b, rest) = backslash_x(s); + s = rest; + b + } + b'n' => b'\n', + b'r' => b'\r', + b't' => b'\t', + b'\\' => b'\\', + b'0' => b'\0', + b'\'' => b'\'', + b'"' => b'"', + b'\r' | b'\n' => loop { + let byte = byte(s, 0); + let ch = char::from_u32(u32::from(byte)).unwrap(); + if ch.is_whitespace() { + s = &s[1..]; + } else { + continue 'outer; + } + }, + b => panic!("unexpected byte {:?} after \\ character in byte literal", b), + } + } + b'\r' => { + assert_eq!(byte(s, 1), b'\n', "Bare CR not allowed in string"); + s = &s[2..]; + b'\n' + } + b => { + s = &s[1..]; + b + } + }; + out.push(byte); + } + + assert_eq!(s, b"\""); + out + } + + fn parse_lit_byte_str_raw(s: &str) -> Vec { + assert_eq!(byte(s, 0), b'b'); + parse_lit_str_raw(&s[1..]).into_bytes() + } + + pub fn parse_lit_byte(s: &str) -> u8 { + assert_eq!(byte(s, 0), b'b'); + assert_eq!(byte(s, 1), b'\''); + + // We're going to want to have slices which don't respect codepoint boundaries. + let mut s = s[2..].as_bytes(); + + let b = match byte(s, 0) { + b'\\' => { + let b = byte(s, 1); + s = &s[2..]; + match b { + b'x' => { + let (b, rest) = backslash_x(s); + s = rest; + b + } + b'n' => b'\n', + b'r' => b'\r', + b't' => b'\t', + b'\\' => b'\\', + b'0' => b'\0', + b'\'' => b'\'', + b'"' => b'"', + b => panic!("unexpected byte {:?} after \\ character in byte literal", b), + } + } + b => { + s = &s[1..]; + b + } + }; + + assert_eq!(byte(s, 0), b'\''); + b + } + + pub fn parse_lit_char(mut s: &str) -> char { + assert_eq!(byte(s, 0), b'\''); + s = &s[1..]; + + let ch = match byte(s, 0) { + b'\\' => { + let b = byte(s, 1); + s = &s[2..]; + match b { + b'x' => { + let (byte, rest) = backslash_x(s); + s = rest; + assert!(byte <= 0x80, "Invalid \\x byte in string literal"); + char::from_u32(u32::from(byte)).unwrap() + } + b'u' => { + let (chr, rest) = backslash_u(s); + s = rest; + chr + } + b'n' => '\n', + b'r' => '\r', + b't' => '\t', + b'\\' => '\\', + b'0' => '\0', + b'\'' => '\'', + b'"' => '"', + b => panic!("unexpected byte {:?} after \\ character in byte literal", b), + } + } + _ => { + let ch = next_chr(s); + s = &s[ch.len_utf8()..]; + ch + } + }; + assert_eq!(s, "\'", "Expected end of char literal"); + ch + } + + fn backslash_x(s: &S) -> (u8, &S) + where + S: Index, Output = S> + AsRef<[u8]> + ?Sized, + { + let mut ch = 0; + let b0 = byte(s, 0); + let b1 = byte(s, 1); + ch += 0x10 + * match b0 { + b'0'...b'9' => b0 - b'0', + b'a'...b'f' => 10 + (b0 - b'a'), + b'A'...b'F' => 10 + (b0 - b'A'), + _ => panic!("unexpected non-hex character after \\x"), + }; + ch += match b1 { + b'0'...b'9' => b1 - b'0', + b'a'...b'f' => 10 + (b1 - b'a'), + b'A'...b'F' => 10 + (b1 - b'A'), + _ => panic!("unexpected non-hex character after \\x"), + }; + (ch, &s[2..]) + } + + fn backslash_u(mut s: &str) -> (char, &str) { + if byte(s, 0) != b'{' { + panic!("expected {{ after \\u"); + } + s = &s[1..]; + + let mut ch = 0; + for _ in 0..6 { + let b = byte(s, 0); + match b { + b'0'...b'9' => { + ch *= 0x10; + ch += u32::from(b - b'0'); + s = &s[1..]; + } + b'a'...b'f' => { + ch *= 0x10; + ch += u32::from(10 + b - b'a'); + s = &s[1..]; + } + b'A'...b'F' => { + ch *= 0x10; + ch += u32::from(10 + b - b'A'); + s = &s[1..]; + } + b'}' => break, + _ => panic!("unexpected non-hex character after \\u"), + } + } + assert!(byte(s, 0) == b'}'); + s = &s[1..]; + + if let Some(ch) = char::from_u32(ch) { + (ch, s) + } else { + panic!("character code {:x} is not a valid unicode character", ch); + } + } + + pub fn parse_lit_int(mut s: &str) -> Option { + let base = match (byte(s, 0), byte(s, 1)) { + (b'0', b'x') => { + s = &s[2..]; + 16 + } + (b'0', b'o') => { + s = &s[2..]; + 8 + } + (b'0', b'b') => { + s = &s[2..]; + 2 + } + (b'0'...b'9', _) => 10, + _ => unreachable!(), + }; + + let mut value = 0u64; + loop { + let b = byte(s, 0); + let digit = match b { + b'0'...b'9' => u64::from(b - b'0'), + b'a'...b'f' if base > 10 => 10 + u64::from(b - b'a'), + b'A'...b'F' if base > 10 => 10 + u64::from(b - b'A'), + b'_' => { + s = &s[1..]; + continue; + } + // NOTE: Looking at a floating point literal, we don't want to + // consider these integers. + b'.' if base == 10 => return None, + b'e' | b'E' if base == 10 => return None, + _ => break, + }; + + if digit >= base { + panic!("Unexpected digit {:x} out of base range", digit); + } + + value = match value.checked_mul(base) { + Some(value) => value, + None => return None, + }; + value = match value.checked_add(digit) { + Some(value) => value, + None => return None, + }; + s = &s[1..]; + } + + Some(value) + } + + pub fn parse_lit_float(input: &str) -> f64 { + // Rust's floating point literals are very similar to the ones parsed by + // the standard library, except that rust's literals can contain + // ignorable underscores. Let's remove those underscores. + let mut bytes = input.to_owned().into_bytes(); + let mut write = 0; + for read in 0..bytes.len() { + if bytes[read] == b'_' { + continue; // Don't increase write + } + if write != read { + let x = bytes[read]; + bytes[write] = x; + } + write += 1; + } + bytes.truncate(write); + let input = String::from_utf8(bytes).unwrap(); + let end = input.find('f').unwrap_or_else(|| input.len()); + input[..end].parse().unwrap() + } + + pub fn to_literal(s: &str) -> Literal { + let stream = s.parse::().unwrap(); + match stream.into_iter().next().unwrap() { + TokenTree::Literal(l) => l, + _ => unreachable!(), + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/lookahead.rs b/vendor/registry-40351f815f426200/syn/src/lookahead.rs new file mode 100644 index 000000000..0f5afe189 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/lookahead.rs @@ -0,0 +1,168 @@ +use std::cell::RefCell; + +use proc_macro2::{Delimiter, Span}; + +use buffer::Cursor; +use error::{self, Error}; +use sealed::lookahead::Sealed; +use span::IntoSpans; +use token::Token; + +/// Support for checking the next token in a stream to decide how to parse. +/// +/// An important advantage over [`ParseStream::peek`] is that here we +/// automatically construct an appropriate error message based on the token +/// alternatives that get peeked. If you are producing your own error message, +/// go ahead and use `ParseStream::peek` instead. +/// +/// Use [`ParseStream::lookahead1`] to construct this object. +/// +/// [`ParseStream::peek`]: struct.ParseBuffer.html#method.peek +/// [`ParseStream::lookahead1`]: struct.ParseBuffer.html#method.lookahead1 +/// +/// # Example +/// +/// ```edition2018 +/// use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam}; +/// use syn::parse::{Parse, ParseStream}; +/// +/// // A generic parameter, a single one of the comma-separated elements inside +/// // angle brackets in: +/// // +/// // fn f() { ... } +/// // +/// // On invalid input, lookahead gives us a reasonable error message. +/// // +/// // error: expected one of: identifier, lifetime, `const` +/// // | +/// // 5 | fn f() {} +/// // | ^ +/// enum GenericParam { +/// Type(TypeParam), +/// Lifetime(LifetimeDef), +/// Const(ConstParam), +/// } +/// +/// impl Parse for GenericParam { +/// fn parse(input: ParseStream) -> Result { +/// let lookahead = input.lookahead1(); +/// if lookahead.peek(Ident) { +/// input.parse().map(GenericParam::Type) +/// } else if lookahead.peek(Lifetime) { +/// input.parse().map(GenericParam::Lifetime) +/// } else if lookahead.peek(Token![const]) { +/// input.parse().map(GenericParam::Const) +/// } else { +/// Err(lookahead.error()) +/// } +/// } +/// } +/// ``` +pub struct Lookahead1<'a> { + scope: Span, + cursor: Cursor<'a>, + comparisons: RefCell>, +} + +pub fn new(scope: Span, cursor: Cursor) -> Lookahead1 { + Lookahead1 { + scope: scope, + cursor: cursor, + comparisons: RefCell::new(Vec::new()), + } +} + +fn peek_impl( + lookahead: &Lookahead1, + peek: fn(Cursor) -> bool, + display: fn() -> &'static str, +) -> bool { + if peek(lookahead.cursor) { + return true; + } + lookahead.comparisons.borrow_mut().push(display()); + false +} + +impl<'a> Lookahead1<'a> { + /// Looks at the next token in the parse stream to determine whether it + /// matches the requested type of token. + /// + /// # Syntax + /// + /// Note that this method does not use turbofish syntax. Pass the peek type + /// inside of parentheses. + /// + /// - `input.peek(Token![struct])` + /// - `input.peek(Token![==])` + /// - `input.peek(Ident)` *(does not accept keywords)* + /// - `input.peek(Ident::peek_any)` + /// - `input.peek(Lifetime)` + /// - `input.peek(token::Brace)` + pub fn peek(&self, token: T) -> bool { + let _ = token; + peek_impl(self, T::Token::peek, T::Token::display) + } + + /// Triggers an error at the current position of the parse stream. + /// + /// The error message will identify all of the expected token types that + /// have been peeked against this lookahead instance. + pub fn error(self) -> Error { + let comparisons = self.comparisons.borrow(); + match comparisons.len() { + 0 => { + if self.cursor.eof() { + Error::new(self.scope, "unexpected end of input") + } else { + Error::new(self.cursor.span(), "unexpected token") + } + } + 1 => { + let message = format!("expected {}", comparisons[0]); + error::new_at(self.scope, self.cursor, message) + } + 2 => { + let message = format!("expected {} or {}", comparisons[0], comparisons[1]); + error::new_at(self.scope, self.cursor, message) + } + _ => { + let join = comparisons.join(", "); + let message = format!("expected one of: {}", join); + error::new_at(self.scope, self.cursor, message) + } + } + } +} + +/// Types that can be parsed by looking at just one token. +/// +/// Use [`ParseStream::peek`] to peek one of these types in a parse stream +/// without consuming it from the stream. +/// +/// This trait is sealed and cannot be implemented for types outside of Syn. +/// +/// [`ParseStream::peek`]: struct.ParseBuffer.html#method.peek +pub trait Peek: Sealed { + // Not public API. + #[doc(hidden)] + type Token: Token; +} + +impl T, T: Token> Peek for F { + type Token = T; +} + +pub enum TokenMarker {} + +impl IntoSpans for TokenMarker { + fn into_spans(self) -> S { + match self {} + } +} + +pub fn is_delimiter(cursor: Cursor, delimiter: Delimiter) -> bool { + cursor.group(delimiter).is_some() +} + +impl T, T: Token> Sealed for F {} diff --git a/vendor/registry-40351f815f426200/syn/src/mac.rs b/vendor/registry-40351f815f426200/syn/src/mac.rs new file mode 100644 index 000000000..46dc5dd57 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/mac.rs @@ -0,0 +1,131 @@ +use super::*; +use proc_macro2::TokenStream; +#[cfg(feature = "parsing")] +use proc_macro2::{Delimiter, TokenTree}; +use token::{Brace, Bracket, Paren}; + +#[cfg(feature = "parsing")] +use parse::{ParseStream, Result}; +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +#[cfg(feature = "extra-traits")] +use tt::TokenStreamHelper; + +ast_struct! { + /// A macro invocation: `println!("{}", mac)`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Macro #manual_extra_traits { + pub path: Path, + pub bang_token: Token![!], + pub delimiter: MacroDelimiter, + pub tts: TokenStream, + } +} + +ast_enum! { + /// A grouping token that surrounds a macro body: `m!(...)` or `m!{...}` or `m![...]`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum MacroDelimiter { + Paren(Paren), + Brace(Brace), + Bracket(Bracket), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for Macro {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for Macro { + fn eq(&self, other: &Self) -> bool { + self.path == other.path + && self.bang_token == other.bang_token + && self.delimiter == other.delimiter + && TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for Macro { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + self.path.hash(state); + self.bang_token.hash(state); + self.delimiter.hash(state); + TokenStreamHelper(&self.tts).hash(state); + } +} + +#[cfg(feature = "parsing")] +pub fn parse_delimiter(input: ParseStream) -> Result<(MacroDelimiter, TokenStream)> { + input.step(|cursor| { + if let Some((TokenTree::Group(g), rest)) = cursor.token_tree() { + let span = g.span(); + let delimiter = match g.delimiter() { + Delimiter::Parenthesis => MacroDelimiter::Paren(Paren(span)), + Delimiter::Brace => MacroDelimiter::Brace(Brace(span)), + Delimiter::Bracket => MacroDelimiter::Bracket(Bracket(span)), + Delimiter::None => { + return Err(cursor.error("expected delimiter")); + } + }; + Ok(((delimiter, g.stream().clone()), rest)) + } else { + Err(cursor.error("expected delimiter")) + } + }) +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + + impl Parse for Macro { + fn parse(input: ParseStream) -> Result { + let tts; + Ok(Macro { + path: input.call(Path::parse_mod_style)?, + bang_token: input.parse()?, + delimiter: { + let (delimiter, content) = parse_delimiter(input)?; + tts = content; + delimiter + }, + tts: tts, + }) + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + use proc_macro2::TokenStream; + use quote::ToTokens; + + impl ToTokens for Macro { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.path.to_tokens(tokens); + self.bang_token.to_tokens(tokens); + match self.delimiter { + MacroDelimiter::Paren(ref paren) => { + paren.surround(tokens, |tokens| self.tts.to_tokens(tokens)); + } + MacroDelimiter::Brace(ref brace) => { + brace.surround(tokens, |tokens| self.tts.to_tokens(tokens)); + } + MacroDelimiter::Bracket(ref bracket) => { + bracket.surround(tokens, |tokens| self.tts.to_tokens(tokens)); + } + } + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/macros.rs b/vendor/registry-40351f815f426200/syn/src/macros.rs new file mode 100644 index 000000000..bb59063a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/macros.rs @@ -0,0 +1,165 @@ +#[cfg(any(feature = "full", feature = "derive"))] +macro_rules! ast_struct { + ( + $(#[$attr:meta])* + pub struct $name:ident #full $($rest:tt)* + ) => { + #[cfg(feature = "full")] + $(#[$attr])* + #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] + #[cfg_attr(feature = "clone-impls", derive(Clone))] + pub struct $name $($rest)* + + #[cfg(not(feature = "full"))] + $(#[$attr])* + #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] + #[cfg_attr(feature = "clone-impls", derive(Clone))] + pub struct $name { + _noconstruct: (), + } + }; + + ( + $(#[$attr:meta])* + pub struct $name:ident #manual_extra_traits $($rest:tt)* + ) => { + $(#[$attr])* + #[cfg_attr(feature = "extra-traits", derive(Debug))] + #[cfg_attr(feature = "clone-impls", derive(Clone))] + pub struct $name $($rest)* + }; + + ( + $(#[$attr:meta])* + pub struct $name:ident $($rest:tt)* + ) => { + $(#[$attr])* + #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] + #[cfg_attr(feature = "clone-impls", derive(Clone))] + pub struct $name $($rest)* + }; +} + +#[cfg(any(feature = "full", feature = "derive"))] +macro_rules! ast_enum { + ( + $(#[$enum_attr:meta])* + pub enum $name:ident $(# $tags:ident)* { $($variants:tt)* } + ) => ( + $(#[$enum_attr])* + #[cfg_attr(feature = "extra-traits", derive(Debug, Eq, PartialEq, Hash))] + #[cfg_attr(feature = "clone-impls", derive(Clone))] + pub enum $name { + $($variants)* + } + ) +} + +#[cfg(any(feature = "full", feature = "derive"))] +macro_rules! ast_enum_of_structs { + ( + $(#[$enum_attr:meta])* + pub enum $name:ident { + $( + $(#[$variant_attr:meta])* + pub $variant:ident $( ($member:ident $($rest:tt)*) )*, + )* + } + + $($remaining:tt)* + ) => ( + ast_enum! { + $(#[$enum_attr])* + pub enum $name { + $( + $(#[$variant_attr])* + $variant $( ($member) )*, + )* + } + } + + $( + maybe_ast_struct! { + $(#[$variant_attr])* + $( + pub struct $member $($rest)* + )* + } + + $( + impl From<$member> for $name { + fn from(e: $member) -> $name { + $name::$variant(e) + } + } + )* + )* + + #[cfg(feature = "printing")] + generate_to_tokens! { + $($remaining)* + () + tokens + $name { $($variant $( [$($rest)*] )*,)* } + } + ) +} + +#[cfg(all(feature = "printing", any(feature = "full", feature = "derive")))] +macro_rules! generate_to_tokens { + (do_not_generate_to_tokens $($foo:tt)*) => (); + + (($($arms:tt)*) $tokens:ident $name:ident { $variant:ident, $($next:tt)*}) => { + generate_to_tokens!( + ($($arms)* $name::$variant => {}) + $tokens $name { $($next)* } + ); + }; + + (($($arms:tt)*) $tokens:ident $name:ident { $variant:ident [$($rest:tt)*], $($next:tt)*}) => { + generate_to_tokens!( + ($($arms)* $name::$variant(ref _e) => to_tokens_call!(_e, $tokens, $($rest)*),) + $tokens $name { $($next)* } + ); + }; + + (($($arms:tt)*) $tokens:ident $name:ident {}) => { + impl ::quote::ToTokens for $name { + fn to_tokens(&self, $tokens: &mut ::proc_macro2::TokenStream) { + match *self { + $($arms)* + } + } + } + }; +} + +#[cfg(all(feature = "printing", feature = "full"))] +macro_rules! to_tokens_call { + ($e:ident, $tokens:ident, $($rest:tt)*) => { + $e.to_tokens($tokens) + }; +} + +#[cfg(all(feature = "printing", feature = "derive", not(feature = "full")))] +macro_rules! to_tokens_call { + // If the variant is marked as #full, don't auto-generate to-tokens for it. + ($e:ident, $tokens:ident, #full $($rest:tt)*) => { + unreachable!() + }; + ($e:ident, $tokens:ident, $($rest:tt)*) => { + $e.to_tokens($tokens) + }; +} + +#[cfg(any(feature = "full", feature = "derive"))] +macro_rules! maybe_ast_struct { + ( + $(#[$attr:meta])* + $( + pub struct $name:ident + )* + ) => (); + + ($($rest:tt)*) => (ast_struct! { $($rest)* }); +} diff --git a/vendor/registry-40351f815f426200/syn/src/op.rs b/vendor/registry-40351f815f426200/syn/src/op.rs new file mode 100644 index 000000000..96d8c9958 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/op.rs @@ -0,0 +1,231 @@ +ast_enum! { + /// A binary operator: `+`, `+=`, `&`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + #[cfg_attr(feature = "clone-impls", derive(Copy))] + pub enum BinOp { + /// The `+` operator (addition) + Add(Token![+]), + /// The `-` operator (subtraction) + Sub(Token![-]), + /// The `*` operator (multiplication) + Mul(Token![*]), + /// The `/` operator (division) + Div(Token![/]), + /// The `%` operator (modulus) + Rem(Token![%]), + /// The `&&` operator (logical and) + And(Token![&&]), + /// The `||` operator (logical or) + Or(Token![||]), + /// The `^` operator (bitwise xor) + BitXor(Token![^]), + /// The `&` operator (bitwise and) + BitAnd(Token![&]), + /// The `|` operator (bitwise or) + BitOr(Token![|]), + /// The `<<` operator (shift left) + Shl(Token![<<]), + /// The `>>` operator (shift right) + Shr(Token![>>]), + /// The `==` operator (equality) + Eq(Token![==]), + /// The `<` operator (less than) + Lt(Token![<]), + /// The `<=` operator (less than or equal to) + Le(Token![<=]), + /// The `!=` operator (not equal to) + Ne(Token![!=]), + /// The `>=` operator (greater than or equal to) + Ge(Token![>=]), + /// The `>` operator (greater than) + Gt(Token![>]), + /// The `+=` operator + AddEq(Token![+=]), + /// The `-=` operator + SubEq(Token![-=]), + /// The `*=` operator + MulEq(Token![*=]), + /// The `/=` operator + DivEq(Token![/=]), + /// The `%=` operator + RemEq(Token![%=]), + /// The `^=` operator + BitXorEq(Token![^=]), + /// The `&=` operator + BitAndEq(Token![&=]), + /// The `|=` operator + BitOrEq(Token![|=]), + /// The `<<=` operator + ShlEq(Token![<<=]), + /// The `>>=` operator + ShrEq(Token![>>=]), + } +} + +ast_enum! { + /// A unary operator: `*`, `!`, `-`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + #[cfg_attr(feature = "clone-impls", derive(Copy))] + pub enum UnOp { + /// The `*` operator for dereferencing + Deref(Token![*]), + /// The `!` operator for logical inversion + Not(Token![!]), + /// The `-` operator for negation + Neg(Token![-]), + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + + fn parse_binop(input: ParseStream) -> Result { + if input.peek(Token![&&]) { + input.parse().map(BinOp::And) + } else if input.peek(Token![||]) { + input.parse().map(BinOp::Or) + } else if input.peek(Token![<<]) { + input.parse().map(BinOp::Shl) + } else if input.peek(Token![>>]) { + input.parse().map(BinOp::Shr) + } else if input.peek(Token![==]) { + input.parse().map(BinOp::Eq) + } else if input.peek(Token![<=]) { + input.parse().map(BinOp::Le) + } else if input.peek(Token![!=]) { + input.parse().map(BinOp::Ne) + } else if input.peek(Token![>=]) { + input.parse().map(BinOp::Ge) + } else if input.peek(Token![+]) { + input.parse().map(BinOp::Add) + } else if input.peek(Token![-]) { + input.parse().map(BinOp::Sub) + } else if input.peek(Token![*]) { + input.parse().map(BinOp::Mul) + } else if input.peek(Token![/]) { + input.parse().map(BinOp::Div) + } else if input.peek(Token![%]) { + input.parse().map(BinOp::Rem) + } else if input.peek(Token![^]) { + input.parse().map(BinOp::BitXor) + } else if input.peek(Token![&]) { + input.parse().map(BinOp::BitAnd) + } else if input.peek(Token![|]) { + input.parse().map(BinOp::BitOr) + } else if input.peek(Token![<]) { + input.parse().map(BinOp::Lt) + } else if input.peek(Token![>]) { + input.parse().map(BinOp::Gt) + } else { + Err(input.error("expected binary operator")) + } + } + + impl Parse for BinOp { + #[cfg(not(feature = "full"))] + fn parse(input: ParseStream) -> Result { + parse_binop(input) + } + + #[cfg(feature = "full")] + fn parse(input: ParseStream) -> Result { + if input.peek(Token![+=]) { + input.parse().map(BinOp::AddEq) + } else if input.peek(Token![-=]) { + input.parse().map(BinOp::SubEq) + } else if input.peek(Token![*=]) { + input.parse().map(BinOp::MulEq) + } else if input.peek(Token![/=]) { + input.parse().map(BinOp::DivEq) + } else if input.peek(Token![%=]) { + input.parse().map(BinOp::RemEq) + } else if input.peek(Token![^=]) { + input.parse().map(BinOp::BitXorEq) + } else if input.peek(Token![&=]) { + input.parse().map(BinOp::BitAndEq) + } else if input.peek(Token![|=]) { + input.parse().map(BinOp::BitOrEq) + } else if input.peek(Token![<<=]) { + input.parse().map(BinOp::ShlEq) + } else if input.peek(Token![>>=]) { + input.parse().map(BinOp::ShrEq) + } else { + parse_binop(input) + } + } + } + + impl Parse for UnOp { + fn parse(input: ParseStream) -> Result { + let lookahead = input.lookahead1(); + if lookahead.peek(Token![*]) { + input.parse().map(UnOp::Deref) + } else if lookahead.peek(Token![!]) { + input.parse().map(UnOp::Not) + } else if lookahead.peek(Token![-]) { + input.parse().map(UnOp::Neg) + } else { + Err(lookahead.error()) + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + use proc_macro2::TokenStream; + use quote::ToTokens; + + impl ToTokens for BinOp { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + BinOp::Add(ref t) => t.to_tokens(tokens), + BinOp::Sub(ref t) => t.to_tokens(tokens), + BinOp::Mul(ref t) => t.to_tokens(tokens), + BinOp::Div(ref t) => t.to_tokens(tokens), + BinOp::Rem(ref t) => t.to_tokens(tokens), + BinOp::And(ref t) => t.to_tokens(tokens), + BinOp::Or(ref t) => t.to_tokens(tokens), + BinOp::BitXor(ref t) => t.to_tokens(tokens), + BinOp::BitAnd(ref t) => t.to_tokens(tokens), + BinOp::BitOr(ref t) => t.to_tokens(tokens), + BinOp::Shl(ref t) => t.to_tokens(tokens), + BinOp::Shr(ref t) => t.to_tokens(tokens), + BinOp::Eq(ref t) => t.to_tokens(tokens), + BinOp::Lt(ref t) => t.to_tokens(tokens), + BinOp::Le(ref t) => t.to_tokens(tokens), + BinOp::Ne(ref t) => t.to_tokens(tokens), + BinOp::Ge(ref t) => t.to_tokens(tokens), + BinOp::Gt(ref t) => t.to_tokens(tokens), + BinOp::AddEq(ref t) => t.to_tokens(tokens), + BinOp::SubEq(ref t) => t.to_tokens(tokens), + BinOp::MulEq(ref t) => t.to_tokens(tokens), + BinOp::DivEq(ref t) => t.to_tokens(tokens), + BinOp::RemEq(ref t) => t.to_tokens(tokens), + BinOp::BitXorEq(ref t) => t.to_tokens(tokens), + BinOp::BitAndEq(ref t) => t.to_tokens(tokens), + BinOp::BitOrEq(ref t) => t.to_tokens(tokens), + BinOp::ShlEq(ref t) => t.to_tokens(tokens), + BinOp::ShrEq(ref t) => t.to_tokens(tokens), + } + } + } + + impl ToTokens for UnOp { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + UnOp::Deref(ref t) => t.to_tokens(tokens), + UnOp::Not(ref t) => t.to_tokens(tokens), + UnOp::Neg(ref t) => t.to_tokens(tokens), + } + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/parse.rs b/vendor/registry-40351f815f426200/syn/src/parse.rs new file mode 100644 index 000000000..c5786e740 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/parse.rs @@ -0,0 +1,1111 @@ +//! Parsing interface for parsing a token stream into a syntax tree node. +//! +//! Parsing in Syn is built on parser functions that take in a [`ParseStream`] +//! and produce a [`Result`] where `T` is some syntax tree node. Underlying +//! these parser functions is a lower level mechanism built around the +//! [`Cursor`] type. `Cursor` is a cheaply copyable cursor over a range of +//! tokens in a token stream. +//! +//! [`ParseStream`]: type.ParseStream.html +//! [`Result`]: type.Result.html +//! [`Cursor`]: ../buffer/index.html +//! +//! # Example +//! +//! Here is a snippet of parsing code to get a feel for the style of the +//! library. We define data structures for a subset of Rust syntax including +//! enums (not shown) and structs, then provide implementations of the [`Parse`] +//! trait to parse these syntax tree data structures from a token stream. +//! +//! Once `Parse` impls have been defined, they can be called conveniently from a +//! procedural macro through [`parse_macro_input!`] as shown at the bottom of +//! the snippet. If the caller provides syntactically invalid input to the +//! procedural macro, they will receive a helpful compiler error message +//! pointing out the exact token that triggered the failure to parse. +//! +//! [`parse_macro_input!`]: ../macro.parse_macro_input.html +//! +//! ```edition2018 +//! extern crate proc_macro; +//! +//! use proc_macro::TokenStream; +//! use syn::{braced, parse_macro_input, token, Field, Ident, Result, Token}; +//! use syn::parse::{Parse, ParseStream}; +//! use syn::punctuated::Punctuated; +//! +//! enum Item { +//! Struct(ItemStruct), +//! Enum(ItemEnum), +//! } +//! +//! struct ItemStruct { +//! struct_token: Token![struct], +//! ident: Ident, +//! brace_token: token::Brace, +//! fields: Punctuated, +//! } +//! # +//! # enum ItemEnum {} +//! +//! impl Parse for Item { +//! fn parse(input: ParseStream) -> Result { +//! let lookahead = input.lookahead1(); +//! if lookahead.peek(Token![struct]) { +//! input.parse().map(Item::Struct) +//! } else if lookahead.peek(Token![enum]) { +//! input.parse().map(Item::Enum) +//! } else { +//! Err(lookahead.error()) +//! } +//! } +//! } +//! +//! impl Parse for ItemStruct { +//! fn parse(input: ParseStream) -> Result { +//! let content; +//! Ok(ItemStruct { +//! struct_token: input.parse()?, +//! ident: input.parse()?, +//! brace_token: braced!(content in input), +//! fields: content.parse_terminated(Field::parse_named)?, +//! }) +//! } +//! } +//! # +//! # impl Parse for ItemEnum { +//! # fn parse(input: ParseStream) -> Result { +//! # unimplemented!() +//! # } +//! # } +//! +//! # const IGNORE: &str = stringify! { +//! #[proc_macro] +//! # }; +//! pub fn my_macro(tokens: TokenStream) -> TokenStream { +//! let input = parse_macro_input!(tokens as Item); +//! +//! /* ... */ +//! # "".parse().unwrap() +//! } +//! ``` +//! +//! # The `syn::parse*` functions +//! +//! The [`syn::parse`], [`syn::parse2`], and [`syn::parse_str`] functions serve +//! as an entry point for parsing syntax tree nodes that can be parsed in an +//! obvious default way. These functions can return any syntax tree node that +//! implements the [`Parse`] trait, which includes most types in Syn. +//! +//! [`syn::parse`]: ../fn.parse.html +//! [`syn::parse2`]: ../fn.parse2.html +//! [`syn::parse_str`]: ../fn.parse_str.html +//! [`Parse`]: trait.Parse.html +//! +//! ```edition2018 +//! use syn::Type; +//! +//! # fn run_parser() -> syn::Result<()> { +//! let t: Type = syn::parse_str("std::collections::HashMap")?; +//! # Ok(()) +//! # } +//! # +//! # fn main() { +//! # run_parser().unwrap(); +//! # } +//! ``` +//! +//! The [`parse_quote!`] macro also uses this approach. +//! +//! [`parse_quote!`]: ../macro.parse_quote.html +//! +//! # The `Parser` trait +//! +//! Some types can be parsed in several ways depending on context. For example +//! an [`Attribute`] can be either "outer" like `#[...]` or "inner" like +//! `#![...]` and parsing the wrong one would be a bug. Similarly [`Punctuated`] +//! may or may not allow trailing punctuation, and parsing it the wrong way +//! would either reject valid input or accept invalid input. +//! +//! [`Attribute`]: ../struct.Attribute.html +//! [`Punctuated`]: ../punctuated/index.html +//! +//! The `Parse` trait is not implemented in these cases because there is no good +//! behavior to consider the default. +//! +//! ```edition2018,compile_fail +//! # extern crate proc_macro; +//! # +//! # use syn::punctuated::Punctuated; +//! # use syn::{PathSegment, Result, Token}; +//! # +//! # fn f(tokens: proc_macro::TokenStream) -> Result<()> { +//! # +//! // Can't parse `Punctuated` without knowing whether trailing punctuation +//! // should be allowed in this context. +//! let path: Punctuated = syn::parse(tokens)?; +//! # +//! # Ok(()) +//! # } +//! ``` +//! +//! In these cases the types provide a choice of parser functions rather than a +//! single `Parse` implementation, and those parser functions can be invoked +//! through the [`Parser`] trait. +//! +//! [`Parser`]: trait.Parser.html +//! +//! ```edition2018 +//! extern crate proc_macro; +//! +//! use proc_macro::TokenStream; +//! use syn::parse::Parser; +//! use syn::punctuated::Punctuated; +//! use syn::{Attribute, Expr, PathSegment, Result, Token}; +//! +//! fn call_some_parser_methods(input: TokenStream) -> Result<()> { +//! // Parse a nonempty sequence of path segments separated by `::` punctuation +//! // with no trailing punctuation. +//! let tokens = input.clone(); +//! let parser = Punctuated::::parse_separated_nonempty; +//! let _path = parser.parse(tokens)?; +//! +//! // Parse a possibly empty sequence of expressions terminated by commas with +//! // an optional trailing punctuation. +//! let tokens = input.clone(); +//! let parser = Punctuated::::parse_terminated; +//! let _args = parser.parse(tokens)?; +//! +//! // Parse zero or more outer attributes but not inner attributes. +//! let tokens = input.clone(); +//! let parser = Attribute::parse_outer; +//! let _attrs = parser.parse(tokens)?; +//! +//! Ok(()) +//! } +//! ``` +//! +//! --- +//! +//! *This module is available if Syn is built with the `"parsing"` feature.* + +use std::cell::Cell; +use std::fmt::{self, Debug, Display}; +use std::marker::PhantomData; +use std::mem; +use std::ops::Deref; +use std::rc::Rc; +use std::str::FromStr; + +#[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" +))] +use proc_macro; +use proc_macro2::{self, Delimiter, Group, Literal, Punct, Span, TokenStream, TokenTree}; + +use buffer::{Cursor, TokenBuffer}; +use error; +use lookahead; +use private; +use punctuated::Punctuated; +use token::Token; + +pub use error::{Error, Result}; +pub use lookahead::{Lookahead1, Peek}; + +/// Parsing interface implemented by all types that can be parsed in a default +/// way from a token stream. +pub trait Parse: Sized { + fn parse(input: ParseStream) -> Result; +} + +/// Input to a Syn parser function. +/// +/// See the methods of this type under the documentation of [`ParseBuffer`]. For +/// an overview of parsing in Syn, refer to the [module documentation]. +/// +/// [module documentation]: index.html +pub type ParseStream<'a> = &'a ParseBuffer<'a>; + +/// Cursor position within a buffered token stream. +/// +/// This type is more commonly used through the type alias [`ParseStream`] which +/// is an alias for `&ParseBuffer`. +/// +/// `ParseStream` is the input type for all parser functions in Syn. They have +/// the signature `fn(ParseStream) -> Result`. +/// +/// ## Calling a parser function +/// +/// There is no public way to construct a `ParseBuffer`. Instead, if you are +/// looking to invoke a parser function that requires `ParseStream` as input, +/// you will need to go through one of the public parsing entry points. +/// +/// - The [`parse_macro_input!`] macro if parsing input of a procedural macro; +/// - One of [the `syn::parse*` functions][syn-parse]; or +/// - A method of the [`Parser`] trait. +/// +/// [`parse_macro_input!`]: ../macro.parse_macro_input.html +/// [syn-parse]: index.html#the-synparse-functions +pub struct ParseBuffer<'a> { + scope: Span, + // Instead of Cell> so that ParseBuffer<'a> is covariant in 'a. + // The rest of the code in this module needs to be careful that only a + // cursor derived from this `cell` is ever assigned to this `cell`. + // + // Cell> cannot be covariant in 'a because then we could take a + // ParseBuffer<'a>, upcast to ParseBuffer<'short> for some lifetime shorter + // than 'a, and then assign a Cursor<'short> into the Cell. + // + // By extension, it would not be safe to expose an API that accepts a + // Cursor<'a> and trusts that it lives as long as the cursor currently in + // the cell. + cell: Cell>, + marker: PhantomData>, + unexpected: Rc>>, +} + +impl<'a> Drop for ParseBuffer<'a> { + fn drop(&mut self) { + if !self.is_empty() && self.unexpected.get().is_none() { + self.unexpected.set(Some(self.cursor().span())); + } + } +} + +impl<'a> Display for ParseBuffer<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Display::fmt(&self.cursor().token_stream(), f) + } +} + +impl<'a> Debug for ParseBuffer<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + Debug::fmt(&self.cursor().token_stream(), f) + } +} + +/// Cursor state associated with speculative parsing. +/// +/// This type is the input of the closure provided to [`ParseStream::step`]. +/// +/// [`ParseStream::step`]: struct.ParseBuffer.html#method.step +/// +/// # Example +/// +/// ```edition2018 +/// use proc_macro2::TokenTree; +/// use syn::Result; +/// use syn::parse::ParseStream; +/// +/// // This function advances the stream past the next occurrence of `@`. If +/// // no `@` is present in the stream, the stream position is unchanged and +/// // an error is returned. +/// fn skip_past_next_at(input: ParseStream) -> Result<()> { +/// input.step(|cursor| { +/// let mut rest = *cursor; +/// while let Some((tt, next)) = rest.token_tree() { +/// match &tt { +/// TokenTree::Punct(punct) if punct.as_char() == '@' => { +/// return Ok(((), next)); +/// } +/// _ => rest = next, +/// } +/// } +/// Err(cursor.error("no `@` was found after this point")) +/// }) +/// } +/// # +/// # fn remainder_after_skipping_past_next_at( +/// # input: ParseStream, +/// # ) -> Result { +/// # skip_past_next_at(input)?; +/// # input.parse() +/// # } +/// # +/// # fn main() { +/// # use syn::parse::Parser; +/// # let remainder = remainder_after_skipping_past_next_at +/// # .parse_str("a @ b c") +/// # .unwrap(); +/// # assert_eq!(remainder.to_string(), "b c"); +/// # } +/// ``` +#[derive(Copy, Clone)] +pub struct StepCursor<'c, 'a> { + scope: Span, + // This field is covariant in 'c. + cursor: Cursor<'c>, + // This field is contravariant in 'c. Together these make StepCursor + // invariant in 'c. Also covariant in 'a. The user cannot cast 'c to a + // different lifetime but can upcast into a StepCursor with a shorter + // lifetime 'a. + // + // As long as we only ever construct a StepCursor for which 'c outlives 'a, + // this means if ever a StepCursor<'c, 'a> exists we are guaranteed that 'c + // outlives 'a. + marker: PhantomData) -> Cursor<'a>>, +} + +impl<'c, 'a> Deref for StepCursor<'c, 'a> { + type Target = Cursor<'c>; + + fn deref(&self) -> &Self::Target { + &self.cursor + } +} + +impl<'c, 'a> StepCursor<'c, 'a> { + /// Triggers an error at the current position of the parse stream. + /// + /// The `ParseStream::step` invocation will return this same error without + /// advancing the stream state. + pub fn error(self, message: T) -> Error { + error::new_at(self.scope, self.cursor, message) + } +} + +impl private { + pub fn advance_step_cursor<'c, 'a>(proof: StepCursor<'c, 'a>, to: Cursor<'c>) -> Cursor<'a> { + // Refer to the comments within the StepCursor definition. We use the + // fact that a StepCursor<'c, 'a> exists as proof that 'c outlives 'a. + // Cursor is covariant in its lifetime parameter so we can cast a + // Cursor<'c> to one with the shorter lifetime Cursor<'a>. + let _ = proof; + unsafe { mem::transmute::, Cursor<'a>>(to) } + } +} + +fn skip(input: ParseStream) -> bool { + input + .step(|cursor| { + if let Some((_lifetime, rest)) = cursor.lifetime() { + Ok((true, rest)) + } else if let Some((_token, rest)) = cursor.token_tree() { + Ok((true, rest)) + } else { + Ok((false, *cursor)) + } + }) + .unwrap() +} + +impl private { + pub fn new_parse_buffer( + scope: Span, + cursor: Cursor, + unexpected: Rc>>, + ) -> ParseBuffer { + ParseBuffer { + scope: scope, + // See comment on `cell` in the struct definition. + cell: Cell::new(unsafe { mem::transmute::>(cursor) }), + marker: PhantomData, + unexpected: unexpected, + } + } + + pub fn get_unexpected(buffer: &ParseBuffer) -> Rc>> { + buffer.unexpected.clone() + } +} + +impl<'a> ParseBuffer<'a> { + /// Parses a syntax tree node of type `T`, advancing the position of our + /// parse stream past it. + pub fn parse(&self) -> Result { + T::parse(self) + } + + /// Calls the given parser function to parse a syntax tree node of type `T` + /// from this stream. + /// + /// # Example + /// + /// The parser below invokes [`Attribute::parse_outer`] to parse a vector of + /// zero or more outer attributes. + /// + /// [`Attribute::parse_outer`]: ../struct.Attribute.html#method.parse_outer + /// + /// ```edition2018 + /// use syn::{Attribute, Ident, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // Parses a unit struct with attributes. + /// // + /// // #[path = "s.tmpl"] + /// // struct S; + /// struct UnitStruct { + /// attrs: Vec, + /// struct_token: Token![struct], + /// name: Ident, + /// semi_token: Token![;], + /// } + /// + /// impl Parse for UnitStruct { + /// fn parse(input: ParseStream) -> Result { + /// Ok(UnitStruct { + /// attrs: input.call(Attribute::parse_outer)?, + /// struct_token: input.parse()?, + /// name: input.parse()?, + /// semi_token: input.parse()?, + /// }) + /// } + /// } + /// ``` + pub fn call(&self, function: fn(ParseStream) -> Result) -> Result { + function(self) + } + + /// Looks at the next token in the parse stream to determine whether it + /// matches the requested type of token. + /// + /// Does not advance the position of the parse stream. + /// + /// # Syntax + /// + /// Note that this method does not use turbofish syntax. Pass the peek type + /// inside of parentheses. + /// + /// - `input.peek(Token![struct])` + /// - `input.peek(Token![==])` + /// - `input.peek(Ident)` *(does not accept keywords)* + /// - `input.peek(Ident::peek_any)` + /// - `input.peek(Lifetime)` + /// - `input.peek(token::Brace)` + /// + /// # Example + /// + /// In this example we finish parsing the list of supertraits when the next + /// token in the input is either `where` or an opening curly brace. + /// + /// ```edition2018 + /// use syn::{braced, token, Generics, Ident, Result, Token, TypeParamBound}; + /// use syn::parse::{Parse, ParseStream}; + /// use syn::punctuated::Punctuated; + /// + /// // Parses a trait definition containing no associated items. + /// // + /// // trait Marker<'de, T>: A + B<'de> where Box: Clone {} + /// struct MarkerTrait { + /// trait_token: Token![trait], + /// ident: Ident, + /// generics: Generics, + /// colon_token: Option, + /// supertraits: Punctuated, + /// brace_token: token::Brace, + /// } + /// + /// impl Parse for MarkerTrait { + /// fn parse(input: ParseStream) -> Result { + /// let trait_token: Token![trait] = input.parse()?; + /// let ident: Ident = input.parse()?; + /// let mut generics: Generics = input.parse()?; + /// let colon_token: Option = input.parse()?; + /// + /// let mut supertraits = Punctuated::new(); + /// if colon_token.is_some() { + /// loop { + /// supertraits.push_value(input.parse()?); + /// if input.peek(Token![where]) || input.peek(token::Brace) { + /// break; + /// } + /// supertraits.push_punct(input.parse()?); + /// } + /// } + /// + /// generics.where_clause = input.parse()?; + /// let content; + /// let empty_brace_token = braced!(content in input); + /// + /// Ok(MarkerTrait { + /// trait_token: trait_token, + /// ident: ident, + /// generics: generics, + /// colon_token: colon_token, + /// supertraits: supertraits, + /// brace_token: empty_brace_token, + /// }) + /// } + /// } + /// ``` + pub fn peek(&self, token: T) -> bool { + let _ = token; + T::Token::peek(self.cursor()) + } + + /// Looks at the second-next token in the parse stream. + /// + /// This is commonly useful as a way to implement contextual keywords. + /// + /// # Example + /// + /// This example needs to use `peek2` because the symbol `union` is not a + /// keyword in Rust. We can't use just `peek` and decide to parse a union if + /// the very next token is `union`, because someone is free to write a `mod + /// union` and a macro invocation that looks like `union::some_macro! { ... + /// }`. In other words `union` is a contextual keyword. + /// + /// ```edition2018 + /// use syn::{Ident, ItemUnion, Macro, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // Parses either a union or a macro invocation. + /// enum UnionOrMacro { + /// // union MaybeUninit { uninit: (), value: T } + /// Union(ItemUnion), + /// // lazy_static! { ... } + /// Macro(Macro), + /// } + /// + /// impl Parse for UnionOrMacro { + /// fn parse(input: ParseStream) -> Result { + /// if input.peek(Token![union]) && input.peek2(Ident) { + /// input.parse().map(UnionOrMacro::Union) + /// } else { + /// input.parse().map(UnionOrMacro::Macro) + /// } + /// } + /// } + /// ``` + pub fn peek2(&self, token: T) -> bool { + let ahead = self.fork(); + skip(&ahead) && ahead.peek(token) + } + + /// Looks at the third-next token in the parse stream. + pub fn peek3(&self, token: T) -> bool { + let ahead = self.fork(); + skip(&ahead) && skip(&ahead) && ahead.peek(token) + } + + /// Parses zero or more occurrences of `T` separated by punctuation of type + /// `P`, with optional trailing punctuation. + /// + /// Parsing continues until the end of this parse stream. The entire content + /// of this parse stream must consist of `T` and `P`. + /// + /// # Example + /// + /// ```edition2018 + /// # use quote::quote; + /// # + /// use syn::{parenthesized, token, Ident, Result, Token, Type}; + /// use syn::parse::{Parse, ParseStream}; + /// use syn::punctuated::Punctuated; + /// + /// // Parse a simplified tuple struct syntax like: + /// // + /// // struct S(A, B); + /// struct TupleStruct { + /// struct_token: Token![struct], + /// ident: Ident, + /// paren_token: token::Paren, + /// fields: Punctuated, + /// semi_token: Token![;], + /// } + /// + /// impl Parse for TupleStruct { + /// fn parse(input: ParseStream) -> Result { + /// let content; + /// Ok(TupleStruct { + /// struct_token: input.parse()?, + /// ident: input.parse()?, + /// paren_token: parenthesized!(content in input), + /// fields: content.parse_terminated(Type::parse)?, + /// semi_token: input.parse()?, + /// }) + /// } + /// } + /// # + /// # fn main() { + /// # let input = quote! { + /// # struct S(A, B); + /// # }; + /// # syn::parse2::(input).unwrap(); + /// # } + /// ``` + pub fn parse_terminated( + &self, + parser: fn(ParseStream) -> Result, + ) -> Result> { + Punctuated::parse_terminated_with(self, parser) + } + + /// Returns whether there are tokens remaining in this stream. + /// + /// This method returns true at the end of the content of a set of + /// delimiters, as well as at the very end of the complete macro input. + /// + /// # Example + /// + /// ```edition2018 + /// use syn::{braced, token, Ident, Item, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // Parses a Rust `mod m { ... }` containing zero or more items. + /// struct Mod { + /// mod_token: Token![mod], + /// name: Ident, + /// brace_token: token::Brace, + /// items: Vec, + /// } + /// + /// impl Parse for Mod { + /// fn parse(input: ParseStream) -> Result { + /// let content; + /// Ok(Mod { + /// mod_token: input.parse()?, + /// name: input.parse()?, + /// brace_token: braced!(content in input), + /// items: { + /// let mut items = Vec::new(); + /// while !content.is_empty() { + /// items.push(content.parse()?); + /// } + /// items + /// }, + /// }) + /// } + /// } + /// ``` + pub fn is_empty(&self) -> bool { + self.cursor().eof() + } + + /// Constructs a helper for peeking at the next token in this stream and + /// building an error message if it is not one of a set of expected tokens. + /// + /// # Example + /// + /// ```edition2018 + /// use syn::{ConstParam, Ident, Lifetime, LifetimeDef, Result, Token, TypeParam}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // A generic parameter, a single one of the comma-separated elements inside + /// // angle brackets in: + /// // + /// // fn f() { ... } + /// // + /// // On invalid input, lookahead gives us a reasonable error message. + /// // + /// // error: expected one of: identifier, lifetime, `const` + /// // | + /// // 5 | fn f() {} + /// // | ^ + /// enum GenericParam { + /// Type(TypeParam), + /// Lifetime(LifetimeDef), + /// Const(ConstParam), + /// } + /// + /// impl Parse for GenericParam { + /// fn parse(input: ParseStream) -> Result { + /// let lookahead = input.lookahead1(); + /// if lookahead.peek(Ident) { + /// input.parse().map(GenericParam::Type) + /// } else if lookahead.peek(Lifetime) { + /// input.parse().map(GenericParam::Lifetime) + /// } else if lookahead.peek(Token![const]) { + /// input.parse().map(GenericParam::Const) + /// } else { + /// Err(lookahead.error()) + /// } + /// } + /// } + /// ``` + pub fn lookahead1(&self) -> Lookahead1<'a> { + lookahead::new(self.scope, self.cursor()) + } + + /// Forks a parse stream so that parsing tokens out of either the original + /// or the fork does not advance the position of the other. + /// + /// # Performance + /// + /// Forking a parse stream is a cheap fixed amount of work and does not + /// involve copying token buffers. Where you might hit performance problems + /// is if your macro ends up parsing a large amount of content more than + /// once. + /// + /// ```edition2018 + /// # use syn::{Expr, Result}; + /// # use syn::parse::ParseStream; + /// # + /// # fn bad(input: ParseStream) -> Result { + /// // Do not do this. + /// if input.fork().parse::().is_ok() { + /// return input.parse::(); + /// } + /// # unimplemented!() + /// # } + /// ``` + /// + /// As a rule, avoid parsing an unbounded amount of tokens out of a forked + /// parse stream. Only use a fork when the amount of work performed against + /// the fork is small and bounded. + /// + /// For a lower level but occasionally more performant way to perform + /// speculative parsing, consider using [`ParseStream::step`] instead. + /// + /// [`ParseStream::step`]: #method.step + /// + /// # Example + /// + /// The parse implementation shown here parses possibly restricted `pub` + /// visibilities. + /// + /// - `pub` + /// - `pub(crate)` + /// - `pub(self)` + /// - `pub(super)` + /// - `pub(in some::path)` + /// + /// To handle the case of visibilities inside of tuple structs, the parser + /// needs to distinguish parentheses that specify visibility restrictions + /// from parentheses that form part of a tuple type. + /// + /// ```edition2018 + /// # struct A; + /// # struct B; + /// # struct C; + /// # + /// struct S(pub(crate) A, pub (B, C)); + /// ``` + /// + /// In this example input the first tuple struct element of `S` has + /// `pub(crate)` visibility while the second tuple struct element has `pub` + /// visibility; the parentheses around `(B, C)` are part of the type rather + /// than part of a visibility restriction. + /// + /// The parser uses a forked parse stream to check the first token inside of + /// parentheses after the `pub` keyword. This is a small bounded amount of + /// work performed against the forked parse stream. + /// + /// ```edition2018 + /// use syn::{parenthesized, token, Ident, Path, Result, Token}; + /// use syn::ext::IdentExt; + /// use syn::parse::{Parse, ParseStream}; + /// + /// struct PubVisibility { + /// pub_token: Token![pub], + /// restricted: Option, + /// } + /// + /// struct Restricted { + /// paren_token: token::Paren, + /// in_token: Option, + /// path: Path, + /// } + /// + /// impl Parse for PubVisibility { + /// fn parse(input: ParseStream) -> Result { + /// let pub_token: Token![pub] = input.parse()?; + /// + /// if input.peek(token::Paren) { + /// let ahead = input.fork(); + /// let mut content; + /// parenthesized!(content in ahead); + /// + /// if content.peek(Token![crate]) + /// || content.peek(Token![self]) + /// || content.peek(Token![super]) + /// { + /// return Ok(PubVisibility { + /// pub_token: pub_token, + /// restricted: Some(Restricted { + /// paren_token: parenthesized!(content in input), + /// in_token: None, + /// path: Path::from(content.call(Ident::parse_any)?), + /// }), + /// }); + /// } else if content.peek(Token![in]) { + /// return Ok(PubVisibility { + /// pub_token: pub_token, + /// restricted: Some(Restricted { + /// paren_token: parenthesized!(content in input), + /// in_token: Some(content.parse()?), + /// path: content.call(Path::parse_mod_style)?, + /// }), + /// }); + /// } + /// } + /// + /// Ok(PubVisibility { + /// pub_token: pub_token, + /// restricted: None, + /// }) + /// } + /// } + /// ``` + pub fn fork(&self) -> Self { + ParseBuffer { + scope: self.scope, + cell: self.cell.clone(), + marker: PhantomData, + // Not the parent's unexpected. Nothing cares whether the clone + // parses all the way. + unexpected: Rc::new(Cell::new(None)), + } + } + + /// Triggers an error at the current position of the parse stream. + /// + /// # Example + /// + /// ```edition2018 + /// use syn::{Expr, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // Some kind of loop: `while` or `for` or `loop`. + /// struct Loop { + /// expr: Expr, + /// } + /// + /// impl Parse for Loop { + /// fn parse(input: ParseStream) -> Result { + /// if input.peek(Token![while]) + /// || input.peek(Token![for]) + /// || input.peek(Token![loop]) + /// { + /// Ok(Loop { + /// expr: input.parse()?, + /// }) + /// } else { + /// Err(input.error("expected some kind of loop")) + /// } + /// } + /// } + /// ``` + pub fn error(&self, message: T) -> Error { + error::new_at(self.scope, self.cursor(), message) + } + + /// Speculatively parses tokens from this parse stream, advancing the + /// position of this stream only if parsing succeeds. + /// + /// This is a powerful low-level API used for defining the `Parse` impls of + /// the basic built-in token types. It is not something that will be used + /// widely outside of the Syn codebase. + /// + /// # Example + /// + /// ```edition2018 + /// use proc_macro2::TokenTree; + /// use syn::Result; + /// use syn::parse::ParseStream; + /// + /// // This function advances the stream past the next occurrence of `@`. If + /// // no `@` is present in the stream, the stream position is unchanged and + /// // an error is returned. + /// fn skip_past_next_at(input: ParseStream) -> Result<()> { + /// input.step(|cursor| { + /// let mut rest = *cursor; + /// while let Some((tt, next)) = rest.token_tree() { + /// match &tt { + /// TokenTree::Punct(punct) if punct.as_char() == '@' => { + /// return Ok(((), next)); + /// } + /// _ => rest = next, + /// } + /// } + /// Err(cursor.error("no `@` was found after this point")) + /// }) + /// } + /// # + /// # fn remainder_after_skipping_past_next_at( + /// # input: ParseStream, + /// # ) -> Result { + /// # skip_past_next_at(input)?; + /// # input.parse() + /// # } + /// # + /// # fn main() { + /// # use syn::parse::Parser; + /// # let remainder = remainder_after_skipping_past_next_at + /// # .parse_str("a @ b c") + /// # .unwrap(); + /// # assert_eq!(remainder.to_string(), "b c"); + /// # } + /// ``` + pub fn step(&self, function: F) -> Result + where + F: for<'c> FnOnce(StepCursor<'c, 'a>) -> Result<(R, Cursor<'c>)>, + { + // Since the user's function is required to work for any 'c, we know + // that the Cursor<'c> they return is either derived from the input + // StepCursor<'c, 'a> or from a Cursor<'static>. + // + // It would not be legal to write this function without the invariant + // lifetime 'c in StepCursor<'c, 'a>. If this function were written only + // in terms of 'a, the user could take our ParseBuffer<'a>, upcast it to + // a ParseBuffer<'short> which some shorter lifetime than 'a, invoke + // `step` on their ParseBuffer<'short> with a closure that returns + // Cursor<'short>, and we would wrongly write that Cursor<'short> into + // the Cell intended to hold Cursor<'a>. + // + // In some cases it may be necessary for R to contain a Cursor<'a>. + // Within Syn we solve this using `private::advance_step_cursor` which + // uses the existence of a StepCursor<'c, 'a> as proof that it is safe + // to cast from Cursor<'c> to Cursor<'a>. If needed outside of Syn, it + // would be safe to expose that API as a method on StepCursor. + let (node, rest) = function(StepCursor { + scope: self.scope, + cursor: self.cell.get(), + marker: PhantomData, + })?; + self.cell.set(rest); + Ok(node) + } + + /// Provides low-level access to the token representation underlying this + /// parse stream. + /// + /// Cursors are immutable so no operations you perform against the cursor + /// will affect the state of this parse stream. + pub fn cursor(&self) -> Cursor<'a> { + self.cell.get() + } + + fn check_unexpected(&self) -> Result<()> { + match self.unexpected.get() { + Some(span) => Err(Error::new(span, "unexpected token")), + None => Ok(()), + } + } +} + +impl Parse for Box { + fn parse(input: ParseStream) -> Result { + input.parse().map(Box::new) + } +} + +impl Parse for Option { + fn parse(input: ParseStream) -> Result { + if T::peek(input.cursor()) { + Ok(Some(input.parse()?)) + } else { + Ok(None) + } + } +} + +impl Parse for TokenStream { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| Ok((cursor.token_stream(), Cursor::empty()))) + } +} + +impl Parse for TokenTree { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| match cursor.token_tree() { + Some((tt, rest)) => Ok((tt, rest)), + None => Err(cursor.error("expected token tree")), + }) + } +} + +impl Parse for Group { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| { + for delim in &[Delimiter::Parenthesis, Delimiter::Brace, Delimiter::Bracket] { + if let Some((inside, span, rest)) = cursor.group(*delim) { + let mut group = Group::new(*delim, inside.token_stream()); + group.set_span(span); + return Ok((group, rest)); + } + } + Err(cursor.error("expected group token")) + }) + } +} + +impl Parse for Punct { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| match cursor.punct() { + Some((punct, rest)) => Ok((punct, rest)), + None => Err(cursor.error("expected punctuation token")), + }) + } +} + +impl Parse for Literal { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| match cursor.literal() { + Some((literal, rest)) => Ok((literal, rest)), + None => Err(cursor.error("expected literal token")), + }) + } +} + +/// Parser that can parse Rust tokens into a particular syntax tree node. +/// +/// Refer to the [module documentation] for details about parsing in Syn. +/// +/// [module documentation]: index.html +/// +/// *This trait is available if Syn is built with the `"parsing"` feature.* +pub trait Parser: Sized { + type Output; + + /// Parse a proc-macro2 token stream into the chosen syntax tree node. + /// + /// This function will check that the input is fully parsed. If there are + /// any unparsed tokens at the end of the stream, an error is returned. + fn parse2(self, tokens: TokenStream) -> Result; + + /// Parse tokens of source code into the chosen syntax tree node. + /// + /// This function will check that the input is fully parsed. If there are + /// any unparsed tokens at the end of the stream, an error is returned. + /// + /// *This method is available if Syn is built with both the `"parsing"` and + /// `"proc-macro"` features.* + #[cfg(all( + not(all(target_arch = "wasm32", target_os = "unknown")), + feature = "proc-macro" + ))] + fn parse(self, tokens: proc_macro::TokenStream) -> Result { + self.parse2(proc_macro2::TokenStream::from(tokens)) + } + + /// Parse a string of Rust code into the chosen syntax tree node. + /// + /// This function will check that the input is fully parsed. If there are + /// any unparsed tokens at the end of the string, an error is returned. + /// + /// # Hygiene + /// + /// Every span in the resulting syntax tree will be set to resolve at the + /// macro call site. + fn parse_str(self, s: &str) -> Result { + self.parse2(proc_macro2::TokenStream::from_str(s)?) + } +} + +fn tokens_to_parse_buffer(tokens: &TokenBuffer) -> ParseBuffer { + let scope = Span::call_site(); + let cursor = tokens.begin(); + let unexpected = Rc::new(Cell::new(None)); + private::new_parse_buffer(scope, cursor, unexpected) +} + +impl Parser for F +where + F: FnOnce(ParseStream) -> Result, +{ + type Output = T; + + fn parse2(self, tokens: TokenStream) -> Result { + let buf = TokenBuffer::new2(tokens); + let state = tokens_to_parse_buffer(&buf); + let node = self(&state)?; + state.check_unexpected()?; + if state.is_empty() { + Ok(node) + } else { + Err(state.error("unexpected token")) + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/parse_macro_input.rs b/vendor/registry-40351f815f426200/syn/src/parse_macro_input.rs new file mode 100644 index 000000000..9d8f6aea2 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/parse_macro_input.rs @@ -0,0 +1,103 @@ +/// Parse the input TokenStream of a macro, triggering a compile error if the +/// tokens fail to parse. +/// +/// Refer to the [`parse` module] documentation for more details about parsing +/// in Syn. +/// +/// [`parse` module]: parse/index.html +/// +/// # Intended usage +/// +/// ```edition2018 +/// extern crate proc_macro; +/// +/// use proc_macro::TokenStream; +/// use syn::{parse_macro_input, Result}; +/// use syn::parse::{Parse, ParseStream}; +/// +/// struct MyMacroInput { +/// /* ... */ +/// } +/// +/// impl Parse for MyMacroInput { +/// fn parse(input: ParseStream) -> Result { +/// /* ... */ +/// # Ok(MyMacroInput {}) +/// } +/// } +/// +/// # const IGNORE: &str = stringify! { +/// #[proc_macro] +/// # }; +/// pub fn my_macro(tokens: TokenStream) -> TokenStream { +/// let input = parse_macro_input!(tokens as MyMacroInput); +/// +/// /* ... */ +/// # "".parse().unwrap() +/// } +/// ``` +#[macro_export(local_inner_macros)] +macro_rules! parse_macro_input { + ($tokenstream:ident as $ty:ty) => { + match $crate::parse_macro_input::parse::<$ty>($tokenstream) { + $crate::export::Ok(data) => data, + $crate::export::Err(err) => { + return $crate::export::TokenStream::from(err.to_compile_error()); + } + } + }; + ($tokenstream:ident) => { + parse_macro_input!($tokenstream as _) + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// Can parse any type that implements Parse. + +use parse::{Parse, ParseStream, Parser, Result}; +use proc_macro::TokenStream; + +// Not public API. +#[doc(hidden)] +pub fn parse(token_stream: TokenStream) -> Result { + T::parse.parse(token_stream) +} + +// Not public API. +#[doc(hidden)] +pub trait ParseMacroInput: Sized { + fn parse(input: ParseStream) -> Result; +} + +impl ParseMacroInput for T { + fn parse(input: ParseStream) -> Result { + ::parse(input) + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Any other types that we want `parse_macro_input!` to be able to parse. + +#[cfg(any(feature = "full", feature = "derive"))] +use AttributeArgs; + +#[cfg(any(feature = "full", feature = "derive"))] +impl ParseMacroInput for AttributeArgs { + fn parse(input: ParseStream) -> Result { + let mut metas = Vec::new(); + + loop { + if input.is_empty() { + break; + } + let value = input.parse()?; + metas.push(value); + if input.is_empty() { + break; + } + input.parse::()?; + } + + Ok(metas) + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/parse_quote.rs b/vendor/registry-40351f815f426200/syn/src/parse_quote.rs new file mode 100644 index 000000000..08012f5e8 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/parse_quote.rs @@ -0,0 +1,144 @@ +/// Quasi-quotation macro that accepts input like the [`quote!`] macro but uses +/// type inference to figure out a return type for those tokens. +/// +/// [`quote!`]: https://docs.rs/quote/0.6/quote/index.html +/// +/// The return type can be any syntax tree node that implements the [`Parse`] +/// trait. +/// +/// [`Parse`]: parse/trait.Parse.html +/// +/// ```edition2018 +/// use quote::quote; +/// use syn::{parse_quote, Stmt}; +/// +/// fn main() { +/// let name = quote!(v); +/// let ty = quote!(u8); +/// +/// let stmt: Stmt = parse_quote! { +/// let #name: #ty = Default::default(); +/// }; +/// +/// println!("{:#?}", stmt); +/// } +/// ``` +/// +/// *This macro is available if Syn is built with the `"parsing"` feature, +/// although interpolation of syntax tree nodes into the quoted tokens is only +/// supported if Syn is built with the `"printing"` feature as well.* +/// +/// # Example +/// +/// The following helper function adds a bound `T: HeapSize` to every type +/// parameter `T` in the input generics. +/// +/// ```edition2018 +/// use syn::{parse_quote, Generics, GenericParam}; +/// +/// // Add a bound `T: HeapSize` to every type parameter T. +/// fn add_trait_bounds(mut generics: Generics) -> Generics { +/// for param in &mut generics.params { +/// if let GenericParam::Type(type_param) = param { +/// type_param.bounds.push(parse_quote!(HeapSize)); +/// } +/// } +/// generics +/// } +/// ``` +/// +/// # Special cases +/// +/// This macro can parse the following additional types as a special case even +/// though they do not implement the `Parse` trait. +/// +/// - [`Attribute`] — parses one attribute, allowing either outer like `#[...]` +/// or inner like `#![...]` +/// - [`Punctuated`] — parses zero or more `T` separated by punctuation +/// `P` with optional trailing punctuation +/// +/// [`Attribute`]: struct.Attribute.html +/// [`Punctuated`]: punctuated/struct.Punctuated.html +/// +/// # Panics +/// +/// Panics if the tokens fail to parse as the expected syntax tree type. The +/// caller is responsible for ensuring that the input tokens are syntactically +/// valid. +#[macro_export(local_inner_macros)] +macro_rules! parse_quote { + ($($tt:tt)*) => { + $crate::parse_quote::parse($crate::export::From::from(quote_impl!($($tt)*))) + }; +} + +#[cfg(not(syn_can_call_macro_by_path))] +#[doc(hidden)] +#[macro_export] +macro_rules! quote_impl { + ($($tt:tt)*) => { + // Require caller to have their own `#[macro_use] extern crate quote`. + quote!($($tt)*) + }; +} + +#[cfg(syn_can_call_macro_by_path)] +#[doc(hidden)] +#[macro_export] +macro_rules! quote_impl { + ($($tt:tt)*) => { + $crate::export::quote::quote!($($tt)*) + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// Can parse any type that implements Parse. + +use parse::{Parse, ParseStream, Parser, Result}; +use proc_macro2::TokenStream; + +// Not public API. +#[doc(hidden)] +pub fn parse(token_stream: TokenStream) -> T { + let parser = T::parse; + match parser.parse2(token_stream) { + Ok(t) => t, + Err(err) => panic!("{}", err), + } +} + +// Not public API. +#[doc(hidden)] +pub trait ParseQuote: Sized { + fn parse(input: ParseStream) -> Result; +} + +impl ParseQuote for T { + fn parse(input: ParseStream) -> Result { + ::parse(input) + } +} + +//////////////////////////////////////////////////////////////////////////////// +// Any other types that we want `parse_quote!` to be able to parse. + +use punctuated::Punctuated; +#[cfg(any(feature = "full", feature = "derive"))] +use {attr, Attribute}; + +#[cfg(any(feature = "full", feature = "derive"))] +impl ParseQuote for Attribute { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![#]) && input.peek2(Token![!]) { + attr::parsing::single_parse_inner(input) + } else { + attr::parsing::single_parse_outer(input) + } + } +} + +impl ParseQuote for Punctuated { + fn parse(input: ParseStream) -> Result { + Self::parse_terminated(input) + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/path.rs b/vendor/registry-40351f815f426200/syn/src/path.rs new file mode 100644 index 000000000..afdecc2ee --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/path.rs @@ -0,0 +1,704 @@ +use super::*; +use punctuated::Punctuated; + +ast_struct! { + /// A path at which a named item is exported: `std::collections::HashMap`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Path { + pub leading_colon: Option, + pub segments: Punctuated, + } +} + +impl From for Path +where + T: Into, +{ + fn from(segment: T) -> Self { + let mut path = Path { + leading_colon: None, + segments: Punctuated::new(), + }; + path.segments.push_value(segment.into()); + path + } +} + +ast_struct! { + /// A segment of a path together with any path arguments on that segment. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct PathSegment { + pub ident: Ident, + pub arguments: PathArguments, + } +} + +impl From for PathSegment +where + T: Into, +{ + fn from(ident: T) -> Self { + PathSegment { + ident: ident.into(), + arguments: PathArguments::None, + } + } +} + +ast_enum! { + /// Angle bracketed or parenthesized arguments of a path segment. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// ## Angle bracketed + /// + /// The `<'a, T>` in `std::slice::iter<'a, T>`. + /// + /// ## Parenthesized + /// + /// The `(A, B) -> C` in `Fn(A, B) -> C`. + pub enum PathArguments { + None, + /// The `<'a, T>` in `std::slice::iter<'a, T>`. + AngleBracketed(AngleBracketedGenericArguments), + /// The `(A, B) -> C` in `Fn(A, B) -> C`. + Parenthesized(ParenthesizedGenericArguments), + } +} + +impl Default for PathArguments { + fn default() -> Self { + PathArguments::None + } +} + +impl PathArguments { + pub fn is_empty(&self) -> bool { + match *self { + PathArguments::None => true, + PathArguments::AngleBracketed(ref bracketed) => bracketed.args.is_empty(), + PathArguments::Parenthesized(_) => false, + } + } + + #[cfg(feature = "parsing")] + fn is_none(&self) -> bool { + match *self { + PathArguments::None => true, + PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => false, + } + } +} + +ast_enum! { + /// An individual generic argument, like `'a`, `T`, or `Item = T`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum GenericArgument { + /// A lifetime argument. + Lifetime(Lifetime), + /// A type argument. + Type(Type), + /// A binding (equality constraint) on an associated type: the `Item = + /// u8` in `Iterator`. + Binding(Binding), + /// An associated type bound: `Iterator`. + Constraint(Constraint), + /// A const expression. Must be inside of a block. + /// + /// NOTE: Identity expressions are represented as Type arguments, as + /// they are indistinguishable syntactically. + Const(Expr), + } +} + +ast_struct! { + /// Angle bracketed arguments of a path segment: the `` in `HashMap`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct AngleBracketedGenericArguments { + pub colon2_token: Option, + pub lt_token: Token![<], + pub args: Punctuated, + pub gt_token: Token![>], + } +} + +ast_struct! { + /// A binding (equality constraint) on an associated type: `Item = u8`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Binding { + pub ident: Ident, + pub eq_token: Token![=], + pub ty: Type, + } +} + +ast_struct! { + /// An associated type bound: `Iterator`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Constraint { + pub ident: Ident, + pub colon_token: Token![:], + pub bounds: Punctuated, + } +} + +ast_struct! { + /// Arguments of a function path segment: the `(A, B) -> C` in `Fn(A,B) -> + /// C`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct ParenthesizedGenericArguments { + pub paren_token: token::Paren, + /// `(A, B)` + pub inputs: Punctuated, + /// `C` + pub output: ReturnType, + } +} + +ast_struct! { + /// The explicit Self type in a qualified path: the `T` in `::fmt`. + /// + /// The actual path, including the trait and the associated item, is stored + /// separately. The `position` field represents the index of the associated + /// item qualified with this Self type. + /// + /// ```text + /// as a::b::Trait>::AssociatedItem + /// ^~~~~~ ~~~~~~~~~~~~~~^ + /// ty position = 3 + /// + /// >::AssociatedItem + /// ^~~~~~ ^ + /// ty position = 0 + /// ``` + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct QSelf { + pub lt_token: Token![<], + pub ty: Box, + pub position: usize, + pub as_token: Option, + pub gt_token: Token![>], + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + #[cfg(feature = "full")] + use expr; + use ext::IdentExt; + use parse::{Parse, ParseStream, Result}; + + impl Parse for Path { + fn parse(input: ParseStream) -> Result { + Self::parse_helper(input, false) + } + } + + impl Parse for GenericArgument { + fn parse(input: ParseStream) -> Result { + if input.peek(Lifetime) && !input.peek2(Token![+]) { + return Ok(GenericArgument::Lifetime(input.parse()?)); + } + + if input.peek(Ident) && input.peek2(Token![=]) { + return Ok(GenericArgument::Binding(input.parse()?)); + } + + #[cfg(feature = "full")] + { + if input.peek(Ident) && input.peek2(Token![:]) && !input.peek2(Token![::]) { + return Ok(GenericArgument::Constraint(input.parse()?)); + } + + if input.peek(Lit) { + let lit = input.parse()?; + return Ok(GenericArgument::Const(Expr::Lit(lit))); + } + + if input.peek(token::Brace) { + let block = input.call(expr::parsing::expr_block)?; + return Ok(GenericArgument::Const(Expr::Block(block))); + } + } + + input.parse().map(GenericArgument::Type) + } + } + + impl Parse for AngleBracketedGenericArguments { + fn parse(input: ParseStream) -> Result { + Ok(AngleBracketedGenericArguments { + colon2_token: input.parse()?, + lt_token: input.parse()?, + args: { + let mut args = Punctuated::new(); + loop { + if input.peek(Token![>]) { + break; + } + let value = input.parse()?; + args.push_value(value); + if input.peek(Token![>]) { + break; + } + let punct = input.parse()?; + args.push_punct(punct); + } + args + }, + gt_token: input.parse()?, + }) + } + } + + impl Parse for ParenthesizedGenericArguments { + fn parse(input: ParseStream) -> Result { + let content; + Ok(ParenthesizedGenericArguments { + paren_token: parenthesized!(content in input), + inputs: content.parse_terminated(Type::parse)?, + output: input.call(ReturnType::without_plus)?, + }) + } + } + + impl Parse for PathSegment { + fn parse(input: ParseStream) -> Result { + Self::parse_helper(input, false) + } + } + + impl PathSegment { + fn parse_helper(input: ParseStream, expr_style: bool) -> Result { + if input.peek(Token![super]) + || input.peek(Token![self]) + || input.peek(Token![Self]) + || input.peek(Token![crate]) + || input.peek(Token![extern]) + { + let ident = input.call(Ident::parse_any)?; + return Ok(PathSegment::from(ident)); + } + + let ident = input.parse()?; + if !expr_style && input.peek(Token![<]) && !input.peek(Token![<=]) + || input.peek(Token![::]) && input.peek3(Token![<]) + { + Ok(PathSegment { + ident: ident, + arguments: PathArguments::AngleBracketed(input.parse()?), + }) + } else { + Ok(PathSegment::from(ident)) + } + } + } + + impl Parse for Binding { + fn parse(input: ParseStream) -> Result { + Ok(Binding { + ident: input.parse()?, + eq_token: input.parse()?, + ty: input.parse()?, + }) + } + } + + #[cfg(feature = "full")] + impl Parse for Constraint { + fn parse(input: ParseStream) -> Result { + Ok(Constraint { + ident: input.parse()?, + colon_token: input.parse()?, + bounds: { + let mut bounds = Punctuated::new(); + loop { + if input.peek(Token![,]) || input.peek(Token![>]) { + break; + } + let value = input.parse()?; + bounds.push_value(value); + if !input.peek(Token![+]) { + break; + } + let punct = input.parse()?; + bounds.push_punct(punct); + } + bounds + }, + }) + } + } + + impl Path { + /// Parse a `Path` containing no path arguments on any of its segments. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + /// + /// # Example + /// + /// ```edition2018 + /// use syn::{Path, Result, Token}; + /// use syn::parse::{Parse, ParseStream}; + /// + /// // A simplified single `use` statement like: + /// // + /// // use std::collections::HashMap; + /// // + /// // Note that generic parameters are not allowed in a `use` statement + /// // so the following must not be accepted. + /// // + /// // use a::::c; + /// struct SingleUse { + /// use_token: Token![use], + /// path: Path, + /// } + /// + /// impl Parse for SingleUse { + /// fn parse(input: ParseStream) -> Result { + /// Ok(SingleUse { + /// use_token: input.parse()?, + /// path: input.call(Path::parse_mod_style)?, + /// }) + /// } + /// } + /// ``` + pub fn parse_mod_style(input: ParseStream) -> Result { + Ok(Path { + leading_colon: input.parse()?, + segments: { + let mut segments = Punctuated::new(); + loop { + if !input.peek(Ident) + && !input.peek(Token![super]) + && !input.peek(Token![self]) + && !input.peek(Token![Self]) + && !input.peek(Token![crate]) + && !input.peek(Token![extern]) + { + break; + } + let ident = Ident::parse_any(input)?; + segments.push_value(PathSegment::from(ident)); + if !input.peek(Token![::]) { + break; + } + let punct = input.parse()?; + segments.push_punct(punct); + } + if segments.is_empty() { + return Err(input.error("expected path")); + } else if segments.trailing_punct() { + return Err(input.error("expected path segment")); + } + segments + }, + }) + } + + /// Determines whether this is a path of length 1 equal to the given + /// ident. + /// + /// For them to compare equal, it must be the case that: + /// + /// - the path has no leading colon, + /// - the number of path segments is 1, + /// - the first path segment has no angle bracketed or parenthesized + /// path arguments + /// - and the ident of the first path segment is equal to the given one. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + pub fn is_ident(&self, ident: I) -> bool + where + Ident: PartialEq, + { + self.leading_colon.is_none() + && self.segments.len() == 1 + && self.segments[0].arguments.is_none() + && self.segments[0].ident == ident + } + + fn parse_helper(input: ParseStream, expr_style: bool) -> Result { + if input.peek(Token![dyn]) { + return Err(input.error("expected path")); + } + + Ok(Path { + leading_colon: input.parse()?, + segments: { + let mut segments = Punctuated::new(); + let value = PathSegment::parse_helper(input, expr_style)?; + segments.push_value(value); + while input.peek(Token![::]) { + let punct: Token![::] = input.parse()?; + segments.push_punct(punct); + let value = PathSegment::parse_helper(input, expr_style)?; + segments.push_value(value); + } + segments + }, + }) + } + } + + pub fn qpath(input: ParseStream, expr_style: bool) -> Result<(Option, Path)> { + if input.peek(Token![<]) { + let lt_token: Token![<] = input.parse()?; + let this: Type = input.parse()?; + let path = if input.peek(Token![as]) { + let as_token: Token![as] = input.parse()?; + let path: Path = input.parse()?; + Some((as_token, path)) + } else { + None + }; + let gt_token: Token![>] = input.parse()?; + let colon2_token: Token![::] = input.parse()?; + let mut rest = Punctuated::new(); + loop { + let path = PathSegment::parse_helper(input, expr_style)?; + rest.push_value(path); + if !input.peek(Token![::]) { + break; + } + let punct: Token![::] = input.parse()?; + rest.push_punct(punct); + } + let (position, as_token, path) = match path { + Some((as_token, mut path)) => { + let pos = path.segments.len(); + path.segments.push_punct(colon2_token); + path.segments.extend(rest.into_pairs()); + (pos, Some(as_token), path) + } + None => { + let path = Path { + leading_colon: Some(colon2_token), + segments: rest, + }; + (0, None, path) + } + }; + let qself = QSelf { + lt_token: lt_token, + ty: Box::new(this), + position: position, + as_token: as_token, + gt_token: gt_token, + }; + Ok((Some(qself), path)) + } else { + let path = Path::parse_helper(input, expr_style)?; + Ok((None, path)) + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::ToTokens; + + use print::TokensOrDefault; + + impl ToTokens for Path { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.leading_colon.to_tokens(tokens); + self.segments.to_tokens(tokens); + } + } + + impl ToTokens for PathSegment { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.arguments.to_tokens(tokens); + } + } + + impl ToTokens for PathArguments { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + PathArguments::None => {} + PathArguments::AngleBracketed(ref arguments) => { + arguments.to_tokens(tokens); + } + PathArguments::Parenthesized(ref arguments) => { + arguments.to_tokens(tokens); + } + } + } + } + + impl ToTokens for GenericArgument { + #[cfg_attr(feature = "cargo-clippy", allow(match_same_arms))] + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + GenericArgument::Lifetime(ref lt) => lt.to_tokens(tokens), + GenericArgument::Type(ref ty) => ty.to_tokens(tokens), + GenericArgument::Binding(ref tb) => tb.to_tokens(tokens), + GenericArgument::Constraint(ref tc) => tc.to_tokens(tokens), + GenericArgument::Const(ref e) => match *e { + Expr::Lit(_) => e.to_tokens(tokens), + + // NOTE: We should probably support parsing blocks with only + // expressions in them without the full feature for const + // generics. + #[cfg(feature = "full")] + Expr::Block(_) => e.to_tokens(tokens), + + // ERROR CORRECTION: Add braces to make sure that the + // generated code is valid. + _ => token::Brace::default().surround(tokens, |tokens| { + e.to_tokens(tokens); + }), + }, + } + } + } + + impl ToTokens for AngleBracketedGenericArguments { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.colon2_token.to_tokens(tokens); + self.lt_token.to_tokens(tokens); + + // Print lifetimes before types and consts, all before bindings, + // regardless of their order in self.args. + // + // TODO: ordering rules for const arguments vs type arguments have + // not been settled yet. https://github.com/rust-lang/rust/issues/44580 + let mut trailing_or_empty = true; + for param in self.args.pairs() { + match **param.value() { + GenericArgument::Lifetime(_) => { + param.to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + GenericArgument::Type(_) + | GenericArgument::Binding(_) + | GenericArgument::Constraint(_) + | GenericArgument::Const(_) => {} + } + } + for param in self.args.pairs() { + match **param.value() { + GenericArgument::Type(_) | GenericArgument::Const(_) => { + if !trailing_or_empty { + ::default().to_tokens(tokens); + } + param.to_tokens(tokens); + trailing_or_empty = param.punct().is_some(); + } + GenericArgument::Lifetime(_) + | GenericArgument::Binding(_) + | GenericArgument::Constraint(_) => {} + } + } + for param in self.args.pairs() { + match **param.value() { + GenericArgument::Binding(_) | GenericArgument::Constraint(_) => { + if !trailing_or_empty { + ::default().to_tokens(tokens); + trailing_or_empty = true; + } + param.to_tokens(tokens); + } + GenericArgument::Lifetime(_) + | GenericArgument::Type(_) + | GenericArgument::Const(_) => {} + } + } + + self.gt_token.to_tokens(tokens); + } + } + + impl ToTokens for Binding { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.eq_token.to_tokens(tokens); + self.ty.to_tokens(tokens); + } + } + + impl ToTokens for Constraint { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.ident.to_tokens(tokens); + self.colon_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + + impl ToTokens for ParenthesizedGenericArguments { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.paren_token.surround(tokens, |tokens| { + self.inputs.to_tokens(tokens); + }); + self.output.to_tokens(tokens); + } + } + + impl private { + pub fn print_path(tokens: &mut TokenStream, qself: &Option, path: &Path) { + let qself = match *qself { + Some(ref qself) => qself, + None => { + path.to_tokens(tokens); + return; + } + }; + qself.lt_token.to_tokens(tokens); + qself.ty.to_tokens(tokens); + + let pos = if qself.position > 0 && qself.position >= path.segments.len() { + path.segments.len() - 1 + } else { + qself.position + }; + let mut segments = path.segments.pairs(); + if pos > 0 { + TokensOrDefault(&qself.as_token).to_tokens(tokens); + path.leading_colon.to_tokens(tokens); + for (i, segment) in segments.by_ref().take(pos).enumerate() { + if i + 1 == pos { + segment.value().to_tokens(tokens); + qself.gt_token.to_tokens(tokens); + segment.punct().to_tokens(tokens); + } else { + segment.to_tokens(tokens); + } + } + } else { + qself.gt_token.to_tokens(tokens); + path.leading_colon.to_tokens(tokens); + } + for segment in segments { + segment.to_tokens(tokens); + } + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/print.rs b/vendor/registry-40351f815f426200/syn/src/print.rs new file mode 100644 index 000000000..90570a040 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/print.rs @@ -0,0 +1,16 @@ +use proc_macro2::TokenStream; +use quote::ToTokens; + +pub struct TokensOrDefault<'a, T: 'a>(pub &'a Option); + +impl<'a, T> ToTokens for TokensOrDefault<'a, T> +where + T: ToTokens + Default, +{ + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self.0 { + Some(ref t) => t.to_tokens(tokens), + None => T::default().to_tokens(tokens), + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/punctuated.rs b/vendor/registry-40351f815f426200/syn/src/punctuated.rs new file mode 100644 index 000000000..5aa519ffe --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/punctuated.rs @@ -0,0 +1,836 @@ +//! A punctuated sequence of syntax tree nodes separated by punctuation. +//! +//! Lots of things in Rust are punctuated sequences. +//! +//! - The fields of a struct are `Punctuated`. +//! - The segments of a path are `Punctuated`. +//! - The bounds on a generic parameter are `Punctuated`. +//! - The arguments to a function call are `Punctuated`. +//! +//! This module provides a common representation for these punctuated sequences +//! in the form of the [`Punctuated`] type. We store a vector of pairs of +//! syntax tree node + punctuation, where every node in the sequence is followed +//! by punctuation except for possibly the final one. +//! +//! [`Punctuated`]: struct.Punctuated.html +//! +//! ```text +//! a_function_call(arg1, arg2, arg3); +//! ^^^^^ ~~~~~ ^^^^ +//! ``` + +#[cfg(feature = "extra-traits")] +use std::fmt::{self, Debug}; +#[cfg(any(feature = "full", feature = "derive"))] +use std::iter; +use std::iter::FromIterator; +use std::marker::PhantomData; +use std::ops::{Index, IndexMut}; +use std::option; +use std::slice; +use std::vec; + +#[cfg(feature = "parsing")] +use parse::{Parse, ParseStream, Result}; +#[cfg(any(feature = "full", feature = "derive"))] +use private; +#[cfg(feature = "parsing")] +use token::Token; + +/// A punctuated sequence of syntax tree nodes of type `T` separated by +/// punctuation of type `P`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +#[cfg_attr(feature = "extra-traits", derive(Eq, PartialEq, Hash))] +#[cfg_attr(feature = "clone-impls", derive(Clone))] +pub struct Punctuated { + inner: Vec<(T, P)>, + last: Option>, +} + +impl Punctuated { + /// Creates an empty punctuated sequence. + pub fn new() -> Punctuated { + Punctuated { + inner: Vec::new(), + last: None, + } + } + + /// Determines whether this punctuated sequence is empty, meaning it + /// contains no syntax tree nodes or punctuation. + pub fn is_empty(&self) -> bool { + self.inner.len() == 0 && self.last.is_none() + } + + /// Returns the number of syntax tree nodes in this punctuated sequence. + /// + /// This is the number of nodes of type `T`, not counting the punctuation of + /// type `P`. + pub fn len(&self) -> usize { + self.inner.len() + if self.last.is_some() { 1 } else { 0 } + } + + /// Borrows the first punctuated pair in this sequence. + pub fn first(&self) -> Option> { + self.pairs().next() + } + + /// Borrows the last punctuated pair in this sequence. + pub fn last(&self) -> Option> { + if self.last.is_some() { + self.last.as_ref().map(|t| Pair::End(t.as_ref())) + } else { + self.inner + .last() + .map(|&(ref t, ref d)| Pair::Punctuated(t, d)) + } + } + + /// Mutably borrows the last punctuated pair in this sequence. + pub fn last_mut(&mut self) -> Option> { + if self.last.is_some() { + self.last.as_mut().map(|t| Pair::End(t.as_mut())) + } else { + self.inner + .last_mut() + .map(|&mut (ref mut t, ref mut d)| Pair::Punctuated(t, d)) + } + } + + /// Returns an iterator over borrowed syntax tree nodes of type `&T`. + pub fn iter(&self) -> Iter { + Iter { + inner: Box::new(PrivateIter { + inner: self.inner.iter(), + last: self.last.as_ref().map(Box::as_ref).into_iter(), + }), + } + } + + /// Returns an iterator over mutably borrowed syntax tree nodes of type + /// `&mut T`. + pub fn iter_mut(&mut self) -> IterMut { + IterMut { + inner: Box::new(PrivateIterMut { + inner: self.inner.iter_mut(), + last: self.last.as_mut().map(Box::as_mut).into_iter(), + }), + } + } + + /// Returns an iterator over the contents of this sequence as borrowed + /// punctuated pairs. + pub fn pairs(&self) -> Pairs { + Pairs { + inner: self.inner.iter(), + last: self.last.as_ref().map(Box::as_ref).into_iter(), + } + } + + /// Returns an iterator over the contents of this sequence as mutably + /// borrowed punctuated pairs. + pub fn pairs_mut(&mut self) -> PairsMut { + PairsMut { + inner: self.inner.iter_mut(), + last: self.last.as_mut().map(Box::as_mut).into_iter(), + } + } + + /// Returns an iterator over the contents of this sequence as owned + /// punctuated pairs. + pub fn into_pairs(self) -> IntoPairs { + IntoPairs { + inner: self.inner.into_iter(), + last: self.last.map(|t| *t).into_iter(), + } + } + + /// Appends a syntax tree node onto the end of this punctuated sequence. The + /// sequence must previously have a trailing punctuation. + /// + /// Use [`push`] instead if the punctuated sequence may or may not already + /// have trailing punctuation. + /// + /// [`push`]: #method.push + /// + /// # Panics + /// + /// Panics if the sequence does not already have a trailing punctuation when + /// this method is called. + pub fn push_value(&mut self, value: T) { + assert!(self.empty_or_trailing()); + self.last = Some(Box::new(value)); + } + + /// Appends a trailing punctuation onto the end of this punctuated sequence. + /// The sequence must be non-empty and must not already have trailing + /// punctuation. + /// + /// # Panics + /// + /// Panics if the sequence is empty or already has a trailing punctuation. + pub fn push_punct(&mut self, punctuation: P) { + assert!(self.last.is_some()); + let last = self.last.take().unwrap(); + self.inner.push((*last, punctuation)); + } + + /// Removes the last punctuated pair from this sequence, or `None` if the + /// sequence is empty. + pub fn pop(&mut self) -> Option> { + if self.last.is_some() { + self.last.take().map(|t| Pair::End(*t)) + } else { + self.inner.pop().map(|(t, d)| Pair::Punctuated(t, d)) + } + } + + /// Determines whether this punctuated sequence ends with a trailing + /// punctuation. + pub fn trailing_punct(&self) -> bool { + self.last.is_none() && !self.is_empty() + } + + /// Returns true if either this `Punctuated` is empty, or it has a trailing + /// punctuation. + /// + /// Equivalent to `punctuated.is_empty() || punctuated.trailing_punct()`. + pub fn empty_or_trailing(&self) -> bool { + self.last.is_none() + } + + /// Appends a syntax tree node onto the end of this punctuated sequence. + /// + /// If there is not a trailing punctuation in this sequence when this method + /// is called, the default value of punctuation type `P` is inserted before + /// the given value of type `T`. + pub fn push(&mut self, value: T) + where + P: Default, + { + if !self.empty_or_trailing() { + self.push_punct(Default::default()); + } + self.push_value(value); + } + + /// Inserts an element at position `index`. + /// + /// # Panics + /// + /// Panics if `index` is greater than the number of elements previously in + /// this punctuated sequence. + pub fn insert(&mut self, index: usize, value: T) + where + P: Default, + { + assert!(index <= self.len()); + + if index == self.len() { + self.push(value); + } else { + self.inner.insert(index, (value, Default::default())); + } + } + + /// Parses zero or more occurrences of `T` separated by punctuation of type + /// `P`, with optional trailing punctuation. + /// + /// Parsing continues until the end of this parse stream. The entire content + /// of this parse stream must consist of `T` and `P`. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_terminated(input: ParseStream) -> Result + where + T: Parse, + P: Parse, + { + Self::parse_terminated_with(input, T::parse) + } + + /// Parses zero or more occurrences of `T` using the given parse function, + /// separated by punctuation of type `P`, with optional trailing + /// punctuation. + /// + /// Like [`parse_terminated`], the entire content of this stream is expected + /// to be parsed. + /// + /// [`parse_terminated`]: #method.parse_terminated + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_terminated_with( + input: ParseStream, + parser: fn(ParseStream) -> Result, + ) -> Result + where + P: Parse, + { + let mut punctuated = Punctuated::new(); + + loop { + if input.is_empty() { + break; + } + let value = parser(input)?; + punctuated.push_value(value); + if input.is_empty() { + break; + } + let punct = input.parse()?; + punctuated.push_punct(punct); + } + + Ok(punctuated) + } + + /// Parses one or more occurrences of `T` separated by punctuation of type + /// `P`, not accepting trailing punctuation. + /// + /// Parsing continues as long as punctuation `P` is present at the head of + /// the stream. This method returns upon parsing a `T` and observing that it + /// is not followed by a `P`, even if there are remaining tokens in the + /// stream. + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_separated_nonempty(input: ParseStream) -> Result + where + T: Parse, + P: Token + Parse, + { + Self::parse_separated_nonempty_with(input, T::parse) + } + + /// Parses one or more occurrences of `T` using the given parse function, + /// separated by punctuation of type `P`, not accepting trailing + /// punctuation. + /// + /// Like [`parse_separated_nonempty`], may complete early without parsing + /// the entire content of this stream. + /// + /// [`parse_separated_nonempty`]: #method.parse_separated_nonempty + /// + /// *This function is available if Syn is built with the `"parsing"` + /// feature.* + #[cfg(feature = "parsing")] + pub fn parse_separated_nonempty_with( + input: ParseStream, + parser: fn(ParseStream) -> Result, + ) -> Result + where + P: Token + Parse, + { + let mut punctuated = Punctuated::new(); + + loop { + let value = parser(input)?; + punctuated.push_value(value); + if !P::peek(input.cursor()) { + break; + } + let punct = input.parse()?; + punctuated.push_punct(punct); + } + + Ok(punctuated) + } +} + +#[cfg(feature = "extra-traits")] +impl Debug for Punctuated { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let mut list = f.debug_list(); + for &(ref t, ref p) in &self.inner { + list.entry(t); + list.entry(p); + } + if let Some(ref last) = self.last { + list.entry(last); + } + list.finish() + } +} + +impl FromIterator for Punctuated +where + P: Default, +{ + fn from_iter>(i: I) -> Self { + let mut ret = Punctuated::new(); + ret.extend(i); + ret + } +} + +impl Extend for Punctuated +where + P: Default, +{ + fn extend>(&mut self, i: I) { + for value in i { + self.push(value); + } + } +} + +impl FromIterator> for Punctuated { + fn from_iter>>(i: I) -> Self { + let mut ret = Punctuated::new(); + ret.extend(i); + ret + } +} + +impl Extend> for Punctuated { + fn extend>>(&mut self, i: I) { + assert!(self.empty_or_trailing()); + let mut nomore = false; + for pair in i { + if nomore { + panic!("Punctuated extended with items after a Pair::End"); + } + match pair { + Pair::Punctuated(a, b) => self.inner.push((a, b)), + Pair::End(a) => { + self.last = Some(Box::new(a)); + nomore = true; + } + } + } + } +} + +impl IntoIterator for Punctuated { + type Item = T; + type IntoIter = IntoIter; + + fn into_iter(self) -> Self::IntoIter { + let mut elements = Vec::with_capacity(self.len()); + elements.extend(self.inner.into_iter().map(|pair| pair.0)); + elements.extend(self.last.map(|t| *t)); + + IntoIter { + inner: elements.into_iter(), + marker: PhantomData, + } + } +} + +impl<'a, T, P> IntoIterator for &'a Punctuated { + type Item = &'a T; + type IntoIter = Iter<'a, T>; + + fn into_iter(self) -> Self::IntoIter { + Punctuated::iter(self) + } +} + +impl<'a, T, P> IntoIterator for &'a mut Punctuated { + type Item = &'a mut T; + type IntoIter = IterMut<'a, T>; + + fn into_iter(self) -> Self::IntoIter { + Punctuated::iter_mut(self) + } +} + +impl Default for Punctuated { + fn default() -> Self { + Punctuated::new() + } +} + +/// An iterator over borrowed pairs of type `Pair<&T, &P>`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +pub struct Pairs<'a, T: 'a, P: 'a> { + inner: slice::Iter<'a, (T, P)>, + last: option::IntoIter<&'a T>, +} + +impl<'a, T, P> Iterator for Pairs<'a, T, P> { + type Item = Pair<&'a T, &'a P>; + + fn next(&mut self) -> Option { + self.inner + .next() + .map(|&(ref t, ref p)| Pair::Punctuated(t, p)) + .or_else(|| self.last.next().map(Pair::End)) + } +} + +impl<'a, T, P> ExactSizeIterator for Pairs<'a, T, P> { + fn len(&self) -> usize { + self.inner.len() + self.last.len() + } +} + +// No Clone bound on T or P. +impl<'a, T, P> Clone for Pairs<'a, T, P> { + fn clone(&self) -> Self { + Pairs { + inner: self.inner.clone(), + last: self.last.clone(), + } + } +} + +/// An iterator over mutably borrowed pairs of type `Pair<&mut T, &mut P>`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +pub struct PairsMut<'a, T: 'a, P: 'a> { + inner: slice::IterMut<'a, (T, P)>, + last: option::IntoIter<&'a mut T>, +} + +impl<'a, T, P> Iterator for PairsMut<'a, T, P> { + type Item = Pair<&'a mut T, &'a mut P>; + + fn next(&mut self) -> Option { + self.inner + .next() + .map(|&mut (ref mut t, ref mut p)| Pair::Punctuated(t, p)) + .or_else(|| self.last.next().map(Pair::End)) + } +} + +impl<'a, T, P> ExactSizeIterator for PairsMut<'a, T, P> { + fn len(&self) -> usize { + self.inner.len() + self.last.len() + } +} + +/// An iterator over owned pairs of type `Pair`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +#[derive(Clone)] +pub struct IntoPairs { + inner: vec::IntoIter<(T, P)>, + last: option::IntoIter, +} + +impl Iterator for IntoPairs { + type Item = Pair; + + fn next(&mut self) -> Option { + self.inner + .next() + .map(|(t, p)| Pair::Punctuated(t, p)) + .or_else(|| self.last.next().map(Pair::End)) + } +} + +impl ExactSizeIterator for IntoPairs { + fn len(&self) -> usize { + self.inner.len() + self.last.len() + } +} + +/// An iterator over owned values of type `T`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +#[derive(Clone)] +pub struct IntoIter { + inner: vec::IntoIter, + + // TODO: remove P type parameter in the next breaking change + marker: PhantomData

, +} + +impl Iterator for IntoIter { + type Item = T; + + fn next(&mut self) -> Option { + self.inner.next() + } +} + +impl ExactSizeIterator for IntoIter { + fn len(&self) -> usize { + self.inner.len() + } +} + +/// An iterator over borrowed values of type `&T`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +pub struct Iter<'a, T: 'a> { + // The `Item = &'a T` needs to be specified to support rustc 1.31 and older. + // On modern compilers we would be able to write just IterTrait<'a, T> where + // Item can be inferred unambiguously from the supertrait. + inner: Box + 'a>, +} + +trait IterTrait<'a, T: 'a>: ExactSizeIterator { + fn clone_box(&self) -> Box + 'a>; +} + +struct PrivateIter<'a, T: 'a, P: 'a> { + inner: slice::Iter<'a, (T, P)>, + last: option::IntoIter<&'a T>, +} + +#[cfg(any(feature = "full", feature = "derive"))] +impl private { + pub fn empty_punctuated_iter<'a, T>() -> Iter<'a, T> { + Iter { + inner: Box::new(iter::empty()), + } + } +} + +// No Clone bound on T. +impl<'a, T> Clone for Iter<'a, T> { + fn clone(&self) -> Self { + Iter { + inner: self.inner.clone_box(), + } + } +} + +impl<'a, T> Iterator for Iter<'a, T> { + type Item = &'a T; + + fn next(&mut self) -> Option { + self.inner.next() + } +} + +impl<'a, T> ExactSizeIterator for Iter<'a, T> { + fn len(&self) -> usize { + self.inner.len() + } +} + +impl<'a, T, P> Iterator for PrivateIter<'a, T, P> { + type Item = &'a T; + + fn next(&mut self) -> Option { + self.inner + .next() + .map(|pair| &pair.0) + .or_else(|| self.last.next()) + } +} + +impl<'a, T, P> ExactSizeIterator for PrivateIter<'a, T, P> { + fn len(&self) -> usize { + self.inner.len() + self.last.len() + } +} + +// No Clone bound on T or P. +impl<'a, T, P> Clone for PrivateIter<'a, T, P> { + fn clone(&self) -> Self { + PrivateIter { + inner: self.inner.clone(), + last: self.last.clone(), + } + } +} + +impl<'a, T: 'a, I: 'a> IterTrait<'a, T> for I +where + I: ExactSizeIterator + Clone, +{ + fn clone_box(&self) -> Box + 'a> { + Box::new(self.clone()) + } +} + +/// An iterator over mutably borrowed values of type `&mut T`. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +pub struct IterMut<'a, T: 'a> { + inner: Box + 'a>, +} + +struct PrivateIterMut<'a, T: 'a, P: 'a> { + inner: slice::IterMut<'a, (T, P)>, + last: option::IntoIter<&'a mut T>, +} + +#[cfg(any(feature = "full", feature = "derive"))] +impl private { + pub fn empty_punctuated_iter_mut<'a, T>() -> IterMut<'a, T> { + IterMut { + inner: Box::new(iter::empty()), + } + } +} + +impl<'a, T> Iterator for IterMut<'a, T> { + type Item = &'a mut T; + + fn next(&mut self) -> Option { + self.inner.next() + } +} + +impl<'a, T> ExactSizeIterator for IterMut<'a, T> { + fn len(&self) -> usize { + self.inner.len() + } +} + +impl<'a, T, P> Iterator for PrivateIterMut<'a, T, P> { + type Item = &'a mut T; + + fn next(&mut self) -> Option { + self.inner + .next() + .map(|pair| &mut pair.0) + .or_else(|| self.last.next()) + } +} + +impl<'a, T, P> ExactSizeIterator for PrivateIterMut<'a, T, P> { + fn len(&self) -> usize { + self.inner.len() + self.last.len() + } +} + +/// A single syntax tree node of type `T` followed by its trailing punctuation +/// of type `P` if any. +/// +/// Refer to the [module documentation] for details about punctuated sequences. +/// +/// [module documentation]: index.html +#[cfg_attr(feature = "clone-impls", derive(Clone))] +pub enum Pair { + Punctuated(T, P), + End(T), +} + +impl Pair { + /// Extracts the syntax tree node from this punctuated pair, discarding the + /// following punctuation. + pub fn into_value(self) -> T { + match self { + Pair::Punctuated(t, _) | Pair::End(t) => t, + } + } + + /// Borrows the syntax tree node from this punctuated pair. + pub fn value(&self) -> &T { + match *self { + Pair::Punctuated(ref t, _) | Pair::End(ref t) => t, + } + } + + /// Mutably borrows the syntax tree node from this punctuated pair. + pub fn value_mut(&mut self) -> &mut T { + match *self { + Pair::Punctuated(ref mut t, _) | Pair::End(ref mut t) => t, + } + } + + /// Borrows the punctuation from this punctuated pair, unless this pair is + /// the final one and there is no trailing punctuation. + pub fn punct(&self) -> Option<&P> { + match *self { + Pair::Punctuated(_, ref d) => Some(d), + Pair::End(_) => None, + } + } + + /// Creates a punctuated pair out of a syntax tree node and an optional + /// following punctuation. + pub fn new(t: T, d: Option

) -> Self { + match d { + Some(d) => Pair::Punctuated(t, d), + None => Pair::End(t), + } + } + + /// Produces this punctuated pair as a tuple of syntax tree node and + /// optional following punctuation. + pub fn into_tuple(self) -> (T, Option

) { + match self { + Pair::Punctuated(t, d) => (t, Some(d)), + Pair::End(t) => (t, None), + } + } +} + +impl Index for Punctuated { + type Output = T; + + fn index(&self, index: usize) -> &Self::Output { + if index == self.len() - 1 { + match self.last { + Some(ref t) => t, + None => &self.inner[index].0, + } + } else { + &self.inner[index].0 + } + } +} + +impl IndexMut for Punctuated { + fn index_mut(&mut self, index: usize) -> &mut Self::Output { + if index == self.len() - 1 { + match self.last { + Some(ref mut t) => t, + None => &mut self.inner[index].0, + } + } else { + &mut self.inner[index].0 + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + use proc_macro2::TokenStream; + use quote::{ToTokens, TokenStreamExt}; + + impl ToTokens for Punctuated + where + T: ToTokens, + P: ToTokens, + { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append_all(self.pairs()) + } + } + + impl ToTokens for Pair + where + T: ToTokens, + P: ToTokens, + { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + Pair::Punctuated(ref a, ref b) => { + a.to_tokens(tokens); + b.to_tokens(tokens); + } + Pair::End(ref a) => a.to_tokens(tokens), + } + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/sealed.rs b/vendor/registry-40351f815f426200/syn/src/sealed.rs new file mode 100644 index 000000000..0b11bc99a --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/sealed.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "parsing")] +pub mod lookahead { + pub trait Sealed: Copy {} +} diff --git a/vendor/registry-40351f815f426200/syn/src/span.rs b/vendor/registry-40351f815f426200/syn/src/span.rs new file mode 100644 index 000000000..27a7fe846 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/span.rs @@ -0,0 +1,67 @@ +use proc_macro2::Span; + +pub trait IntoSpans { + fn into_spans(self) -> S; +} + +impl IntoSpans<[Span; 1]> for Span { + fn into_spans(self) -> [Span; 1] { + [self] + } +} + +impl IntoSpans<[Span; 2]> for Span { + fn into_spans(self) -> [Span; 2] { + [self, self] + } +} + +impl IntoSpans<[Span; 3]> for Span { + fn into_spans(self) -> [Span; 3] { + [self, self, self] + } +} + +impl IntoSpans<[Span; 1]> for [Span; 1] { + fn into_spans(self) -> [Span; 1] { + self + } +} + +impl IntoSpans<[Span; 2]> for [Span; 2] { + fn into_spans(self) -> [Span; 2] { + self + } +} + +impl IntoSpans<[Span; 3]> for [Span; 3] { + fn into_spans(self) -> [Span; 3] { + self + } +} + +#[cfg(feature = "parsing")] +pub trait FromSpans: Sized { + fn from_spans(spans: &[Span]) -> Self; +} + +#[cfg(feature = "parsing")] +impl FromSpans for [Span; 1] { + fn from_spans(spans: &[Span]) -> Self { + [spans[0]] + } +} + +#[cfg(feature = "parsing")] +impl FromSpans for [Span; 2] { + fn from_spans(spans: &[Span]) -> Self { + [spans[0], spans[1]] + } +} + +#[cfg(feature = "parsing")] +impl FromSpans for [Span; 3] { + fn from_spans(spans: &[Span]) -> Self { + [spans[0], spans[1], spans[2]] + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/spanned.rs b/vendor/registry-40351f815f426200/syn/src/spanned.rs new file mode 100644 index 000000000..79e23dfbb --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/spanned.rs @@ -0,0 +1,144 @@ +//! A trait that can provide the `Span` of the complete contents of a syntax +//! tree node. +//! +//! *This module is available if Syn is built with both the `"parsing"` and +//! `"printing"` features.* +//! +//! # Example +//! +//! Suppose in a procedural macro we have a [`Type`] that we want to assert +//! implements the [`Sync`] trait. Maybe this is the type of one of the fields +//! of a struct for which we are deriving a trait implementation, and we need to +//! be able to pass a reference to one of those fields across threads. +//! +//! [`Type`]: ../enum.Type.html +//! [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html +//! +//! If the field type does *not* implement `Sync` as required, we want the +//! compiler to report an error pointing out exactly which type it was. +//! +//! The following macro code takes a variable `ty` of type `Type` and produces a +//! static assertion that `Sync` is implemented for that type. +//! +//! ```edition2018 +//! # extern crate proc_macro; +//! # +//! use proc_macro::TokenStream; +//! use proc_macro2::Span; +//! use quote::quote_spanned; +//! use syn::Type; +//! use syn::spanned::Spanned; +//! +//! # const IGNORE_TOKENS: &str = stringify! { +//! #[proc_macro_derive(MyMacro)] +//! # }; +//! pub fn my_macro(input: TokenStream) -> TokenStream { +//! # let ty = get_a_type(); +//! /* ... */ +//! +//! let assert_sync = quote_spanned! {ty.span()=> +//! struct _AssertSync where #ty: Sync; +//! }; +//! +//! /* ... */ +//! # input +//! } +//! # +//! # fn get_a_type() -> Type { +//! # unimplemented!() +//! # } +//! ``` +//! +//! By inserting this `assert_sync` fragment into the output code generated by +//! our macro, the user's code will fail to compile if `ty` does not implement +//! `Sync`. The errors they would see look like the following. +//! +//! ```text +//! error[E0277]: the trait bound `*const i32: std::marker::Sync` is not satisfied +//! --> src/main.rs:10:21 +//! | +//! 10 | bad_field: *const i32, +//! | ^^^^^^^^^^ `*const i32` cannot be shared between threads safely +//! ``` +//! +//! In this technique, using the `Type`'s span for the error message makes the +//! error appear in the correct place underlining the right type. + +use proc_macro2::{Span, TokenStream}; +use quote::ToTokens; + +/// A trait that can provide the `Span` of the complete contents of a syntax +/// tree node. +/// +/// This trait is automatically implemented for all types that implement +/// [`ToTokens`] from the `quote` crate. It is sealed and cannot be implemented +/// outside of the Syn crate other than by implementing `ToTokens`. +/// +/// [`ToTokens`]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html +/// +/// See the [module documentation] for an example. +/// +/// [module documentation]: index.html +/// +/// *This trait is available if Syn is built with both the `"parsing"` and +/// `"printing"` features.* +pub trait Spanned: private::Sealed { + /// Returns a `Span` covering the complete contents of this syntax tree + /// node, or [`Span::call_site()`] if this node is empty. + /// + /// [`Span::call_site()`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html#method.call_site + fn span(&self) -> Span; +} + +mod private { + use quote::ToTokens; + pub trait Sealed {} + impl Sealed for T {} +} + +impl Spanned for T +where + T: ToTokens, +{ + fn span(&self) -> Span { + join_spans(self.into_token_stream()) + } +} + +fn join_spans(tokens: TokenStream) -> Span { + let mut iter = tokens.into_iter().filter_map(|tt| { + // FIXME: This shouldn't be required, since optimally spans should + // never be invalid. This filter_map can probably be removed when + // https://github.com/rust-lang/rust/issues/43081 is resolved. + let span = tt.span(); + let debug = format!("{:?}", span); + if debug.ends_with("bytes(0..0)") { + None + } else { + Some(span) + } + }); + + let mut joined = match iter.next() { + Some(span) => span, + None => return Span::call_site(), + }; + + #[cfg(procmacro2_semver_exempt)] + { + for next in iter { + if let Some(span) = joined.join(next) { + joined = span; + } + } + } + + #[cfg(not(procmacro2_semver_exempt))] + { + // We can't join spans without procmacro2_semver_exempt so just grab the + // first one. + joined = joined; + } + + joined +} diff --git a/vendor/registry-40351f815f426200/syn/src/thread.rs b/vendor/registry-40351f815f426200/syn/src/thread.rs new file mode 100644 index 000000000..ff47e4af4 --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/thread.rs @@ -0,0 +1,83 @@ +use std::fmt::{self, Debug}; + +use self::thread_id::ThreadId; + +/// ThreadBound is a Sync-maker and Send-maker that allows accessing a value +/// of type T only from the original thread on which the ThreadBound was +/// constructed. +pub struct ThreadBound { + value: T, + thread_id: ThreadId, +} + +unsafe impl Sync for ThreadBound {} + +// Send bound requires Copy, as otherwise Drop could run in the wrong place. +unsafe impl Send for ThreadBound {} + +impl ThreadBound { + pub fn new(value: T) -> Self { + ThreadBound { + value: value, + thread_id: thread_id::current(), + } + } + + pub fn get(&self) -> Option<&T> { + if thread_id::current() == self.thread_id { + Some(&self.value) + } else { + None + } + } +} + +impl Debug for ThreadBound { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self.get() { + Some(value) => Debug::fmt(value, formatter), + None => formatter.write_str("unknown"), + } + } +} + +#[cfg(syn_can_use_thread_id)] +mod thread_id { + use std::thread; + + pub use std::thread::ThreadId; + + pub fn current() -> ThreadId { + thread::current().id() + } +} + +#[cfg(not(syn_can_use_thread_id))] +mod thread_id { + #[allow(deprecated)] + use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT}; + + thread_local! { + static THREAD_ID: usize = { + #[allow(deprecated)] + static NEXT_THREAD_ID: AtomicUsize = ATOMIC_USIZE_INIT; + + // Ordering::Relaxed because our only requirement for the ids is + // that they are unique. It is okay for the compiler to rearrange + // other memory reads around this fetch. It's still an atomic + // fetch_add, so no two threads will be able to read the same value + // from it. + // + // The main thing which these orderings affect is other memory reads + // around the atomic read, which for our case are irrelevant as this + // atomic guards nothing. + NEXT_THREAD_ID.fetch_add(1, Ordering::Relaxed) + }; + } + + pub type ThreadId = usize; + + pub fn current() -> ThreadId { + THREAD_ID.with(|id| *id) + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/token.rs b/vendor/registry-40351f815f426200/syn/src/token.rs new file mode 100644 index 000000000..55264133e --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/token.rs @@ -0,0 +1,950 @@ +//! Tokens representing Rust punctuation, keywords, and delimiters. +//! +//! The type names in this module can be difficult to keep straight, so we +//! prefer to use the [`Token!`] macro instead. This is a type-macro that +//! expands to the token type of the given token. +//! +//! [`Token!`]: ../macro.Token.html +//! +//! # Example +//! +//! The [`ItemStatic`] syntax tree node is defined like this. +//! +//! [`ItemStatic`]: ../struct.ItemStatic.html +//! +//! ```edition2018 +//! # use syn::{Attribute, Expr, Ident, Token, Type, Visibility}; +//! # +//! pub struct ItemStatic { +//! pub attrs: Vec, +//! pub vis: Visibility, +//! pub static_token: Token![static], +//! pub mutability: Option, +//! pub ident: Ident, +//! pub colon_token: Token![:], +//! pub ty: Box, +//! pub eq_token: Token![=], +//! pub expr: Box, +//! pub semi_token: Token![;], +//! } +//! ``` +//! +//! # Parsing +//! +//! Keywords and punctuation can be parsed through the [`ParseStream::parse`] +//! method. Delimiter tokens are parsed using the [`parenthesized!`], +//! [`bracketed!`] and [`braced!`] macros. +//! +//! [`ParseStream::parse`]: ../parse/struct.ParseBuffer.html#method.parse +//! [`parenthesized!`]: ../macro.parenthesized.html +//! [`bracketed!`]: ../macro.bracketed.html +//! [`braced!`]: ../macro.braced.html +//! +//! ```edition2018 +//! use syn::{Attribute, Result}; +//! use syn::parse::{Parse, ParseStream}; +//! # +//! # enum ItemStatic {} +//! +//! // Parse the ItemStatic struct shown above. +//! impl Parse for ItemStatic { +//! fn parse(input: ParseStream) -> Result { +//! # use syn::ItemStatic; +//! # fn parse(input: ParseStream) -> Result { +//! Ok(ItemStatic { +//! attrs: input.call(Attribute::parse_outer)?, +//! vis: input.parse()?, +//! static_token: input.parse()?, +//! mutability: input.parse()?, +//! ident: input.parse()?, +//! colon_token: input.parse()?, +//! ty: input.parse()?, +//! eq_token: input.parse()?, +//! expr: input.parse()?, +//! semi_token: input.parse()?, +//! }) +//! # } +//! # unimplemented!() +//! } +//! } +//! ``` +//! +//! # Other operations +//! +//! Every keyword and punctuation token supports the following operations. +//! +//! - [Peeking] — `input.peek(Token![...])` +//! +//! - [Parsing] — `input.parse::()?` +//! +//! - [Printing] — `quote!( ... #the_token ... )` +//! +//! - Construction from a [`Span`] — `let the_token = Token![...](sp)` +//! +//! - Field access to its span — `let sp = the_token.span` +//! +//! [Peeking]: ../parse/struct.ParseBuffer.html#method.peek +//! [Parsing]: ../parse/struct.ParseBuffer.html#method.parse +//! [Printing]: https://docs.rs/quote/0.6/quote/trait.ToTokens.html +//! [`Span`]: https://docs.rs/proc-macro2/0.4/proc_macro2/struct.Span.html + +use std; +#[cfg(feature = "extra-traits")] +use std::cmp; +#[cfg(feature = "extra-traits")] +use std::fmt::{self, Debug}; +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +use std::ops::{Deref, DerefMut}; + +#[cfg(feature = "parsing")] +use proc_macro2::Delimiter; +#[cfg(any(feature = "parsing", feature = "printing"))] +use proc_macro2::Ident; +use proc_macro2::Span; +#[cfg(feature = "printing")] +use proc_macro2::TokenStream; +#[cfg(feature = "printing")] +use quote::{ToTokens, TokenStreamExt}; + +use self::private::WithSpan; +#[cfg(feature = "parsing")] +use buffer::Cursor; +#[cfg(feature = "parsing")] +use error::Result; +#[cfg(any(feature = "full", feature = "derive"))] +#[cfg(feature = "parsing")] +use lifetime::Lifetime; +#[cfg(any(feature = "full", feature = "derive"))] +#[cfg(feature = "parsing")] +use lit::{Lit, LitBool, LitByte, LitByteStr, LitChar, LitFloat, LitInt, LitStr}; +#[cfg(feature = "parsing")] +use lookahead; +#[cfg(feature = "parsing")] +use parse::{Parse, ParseStream}; +use span::IntoSpans; + +/// Marker trait for types that represent single tokens. +/// +/// This trait is sealed and cannot be implemented for types outside of Syn. +#[cfg(feature = "parsing")] +pub trait Token: private::Sealed { + // Not public API. + #[doc(hidden)] + fn peek(cursor: Cursor) -> bool; + + // Not public API. + #[doc(hidden)] + fn display() -> &'static str; +} + +mod private { + use proc_macro2::Span; + + #[cfg(feature = "parsing")] + pub trait Sealed {} + + /// Support writing `token.span` rather than `token.spans[0]` on tokens that + /// hold a single span. + #[repr(C)] + pub struct WithSpan { + pub span: Span, + } +} + +#[cfg(feature = "parsing")] +impl private::Sealed for Ident {} + +#[cfg(any(feature = "full", feature = "derive"))] +#[cfg(feature = "parsing")] +fn peek_impl(cursor: Cursor, peek: fn(ParseStream) -> bool) -> bool { + use std::cell::Cell; + use std::rc::Rc; + + let scope = Span::call_site(); + let unexpected = Rc::new(Cell::new(None)); + let buffer = ::private::new_parse_buffer(scope, cursor, unexpected); + peek(&buffer) +} + +#[cfg(any(feature = "full", feature = "derive"))] +macro_rules! impl_token { + ($name:ident $display:expr) => { + #[cfg(feature = "parsing")] + impl Token for $name { + fn peek(cursor: Cursor) -> bool { + fn peek(input: ParseStream) -> bool { + <$name as Parse>::parse(input).is_ok() + } + peek_impl(cursor, peek) + } + + fn display() -> &'static str { + $display + } + } + + #[cfg(feature = "parsing")] + impl private::Sealed for $name {} + }; +} + +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(Lifetime "lifetime"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(Lit "literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitStr "string literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitByteStr "byte string literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitByte "byte literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitChar "character literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitInt "integer literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitFloat "floating point literal"); +#[cfg(any(feature = "full", feature = "derive"))] +impl_token!(LitBool "boolean literal"); + +// Not public API. +#[doc(hidden)] +#[cfg(feature = "parsing")] +pub trait CustomToken { + fn peek(cursor: Cursor) -> bool; + fn display() -> &'static str; +} + +#[cfg(feature = "parsing")] +impl private::Sealed for T {} + +#[cfg(feature = "parsing")] +impl Token for T { + fn peek(cursor: Cursor) -> bool { + ::peek(cursor) + } + + fn display() -> &'static str { + ::display() + } +} + +macro_rules! define_keywords { + ($($token:tt pub struct $name:ident #[$doc:meta])*) => { + $( + #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))] + #[$doc] + /// + /// Don't try to remember the name of this type -- use the [`Token!`] + /// macro instead. + /// + /// [`Token!`]: index.html + pub struct $name { + pub span: Span, + } + + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $name>(span: S) -> $name { + $name { + span: span.into_spans()[0], + } + } + + impl std::default::Default for $name { + fn default() -> Self { + $name { + span: Span::call_site(), + } + } + } + + #[cfg(feature = "extra-traits")] + impl Debug for $name { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(stringify!($name)) + } + } + + #[cfg(feature = "extra-traits")] + impl cmp::Eq for $name {} + + #[cfg(feature = "extra-traits")] + impl PartialEq for $name { + fn eq(&self, _other: &$name) -> bool { + true + } + } + + #[cfg(feature = "extra-traits")] + impl Hash for $name { + fn hash(&self, _state: &mut H) {} + } + + #[cfg(feature = "printing")] + impl ToTokens for $name { + fn to_tokens(&self, tokens: &mut TokenStream) { + printing::keyword($token, self.span, tokens); + } + } + + #[cfg(feature = "parsing")] + impl Parse for $name { + fn parse(input: ParseStream) -> Result { + Ok($name { + span: parsing::keyword(input, $token)?, + }) + } + } + + #[cfg(feature = "parsing")] + impl Token for $name { + fn peek(cursor: Cursor) -> bool { + parsing::peek_keyword(cursor, $token) + } + + fn display() -> &'static str { + concat!("`", $token, "`") + } + } + + #[cfg(feature = "parsing")] + impl private::Sealed for $name {} + )* + }; +} + +macro_rules! impl_deref_if_len_is_1 { + ($name:ident/1) => { + impl Deref for $name { + type Target = WithSpan; + + fn deref(&self) -> &Self::Target { + unsafe { &*(self as *const Self as *const WithSpan) } + } + } + + impl DerefMut for $name { + fn deref_mut(&mut self) -> &mut Self::Target { + unsafe { &mut *(self as *mut Self as *mut WithSpan) } + } + } + }; + + ($name:ident/$len:tt) => {}; +} + +macro_rules! define_punctuation_structs { + ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => { + $( + #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))] + #[repr(C)] + #[$doc] + /// + /// Don't try to remember the name of this type -- use the [`Token!`] + /// macro instead. + /// + /// [`Token!`]: index.html + pub struct $name { + pub spans: [Span; $len], + } + + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $name>(spans: S) -> $name { + $name { + spans: spans.into_spans(), + } + } + + impl std::default::Default for $name { + fn default() -> Self { + $name { + spans: [Span::call_site(); $len], + } + } + } + + #[cfg(feature = "extra-traits")] + impl Debug for $name { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(stringify!($name)) + } + } + + #[cfg(feature = "extra-traits")] + impl cmp::Eq for $name {} + + #[cfg(feature = "extra-traits")] + impl PartialEq for $name { + fn eq(&self, _other: &$name) -> bool { + true + } + } + + #[cfg(feature = "extra-traits")] + impl Hash for $name { + fn hash(&self, _state: &mut H) {} + } + + impl_deref_if_len_is_1!($name/$len); + )* + }; +} + +macro_rules! define_punctuation { + ($($token:tt pub struct $name:ident/$len:tt #[$doc:meta])*) => { + $( + define_punctuation_structs! { + $token pub struct $name/$len #[$doc] + } + + #[cfg(feature = "printing")] + impl ToTokens for $name { + fn to_tokens(&self, tokens: &mut TokenStream) { + printing::punct($token, &self.spans, tokens); + } + } + + #[cfg(feature = "parsing")] + impl Parse for $name { + fn parse(input: ParseStream) -> Result { + Ok($name { + spans: parsing::punct(input, $token)?, + }) + } + } + + #[cfg(feature = "parsing")] + impl Token for $name { + fn peek(cursor: Cursor) -> bool { + parsing::peek_punct(cursor, $token) + } + + fn display() -> &'static str { + concat!("`", $token, "`") + } + } + + #[cfg(feature = "parsing")] + impl private::Sealed for $name {} + )* + }; +} + +macro_rules! define_delimiters { + ($($token:tt pub struct $name:ident #[$doc:meta])*) => { + $( + #[cfg_attr(feature = "clone-impls", derive(Copy, Clone))] + #[$doc] + pub struct $name { + pub span: Span, + } + + #[doc(hidden)] + #[allow(non_snake_case)] + pub fn $name>(span: S) -> $name { + $name { + span: span.into_spans()[0], + } + } + + impl std::default::Default for $name { + fn default() -> Self { + $name { + span: Span::call_site(), + } + } + } + + #[cfg(feature = "extra-traits")] + impl Debug for $name { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(stringify!($name)) + } + } + + #[cfg(feature = "extra-traits")] + impl cmp::Eq for $name {} + + #[cfg(feature = "extra-traits")] + impl PartialEq for $name { + fn eq(&self, _other: &$name) -> bool { + true + } + } + + #[cfg(feature = "extra-traits")] + impl Hash for $name { + fn hash(&self, _state: &mut H) {} + } + + impl $name { + #[cfg(feature = "printing")] + pub fn surround(&self, tokens: &mut TokenStream, f: F) + where + F: FnOnce(&mut TokenStream), + { + printing::delim($token, self.span, tokens, f); + } + } + + #[cfg(feature = "parsing")] + impl private::Sealed for $name {} + )* + }; +} + +define_punctuation_structs! { + "_" pub struct Underscore/1 /// `_` +} + +#[cfg(feature = "printing")] +impl ToTokens for Underscore { + fn to_tokens(&self, tokens: &mut TokenStream) { + tokens.append(Ident::new("_", self.span)); + } +} + +#[cfg(feature = "parsing")] +impl Parse for Underscore { + fn parse(input: ParseStream) -> Result { + input.step(|cursor| { + if let Some((ident, rest)) = cursor.ident() { + if ident == "_" { + return Ok((Underscore(ident.span()), rest)); + } + } + if let Some((punct, rest)) = cursor.punct() { + if punct.as_char() == '_' { + return Ok((Underscore(punct.span()), rest)); + } + } + Err(cursor.error("expected `_`")) + }) + } +} + +#[cfg(feature = "parsing")] +impl Token for Underscore { + fn peek(cursor: Cursor) -> bool { + if let Some((ident, _rest)) = cursor.ident() { + return ident == "_"; + } + if let Some((punct, _rest)) = cursor.punct() { + return punct.as_char() == '_'; + } + false + } + + fn display() -> &'static str { + "`_`" + } +} + +#[cfg(feature = "parsing")] +impl private::Sealed for Underscore {} + +#[cfg(feature = "parsing")] +impl Token for Paren { + fn peek(cursor: Cursor) -> bool { + lookahead::is_delimiter(cursor, Delimiter::Parenthesis) + } + + fn display() -> &'static str { + "parentheses" + } +} + +#[cfg(feature = "parsing")] +impl Token for Brace { + fn peek(cursor: Cursor) -> bool { + lookahead::is_delimiter(cursor, Delimiter::Brace) + } + + fn display() -> &'static str { + "curly braces" + } +} + +#[cfg(feature = "parsing")] +impl Token for Bracket { + fn peek(cursor: Cursor) -> bool { + lookahead::is_delimiter(cursor, Delimiter::Bracket) + } + + fn display() -> &'static str { + "square brackets" + } +} + +#[cfg(feature = "parsing")] +impl Token for Group { + fn peek(cursor: Cursor) -> bool { + lookahead::is_delimiter(cursor, Delimiter::None) + } + + fn display() -> &'static str { + "invisible group" + } +} + +define_keywords! { + "abstract" pub struct Abstract /// `abstract` + "as" pub struct As /// `as` + "async" pub struct Async /// `async` + "auto" pub struct Auto /// `auto` + "become" pub struct Become /// `become` + "box" pub struct Box /// `box` + "break" pub struct Break /// `break` + "const" pub struct Const /// `const` + "continue" pub struct Continue /// `continue` + "crate" pub struct Crate /// `crate` + "default" pub struct Default /// `default` + "do" pub struct Do /// `do` + "dyn" pub struct Dyn /// `dyn` + "else" pub struct Else /// `else` + "enum" pub struct Enum /// `enum` + "existential" pub struct Existential /// `existential` + "extern" pub struct Extern /// `extern` + "final" pub struct Final /// `final` + "fn" pub struct Fn /// `fn` + "for" pub struct For /// `for` + "if" pub struct If /// `if` + "impl" pub struct Impl /// `impl` + "in" pub struct In /// `in` + "let" pub struct Let /// `let` + "loop" pub struct Loop /// `loop` + "macro" pub struct Macro /// `macro` + "match" pub struct Match /// `match` + "mod" pub struct Mod /// `mod` + "move" pub struct Move /// `move` + "mut" pub struct Mut /// `mut` + "override" pub struct Override /// `override` + "priv" pub struct Priv /// `priv` + "pub" pub struct Pub /// `pub` + "ref" pub struct Ref /// `ref` + "return" pub struct Return /// `return` + "Self" pub struct SelfType /// `Self` + "self" pub struct SelfValue /// `self` + "static" pub struct Static /// `static` + "struct" pub struct Struct /// `struct` + "super" pub struct Super /// `super` + "trait" pub struct Trait /// `trait` + "try" pub struct Try /// `try` + "type" pub struct Type /// `type` + "typeof" pub struct Typeof /// `typeof` + "union" pub struct Union /// `union` + "unsafe" pub struct Unsafe /// `unsafe` + "unsized" pub struct Unsized /// `unsized` + "use" pub struct Use /// `use` + "virtual" pub struct Virtual /// `virtual` + "where" pub struct Where /// `where` + "while" pub struct While /// `while` + "yield" pub struct Yield /// `yield` +} + +define_punctuation! { + "+" pub struct Add/1 /// `+` + "+=" pub struct AddEq/2 /// `+=` + "&" pub struct And/1 /// `&` + "&&" pub struct AndAnd/2 /// `&&` + "&=" pub struct AndEq/2 /// `&=` + "@" pub struct At/1 /// `@` + "!" pub struct Bang/1 /// `!` + "^" pub struct Caret/1 /// `^` + "^=" pub struct CaretEq/2 /// `^=` + ":" pub struct Colon/1 /// `:` + "::" pub struct Colon2/2 /// `::` + "," pub struct Comma/1 /// `,` + "/" pub struct Div/1 /// `/` + "/=" pub struct DivEq/2 /// `/=` + "$" pub struct Dollar/1 /// `$` + "." pub struct Dot/1 /// `.` + ".." pub struct Dot2/2 /// `..` + "..." pub struct Dot3/3 /// `...` + "..=" pub struct DotDotEq/3 /// `..=` + "=" pub struct Eq/1 /// `=` + "==" pub struct EqEq/2 /// `==` + ">=" pub struct Ge/2 /// `>=` + ">" pub struct Gt/1 /// `>` + "<=" pub struct Le/2 /// `<=` + "<" pub struct Lt/1 /// `<` + "*=" pub struct MulEq/2 /// `*=` + "!=" pub struct Ne/2 /// `!=` + "|" pub struct Or/1 /// `|` + "|=" pub struct OrEq/2 /// `|=` + "||" pub struct OrOr/2 /// `||` + "#" pub struct Pound/1 /// `#` + "?" pub struct Question/1 /// `?` + "->" pub struct RArrow/2 /// `->` + "<-" pub struct LArrow/2 /// `<-` + "%" pub struct Rem/1 /// `%` + "%=" pub struct RemEq/2 /// `%=` + "=>" pub struct FatArrow/2 /// `=>` + ";" pub struct Semi/1 /// `;` + "<<" pub struct Shl/2 /// `<<` + "<<=" pub struct ShlEq/3 /// `<<=` + ">>" pub struct Shr/2 /// `>>` + ">>=" pub struct ShrEq/3 /// `>>=` + "*" pub struct Star/1 /// `*` + "-" pub struct Sub/1 /// `-` + "-=" pub struct SubEq/2 /// `-=` + "~" pub struct Tilde/1 /// `~` +} + +define_delimiters! { + "{" pub struct Brace /// `{...}` + "[" pub struct Bracket /// `[...]` + "(" pub struct Paren /// `(...)` + " " pub struct Group /// None-delimited group +} + +/// A type-macro that expands to the name of the Rust type representation of a +/// given token. +/// +/// See the [token module] documentation for details and examples. +/// +/// [token module]: token/index.html +// Unfortunate duplication due to a rustdoc bug. +// https://github.com/rust-lang/rust/issues/45939 +#[macro_export] +#[cfg_attr(rustfmt, rustfmt_skip)] +macro_rules! Token { + (abstract) => { $crate::token::Abstract }; + (as) => { $crate::token::As }; + (async) => { $crate::token::Async }; + (auto) => { $crate::token::Auto }; + (become) => { $crate::token::Become }; + (box) => { $crate::token::Box }; + (break) => { $crate::token::Break }; + (const) => { $crate::token::Const }; + (continue) => { $crate::token::Continue }; + (crate) => { $crate::token::Crate }; + (default) => { $crate::token::Default }; + (do) => { $crate::token::Do }; + (dyn) => { $crate::token::Dyn }; + (else) => { $crate::token::Else }; + (enum) => { $crate::token::Enum }; + (existential) => { $crate::token::Existential }; + (extern) => { $crate::token::Extern }; + (final) => { $crate::token::Final }; + (fn) => { $crate::token::Fn }; + (for) => { $crate::token::For }; + (if) => { $crate::token::If }; + (impl) => { $crate::token::Impl }; + (in) => { $crate::token::In }; + (let) => { $crate::token::Let }; + (loop) => { $crate::token::Loop }; + (macro) => { $crate::token::Macro }; + (match) => { $crate::token::Match }; + (mod) => { $crate::token::Mod }; + (move) => { $crate::token::Move }; + (mut) => { $crate::token::Mut }; + (override) => { $crate::token::Override }; + (priv) => { $crate::token::Priv }; + (pub) => { $crate::token::Pub }; + (ref) => { $crate::token::Ref }; + (return) => { $crate::token::Return }; + (Self) => { $crate::token::SelfType }; + (self) => { $crate::token::SelfValue }; + (static) => { $crate::token::Static }; + (struct) => { $crate::token::Struct }; + (super) => { $crate::token::Super }; + (trait) => { $crate::token::Trait }; + (try) => { $crate::token::Try }; + (type) => { $crate::token::Type }; + (typeof) => { $crate::token::Typeof }; + (union) => { $crate::token::Union }; + (unsafe) => { $crate::token::Unsafe }; + (unsized) => { $crate::token::Unsized }; + (use) => { $crate::token::Use }; + (virtual) => { $crate::token::Virtual }; + (where) => { $crate::token::Where }; + (while) => { $crate::token::While }; + (yield) => { $crate::token::Yield }; + (+) => { $crate::token::Add }; + (+=) => { $crate::token::AddEq }; + (&) => { $crate::token::And }; + (&&) => { $crate::token::AndAnd }; + (&=) => { $crate::token::AndEq }; + (@) => { $crate::token::At }; + (!) => { $crate::token::Bang }; + (^) => { $crate::token::Caret }; + (^=) => { $crate::token::CaretEq }; + (:) => { $crate::token::Colon }; + (::) => { $crate::token::Colon2 }; + (,) => { $crate::token::Comma }; + (/) => { $crate::token::Div }; + (/=) => { $crate::token::DivEq }; + (.) => { $crate::token::Dot }; + (..) => { $crate::token::Dot2 }; + (...) => { $crate::token::Dot3 }; + (..=) => { $crate::token::DotDotEq }; + (=) => { $crate::token::Eq }; + (==) => { $crate::token::EqEq }; + (>=) => { $crate::token::Ge }; + (>) => { $crate::token::Gt }; + (<=) => { $crate::token::Le }; + (<) => { $crate::token::Lt }; + (*=) => { $crate::token::MulEq }; + (!=) => { $crate::token::Ne }; + (|) => { $crate::token::Or }; + (|=) => { $crate::token::OrEq }; + (||) => { $crate::token::OrOr }; + (#) => { $crate::token::Pound }; + (?) => { $crate::token::Question }; + (->) => { $crate::token::RArrow }; + (<-) => { $crate::token::LArrow }; + (%) => { $crate::token::Rem }; + (%=) => { $crate::token::RemEq }; + (=>) => { $crate::token::FatArrow }; + (;) => { $crate::token::Semi }; + (<<) => { $crate::token::Shl }; + (<<=) => { $crate::token::ShlEq }; + (>>) => { $crate::token::Shr }; + (>>=) => { $crate::token::ShrEq }; + (*) => { $crate::token::Star }; + (-) => { $crate::token::Sub }; + (-=) => { $crate::token::SubEq }; + (~) => { $crate::token::Tilde }; + (_) => { $crate::token::Underscore }; +} + +// Old names. TODO: remove these re-exports in a breaking change. +// https://github.com/dtolnay/syn/issues/486 +#[doc(hidden)] +pub use self::SelfType as CapSelf; +#[doc(hidden)] +pub use self::SelfValue as Self_; + +// Not public API. +#[doc(hidden)] +#[cfg(feature = "parsing")] +pub mod parsing { + use proc_macro2::{Spacing, Span}; + + use buffer::Cursor; + use error::{Error, Result}; + use parse::ParseStream; + use span::FromSpans; + + pub fn keyword(input: ParseStream, token: &str) -> Result { + input.step(|cursor| { + if let Some((ident, rest)) = cursor.ident() { + if ident == token { + return Ok((ident.span(), rest)); + } + } + Err(cursor.error(format!("expected `{}`", token))) + }) + } + + pub fn peek_keyword(cursor: Cursor, token: &str) -> bool { + if let Some((ident, _rest)) = cursor.ident() { + ident == token + } else { + false + } + } + + pub fn punct(input: ParseStream, token: &str) -> Result { + let mut spans = [input.cursor().span(); 3]; + punct_helper(input, token, &mut spans)?; + Ok(S::from_spans(&spans)) + } + + fn punct_helper(input: ParseStream, token: &str, spans: &mut [Span; 3]) -> Result<()> { + input.step(|cursor| { + let mut cursor = *cursor; + assert!(token.len() <= spans.len()); + + for (i, ch) in token.chars().enumerate() { + match cursor.punct() { + Some((punct, rest)) => { + spans[i] = punct.span(); + if punct.as_char() != ch { + break; + } else if i == token.len() - 1 { + return Ok(((), rest)); + } else if punct.spacing() != Spacing::Joint { + break; + } + cursor = rest; + } + None => break, + } + } + + Err(Error::new(spans[0], format!("expected `{}`", token))) + }) + } + + pub fn peek_punct(mut cursor: Cursor, token: &str) -> bool { + for (i, ch) in token.chars().enumerate() { + match cursor.punct() { + Some((punct, rest)) => { + if punct.as_char() != ch { + break; + } else if i == token.len() - 1 { + return true; + } else if punct.spacing() != Spacing::Joint { + break; + } + cursor = rest; + } + None => break, + } + } + false + } +} + +// Not public API. +#[doc(hidden)] +#[cfg(feature = "printing")] +pub mod printing { + use proc_macro2::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream}; + use quote::TokenStreamExt; + + pub fn punct(s: &str, spans: &[Span], tokens: &mut TokenStream) { + assert_eq!(s.len(), spans.len()); + + let mut chars = s.chars(); + let mut spans = spans.iter(); + let ch = chars.next_back().unwrap(); + let span = spans.next_back().unwrap(); + for (ch, span) in chars.zip(spans) { + let mut op = Punct::new(ch, Spacing::Joint); + op.set_span(*span); + tokens.append(op); + } + + let mut op = Punct::new(ch, Spacing::Alone); + op.set_span(*span); + tokens.append(op); + } + + pub fn keyword(s: &str, span: Span, tokens: &mut TokenStream) { + tokens.append(Ident::new(s, span)); + } + + pub fn delim(s: &str, span: Span, tokens: &mut TokenStream, f: F) + where + F: FnOnce(&mut TokenStream), + { + let delim = match s { + "(" => Delimiter::Parenthesis, + "[" => Delimiter::Bracket, + "{" => Delimiter::Brace, + " " => Delimiter::None, + _ => panic!("unknown delimiter: {}", s), + }; + let mut inner = TokenStream::new(); + f(&mut inner); + let mut g = Group::new(delim, inner); + g.set_span(span); + tokens.append(g); + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/tt.rs b/vendor/registry-40351f815f426200/syn/src/tt.rs new file mode 100644 index 000000000..72bc3c11e --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/tt.rs @@ -0,0 +1,110 @@ +use std::hash::{Hash, Hasher}; + +use proc_macro2::{Delimiter, TokenStream, TokenTree}; + +pub struct TokenTreeHelper<'a>(pub &'a TokenTree); + +impl<'a> PartialEq for TokenTreeHelper<'a> { + fn eq(&self, other: &Self) -> bool { + use proc_macro2::Spacing; + + match (self.0, other.0) { + (&TokenTree::Group(ref g1), &TokenTree::Group(ref g2)) => { + match (g1.delimiter(), g2.delimiter()) { + (Delimiter::Parenthesis, Delimiter::Parenthesis) + | (Delimiter::Brace, Delimiter::Brace) + | (Delimiter::Bracket, Delimiter::Bracket) + | (Delimiter::None, Delimiter::None) => {} + _ => return false, + } + + let s1 = g1.stream().clone().into_iter(); + let mut s2 = g2.stream().clone().into_iter(); + + for item1 in s1 { + let item2 = match s2.next() { + Some(item) => item, + None => return false, + }; + if TokenTreeHelper(&item1) != TokenTreeHelper(&item2) { + return false; + } + } + s2.next().is_none() + } + (&TokenTree::Punct(ref o1), &TokenTree::Punct(ref o2)) => { + o1.as_char() == o2.as_char() + && match (o1.spacing(), o2.spacing()) { + (Spacing::Alone, Spacing::Alone) | (Spacing::Joint, Spacing::Joint) => true, + _ => false, + } + } + (&TokenTree::Literal(ref l1), &TokenTree::Literal(ref l2)) => { + l1.to_string() == l2.to_string() + } + (&TokenTree::Ident(ref s1), &TokenTree::Ident(ref s2)) => s1 == s2, + _ => false, + } + } +} + +impl<'a> Hash for TokenTreeHelper<'a> { + fn hash(&self, h: &mut H) { + use proc_macro2::Spacing; + + match *self.0 { + TokenTree::Group(ref g) => { + 0u8.hash(h); + match g.delimiter() { + Delimiter::Parenthesis => 0u8.hash(h), + Delimiter::Brace => 1u8.hash(h), + Delimiter::Bracket => 2u8.hash(h), + Delimiter::None => 3u8.hash(h), + } + + for item in g.stream().clone() { + TokenTreeHelper(&item).hash(h); + } + 0xffu8.hash(h); // terminator w/ a variant we don't normally hash + } + TokenTree::Punct(ref op) => { + 1u8.hash(h); + op.as_char().hash(h); + match op.spacing() { + Spacing::Alone => 0u8.hash(h), + Spacing::Joint => 1u8.hash(h), + } + } + TokenTree::Literal(ref lit) => (2u8, lit.to_string()).hash(h), + TokenTree::Ident(ref word) => (3u8, word).hash(h), + } + } +} + +pub struct TokenStreamHelper<'a>(pub &'a TokenStream); + +impl<'a> PartialEq for TokenStreamHelper<'a> { + fn eq(&self, other: &Self) -> bool { + let left = self.0.clone().into_iter().collect::>(); + let right = other.0.clone().into_iter().collect::>(); + if left.len() != right.len() { + return false; + } + for (a, b) in left.into_iter().zip(right) { + if TokenTreeHelper(&a) != TokenTreeHelper(&b) { + return false; + } + } + true + } +} + +impl<'a> Hash for TokenStreamHelper<'a> { + fn hash(&self, state: &mut H) { + let tts = self.0.clone().into_iter().collect::>(); + tts.len().hash(state); + for tt in tts { + TokenTreeHelper(&tt).hash(state); + } + } +} diff --git a/vendor/registry-40351f815f426200/syn/src/ty.rs b/vendor/registry-40351f815f426200/syn/src/ty.rs new file mode 100644 index 000000000..d4852f6be --- /dev/null +++ b/vendor/registry-40351f815f426200/syn/src/ty.rs @@ -0,0 +1,994 @@ +use super::*; +use proc_macro2::TokenStream; +use punctuated::Punctuated; +#[cfg(feature = "extra-traits")] +use std::hash::{Hash, Hasher}; +#[cfg(feature = "extra-traits")] +use tt::TokenStreamHelper; + +ast_enum_of_structs! { + /// The possible types that a Rust value could have. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + /// + /// # Syntax tree enum + /// + /// This type is a [syntax tree enum]. + /// + /// [syntax tree enum]: enum.Expr.html#syntax-tree-enums + pub enum Type { + /// A dynamically sized slice type: `[T]`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Slice(TypeSlice { + pub bracket_token: token::Bracket, + pub elem: Box, + }), + + /// A fixed size array type: `[T; n]`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Array(TypeArray { + pub bracket_token: token::Bracket, + pub elem: Box, + pub semi_token: Token![;], + pub len: Expr, + }), + + /// A raw pointer type: `*const T` or `*mut T`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Ptr(TypePtr { + pub star_token: Token![*], + pub const_token: Option, + pub mutability: Option, + pub elem: Box, + }), + + /// A reference type: `&'a T` or `&'a mut T`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Reference(TypeReference { + pub and_token: Token![&], + pub lifetime: Option, + pub mutability: Option, + pub elem: Box, + }), + + /// A bare function type: `fn(usize) -> bool`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub BareFn(TypeBareFn { + pub lifetimes: Option, + pub unsafety: Option, + pub abi: Option, + pub fn_token: Token![fn], + pub paren_token: token::Paren, + pub inputs: Punctuated, + pub variadic: Option, + pub output: ReturnType, + }), + + /// The never type: `!`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Never(TypeNever { + pub bang_token: Token![!], + }), + + /// A tuple type: `(A, B, C, String)`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Tuple(TypeTuple { + pub paren_token: token::Paren, + pub elems: Punctuated, + }), + + /// A path like `std::slice::Iter`, optionally qualified with a + /// self-type as in ` as SomeTrait>::Associated`. + /// + /// Type arguments are stored in the Path itself. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Path(TypePath { + pub qself: Option, + pub path: Path, + }), + + /// A trait object type `Bound1 + Bound2 + Bound3` where `Bound` is a + /// trait or a lifetime. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub TraitObject(TypeTraitObject { + pub dyn_token: Option, + pub bounds: Punctuated, + }), + + /// An `impl Bound1 + Bound2 + Bound3` type where `Bound` is a trait or + /// a lifetime. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub ImplTrait(TypeImplTrait { + pub impl_token: Token![impl], + pub bounds: Punctuated, + }), + + /// A parenthesized type equivalent to the inner type. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Paren(TypeParen { + pub paren_token: token::Paren, + pub elem: Box, + }), + + /// A type contained within invisible delimiters. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Group(TypeGroup { + pub group_token: token::Group, + pub elem: Box, + }), + + /// Indication that a type should be inferred by the compiler: `_`. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Infer(TypeInfer { + pub underscore_token: Token![_], + }), + + /// A macro in the type position. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Macro(TypeMacro { + pub mac: Macro, + }), + + /// Tokens in type position not interpreted by Syn. + /// + /// *This type is available if Syn is built with the `"derive"` or + /// `"full"` feature.* + pub Verbatim(TypeVerbatim #manual_extra_traits { + pub tts: TokenStream, + }), + } +} + +#[cfg(feature = "extra-traits")] +impl Eq for TypeVerbatim {} + +#[cfg(feature = "extra-traits")] +impl PartialEq for TypeVerbatim { + fn eq(&self, other: &Self) -> bool { + TokenStreamHelper(&self.tts) == TokenStreamHelper(&other.tts) + } +} + +#[cfg(feature = "extra-traits")] +impl Hash for TypeVerbatim { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + TokenStreamHelper(&self.tts).hash(state); + } +} + +ast_struct! { + /// The binary interface of a function: `extern "C"`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct Abi { + pub extern_token: Token![extern], + pub name: Option, + } +} + +ast_struct! { + /// An argument in a function type: the `usize` in `fn(usize) -> bool`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub struct BareFnArg { + pub name: Option<(BareFnArgName, Token![:])>, + pub ty: Type, + } +} + +ast_enum! { + /// Name of an argument in a function type: the `n` in `fn(n: usize)`. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum BareFnArgName { + /// Argument given a name. + Named(Ident), + /// Argument not given a name, matched with `_`. + Wild(Token![_]), + } +} + +ast_enum! { + /// Return type of a function signature. + /// + /// *This type is available if Syn is built with the `"derive"` or `"full"` + /// feature.* + pub enum ReturnType { + /// Return type is not specified. + /// + /// Functions default to `()` and closures default to type inference. + Default, + /// A particular type is returned. + Type(Token![->], Box), + } +} + +#[cfg(feature = "parsing")] +pub mod parsing { + use super::*; + + use parse::{Parse, ParseStream, Result}; + use path; + + impl Parse for Type { + fn parse(input: ParseStream) -> Result { + ambig_ty(input, true) + } + } + + impl Type { + /// In some positions, types may not contain the `+` character, to + /// disambiguate them. For example in the expression `1 as T`, T may not + /// contain a `+` character. + /// + /// This parser does not allow a `+`, while the default parser does. + pub fn without_plus(input: ParseStream) -> Result { + ambig_ty(input, false) + } + } + + fn ambig_ty(input: ParseStream, allow_plus: bool) -> Result { + if input.peek(token::Group) { + return input.parse().map(Type::Group); + } + + let mut lifetimes = None::; + let mut lookahead = input.lookahead1(); + if lookahead.peek(Token![for]) { + lifetimes = input.parse()?; + lookahead = input.lookahead1(); + if !lookahead.peek(Ident) + && !lookahead.peek(Token![fn]) + && !lookahead.peek(Token![unsafe]) + && !lookahead.peek(Token![extern]) + && !lookahead.peek(Token![super]) + && !lookahead.peek(Token![self]) + && !lookahead.peek(Token![Self]) + && !lookahead.peek(Token![crate]) + { + return Err(lookahead.error()); + } + } + + if lookahead.peek(token::Paren) { + let content; + let paren_token = parenthesized!(content in input); + if content.is_empty() { + return Ok(Type::Tuple(TypeTuple { + paren_token: paren_token, + elems: Punctuated::new(), + })); + } + if content.peek(Lifetime) { + return Ok(Type::Paren(TypeParen { + paren_token: paren_token, + elem: Box::new(Type::TraitObject(content.parse()?)), + })); + } + if content.peek(Token![?]) { + return Ok(Type::TraitObject(TypeTraitObject { + dyn_token: None, + bounds: { + let mut bounds = Punctuated::new(); + bounds.push_value(TypeParamBound::Trait(TraitBound { + paren_token: Some(paren_token), + ..content.parse()? + })); + while let Some(plus) = input.parse()? { + bounds.push_punct(plus); + bounds.push_value(input.parse()?); + } + bounds + }, + })); + } + let first: Type = content.parse()?; + if content.peek(Token![,]) { + return Ok(Type::Tuple(TypeTuple { + paren_token: paren_token, + elems: { + let mut elems = Punctuated::new(); + elems.push_value(first); + elems.push_punct(content.parse()?); + let rest: Punctuated = + content.parse_terminated(Parse::parse)?; + elems.extend(rest); + elems + }, + })); + } + if allow_plus && input.peek(Token![+]) { + loop { + let first = match first { + Type::Path(TypePath { qself: None, path }) => { + TypeParamBound::Trait(TraitBound { + paren_token: Some(paren_token), + modifier: TraitBoundModifier::None, + lifetimes: None, + path: path, + }) + } + Type::TraitObject(TypeTraitObject { + dyn_token: None, + ref bounds, + }) => { + if bounds.len() > 1 || bounds.trailing_punct() { + break; + } + match first { + Type::TraitObject(TypeTraitObject { bounds, .. }) => { + match bounds.into_iter().next().unwrap() { + TypeParamBound::Trait(trait_bound) => { + TypeParamBound::Trait(TraitBound { + paren_token: Some(paren_token), + ..trait_bound + }) + } + other => other, + } + } + _ => unreachable!(), + } + } + _ => break, + }; + return Ok(Type::TraitObject(TypeTraitObject { + dyn_token: None, + bounds: { + let mut bounds = Punctuated::new(); + bounds.push_value(first); + while let Some(plus) = input.parse()? { + bounds.push_punct(plus); + bounds.push_value(input.parse()?); + } + bounds + }, + })); + } + } + Ok(Type::Paren(TypeParen { + paren_token: paren_token, + elem: Box::new(first), + })) + } else if lookahead.peek(Token![fn]) + || lookahead.peek(Token![unsafe]) + || lookahead.peek(Token![extern]) && !input.peek2(Token![::]) + { + let mut bare_fn: TypeBareFn = input.parse()?; + bare_fn.lifetimes = lifetimes; + Ok(Type::BareFn(bare_fn)) + } else if lookahead.peek(Ident) + || input.peek(Token![super]) + || input.peek(Token![self]) + || input.peek(Token![Self]) + || input.peek(Token![crate]) + || input.peek(Token![extern]) + || lookahead.peek(Token![::]) + || lookahead.peek(Token![<]) + { + if input.peek(Token![dyn]) { + let mut trait_object: TypeTraitObject = input.parse()?; + if lifetimes.is_some() { + match *trait_object.bounds.iter_mut().next().unwrap() { + TypeParamBound::Trait(ref mut trait_bound) => { + trait_bound.lifetimes = lifetimes; + } + TypeParamBound::Lifetime(_) => unreachable!(), + } + } + return Ok(Type::TraitObject(trait_object)); + } + + let ty: TypePath = input.parse()?; + if ty.qself.is_some() { + return Ok(Type::Path(ty)); + } + + if input.peek(Token![!]) && !input.peek(Token![!=]) { + let mut contains_arguments = false; + for segment in &ty.path.segments { + match segment.arguments { + PathArguments::None => {} + PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => { + contains_arguments = true; + } + } + } + + if !contains_arguments { + let bang_token: Token![!] = input.parse()?; + let (delimiter, tts) = mac::parse_delimiter(input)?; + return Ok(Type::Macro(TypeMacro { + mac: Macro { + path: ty.path, + bang_token: bang_token, + delimiter: delimiter, + tts: tts, + }, + })); + } + } + + if lifetimes.is_some() || allow_plus && input.peek(Token![+]) { + let mut bounds = Punctuated::new(); + bounds.push_value(TypeParamBound::Trait(TraitBound { + paren_token: None, + modifier: TraitBoundModifier::None, + lifetimes: lifetimes, + path: ty.path, + })); + if allow_plus { + while input.peek(Token![+]) { + bounds.push_punct(input.parse()?); + if input.peek(Token![>]) { + break; + } + bounds.push_value(input.parse()?); + } + } + return Ok(Type::TraitObject(TypeTraitObject { + dyn_token: None, + bounds: bounds, + })); + } + + Ok(Type::Path(ty)) + } else if lookahead.peek(token::Bracket) { + let content; + let bracket_token = bracketed!(content in input); + let elem: Type = content.parse()?; + if content.peek(Token![;]) { + Ok(Type::Array(TypeArray { + bracket_token: bracket_token, + elem: Box::new(elem), + semi_token: content.parse()?, + len: content.parse()?, + })) + } else { + Ok(Type::Slice(TypeSlice { + bracket_token: bracket_token, + elem: Box::new(elem), + })) + } + } else if lookahead.peek(Token![*]) { + input.parse().map(Type::Ptr) + } else if lookahead.peek(Token![&]) { + input.parse().map(Type::Reference) + } else if lookahead.peek(Token![!]) && !input.peek(Token![=]) { + input.parse().map(Type::Never) + } else if lookahead.peek(Token![impl]) { + input.parse().map(Type::ImplTrait) + } else if lookahead.peek(Token![_]) { + input.parse().map(Type::Infer) + } else if lookahead.peek(Lifetime) { + input.parse().map(Type::TraitObject) + } else { + Err(lookahead.error()) + } + } + + impl Parse for TypeSlice { + fn parse(input: ParseStream) -> Result { + let content; + Ok(TypeSlice { + bracket_token: bracketed!(content in input), + elem: content.parse()?, + }) + } + } + + impl Parse for TypeArray { + fn parse(input: ParseStream) -> Result { + let content; + Ok(TypeArray { + bracket_token: bracketed!(content in input), + elem: content.parse()?, + semi_token: content.parse()?, + len: content.parse()?, + }) + } + } + + impl Parse for TypePtr { + fn parse(input: ParseStream) -> Result { + let star_token: Token![*] = input.parse()?; + + let lookahead = input.lookahead1(); + let (const_token, mutability) = if lookahead.peek(Token![const]) { + (Some(input.parse()?), None) + } else if lookahead.peek(Token![mut]) { + (None, Some(input.parse()?)) + } else { + return Err(lookahead.error()); + }; + + Ok(TypePtr { + star_token: star_token, + const_token: const_token, + mutability: mutability, + elem: Box::new(input.call(Type::without_plus)?), + }) + } + } + + impl Parse for TypeReference { + fn parse(input: ParseStream) -> Result { + Ok(TypeReference { + and_token: input.parse()?, + lifetime: input.parse()?, + mutability: input.parse()?, + // & binds tighter than +, so we don't allow + here. + elem: Box::new(input.call(Type::without_plus)?), + }) + } + } + + impl Parse for TypeBareFn { + fn parse(input: ParseStream) -> Result { + let args; + let allow_variadic; + Ok(TypeBareFn { + lifetimes: input.parse()?, + unsafety: input.parse()?, + abi: input.parse()?, + fn_token: input.parse()?, + paren_token: parenthesized!(args in input), + inputs: { + let mut inputs = Punctuated::new(); + while !args.is_empty() && !args.peek(Token![...]) { + inputs.push_value(args.parse()?); + if args.is_empty() { + break; + } + inputs.push_punct(args.parse()?); + } + allow_variadic = inputs.empty_or_trailing(); + inputs + }, + variadic: { + if allow_variadic && args.peek(Token![...]) { + Some(args.parse()?) + } else { + None + } + }, + output: input.call(ReturnType::without_plus)?, + }) + } + } + + impl Parse for TypeNever { + fn parse(input: ParseStream) -> Result { + Ok(TypeNever { + bang_token: input.parse()?, + }) + } + } + + impl Parse for TypeInfer { + fn parse(input: ParseStream) -> Result { + Ok(TypeInfer { + underscore_token: input.parse()?, + }) + } + } + + impl Parse for TypeTuple { + fn parse(input: ParseStream) -> Result { + let content; + Ok(TypeTuple { + paren_token: parenthesized!(content in input), + elems: content.parse_terminated(Type::parse)?, + }) + } + } + + impl Parse for TypeMacro { + fn parse(input: ParseStream) -> Result { + Ok(TypeMacro { + mac: input.parse()?, + }) + } + } + + impl Parse for TypePath { + fn parse(input: ParseStream) -> Result { + let (qself, mut path) = path::parsing::qpath(input, false)?; + + if path.segments.last().unwrap().value().arguments.is_empty() + && input.peek(token::Paren) + { + let args: ParenthesizedGenericArguments = input.parse()?; + let parenthesized = PathArguments::Parenthesized(args); + path.segments.last_mut().unwrap().value_mut().arguments = parenthesized; + } + + Ok(TypePath { + qself: qself, + path: path, + }) + } + } + + impl ReturnType { + pub fn without_plus(input: ParseStream) -> Result { + Self::parse(input, false) + } + + pub fn parse(input: ParseStream, allow_plus: bool) -> Result { + if input.peek(Token![->]) { + let arrow = input.parse()?; + let ty = ambig_ty(input, allow_plus)?; + Ok(ReturnType::Type(arrow, Box::new(ty))) + } else { + Ok(ReturnType::Default) + } + } + } + + impl Parse for ReturnType { + fn parse(input: ParseStream) -> Result { + Self::parse(input, true) + } + } + + impl Parse for TypeTraitObject { + fn parse(input: ParseStream) -> Result { + Self::parse(input, true) + } + } + + fn at_least_one_type(bounds: &Punctuated) -> bool { + for bound in bounds { + if let TypeParamBound::Trait(_) = *bound { + return true; + } + } + false + } + + impl TypeTraitObject { + pub fn without_plus(input: ParseStream) -> Result { + Self::parse(input, false) + } + + // Only allow multiple trait references if allow_plus is true. + pub fn parse(input: ParseStream, allow_plus: bool) -> Result { + Ok(TypeTraitObject { + dyn_token: input.parse()?, + bounds: { + let mut bounds = Punctuated::new(); + if allow_plus { + loop { + bounds.push_value(input.parse()?); + if !input.peek(Token![+]) { + break; + } + bounds.push_punct(input.parse()?); + if input.peek(Token![>]) { + break; + } + } + } else { + bounds.push_value(input.parse()?); + } + // Just lifetimes like `'a + 'b` is not a TraitObject. + if !at_least_one_type(&bounds) { + return Err(input.error("expected at least one type")); + } + bounds + }, + }) + } + } + + impl Parse for TypeImplTrait { + fn parse(input: ParseStream) -> Result { + Ok(TypeImplTrait { + impl_token: input.parse()?, + // NOTE: rust-lang/rust#34511 includes discussion about whether + // or not + should be allowed in ImplTrait directly without (). + bounds: { + let mut bounds = Punctuated::new(); + loop { + bounds.push_value(input.parse()?); + if !input.peek(Token![+]) { + break; + } + bounds.push_punct(input.parse()?); + } + bounds + }, + }) + } + } + + impl Parse for TypeGroup { + fn parse(input: ParseStream) -> Result { + let group = private::parse_group(input)?; + Ok(TypeGroup { + group_token: group.token, + elem: group.content.parse()?, + }) + } + } + + impl Parse for TypeParen { + fn parse(input: ParseStream) -> Result { + Self::parse(input, false) + } + } + + impl TypeParen { + fn parse(input: ParseStream, allow_plus: bool) -> Result { + let content; + Ok(TypeParen { + paren_token: parenthesized!(content in input), + elem: Box::new(ambig_ty(&content, allow_plus)?), + }) + } + } + + impl Parse for BareFnArg { + fn parse(input: ParseStream) -> Result { + Ok(BareFnArg { + name: { + if (input.peek(Ident) || input.peek(Token![_])) + && !input.peek2(Token![::]) + && input.peek2(Token![:]) + { + let name: BareFnArgName = input.parse()?; + let colon: Token![:] = input.parse()?; + Some((name, colon)) + } else { + None + } + }, + ty: input.parse()?, + }) + } + } + + impl Parse for BareFnArgName { + fn parse(input: ParseStream) -> Result { + let lookahead = input.lookahead1(); + if lookahead.peek(Ident) { + input.parse().map(BareFnArgName::Named) + } else if lookahead.peek(Token![_]) { + input.parse().map(BareFnArgName::Wild) + } else { + Err(lookahead.error()) + } + } + } + + impl Parse for Abi { + fn parse(input: ParseStream) -> Result { + Ok(Abi { + extern_token: input.parse()?, + name: input.parse()?, + }) + } + } + + impl Parse for Option { + fn parse(input: ParseStream) -> Result { + if input.peek(Token![extern]) { + input.parse().map(Some) + } else { + Ok(None) + } + } + } +} + +#[cfg(feature = "printing")] +mod printing { + use super::*; + + use proc_macro2::TokenStream; + use quote::ToTokens; + + use print::TokensOrDefault; + + impl ToTokens for TypeSlice { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.bracket_token.surround(tokens, |tokens| { + self.elem.to_tokens(tokens); + }); + } + } + + impl ToTokens for TypeArray { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.bracket_token.surround(tokens, |tokens| { + self.elem.to_tokens(tokens); + self.semi_token.to_tokens(tokens); + self.len.to_tokens(tokens); + }); + } + } + + impl ToTokens for TypePtr { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.star_token.to_tokens(tokens); + match self.mutability { + Some(ref tok) => tok.to_tokens(tokens), + None => { + TokensOrDefault(&self.const_token).to_tokens(tokens); + } + } + self.elem.to_tokens(tokens); + } + } + + impl ToTokens for TypeReference { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.and_token.to_tokens(tokens); + self.lifetime.to_tokens(tokens); + self.mutability.to_tokens(tokens); + self.elem.to_tokens(tokens); + } + } + + impl ToTokens for TypeBareFn { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.lifetimes.to_tokens(tokens); + self.unsafety.to_tokens(tokens); + self.abi.to_tokens(tokens); + self.fn_token.to_tokens(tokens); + self.paren_token.surround(tokens, |tokens| { + self.inputs.to_tokens(tokens); + if let Some(ref variadic) = self.variadic { + if !self.inputs.empty_or_trailing() { + let span = variadic.spans[0]; + Token![,](span).to_tokens(tokens); + } + variadic.to_tokens(tokens); + } + }); + self.output.to_tokens(tokens); + } + } + + impl ToTokens for TypeNever { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.bang_token.to_tokens(tokens); + } + } + + impl ToTokens for TypeTuple { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.paren_token.surround(tokens, |tokens| { + self.elems.to_tokens(tokens); + }); + } + } + + impl ToTokens for TypePath { + fn to_tokens(&self, tokens: &mut TokenStream) { + private::print_path(tokens, &self.qself, &self.path); + } + } + + impl ToTokens for TypeTraitObject { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.dyn_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + + impl ToTokens for TypeImplTrait { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.impl_token.to_tokens(tokens); + self.bounds.to_tokens(tokens); + } + } + + impl ToTokens for TypeGroup { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.group_token.surround(tokens, |tokens| { + self.elem.to_tokens(tokens); + }); + } + } + + impl ToTokens for TypeParen { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.paren_token.surround(tokens, |tokens| { + self.elem.to_tokens(tokens); + }); + } + } + + impl ToTokens for TypeInfer { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.underscore_token.to_tokens(tokens); + } + } + + impl ToTokens for TypeMacro { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.mac.to_tokens(tokens); + } + } + + impl ToTokens for TypeVerbatim { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.tts.to_tokens(tokens); + } + } + + impl ToTokens for ReturnType { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + ReturnType::Default => {} + ReturnType::Type(ref arrow, ref ty) => { + arrow.to_tokens(tokens); + ty.to_tokens(tokens); + } + } + } + } + + impl ToTokens for BareFnArg { + fn to_tokens(&self, tokens: &mut TokenStream) { + if let Some((ref name, ref colon)) = self.name { + name.to_tokens(tokens); + colon.to_tokens(tokens); + } + self.ty.to_tokens(tokens); + } + } + + impl ToTokens for BareFnArgName { + fn to_tokens(&self, tokens: &mut TokenStream) { + match *self { + BareFnArgName::Named(ref t) => t.to_tokens(tokens), + BareFnArgName::Wild(ref t) => t.to_tokens(tokens), + } + } + } + + impl ToTokens for Abi { + fn to_tokens(&self, tokens: &mut TokenStream) { + self.extern_token.to_tokens(tokens); + self.name.to_tokens(tokens); + } + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/.cargo-checksum.json b/vendor/registry-40351f815f426200/tempfile/.cargo-checksum.json new file mode 100644 index 000000000..3bc554819 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"7da847910390d693f2232fa47d024deeae18bfc5dc41c20fcb2c92cd1b319611","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"8b427f5bc501764575e52ba4f9d95673cf8f6d80a86d0d06599852e1a9a20a36","NEWS":"16c2b8b65937c914480bb13b3b63ef6a0bde7b6f9cc8de39f4d081f162f16fe9","README.md":"f78af02dbd4504af71d9b5a39cc71f310a64433dbaf1aefce33cd690a8af172a","src/dir.rs":"70e85b0910671f63822645546e9c86d6446305da128f1d9f171137ba2299c852","src/error.rs":"34eb148cbc4c34ebe03555bbdce67387288e78ff879e9de867d8963ad4625f86","src/file/imp/mod.rs":"bec50fb99c14cb4a49402bdbb7c5e6b5b8ff785b06b6fcb13267f35df8f3c8c2","src/file/imp/other.rs":"6cffd765cb3a2f86ab30d15c77b913b9cdabc7145c1083fc56fca3fe77c68c81","src/file/imp/unix.rs":"05c3adbf845fd4e7a9be8a1f6071227a2a0df2e3fbda9fd7c0c3c9009b145e74","src/file/imp/windows.rs":"cf8c2f8403de08d9444b9b67f71582d640c7cb8b0aa0e27e47378e0f2a8d8717","src/file/mod.rs":"a35604953b99d544298be24b3d899727cdd9b80bb5cbb000e25c752e371f121b","src/lib.rs":"fbd890783af33638103607aeb7c93d06b95a261f53e5dc8831543295722e3dac","src/spooled.rs":"2c73567461cea354bbdd5bda737548a050d20b19c82bce709e42c43831bd35dd","src/util.rs":"6f5761e876f088c8b45518131fec5d506f316f52a4a59678351719c94192092b","tests/namedtempfile.rs":"9ffae38a4a9e82a4bbca51274d5b4cc51c501026286b2ec630cebe1368f3dda2","tests/spooled.rs":"0698dacfe5628d931b3a657efe539025c63868d248dd4596f887a6653bdded74","tests/tempdir.rs":"0e9e3c9d8b03729cafd4537097317d0865da475c5e82b75e9e00ef9dfb4cf358","tests/tempfile.rs":"20e92c7e967f171589d9812d68e4599ebd41bbac22f0bc48c3bdb65c9ee9cc2b"},"package":"7dc4738f2e68ed2855de5ac9cdbe05c9216773ecde4739b2f095002ab03a13ef"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/tempfile/Cargo.toml b/vendor/registry-40351f815f426200/tempfile/Cargo.toml new file mode 100644 index 000000000..ff4c9d3e5 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/Cargo.toml @@ -0,0 +1,38 @@ +# 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 = "tempfile" +version = "3.0.8" +authors = ["Steven Allen ", "The Rust Project Developers", "Ashley Mannix ", "Jason White "] +exclude = ["/.travis.yml", "/appveyor.yml"] +description = "A library for managing temporary files and directories.\n" +homepage = "http://stebalien.com/projects/tempfile-rs" +documentation = "https://docs.rs/tempfile" +keywords = ["tempfile", "tmpfile", "filesystem"] +license = "MIT/Apache-2.0" +repository = "https://github.com/Stebalien/tempfile" +[dependencies.cfg-if] +version = "0.1" + +[dependencies.rand] +version = "0.6" + +[dependencies.remove_dir_all] +version = "0.5" +[target."cfg(target_os = \"redox\")".dependencies.redox_syscall] +version = "0.1" +[target."cfg(unix)".dependencies.libc] +version = "0.2.27" +[target."cfg(windows)".dependencies.winapi] +version = "0.3" +features = ["fileapi", "winbase", "handleapi"] diff --git a/vendor/registry-40351f815f426200/tempfile/LICENSE-APACHE b/vendor/registry-40351f815f426200/tempfile/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/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/vendor/registry-40351f815f426200/tempfile/LICENSE-MIT b/vendor/registry-40351f815f426200/tempfile/LICENSE-MIT new file mode 100644 index 000000000..0c3270fdd --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 Steven Allen + +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/vendor/registry-40351f815f426200/tempfile/NEWS b/vendor/registry-40351f815f426200/tempfile/NEWS new file mode 100644 index 000000000..d274bc9b9 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/NEWS @@ -0,0 +1,153 @@ +3.0.8 +===== + +This is a bugfix release. + +Fixes: + +* Export `PathPersistError`. +* Fix a bug where flushing a `SpooledTempFile` to disk could fail to write part + of the file in some rare, yet-to-reproduced cases. + +3.0.7 +===== + +Breaking: + +* `Builder::prefix` and `Builder::suffix` now accept a generic `&AsRef`. + This could affect type inference. +* Temporary files (except unnamed temporary files on Windows and Linux >= 3.11) + now use absolute path names. This will break programs that create temporary + files relative to their current working directory when they don't have the + search permission (x) on some ancestor directory. This is only likely to + affect programs with strange chroot-less filesystem sandboxes. If you believe + you're affected by this issue, please comment on #40. + +Features: + +* Accept anything implementing `&AsRef` in the builder: &OsStr, &OsString, &Path, etc. + +Fixes: + +* Fix LFS support. +* Use absolute paths for named temporary files to guard against changes in the + current directory. +* Use absolute paths when creating unnamed temporary files on platforms that + can't create unlinked or auto-deleted temporary files. This fixes a very + unlikely race where the current directory could change while the temporary + file is being created. + +Misc: + +* Use modern stdlib features to avoid custom unsafe code. This reduces the + number of unsafe blocks from 12 to 4. + +3.0.6 +===== + +* Don't hide temporary files on windows, fixing #66 and #69. + +3.0.5 +===== + +Features: + +* Added a spooled temporary file implementation. This temporary file variant + starts out as an in-memory temporary file but "rolls-over" onto disk when it + grows over a specified size (#68). +* Errors are now annotated with paths to make debugging easier (#73). + +Misc: + +* The rand version has been bumped to 0.6 (#74). + +Bugs: + +* Tempfile compiles again on Redox (#75). + +3.0.4 +===== + +* Now compiles on unsupported platforms. + +3.0.3 +===== + +* update rand to 0.5 + +3.0.2 +===== + +* Actually *delete* temporary files on non-Linux unix systems (thanks to +@oliverhenshaw for the fix and a test case). + +3.0.1 +===== + +* Restore NamedTempFile::new_in + +3.0.0 +===== + +* Adds temporary directory support (@KodrAus) +* Allow closing named temporary files without deleting them (@jasonwhite) + +2.2.0 +===== + +* Redox Support + +2.1.6 +===== + +* Remove build script and bump minimum rustc version to 1.9.0 + +2.1.5 +===== + +* Don't build platform-specific dependencies on all platforms. +* Cleanup some documentation. + +2.1.4 +===== + +* Fix crates.io tags. No interesting changes. + +2.1.3 +===== + +Export `PersistError`. + +2.1.2 +===== + +Add `Read`/`Write`/`Seek` impls on `&NamedTempFile`. This mirrors the +implementations on `&File`. One can currently just deref to a `&File` but these +implementations are more discoverable. + +2.1.1 +===== + +Add LFS Support. + +2.1.0 +===== + +* Implement `AsRef` for `NamedTempFile` allowing named temporary files to + be borrowed as `File`s. +* Add a method to convert a `NamedTempFile` to an unnamed temporary `File`. + +2.0.1 +===== + +* Arm bugfix + +2.0.0 +===== + +This release replaces `TempFile` with a `tempfile()` function that returnes +`std::fs::File` objects. These are significantly more useful because most rust +libraries expect normal `File` objects. + +To continue supporting shared temporary files, this new version adds a +`reopen()` method to `NamedTempFile`. diff --git a/vendor/registry-40351f815f426200/tempfile/README.md b/vendor/registry-40351f815f426200/tempfile/README.md new file mode 100644 index 000000000..81f6258ec --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/README.md @@ -0,0 +1,52 @@ +tempfile +======== + +[![Crate](https://img.shields.io/crates/v/tempfile.svg)](https://crates.io/crates/tempfile) +[![Build Status](https://travis-ci.org/Stebalien/tempfile.svg?branch=master)](https://travis-ci.org/Stebalien/tempfile) +[![Build status](https://ci.appveyor.com/api/projects/status/5q00b8rvvg46i5tf/branch/master?svg=true)](https://ci.appveyor.com/project/Stebalien/tempfile/branch/master) + +A secure, cross-platform, temporary file library for Rust. In addition to creating +temporary files, this library also allows users to securely open multiple +independent references to the same temporary file (useful for consumer/producer +patterns and surprisingly difficult to implement securely). + +[Documentation](https://docs.rs/tempfile/) + +Usage +----- + +Minimum required Rust version: 1.24.0 + +Add this to your `Cargo.toml`: +```toml +[dependencies] +tempfile = "3" +``` + +...and this to your crate root: +```rust +extern crate tempfile; +``` + +Example +------- + +```rust +extern crate tempfile; +use std::fs::File; +use std::io::{Write, Read, Seek, SeekFrom}; + +fn main() { + // Write + let mut tmpfile: File = tempfile::tempfile().unwrap(); + write!(tmpfile, "Hello World!").unwrap(); + + // Seek to start + tmpfile.seek(SeekFrom::Start(0)).unwrap(); + + // Read + let mut buf = String::new(); + tmpfile.read_to_string(&mut buf).unwrap(); + assert_eq!("Hello World!", buf); +} +``` diff --git a/vendor/registry-40351f815f426200/tempfile/src/dir.rs b/vendor/registry-40351f815f426200/tempfile/src/dir.rs new file mode 100644 index 000000000..90507a70b --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/dir.rs @@ -0,0 +1,408 @@ +// 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 remove_dir_all::remove_dir_all; +use std::path::{self, Path, PathBuf}; +use std::{fmt, fs, io}; + +use error::IoResultExt; +use Builder; + +/// Create a new temporary directory. +/// +/// The `tempdir` function creates a directory in the file system +/// and returns a [`TempDir`]. +/// The directory will be automatically deleted when the `TempDir`s +/// desctructor is run. +/// +/// # Resource Leaking +/// +/// See [the resource leaking][resource-leaking] docs on `TempDir`. +/// +/// # Errors +/// +/// If the directory can not be created, `Err` is returned. +/// +/// # Examples +/// +/// ``` +/// # extern crate tempfile; +/// use tempfile::tempdir; +/// use std::fs::File; +/// use std::io::{self, Write}; +/// +/// # fn main() { +/// # if let Err(_) = run() { +/// # ::std::process::exit(1); +/// # } +/// # } +/// # fn run() -> Result<(), io::Error> { +/// // Create a directory inside of `std::env::temp_dir()` +/// let dir = tempdir()?; +/// +/// let file_path = dir.path().join("my-temporary-note.txt"); +/// let mut file = File::create(file_path)?; +/// writeln!(file, "Brian was here. Briefly.")?; +/// +/// // `tmp_dir` goes out of scope, the directory as well as +/// // `tmp_file` will be deleted here. +/// drop(file); +/// dir.close()?; +/// # Ok(()) +/// # } +/// ``` +/// +/// [`TempDir`]: struct.TempDir.html +/// [resource-leaking]: struct.TempDir.html#resource-leaking +pub fn tempdir() -> io::Result { + TempDir::new() +} + +/// Create a new temporary directory. +/// +/// The `tempdir` function creates a directory in the file system +/// and returns a [`TempDir`]. +/// The directory will be automatically deleted when the `TempDir`s +/// desctructor is run. +/// +/// # Resource Leaking +/// +/// See [the resource leaking][resource-leaking] docs on `TempDir`. +/// +/// # Errors +/// +/// If the directory can not be created, `Err` is returned. +/// +/// # Examples +/// +/// ``` +/// # extern crate tempfile; +/// use tempfile::tempdir; +/// use std::fs::File; +/// use std::io::{self, Write}; +/// +/// # fn main() { +/// # if let Err(_) = run() { +/// # ::std::process::exit(1); +/// # } +/// # } +/// # fn run() -> Result<(), io::Error> { +/// // Create a directory inside of `std::env::temp_dir()`, +/// let dir = tempdir()?; +/// +/// let file_path = dir.path().join("my-temporary-note.txt"); +/// let mut file = File::create(file_path)?; +/// writeln!(file, "Brian was here. Briefly.")?; +/// +/// // `tmp_dir` goes out of scope, the directory as well as +/// // `tmp_file` will be deleted here. +/// drop(file); +/// dir.close()?; +/// # Ok(()) +/// # } +/// ``` +/// +/// [`TempDir`]: struct.TempDir.html +/// [resource-leaking]: struct.TempDir.html#resource-leaking +pub fn tempdir_in>(dir: P) -> io::Result { + TempDir::new_in(dir) +} + +/// A directory in the filesystem that is automatically deleted when +/// it goes out of scope. +/// +/// The [`TempDir`] type creates a directory on the file system that +/// is deleted once it goes out of scope. At construction, the +/// `TempDir` creates a new directory with a randomly generated name. +/// +/// The default constructor, [`TempDir::new()`], creates directories in +/// the location returned by [`std::env::temp_dir()`], but `TempDir` +/// can be configured to manage a temporary directory in any location +/// by constructing with a [`Builder`]. +/// +/// After creating a `TempDir`, work with the file system by doing +/// standard [`std::fs`] file system operations on its [`Path`], +/// which can be retrieved with [`TempDir::path()`]. Once the `TempDir` +/// value is dropped, the directory at the path will be deleted, along +/// with any files and directories it contains. It is your responsibility +/// to ensure that no further file system operations are attempted +/// inside the temporary directory once it has been deleted. +/// +/// # Resource Leaking +/// +/// Various platform-specific conditions may cause `TempDir` to fail +/// to delete the underlying directory. It's important to ensure that +/// handles (like [`File`] and [`ReadDir`]) to files inside the +/// directory are dropped before the `TempDir` goes out of scope. The +/// `TempDir` destructor will silently ignore any errors in deleting +/// the directory; to instead handle errors call [`TempDir::close()`]. +/// +/// Note that if the program exits before the `TempDir` destructor is +/// run, such as via [`std::process::exit()`], by segfaulting, or by +/// receiving a signal like `SIGINT`, then the temporary directory +/// will not be deleted. +/// +/// # Examples +/// +/// Create a temporary directory with a generated name: +/// +/// ``` +/// use std::fs::File; +/// use std::io::Write; +/// use tempfile::TempDir; +/// +/// # use std::io; +/// # fn run() -> Result<(), io::Error> { +/// // Create a directory inside of `std::env::temp_dir()` +/// let tmp_dir = TempDir::new()?; +/// # Ok(()) +/// # } +/// ``` +/// +/// Create a temporary directory with a prefix in its name: +/// +/// ``` +/// use std::fs::File; +/// use std::io::Write; +/// use tempfile::Builder; +/// +/// # use std::io; +/// # fn run() -> Result<(), io::Error> { +/// // Create a directory inside of `std::env::temp_dir()`, +/// // whose name will begin with 'example'. +/// let tmp_dir = Builder::new().prefix("example").tempdir()?; +/// # Ok(()) +/// # } +/// ``` +/// +/// [`File`]: http://doc.rust-lang.org/std/fs/struct.File.html +/// [`Path`]: http://doc.rust-lang.org/std/path/struct.Path.html +/// [`ReadDir`]: http://doc.rust-lang.org/std/fs/struct.ReadDir.html +/// [`Builder`]: struct.Builder.html +/// [`TempDir::close()`]: struct.TempDir.html#method.close +/// [`TempDir::new()`]: struct.TempDir.html#method.new +/// [`TempDir::path()`]: struct.TempDir.html#method.path +/// [`TempDir`]: struct.TempDir.html +/// [`std::env::temp_dir()`]: https://doc.rust-lang.org/std/env/fn.temp_dir.html +/// [`std::fs`]: http://doc.rust-lang.org/std/fs/index.html +/// [`std::process::exit()`]: http://doc.rust-lang.org/std/process/fn.exit.html +pub struct TempDir { + path: Option, +} + +impl TempDir { + /// Attempts to make a temporary directory inside of `env::temp_dir()`. + /// + /// See [`Builder`] for more configuration. + /// + /// The directory and everything inside it will be automatically deleted + /// once the returned `TempDir` is destroyed. + /// + /// # Errors + /// + /// If the directory can not be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// use std::fs::File; + /// use std::io::Write; + /// use tempfile::TempDir; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// // Create a directory inside of `std::env::temp_dir()` + /// let tmp_dir = TempDir::new()?; + /// + /// let file_path = tmp_dir.path().join("my-temporary-note.txt"); + /// let mut tmp_file = File::create(file_path)?; + /// writeln!(tmp_file, "Brian was here. Briefly.")?; + /// + /// // `tmp_dir` goes out of scope, the directory as well as + /// // `tmp_file` will be deleted here. + /// # Ok(()) + /// # } + /// ``` + /// + /// [`Builder`]: struct.Builder.html + pub fn new() -> io::Result { + Builder::new().tempdir() + } + + /// Attempts to make a temporary directory inside of `dir`. + /// The directory and everything inside it will be automatically + /// deleted once the returned `TempDir` is destroyed. + /// + /// # Errors + /// + /// If the directory can not be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// use std::fs::{self, File}; + /// use std::io::Write; + /// use tempfile::TempDir; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// // Create a directory inside of the current directory + /// let tmp_dir = TempDir::new_in(".")?; + /// let file_path = tmp_dir.path().join("my-temporary-note.txt"); + /// let mut tmp_file = File::create(file_path)?; + /// writeln!(tmp_file, "Brian was here. Briefly.")?; + /// # Ok(()) + /// # } + /// ``` + pub fn new_in>(dir: P) -> io::Result { + Builder::new().tempdir_in(dir) + } + + /// Accesses the [`Path`] to the temporary directory. + /// + /// [`Path`]: http://doc.rust-lang.org/std/path/struct.Path.html + /// + /// # Examples + /// + /// ``` + /// use tempfile::TempDir; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// let tmp_path; + /// + /// { + /// let tmp_dir = TempDir::new()?; + /// tmp_path = tmp_dir.path().to_owned(); + /// + /// // Check that the temp directory actually exists. + /// assert!(tmp_path.exists()); + /// + /// // End of `tmp_dir` scope, directory will be deleted + /// } + /// + /// // Temp directory should be deleted by now + /// assert_eq!(tmp_path.exists(), false); + /// # Ok(()) + /// # } + /// ``` + pub fn path(&self) -> &path::Path { + self.path.as_ref().unwrap() + } + + /// Persist the temporary directory to disk, returning the [`PathBuf`] where it is located. + /// + /// This consumes the [`TempDir`] without deleting directory on the filesystem, meaning that + /// the directory will no longer be automatically deleted. + /// + /// [`TempDir`]: struct.TempDir.html + /// [`PathBuf`]: http://doc.rust-lang.org/std/path/struct.PathBuf.html + /// + /// # Examples + /// + /// ``` + /// use std::fs; + /// use tempfile::TempDir; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// let tmp_dir = TempDir::new()?; + /// + /// // Persist the temporary directory to disk, + /// // getting the path where it is. + /// let tmp_path = tmp_dir.into_path(); + /// + /// // Delete the temporary directory ourselves. + /// fs::remove_dir_all(tmp_path)?; + /// # Ok(()) + /// # } + /// ``` + pub fn into_path(mut self) -> PathBuf { + self.path.take().unwrap() + } + + /// Closes and removes the temporary directory, returing a `Result`. + /// + /// Although `TempDir` removes the directory on drop, in the destructor + /// any errors are ignored. To detect errors cleaning up the temporary + /// directory, call `close` instead. + /// + /// # Errors + /// + /// This function may return a variety of [`std::io::Error`]s that result from deleting + /// the files and directories contained with the temporary directory, + /// as well as from deleting the temporary directory itself. These errors + /// may be platform specific. + /// + /// [`std::io::Error`]: http://doc.rust-lang.org/std/io/struct.Error.html + /// + /// # Examples + /// + /// ``` + /// use std::fs::File; + /// use std::io::Write; + /// use tempfile::TempDir; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// // Create a directory inside of `std::env::temp_dir()`. + /// let tmp_dir = TempDir::new()?; + /// let file_path = tmp_dir.path().join("my-temporary-note.txt"); + /// let mut tmp_file = File::create(file_path)?; + /// writeln!(tmp_file, "Brian was here. Briefly.")?; + /// + /// // By closing the `TempDir` explicitly we can check that it has + /// // been deleted successfully. If we don't close it explicitly, + /// // the directory will still be deleted when `tmp_dir` goes out + /// // of scope, but we won't know whether deleting the directory + /// // succeeded. + /// drop(tmp_file); + /// tmp_dir.close()?; + /// # Ok(()) + /// # } + /// ``` + pub fn close(mut self) -> io::Result<()> { + let result = remove_dir_all(self.path()).with_err_path(|| self.path()); + + // Prevent the Drop impl from removing the dir a second time. + self.path = None; + + result + } +} + +impl AsRef for TempDir { + fn as_ref(&self) -> &Path { + self.path() + } +} + +impl fmt::Debug for TempDir { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("TempDir") + .field("path", &self.path()) + .finish() + } +} + +impl Drop for TempDir { + fn drop(&mut self) { + // Path is `None` if `close()` or `into_path()` has been called. + if let Some(ref p) = self.path { + let _ = remove_dir_all(p); + } + } +} + +pub(crate) fn create(path: PathBuf) -> io::Result { + fs::create_dir(&path) + .with_err_path(|| &path) + .map(|_| TempDir { path: Some(path) }) +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/error.rs b/vendor/registry-40351f815f426200/tempfile/src/error.rs new file mode 100644 index 000000000..a5805568a --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/error.rs @@ -0,0 +1,50 @@ +use std::path::PathBuf; +use std::{error, fmt, io}; + +#[derive(Debug)] +struct PathError { + path: PathBuf, + err: io::Error, +} + +impl fmt::Display for PathError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{} at path {:?}", self.err, self.path) + } +} + +impl error::Error for PathError { + fn description(&self) -> &str { + self.err.description() + } + + #[allow(deprecated)] + fn cause(&self) -> Option<&error::Error> { + self.err.cause() + } +} + +pub(crate) trait IoResultExt { + fn with_err_path(self, path: F) -> Self + where + F: FnOnce() -> P, + P: Into; +} + +impl IoResultExt for Result { + fn with_err_path(self, path: F) -> Self + where + F: FnOnce() -> P, + P: Into, + { + self.map_err(|e| { + io::Error::new( + e.kind(), + PathError { + path: path().into(), + err: e, + }, + ) + }) + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/file/imp/mod.rs b/vendor/registry-40351f815f426200/tempfile/src/file/imp/mod.rs new file mode 100644 index 000000000..31e872886 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/file/imp/mod.rs @@ -0,0 +1,12 @@ +cfg_if! { + if #[cfg(any(unix, target_os = "redox"))] { + mod unix; + pub use self::unix::*; + } else if #[cfg(windows)] { + mod windows; + pub use self::windows::*; + } else { + mod other; + pub use self::other::*; + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/file/imp/other.rs b/vendor/registry-40351f815f426200/tempfile/src/file/imp/other.rs new file mode 100644 index 000000000..095ff40d9 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/file/imp/other.rs @@ -0,0 +1,30 @@ +use std::fs::File; +use std::io; +use std::path::Path; + +fn not_supported() -> io::Result { + Err(io::Error::new( + io::ErrorKind::Other, + "operation not supported on this platform", + )) +} + +pub fn create_named(_path: &Path) -> io::Result { + not_supported() +} + +pub fn create(_dir: &Path) -> io::Result { + not_supported() +} + +pub fn reopen(_file: &File, _path: &Path) -> io::Result { + not_supported() +} + +pub fn persist(_old_path: &Path, _new_path: &Path, _overwrite: bool) -> io::Result<()> { + not_supported() +} + +pub fn keep(path: &Path) -> io::Result<()> { + not_supported() +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/file/imp/unix.rs b/vendor/registry-40351f815f426200/tempfile/src/file/imp/unix.rs new file mode 100644 index 000000000..eb76e612c --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/file/imp/unix.rs @@ -0,0 +1,137 @@ +use std::env; +use std::ffi::{CString, OsStr}; +use std::fs::{self, File, OpenOptions}; +use std::io; +use std::os::unix::ffi::OsStrExt; +use std::os::unix::fs::{MetadataExt, OpenOptionsExt}; +use std::path::Path; +use util; + +#[cfg(not(target_os = "redox"))] +use libc::{c_char, c_int, link, rename, unlink}; + +#[cfg(not(target_os = "redox"))] +#[inline(always)] +pub fn cvt_err(result: c_int) -> io::Result { + if result == -1 { + Err(io::Error::last_os_error()) + } else { + Ok(result) + } +} + +#[cfg(target_os = "redox")] +#[inline(always)] +pub fn cvt_err(result: Result) -> io::Result { + result.map_err(|err| io::Error::from_raw_os_error(err.errno)) +} + +// Stolen from std. +pub fn cstr(path: &Path) -> io::Result { + CString::new(path.as_os_str().as_bytes()) + .map_err(|_| io::Error::new(io::ErrorKind::InvalidInput, "path contained a null")) +} + +pub fn create_named(path: &Path) -> io::Result { + OpenOptions::new() + .read(true) + .write(true) + .create_new(true) + .mode(0o600) + .open(path) +} + +fn create_unlinked(path: &Path) -> io::Result { + let tmp; + // shadow this to decrease the lifetime. It can't live longer than `tmp`. + let mut path = path; + if !path.is_absolute() { + let cur_dir = env::current_dir()?; + tmp = cur_dir.join(path); + path = &tmp; + } + + let f = create_named(path)?; + // don't care whether the path has already been unlinked, + // but perhaps there are some IO error conditions we should send up? + let _ = fs::remove_file(path); + Ok(f) +} + +#[cfg(target_os = "linux")] +pub fn create(dir: &Path) -> io::Result { + use libc::{EISDIR, ENOENT, EOPNOTSUPP, O_EXCL, O_TMPFILE}; + OpenOptions::new() + .read(true) + .write(true) + .custom_flags(O_TMPFILE | O_EXCL) // do not mix with `create_new(true)` + .open(dir) + .or_else(|e| { + match e.raw_os_error() { + // These are the three "not supported" error codes for O_TMPFILE. + Some(EOPNOTSUPP) | Some(EISDIR) | Some(ENOENT) => create_unix(dir), + _ => Err(e), + } + }) +} + +#[cfg(not(target_os = "linux"))] +pub fn create(dir: &Path) -> io::Result { + create_unix(dir) +} + +fn create_unix(dir: &Path) -> io::Result { + util::create_helper( + dir, + OsStr::new(".tmp"), + OsStr::new(""), + ::NUM_RAND_CHARS, + |path| create_unlinked(&path), + ) +} + +pub fn reopen(file: &File, path: &Path) -> io::Result { + let new_file = OpenOptions::new().read(true).write(true).open(path)?; + let old_meta = file.metadata()?; + let new_meta = new_file.metadata()?; + if old_meta.dev() != new_meta.dev() || old_meta.ino() != new_meta.ino() { + return Err(io::Error::new( + io::ErrorKind::NotFound, + "original tempfile has been replaced", + )); + } + Ok(new_file) +} + +#[cfg(not(target_os = "redox"))] +pub fn persist(old_path: &Path, new_path: &Path, overwrite: bool) -> io::Result<()> { + unsafe { + let old_path = cstr(old_path)?; + let new_path = cstr(new_path)?; + if overwrite { + cvt_err(rename( + old_path.as_ptr() as *const c_char, + new_path.as_ptr() as *const c_char, + ))?; + } else { + cvt_err(link( + old_path.as_ptr() as *const c_char, + new_path.as_ptr() as *const c_char, + ))?; + // Ignore unlink errors. Can we do better? + // On recent linux, we can use renameat2 to do this atomically. + let _ = unlink(old_path.as_ptr() as *const c_char); + } + Ok(()) + } +} + +#[cfg(target_os = "redox")] +pub fn persist(old_path: &Path, new_path: &Path, overwrite: bool) -> io::Result<()> { + // XXX implement when possible + Err(io::Error::from_raw_os_error(syscall::ENOSYS)) +} + +pub fn keep(_: &Path) -> io::Result<()> { + Ok(()) +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/file/imp/windows.rs b/vendor/registry-40351f815f426200/tempfile/src/file/imp/windows.rs new file mode 100644 index 000000000..3b35f5c72 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/file/imp/windows.rs @@ -0,0 +1,108 @@ +use std::ffi::OsStr; +use std::fs::{File, OpenOptions}; +use std::os::windows::ffi::OsStrExt; +use std::os::windows::fs::OpenOptionsExt; +use std::os::windows::io::{AsRawHandle, FromRawHandle, RawHandle}; +use std::path::Path; +use std::{io, iter}; + +use winapi::um::fileapi::SetFileAttributesW; +use winapi::um::handleapi::INVALID_HANDLE_VALUE; +use winapi::um::winbase::{MoveFileExW, ReOpenFile}; +use winapi::um::winbase::{FILE_FLAG_DELETE_ON_CLOSE, MOVEFILE_REPLACE_EXISTING}; +use winapi::um::winnt::{FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_TEMPORARY}; +use winapi::um::winnt::{FILE_GENERIC_READ, FILE_GENERIC_WRITE, HANDLE}; +use winapi::um::winnt::{FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE}; + +use util; + +fn to_utf16(s: &Path) -> Vec { + s.as_os_str().encode_wide().chain(iter::once(0)).collect() +} + +pub fn create_named(path: &Path) -> io::Result { + OpenOptions::new() + .create_new(true) + .read(true) + .write(true) + .custom_flags(FILE_ATTRIBUTE_TEMPORARY) + .open(path) +} + +pub fn create(dir: &Path) -> io::Result { + util::create_helper( + dir, + OsStr::new(".tmp"), + OsStr::new(""), + ::NUM_RAND_CHARS, + |path| { + OpenOptions::new() + .create_new(true) + .read(true) + .write(true) + .share_mode(0) + .custom_flags(FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE) + .open(path) + }, + ) +} + +pub fn reopen(file: &File, _path: &Path) -> io::Result { + let handle = file.as_raw_handle(); + unsafe { + let handle = ReOpenFile( + handle as HANDLE, + FILE_GENERIC_READ | FILE_GENERIC_WRITE, + FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, + ); + if handle == INVALID_HANDLE_VALUE { + Err(io::Error::last_os_error()) + } else { + Ok(FromRawHandle::from_raw_handle(handle as RawHandle)) + } + } +} + +pub fn keep(path: &Path) -> io::Result<()> { + unsafe { + let path_w = to_utf16(path); + if SetFileAttributesW(path_w.as_ptr(), FILE_ATTRIBUTE_NORMAL) == 0 { + Err(io::Error::last_os_error()) + } else { + Ok(()) + } + } +} + +pub fn persist(old_path: &Path, new_path: &Path, overwrite: bool) -> io::Result<()> { + // TODO: We should probably do this in one-shot using SetFileInformationByHandle but the API is + // really painful. + + unsafe { + let old_path_w = to_utf16(old_path); + let new_path_w = to_utf16(new_path); + + // Don't succeed if this fails. We don't want to claim to have successfully persisted a file + // still marked as temporary because this file won't have the same consistency guarantees. + if SetFileAttributesW(old_path_w.as_ptr(), FILE_ATTRIBUTE_NORMAL) == 0 { + return Err(io::Error::last_os_error()); + } + + let mut flags = 0; + + if overwrite { + flags |= MOVEFILE_REPLACE_EXISTING; + } + + if MoveFileExW(old_path_w.as_ptr(), new_path_w.as_ptr(), flags) == 0 { + let e = io::Error::last_os_error(); + // If this fails, the temporary file is now un-hidden and no longer marked temporary + // (slightly less efficient) but it will still work. + let _ = SetFileAttributesW(old_path_w.as_ptr(), FILE_ATTRIBUTE_TEMPORARY); + Err(e) + } else { + Ok(()) + } + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/file/mod.rs b/vendor/registry-40351f815f426200/tempfile/src/file/mod.rs new file mode 100644 index 000000000..ee1c4f211 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/file/mod.rs @@ -0,0 +1,910 @@ +use std; +use std::env; +use std::error; +use std::ffi::OsStr; +use std::fmt; +use std::fs::{self, File}; +use std::io::{self, Read, Seek, SeekFrom, Write}; +use std::mem; +use std::ops::Deref; +use std::path::{Path, PathBuf}; + +use error::IoResultExt; +use Builder; + +mod imp; + +/// Create a new temporary file. +/// +/// The file will be created in the location returned by [`std::env::temp_dir()`]. +/// +/// # Security +/// +/// This variant is secure/reliable in the presence of a pathological temporary file cleaner. +/// +/// # Resource Leaking +/// +/// The temporary file will be automatically removed by the OS when the last handle to it is closed. +/// This doesn't rely on Rust destructors being run, so will (almost) never fail to clean up the temporary file. +/// +/// # Errors +/// +/// If the file can not be created, `Err` is returned. +/// +/// # Examples +/// +/// ``` +/// # extern crate tempfile; +/// use tempfile::tempfile; +/// use std::io::{self, Write}; +/// +/// # fn main() { +/// # if let Err(_) = run() { +/// # ::std::process::exit(1); +/// # } +/// # } +/// # fn run() -> Result<(), io::Error> { +/// // Create a file inside of `std::env::temp_dir()`. +/// let mut file = tempfile()?; +/// +/// writeln!(file, "Brian was here. Briefly.")?; +/// # Ok(()) +/// # } +/// ``` +/// +/// [`std::env::temp_dir()`]: https://doc.rust-lang.org/std/env/fn.temp_dir.html +pub fn tempfile() -> io::Result { + tempfile_in(&env::temp_dir()) +} + +/// Create a new temporary file in the specified directory. +/// +/// # Security +/// +/// This variant is secure/reliable in the presence of a pathological temporary file cleaner. +/// If the temporary file isn't created in [`std::env::temp_dir()`] then temporary file cleaners aren't an issue. +/// +/// # Resource Leaking +/// +/// The temporary file will be automatically removed by the OS when the last handle to it is closed. +/// This doesn't rely on Rust destructors being run, so will (almost) never fail to clean up the temporary file. +/// +/// # Errors +/// +/// If the file can not be created, `Err` is returned. +/// +/// # Examples +/// +/// ``` +/// # extern crate tempfile; +/// use tempfile::tempfile_in; +/// use std::io::{self, Write}; +/// +/// # fn main() { +/// # if let Err(_) = run() { +/// # ::std::process::exit(1); +/// # } +/// # } +/// # fn run() -> Result<(), io::Error> { +/// // Create a file inside of the current working directory +/// let mut file = tempfile_in("./")?; +/// +/// writeln!(file, "Brian was here. Briefly.")?; +/// # Ok(()) +/// # } +/// ``` +/// +/// [`std::env::temp_dir()`]: https://doc.rust-lang.org/std/env/fn.temp_dir.html +pub fn tempfile_in>(dir: P) -> io::Result { + imp::create(dir.as_ref()) +} + +/// Error returned when persisting a temporary file path fails. +#[derive(Debug)] +pub struct PathPersistError { + /// The underlying IO error. + pub error: io::Error, + /// The temporary file path that couldn't be persisted. + pub path: TempPath, +} + +impl From for io::Error { + #[inline] + fn from(error: PathPersistError) -> io::Error { + error.error + } +} + +impl From for TempPath { + #[inline] + fn from(error: PathPersistError) -> TempPath { + error.path + } +} + +impl fmt::Display for PathPersistError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "failed to persist temporary file path: {}", self.error) + } +} + +impl error::Error for PathPersistError { + fn description(&self) -> &str { + "failed to persist temporary file path" + } + + fn cause(&self) -> Option<&error::Error> { + Some(&self.error) + } +} + +/// A path to a named temporary file without an open file handle. +/// +/// This is useful when the temporary file needs to be used by a child process, +/// for example. +/// +/// When dropped, the temporary file is deleted. +pub struct TempPath { + path: PathBuf, +} + +impl TempPath { + /// Close and remove the temporary file. + /// + /// Use this if you want to detect errors in deleting the file. + /// + /// # Errors + /// + /// If the file cannot be deleted, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # extern crate tempfile; + /// # use std::io; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// // Close the file, but keep the path to it around. + /// let path = file.into_temp_path(); + /// + /// // By closing the `TempPath` explicitly, we can check that it has + /// // been deleted successfully. If we don't close it explicitly, the + /// // file will still be deleted when `file` goes out of scope, but we + /// // won't know whether deleting the file succeeded. + /// path.close()?; + /// # Ok(()) + /// # } + /// ``` + pub fn close(mut self) -> io::Result<()> { + let result = fs::remove_file(&self.path).with_err_path(|| &self.path); + mem::replace(&mut self.path, PathBuf::new()); + mem::forget(self); + result + } + + /// Persist the temporary file at the target path. + /// + /// If a file exists at the target path, persist will atomically replace it. + /// If this method fails, it will return `self` in the resulting + /// [`PathPersistError`]. + /// + /// Note: Temporary files cannot be persisted across filesystems. + /// + /// # Security + /// + /// Only use this method if you're positive that a temporary file cleaner + /// won't have deleted your file. Otherwise, you might end up persisting an + /// attacker controlled file. + /// + /// # Errors + /// + /// If the file cannot be moved to the new location, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let mut file = NamedTempFile::new()?; + /// writeln!(file, "Brian was here. Briefly.")?; + /// + /// let path = file.into_temp_path(); + /// path.persist("./saved_file.txt")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`PathPersistError`]: struct.PathPersistError.html + pub fn persist>(mut self, new_path: P) -> Result<(), PathPersistError> { + match imp::persist(&self.path, new_path.as_ref(), true) { + Ok(_) => { + // Don't drop `self`. We don't want to try deleting the old + // temporary file path. (It'll fail, but the failure is never + // seen.) + mem::replace(&mut self.path, PathBuf::new()); + mem::forget(self); + Ok(()) + } + Err(e) => Err(PathPersistError { + error: e, + path: self, + }), + } + } + + /// Persist the temporary file at the target path iff no file exists there. + /// + /// If a file exists at the target path, fail. If this method fails, it will + /// return `self` in the resulting [`PathPersistError`]. + /// + /// Note: Temporary files cannot be persisted across filesystems. Also Note: + /// This method is not atomic. It can leave the original link to the + /// temporary file behind. + /// + /// # Security + /// + /// Only use this method if you're positive that a temporary file cleaner + /// won't have deleted your file. Otherwise, you might end up persisting an + /// attacker controlled file. + /// + /// # Errors + /// + /// If the file cannot be moved to the new location or a file already exists + /// there, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let mut file = NamedTempFile::new()?; + /// writeln!(file, "Brian was here. Briefly.")?; + /// + /// let path = file.into_temp_path(); + /// path.persist_noclobber("./saved_file.txt")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`PathPersistError`]: struct.PathPersistError.html + pub fn persist_noclobber>( + mut self, + new_path: P, + ) -> Result<(), PathPersistError> { + match imp::persist(&self.path, new_path.as_ref(), false) { + Ok(_) => { + // Don't drop `self`. We don't want to try deleting the old + // temporary file path. (It'll fail, but the failure is never + // seen.) + mem::replace(&mut self.path, PathBuf::new()); + mem::forget(self); + Ok(()) + } + Err(e) => Err(PathPersistError { + error: e, + path: self, + }), + } + } + + /// Keep the temporary file from being deleted. This function will turn the + /// temporary file into a non-temporary file without moving it. + /// + /// + /// # Errors + /// + /// On some platforms (e.g., Windows), we need to mark the file as + /// non-temporary. This operation could fail. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let mut file = NamedTempFile::new()?; + /// writeln!(file, "Brian was here. Briefly.")?; + /// + /// let path = file.into_temp_path(); + /// let path = path.keep()?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`PathPersistError`]: struct.PathPersistError.html + pub fn keep(mut self) -> Result { + match imp::keep(&self.path) { + Ok(_) => { + // Don't drop `self`. We don't want to try deleting the old + // temporary file path. (It'll fail, but the failure is never + // seen.) + let mut path = PathBuf::new(); + mem::swap(&mut self.path, &mut path); + mem::forget(self); + Ok(path) + } + Err(e) => Err(PathPersistError { + error: e, + path: self, + }), + } + } +} + +impl fmt::Debug for TempPath { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.path.fmt(f) + } +} + +impl Drop for TempPath { + fn drop(&mut self) { + let _ = fs::remove_file(&self.path); + } +} + +impl Deref for TempPath { + type Target = Path; + + fn deref(&self) -> &Path { + &self.path + } +} + +impl AsRef for TempPath { + fn as_ref(&self) -> &Path { + &self.path + } +} + +impl AsRef for TempPath { + fn as_ref(&self) -> &OsStr { + self.path.as_os_str() + } +} + +/// A named temporary file. +/// +/// The default constructor, [`NamedTempFile::new()`], creates files in +/// the location returned by [`std::env::temp_dir()`], but `NamedTempFile` +/// can be configured to manage a temporary file in any location +/// by constructing with [`NamedTempFile::new_in()`]. +/// +/// # Security +/// +/// This variant is *NOT* secure/reliable in the presence of a pathological temporary file cleaner. +/// +/// # Resource Leaking +/// +/// If the program exits before the `NamedTempFile` destructor is +/// run, such as via [`std::process::exit()`], by segfaulting, or by +/// receiving a signal like `SIGINT`, then the temporary file +/// will not be deleted. +/// +/// Use the [`tempfile()`] function unless you absolutely need a named file. +/// +/// [`tempfile()`]: fn.tempfile.html +/// [`NamedTempFile::new()`]: #method.new +/// [`NamedTempFile::new_in()`]: #method.new_in +/// [`std::env::temp_dir()`]: https://doc.rust-lang.org/std/env/fn.temp_dir.html +/// [`std::process::exit()`]: http://doc.rust-lang.org/std/process/fn.exit.html +pub struct NamedTempFile { + path: TempPath, + file: File, +} + +impl fmt::Debug for NamedTempFile { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "NamedTempFile({:?})", self.path) + } +} + +impl AsRef for NamedTempFile { + #[inline] + fn as_ref(&self) -> &Path { + self.path() + } +} + +/// Error returned when persisting a temporary file fails. +#[derive(Debug)] +pub struct PersistError { + /// The underlying IO error. + pub error: io::Error, + /// The temporary file that couldn't be persisted. + pub file: NamedTempFile, +} + +impl From for io::Error { + #[inline] + fn from(error: PersistError) -> io::Error { + error.error + } +} + +impl From for NamedTempFile { + #[inline] + fn from(error: PersistError) -> NamedTempFile { + error.file + } +} + +impl fmt::Display for PersistError { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "failed to persist temporary file: {}", self.error) + } +} + +impl error::Error for PersistError { + fn description(&self) -> &str { + "failed to persist temporary file" + } + fn cause(&self) -> Option<&error::Error> { + Some(&self.error) + } +} + +impl NamedTempFile { + /// Create a new named temporary file. + /// + /// See [`Builder`] for more configuration. + /// + /// # Security + /// + /// This will create a temporary file in the default temporary file + /// directory (platform dependent). These directories are often patrolled by temporary file + /// cleaners so only use this method if you're *positive* that the temporary file cleaner won't + /// delete your file. + /// + /// Reasons to use this method: + /// + /// 1. The file has a short lifetime and your temporary file cleaner is + /// sane (doesn't delete recently accessed files). + /// + /// 2. You trust every user on your system (i.e. you are the only user). + /// + /// 3. You have disabled your system's temporary file cleaner or verified + /// that your system doesn't have a temporary file cleaner. + /// + /// Reasons not to use this method: + /// + /// 1. You'll fix it later. No you won't. + /// + /// 2. You don't care about the security of the temporary file. If none of + /// the "reasons to use this method" apply, referring to a temporary + /// file by name may allow an attacker to create/overwrite your + /// non-temporary files. There are exceptions but if you don't already + /// know them, don't use this method. + /// + /// # Errors + /// + /// If the file can not be created, `Err` is returned. + /// + /// # Examples + /// + /// Create a named temporary file and write some data to it: + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), ::std::io::Error> { + /// let mut file = NamedTempFile::new()?; + /// + /// writeln!(file, "Brian was here. Briefly.")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`Builder`]: struct.Builder.html + pub fn new() -> io::Result { + Builder::new().tempfile() + } + + /// Create a new named temporary file in the specified directory. + /// + /// See [`NamedTempFile::new()`] for details. + /// + /// [`NamedTempFile::new()`]: #method.new_in + pub fn new_in>(dir: P) -> io::Result { + Builder::new().tempfile_in(dir) + } + + /// Get the temporary file's path. + /// + /// # Security + /// + /// Only use this method if you're positive that a + /// temporary file cleaner won't have deleted your file. Otherwise, the path + /// returned by this method may refer to an attacker controlled file. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), ::std::io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// println!("{:?}", file.path()); + /// # Ok(()) + /// # } + /// ``` + #[inline] + pub fn path(&self) -> &Path { + &self.path + } + + /// Close and remove the temporary file. + /// + /// Use this if you want to detect errors in deleting the file. + /// + /// # Errors + /// + /// If the file cannot be deleted, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # extern crate tempfile; + /// # use std::io; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// // By closing the `NamedTempFile` explicitly, we can check that it has + /// // been deleted successfully. If we don't close it explicitly, + /// // the file will still be deleted when `file` goes out + /// // of scope, but we won't know whether deleting the file + /// // succeeded. + /// file.close()?; + /// # Ok(()) + /// # } + /// ``` + pub fn close(self) -> io::Result<()> { + let NamedTempFile { path, .. } = self; + path.close() + } + + /// Persist the temporary file at the target path. + /// + /// If a file exists at the target path, persist will atomically replace it. + /// If this method fails, it will return `self` in the resulting + /// [`PersistError`]. + /// + /// Note: Temporary files cannot be persisted across filesystems. + /// + /// # Security + /// + /// Only use this method if you're positive that a + /// temporary file cleaner won't have deleted your file. Otherwise, you + /// might end up persisting an attacker controlled file. + /// + /// # Errors + /// + /// If the file cannot be moved to the new location, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// let mut persisted_file = file.persist("./saved_file.txt")?; + /// writeln!(persisted_file, "Brian was here. Briefly.")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`PersistError`]: struct.PersistError.html + pub fn persist>(self, new_path: P) -> Result { + let NamedTempFile { path, file } = self; + match path.persist(new_path) { + Ok(_) => Ok(file), + Err(err) => { + let PathPersistError { error, path } = err; + Err(PersistError { + file: NamedTempFile { path, file }, + error, + }) + } + } + } + + /// Persist the temporary file at the target path iff no file exists there. + /// + /// If a file exists at the target path, fail. If this method fails, it will + /// return `self` in the resulting PersistError. + /// + /// Note: Temporary files cannot be persisted across filesystems. Also Note: + /// This method is not atomic. It can leave the original link to the + /// temporary file behind. + /// + /// # Security + /// + /// Only use this method if you're positive that a + /// temporary file cleaner won't have deleted your file. Otherwise, you + /// might end up persisting an attacker controlled file. + /// + /// # Errors + /// + /// If the file cannot be moved to the new location or a file already exists there, + /// `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// let mut persisted_file = file.persist_noclobber("./saved_file.txt")?; + /// writeln!(persisted_file, "Brian was here. Briefly.")?; + /// # Ok(()) + /// # } + /// ``` + pub fn persist_noclobber>(self, new_path: P) -> Result { + let NamedTempFile { path, file } = self; + match path.persist_noclobber(new_path) { + Ok(_) => Ok(file), + Err(err) => { + let PathPersistError { error, path } = err; + Err(PersistError { + file: NamedTempFile { path, file }, + error, + }) + } + } + } + + /// Keep the temporary file from being deleted. This function will turn the + /// temporary file into a non-temporary file without moving it. + /// + /// + /// # Errors + /// + /// On some platforms (e.g., Windows), we need to mark the file as + /// non-temporary. This operation could fail. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io::{self, Write}; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let mut file = NamedTempFile::new()?; + /// writeln!(file, "Brian was here. Briefly.")?; + /// + /// let (file, path) = file.keep()?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [`PathPersistError`]: struct.PathPersistError.html + pub fn keep(self) -> Result<(File, PathBuf), PersistError> { + let (file, path) = (self.file, self.path); + match path.keep() { + Ok(path) => Ok((file, path)), + Err(PathPersistError { error, path }) => Err(PersistError { + file: NamedTempFile { path, file }, + error, + }), + } + } + + /// Reopen the temporary file. + /// + /// This function is useful when you need multiple independent handles to + /// the same file. It's perfectly fine to drop the original `NamedTempFile` + /// while holding on to `File`s returned by this function; the `File`s will + /// remain usable. However, they may not be nameable. + /// + /// # Errors + /// + /// If the file cannot be reopened, `Err` is returned. + /// + /// # Examples + /// + /// ```no_run + /// # use std::io; + /// # extern crate tempfile; + /// use tempfile::NamedTempFile; + /// + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// let file = NamedTempFile::new()?; + /// + /// let another_handle = file.reopen()?; + /// # Ok(()) + /// # } + /// ``` + pub fn reopen(&self) -> io::Result { + imp::reopen(self.as_file(), NamedTempFile::path(self)) + .with_err_path(|| NamedTempFile::path(self)) + } + + /// Get a reference to the underlying file. + pub fn as_file(&self) -> &File { + &self.file + } + + /// Get a mutable reference to the underlying file. + pub fn as_file_mut(&mut self) -> &mut File { + &mut self.file + } + + /// Convert the temporary file into a `std::fs::File`. + /// + /// The inner file will be deleted. + pub fn into_file(self) -> File { + self.file + } + + /// Closes the file, leaving only the temporary file path. + /// + /// This is useful when another process must be able to open the temporary + /// file. + pub fn into_temp_path(self) -> TempPath { + self.path + } + + /// Converts the named temporary file into its constituent parts. + /// + /// Note: When the path is dropped, the file is deleted but the file handle + /// is still usable. + pub fn into_parts(self) -> (File, TempPath) { + (self.file, self.path) + } +} + +impl Read for NamedTempFile { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + self.as_file_mut().read(buf).with_err_path(|| self.path()) + } +} + +impl<'a> Read for &'a NamedTempFile { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + self.as_file().read(buf).with_err_path(|| self.path()) + } +} + +impl Write for NamedTempFile { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.as_file_mut().write(buf).with_err_path(|| self.path()) + } + #[inline] + fn flush(&mut self) -> io::Result<()> { + self.as_file_mut().flush().with_err_path(|| self.path()) + } +} + +impl<'a> Write for &'a NamedTempFile { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.as_file().write(buf).with_err_path(|| self.path()) + } + #[inline] + fn flush(&mut self) -> io::Result<()> { + self.as_file().flush().with_err_path(|| self.path()) + } +} + +impl Seek for NamedTempFile { + fn seek(&mut self, pos: SeekFrom) -> io::Result { + self.as_file_mut().seek(pos).with_err_path(|| self.path()) + } +} + +impl<'a> Seek for &'a NamedTempFile { + fn seek(&mut self, pos: SeekFrom) -> io::Result { + self.as_file().seek(pos).with_err_path(|| self.path()) + } +} + +#[cfg(unix)] +impl std::os::unix::io::AsRawFd for NamedTempFile { + #[inline] + fn as_raw_fd(&self) -> std::os::unix::io::RawFd { + self.as_file().as_raw_fd() + } +} + +#[cfg(windows)] +impl std::os::windows::io::AsRawHandle for NamedTempFile { + #[inline] + fn as_raw_handle(&self) -> std::os::windows::io::RawHandle { + self.as_file().as_raw_handle() + } +} + +pub(crate) fn create_named(mut path: PathBuf) -> io::Result { + // Make the path absolute. Otherwise, changing directories could cause us to + // delete the wrong file. + if !path.is_absolute() { + path = env::current_dir()?.join(path) + } + imp::create_named(&path) + .with_err_path(|| path.clone()) + .map(|file| NamedTempFile { + path: TempPath { path }, + file, + }) +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/lib.rs b/vendor/registry-40351f815f426200/tempfile/src/lib.rs new file mode 100644 index 000000000..df04d0798 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/lib.rs @@ -0,0 +1,455 @@ +//! Temporary files and directories. +//! +//! - Use the [`tempfile()`] function for temporary files +//! - Use the [`tempdir()`] function for temporary directories. +//! +//! # Design +//! +//! This crate provides several approaches to creating temporary files and directories. +//! [`tempfile()`] relies on the OS to remove the temporary file once the last handle is closed. +//! [`TempDir`] and [`NamedTempFile`] both rely on Rust destructors for cleanup. +//! +//! When choosing between the temporary file variants, prefer `tempfile` +//! unless you either need to know the file's path or to be able to persist it. +//! +//! ## Resource Leaking +//! +//! `tempfile` will (almost) never fail to cleanup temporary resources, but `TempDir` and `NamedTempFile` will if +//! their destructors don't run. This is because `tempfile` relies on the OS to cleanup the +//! underlying file, while `TempDir` and `NamedTempFile` rely on their destructors to do so. +//! +//! ## Security +//! +//! In the presence of pathological temporary file cleaner, relying on file paths is unsafe because +//! a temporary file cleaner could delete the temporary file which an attacker could then replace. +//! +//! `tempfile` doesn't rely on file paths so this isn't an issue. However, `NamedTempFile` does +//! rely on file paths. +//! +//! ## Examples +//! +//! Create a temporary file and write some data into it: +//! +//! ``` +//! # extern crate tempfile; +//! use tempfile::tempfile; +//! use std::io::{self, Write}; +//! +//! # fn main() { +//! # if let Err(_) = run() { +//! # ::std::process::exit(1); +//! # } +//! # } +//! # fn run() -> Result<(), io::Error> { +//! // Create a file inside of `std::env::temp_dir()`. +//! let mut file = tempfile()?; +//! +//! writeln!(file, "Brian was here. Briefly.")?; +//! # Ok(()) +//! # } +//! ``` +//! +//! Create a temporary directory and add a file to it: +//! +//! ``` +//! # extern crate tempfile; +//! use tempfile::tempdir; +//! use std::fs::File; +//! use std::io::{self, Write}; +//! +//! # fn main() { +//! # if let Err(_) = run() { +//! # ::std::process::exit(1); +//! # } +//! # } +//! # fn run() -> Result<(), io::Error> { +//! // Create a directory inside of `std::env::temp_dir()`. +//! let dir = tempdir()?; +//! +//! let file_path = dir.path().join("my-temporary-note.txt"); +//! let mut file = File::create(file_path)?; +//! writeln!(file, "Brian was here. Briefly.")?; +//! +//! // By closing the `TempDir` explicitly, we can check that it has +//! // been deleted successfully. If we don't close it explicitly, +//! // the directory will still be deleted when `dir` goes out +//! // of scope, but we won't know whether deleting the directory +//! // succeeded. +//! drop(file); +//! dir.close()?; +//! # Ok(()) +//! # } +//! ``` +//! +//! [`tempfile()`]: fn.tempfile.html +//! [`tempdir()`]: fn.tempdir.html +//! [`TempDir`]: struct.TempDir.html +//! [`NamedTempFile`]: struct.NamedTempFile.html +//! [`std::env::temp_dir()`]: https://doc.rust-lang.org/std/env/fn.temp_dir.html + +#![doc( + html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", + html_favicon_url = "https://www.rust-lang.org/favicon.ico", + html_root_url = "https://docs.rs/tempfile/2.2.0" +)] +#![cfg_attr(test, deny(warnings))] + +#[macro_use] +extern crate cfg_if; +extern crate rand; +extern crate remove_dir_all; + +#[cfg(unix)] +extern crate libc; + +#[cfg(windows)] +extern crate winapi; + +#[cfg(target_os = "redox")] +extern crate syscall; + +const NUM_RETRIES: u32 = 1 << 31; +const NUM_RAND_CHARS: usize = 6; + +use std::ffi::OsStr; +use std::path::Path; +use std::{env, io}; + +mod dir; +mod error; +mod file; +mod spooled; +mod util; + +pub use dir::{tempdir, tempdir_in, TempDir}; +pub use file::{tempfile, tempfile_in, NamedTempFile, PathPersistError, PersistError, TempPath}; +pub use spooled::{spooled_tempfile, SpooledTempFile}; + +/// Create a new temporary file or directory with custom parameters. +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct Builder<'a, 'b> { + random_len: usize, + prefix: &'a OsStr, + suffix: &'b OsStr, +} + +impl<'a, 'b> Default for Builder<'a, 'b> { + fn default() -> Self { + Builder { + random_len: ::NUM_RAND_CHARS, + prefix: OsStr::new(".tmp"), + suffix: OsStr::new(""), + } + } +} + +impl<'a, 'b> Builder<'a, 'b> { + /// Create a new `Builder`. + /// + /// # Examples + /// + /// Create a named temporary file and write some data into it: + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # use std::ffi::OsStr; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// use tempfile::Builder; + /// + /// let named_tempfile = Builder::new() + /// .prefix("my-temporary-note") + /// .suffix(".txt") + /// .rand_bytes(5) + /// .tempfile()?; + /// + /// let name = named_tempfile + /// .path() + /// .file_name().and_then(OsStr::to_str); + /// + /// if let Some(name) = name { + /// assert!(name.starts_with("my-temporary-note")); + /// assert!(name.ends_with(".txt")); + /// assert_eq!(name.len(), "my-temporary-note.txt".len() + 5); + /// } + /// # Ok(()) + /// # } + /// ``` + /// + /// Create a temporary directory and add a file to it: + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io::{self, Write}; + /// # use std::fs::File; + /// # use std::ffi::OsStr; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// use tempfile::Builder; + /// + /// let dir = Builder::new() + /// .prefix("my-temporary-dir") + /// .rand_bytes(5) + /// .tempdir()?; + /// + /// let file_path = dir.path().join("my-temporary-note.txt"); + /// let mut file = File::create(file_path)?; + /// writeln!(file, "Brian was here. Briefly.")?; + /// + /// // By closing the `TempDir` explicitly, we can check that it has + /// // been deleted successfully. If we don't close it explicitly, + /// // the directory will still be deleted when `dir` goes out + /// // of scope, but we won't know whether deleting the directory + /// // succeeded. + /// drop(file); + /// dir.close()?; + /// # Ok(()) + /// # } + /// ``` + pub fn new() -> Self { + Self::default() + } + + /// Set a custom filename prefix. + /// + /// Path separators are legal but not advisable. + /// Default: `.tmp`. + /// + /// # Examples + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// # use tempfile::Builder; + /// let named_tempfile = Builder::new() + /// .prefix("my-temporary-note") + /// .tempfile()?; + /// # Ok(()) + /// # } + /// ``` + pub fn prefix + ?Sized>(&mut self, prefix: &'a S) -> &mut Self { + self.prefix = prefix.as_ref(); + self + } + + /// Set a custom filename suffix. + /// + /// Path separators are legal but not advisable. + /// Default: empty. + /// + /// # Examples + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// # use tempfile::Builder; + /// let named_tempfile = Builder::new() + /// .suffix(".txt") + /// .tempfile()?; + /// # Ok(()) + /// # } + /// ``` + pub fn suffix + ?Sized>(&mut self, suffix: &'b S) -> &mut Self { + self.suffix = suffix.as_ref(); + self + } + + /// Set the number of random bytes. + /// + /// Default: `6`. + /// + /// # Examples + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// # use tempfile::Builder; + /// let named_tempfile = Builder::new() + /// .rand_bytes(5) + /// .tempfile()?; + /// # Ok(()) + /// # } + /// ``` + pub fn rand_bytes(&mut self, rand: usize) -> &mut Self { + self.random_len = rand; + self + } + + /// Create the named temporary file. + /// + /// # Security + /// + /// See [the security][security] docs on `NamedTempFile`. + /// + /// # Resource leaking + /// + /// See [the resource leaking][resource-leaking] docs on `NamedTempFile`. + /// + /// # Errors + /// + /// If the file cannot be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// # use tempfile::Builder; + /// let tempfile = Builder::new().tempfile()?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [security]: struct.NamedTempFile.html#security + /// [resource-leaking]: struct.NamedTempFile.html#resource-leaking + pub fn tempfile(&self) -> io::Result { + self.tempfile_in(&env::temp_dir()) + } + + /// Create the named temporary file in the specified directory. + /// + /// # Security + /// + /// See [the security][security] docs on `NamedTempFile`. + /// + /// # Resource leaking + /// + /// See [the resource leaking][resource-leaking] docs on `NamedTempFile`. + /// + /// # Errors + /// + /// If the file cannot be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// # extern crate tempfile; + /// # use std::io; + /// # fn main() { + /// # if let Err(_) = run() { + /// # ::std::process::exit(1); + /// # } + /// # } + /// # fn run() -> Result<(), io::Error> { + /// # use tempfile::Builder; + /// let tempfile = Builder::new().tempfile_in("./")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [security]: struct.NamedTempFile.html#security + /// [resource-leaking]: struct.NamedTempFile.html#resource-leaking + pub fn tempfile_in>(&self, dir: P) -> io::Result { + util::create_helper( + dir.as_ref(), + self.prefix, + self.suffix, + self.random_len, + file::create_named, + ) + } + + /// Attempts to make a temporary directory inside of `env::temp_dir()` whose + /// name will have the prefix, `prefix`. The directory and + /// everything inside it will be automatically deleted once the + /// returned `TempDir` is destroyed. + /// + /// # Resource leaking + /// + /// See [the resource leaking][resource-leaking] docs on `TempDir`. + /// + /// # Errors + /// + /// If the directory can not be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// use std::fs::File; + /// use std::io::Write; + /// use tempfile::Builder; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// let tmp_dir = Builder::new().tempdir()?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [resource-leaking]: struct.TempDir.html#resource-leaking + pub fn tempdir(&self) -> io::Result { + self.tempdir_in(&env::temp_dir()) + } + + /// Attempts to make a temporary directory inside of `dir`. + /// The directory and everything inside it will be automatically + /// deleted once the returned `TempDir` is destroyed. + /// + /// # Resource leaking + /// + /// See [the resource leaking][resource-leaking] docs on `TempDir`. + /// + /// # Errors + /// + /// If the directory can not be created, `Err` is returned. + /// + /// # Examples + /// + /// ``` + /// use std::fs::{self, File}; + /// use std::io::Write; + /// use tempfile::Builder; + /// + /// # use std::io; + /// # fn run() -> Result<(), io::Error> { + /// let tmp_dir = Builder::new().tempdir_in("./")?; + /// # Ok(()) + /// # } + /// ``` + /// + /// [resource-leaking]: struct.TempDir.html#resource-leaking + pub fn tempdir_in>(&self, dir: P) -> io::Result { + let storage; + let mut dir = dir.as_ref(); + if !dir.is_absolute() { + let cur_dir = env::current_dir()?; + storage = cur_dir.join(dir); + dir = &storage; + } + + util::create_helper(dir, self.prefix, self.suffix, self.random_len, dir::create) + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/spooled.rs b/vendor/registry-40351f815f426200/tempfile/src/spooled.rs new file mode 100644 index 000000000..093477b8c --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/spooled.rs @@ -0,0 +1,153 @@ +use file::tempfile; +use std::fs::File; +use std::io::{self, Cursor, Read, Seek, SeekFrom, Write}; + +#[derive(Debug)] +enum SpooledInner { + InMemory(Cursor>), + OnDisk(File), +} + +/// An object that behaves like a regular temporary file, but keeps data in +/// memory until it reaches a configured size, at which point the data is +/// written to a temporary file on disk, and further operations use the file +/// on disk. +#[derive(Debug)] +pub struct SpooledTempFile { + max_size: usize, + inner: SpooledInner, +} + +/// Create a new spooled temporary file. +/// +/// # Security +/// +/// This variant is secure/reliable in the presence of a pathological temporary +/// file cleaner. +/// +/// # Resource Leaking +/// +/// The temporary file will be automatically removed by the OS when the last +/// handle to it is closed. This doesn't rely on Rust destructors being run, so +/// will (almost) never fail to clean up the temporary file. +/// +/// # Examples +/// +/// ``` +/// # extern crate tempfile; +/// use tempfile::spooled_tempfile; +/// use std::io::{self, Write}; +/// +/// # fn main() { +/// # if let Err(_) = run() { +/// # ::std::process::exit(1); +/// # } +/// # } +/// # fn run() -> Result<(), io::Error> { +/// let mut file = spooled_tempfile(15); +/// +/// writeln!(file, "short line")?; +/// assert!(!file.is_rolled()); +/// +/// // as a result of this write call, the size of the data will exceed +/// // `max_size` (15), so it will be written to a temporary file on disk, +/// // and the in-memory buffer will be dropped +/// writeln!(file, "marvin gardens")?; +/// assert!(file.is_rolled()); +/// +/// # Ok(()) +/// # } +/// ``` +#[inline] +pub fn spooled_tempfile(max_size: usize) -> SpooledTempFile { + SpooledTempFile::new(max_size) +} + +impl SpooledTempFile { + pub fn new(max_size: usize) -> SpooledTempFile { + SpooledTempFile { + max_size: max_size, + inner: SpooledInner::InMemory(Cursor::new(Vec::new())), + } + } + + /// Returns true if the file has been rolled over to disk. + pub fn is_rolled(&self) -> bool { + match self.inner { + SpooledInner::InMemory(_) => false, + SpooledInner::OnDisk(_) => true, + } + } + + /// Rolls over to a file on disk, regardless of current size. Does nothing + /// if already rolled over. + pub fn roll(&mut self) -> io::Result<()> { + if !self.is_rolled() { + let mut file = tempfile()?; + if let SpooledInner::InMemory(ref mut cursor) = self.inner { + file.write_all(cursor.get_ref())?; + file.seek(SeekFrom::Start(cursor.position()))?; + } + self.inner = SpooledInner::OnDisk(file); + } + Ok(()) + } + + pub fn set_len(&mut self, size: u64) -> Result<(), io::Error> { + if size as usize > self.max_size { + self.roll()?; // does nothing if already rolled over + } + match self.inner { + SpooledInner::InMemory(ref mut cursor) => { + cursor.get_mut().resize(size as usize, 0); + Ok(()) + } + SpooledInner::OnDisk(ref mut file) => file.set_len(size), + } + } +} + +impl Read for SpooledTempFile { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + match self.inner { + SpooledInner::InMemory(ref mut cursor) => cursor.read(buf), + SpooledInner::OnDisk(ref mut file) => file.read(buf), + } + } +} + +impl Write for SpooledTempFile { + fn write(&mut self, buf: &[u8]) -> io::Result { + // roll over to file if necessary + let mut rolling = false; + if let SpooledInner::InMemory(ref mut cursor) = self.inner { + rolling = cursor.position() as usize + buf.len() > self.max_size; + } + if rolling { + self.roll()?; + } + + // write the bytes + match self.inner { + SpooledInner::InMemory(ref mut cursor) => cursor.write(buf), + SpooledInner::OnDisk(ref mut file) => file.write(buf), + } + } + + #[inline] + fn flush(&mut self) -> io::Result<()> { + match self.inner { + SpooledInner::InMemory(ref mut cursor) => cursor.flush(), + SpooledInner::OnDisk(ref mut file) => file.flush(), + } + } +} + +impl Seek for SpooledTempFile { + fn seek(&mut self, pos: SeekFrom) -> io::Result { + match self.inner { + SpooledInner::InMemory(ref mut cursor) => cursor.seek(pos), + SpooledInner::OnDisk(ref mut file) => file.seek(pos), + } + } +} diff --git a/vendor/registry-40351f815f426200/tempfile/src/util.rs b/vendor/registry-40351f815f426200/tempfile/src/util.rs new file mode 100644 index 000000000..42d1eeded --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/src/util.rs @@ -0,0 +1,51 @@ +use rand::distributions::Alphanumeric; +use rand::{self, Rng}; +use std::ffi::{OsStr, OsString}; +use std::path::{Path, PathBuf}; +use std::{io, str}; + +use error::IoResultExt; + +fn tmpname(prefix: &OsStr, suffix: &OsStr, rand_len: usize) -> OsString { + let mut buf = OsString::with_capacity(prefix.len() + suffix.len() + rand_len); + buf.push(prefix); + + // Push each character in one-by-one. Unfortunately, this is the only + // safe(ish) simple way to do this without allocating a temporary + // String/Vec. + unsafe { + rand::thread_rng() + .sample_iter(&Alphanumeric) + .take(rand_len) + .for_each(|b| buf.push(str::from_utf8_unchecked(&[b as u8]))) + } + buf.push(suffix); + buf +} + +pub fn create_helper( + base: &Path, + prefix: &OsStr, + suffix: &OsStr, + random_len: usize, + f: F, +) -> io::Result +where + F: Fn(PathBuf) -> io::Result, +{ + let num_retries = if random_len != 0 { ::NUM_RETRIES } else { 1 }; + + for _ in 0..num_retries { + let path = base.join(tmpname(prefix, suffix, random_len)); + return match f(path) { + Err(ref e) if e.kind() == io::ErrorKind::AlreadyExists => continue, + res => res, + }; + } + + Err(io::Error::new( + io::ErrorKind::AlreadyExists, + "too many temporary files exist", + )) + .with_err_path(|| base) +} diff --git a/vendor/registry-40351f815f426200/tempfile/tests/namedtempfile.rs b/vendor/registry-40351f815f426200/tempfile/tests/namedtempfile.rs new file mode 100644 index 000000000..2294285a5 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/tests/namedtempfile.rs @@ -0,0 +1,269 @@ +extern crate tempfile; +use std::env; +use std::fs::File; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::path::Path; +use tempfile::{Builder, NamedTempFile}; + +fn exists>(path: P) -> bool { + std::fs::metadata(path.as_ref()).is_ok() +} + +#[test] +fn test_basic() { + let mut tmpfile = NamedTempFile::new().unwrap(); + write!(tmpfile, "abcde").unwrap(); + tmpfile.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + tmpfile.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); +} + +#[test] +fn test_deleted() { + let tmpfile = NamedTempFile::new().unwrap(); + let path = tmpfile.path().to_path_buf(); + assert!(exists(&path)); + drop(tmpfile); + assert!(!exists(&path)); +} + +#[test] +fn test_persist() { + let mut tmpfile = NamedTempFile::new().unwrap(); + let old_path = tmpfile.path().to_path_buf(); + let persist_path = env::temp_dir().join("persisted_temporary_file"); + write!(tmpfile, "abcde").unwrap(); + { + assert!(exists(&old_path)); + let mut f = tmpfile.persist(&persist_path).unwrap(); + assert!(!exists(&old_path)); + + // Check original file + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + + { + // Try opening it at the new path. + let mut f = File::open(&persist_path).unwrap(); + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + std::fs::remove_file(&persist_path).unwrap(); +} + +#[test] +fn test_persist_noclobber() { + let mut tmpfile = NamedTempFile::new().unwrap(); + let old_path = tmpfile.path().to_path_buf(); + let persist_target = NamedTempFile::new().unwrap(); + let persist_path = persist_target.path().to_path_buf(); + write!(tmpfile, "abcde").unwrap(); + assert!(exists(&old_path)); + { + tmpfile = tmpfile.persist_noclobber(&persist_path).unwrap_err().into(); + assert!(exists(&old_path)); + std::fs::remove_file(&persist_path).unwrap(); + drop(persist_target); + } + tmpfile.persist_noclobber(&persist_path).unwrap(); + // Try opening it at the new path. + let mut f = File::open(&persist_path).unwrap(); + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + std::fs::remove_file(&persist_path).unwrap(); +} + +#[test] +fn test_customnamed() { + let tmpfile = Builder::new() + .prefix("tmp") + .suffix(&".rs".to_string()) + .rand_bytes(12) + .tempfile() + .unwrap(); + let name = tmpfile.path().file_name().unwrap().to_str().unwrap(); + assert!(name.starts_with("tmp")); + assert!(name.ends_with(".rs")); + assert_eq!(name.len(), 18); +} + +#[test] +fn test_reopen() { + let source = NamedTempFile::new().unwrap(); + let mut first = source.reopen().unwrap(); + let mut second = source.reopen().unwrap(); + drop(source); + + write!(first, "abcde").expect("write failed"); + let mut buf = String::new(); + second.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); +} + +#[test] +fn test_into_file() { + let mut file = NamedTempFile::new().unwrap(); + let path = file.path().to_owned(); + write!(file, "abcde").expect("write failed"); + + assert!(path.exists()); + let mut file = file.into_file(); + assert!(!path.exists()); + + file.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + file.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); +} + +#[test] +fn test_immut() { + let tmpfile = NamedTempFile::new().unwrap(); + (&tmpfile).write_all(b"abcde").unwrap(); + (&tmpfile).seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + (&tmpfile).read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); +} + +#[test] +fn test_temppath() { + let mut tmpfile = NamedTempFile::new().unwrap(); + write!(tmpfile, "abcde").unwrap(); + + let path = tmpfile.into_temp_path(); + assert!(path.is_file()); +} + +#[test] +fn test_temppath_persist() { + let mut tmpfile = NamedTempFile::new().unwrap(); + write!(tmpfile, "abcde").unwrap(); + + let tmppath = tmpfile.into_temp_path(); + + let old_path = tmppath.to_path_buf(); + let persist_path = env::temp_dir().join("persisted_temppath_file"); + + { + assert!(exists(&old_path)); + tmppath.persist(&persist_path).unwrap(); + assert!(!exists(&old_path)); + } + + { + // Try opening it at the new path. + let mut f = File::open(&persist_path).unwrap(); + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + + std::fs::remove_file(&persist_path).unwrap(); +} + +#[test] +fn test_temppath_persist_noclobber() { + let mut tmpfile = NamedTempFile::new().unwrap(); + write!(tmpfile, "abcde").unwrap(); + + let mut tmppath = tmpfile.into_temp_path(); + + let old_path = tmppath.to_path_buf(); + let persist_target = NamedTempFile::new().unwrap(); + let persist_path = persist_target.path().to_path_buf(); + + assert!(exists(&old_path)); + + { + tmppath = tmppath.persist_noclobber(&persist_path).unwrap_err().into(); + assert!(exists(&old_path)); + std::fs::remove_file(&persist_path).unwrap(); + drop(persist_target); + } + + tmppath.persist_noclobber(&persist_path).unwrap(); + + // Try opening it at the new path. + let mut f = File::open(&persist_path).unwrap(); + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + std::fs::remove_file(&persist_path).unwrap(); +} + +#[test] +fn test_write_after_close() { + let path = NamedTempFile::new().unwrap().into_temp_path(); + File::create(path).unwrap().write_all(b"test").unwrap(); +} + +#[test] +fn test_change_dir() { + env::set_current_dir(env::temp_dir()).unwrap(); + let tmpfile = NamedTempFile::new_in(".").unwrap(); + let path = env::current_dir().unwrap().join(tmpfile.path()); + env::set_current_dir("/").unwrap(); + drop(tmpfile); + assert!(!exists(path)) +} + +#[test] +fn test_into_parts() { + let mut file = NamedTempFile::new().unwrap(); + write!(file, "abcd").expect("write failed"); + + let (mut file, temp_path) = file.into_parts(); + + let path = temp_path.to_path_buf(); + + assert!(path.exists()); + drop(temp_path); + assert!(!path.exists()); + + write!(file, "efgh").expect("write failed"); + + file.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + file.read_to_string(&mut buf).unwrap(); + assert_eq!("abcdefgh", buf); +} + +#[test] +fn test_keep() { + let mut tmpfile = NamedTempFile::new().unwrap(); + write!(tmpfile, "abcde").unwrap(); + let (mut f, temp_path) = tmpfile.into_parts(); + let path; + { + assert!(exists(&temp_path)); + path = temp_path.keep().unwrap(); + assert!(exists(&path)); + + // Check original file + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + + { + // Try opening it again. + let mut f = File::open(&path).unwrap(); + f.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + f.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + std::fs::remove_file(&path).unwrap(); +} diff --git a/vendor/registry-40351f815f426200/tempfile/tests/spooled.rs b/vendor/registry-40351f815f426200/tempfile/tests/spooled.rs new file mode 100644 index 000000000..8481936bd --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/tests/spooled.rs @@ -0,0 +1,307 @@ +extern crate tempfile; + +use std::io::{Read, Seek, SeekFrom, Write}; + +use tempfile::{spooled_tempfile, SpooledTempFile}; + +#[test] +fn test_automatic_rollover() { + let mut t = spooled_tempfile(10); + let mut buf = Vec::new(); + + assert!(!t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); + assert_eq!(buf.as_slice(), b""); + buf.clear(); + + assert_eq!(t.write(b"abcde").unwrap(), 5); + + assert!(!t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 5); + assert_eq!(buf.as_slice(), b"abcde"); + + assert_eq!(t.write(b"fghijklmno").unwrap(), 10); + + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 15); + assert!(t.is_rolled()); +} + +#[test] +fn test_explicit_rollover() { + let mut t = SpooledTempFile::new(100); + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); + assert!(!t.is_rolled()); + + // roll over explicitly + assert!(t.roll().is_ok()); + assert!(t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); + + let mut buf = Vec::new(); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); + assert_eq!(buf.as_slice(), b""); + buf.clear(); + + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); + assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstuvwxyz"); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); +} + +// called by test_seek_{buffer, file} +// assumes t is empty and offset is 0 to start +fn test_seek(t: &mut SpooledTempFile) { + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() + assert_eq!(t.seek(SeekFrom::Current(-1)).unwrap(), 25); + assert_eq!(t.seek(SeekFrom::Current(1)).unwrap(), 26); + assert_eq!(t.seek(SeekFrom::Current(1)).unwrap(), 27); + assert_eq!(t.seek(SeekFrom::Current(-27)).unwrap(), 0); + assert!(t.seek(SeekFrom::Current(-1)).is_err()); + assert!(t.seek(SeekFrom::Current(-1245)).is_err()); + + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.seek(SeekFrom::Start(1)).unwrap(), 1); + assert_eq!(t.seek(SeekFrom::Start(26)).unwrap(), 26); + assert_eq!(t.seek(SeekFrom::Start(27)).unwrap(), 27); + // // these are build errors + // assert!(t.seek(SeekFrom::Start(-1)).is_err()); + // assert!(t.seek(SeekFrom::Start(-1000)).is_err()); + + assert_eq!(t.seek(SeekFrom::End(0)).unwrap(), 26); + assert_eq!(t.seek(SeekFrom::End(-1)).unwrap(), 25); + assert_eq!(t.seek(SeekFrom::End(-26)).unwrap(), 0); + assert!(t.seek(SeekFrom::End(-27)).is_err()); + assert!(t.seek(SeekFrom::End(-99)).is_err()); + assert_eq!(t.seek(SeekFrom::End(1)).unwrap(), 27); + assert_eq!(t.seek(SeekFrom::End(1)).unwrap(), 27); +} + +#[test] +fn test_seek_buffer() { + let mut t = spooled_tempfile(100); + test_seek(&mut t); +} + +#[test] +fn test_seek_file() { + let mut t = SpooledTempFile::new(10); + test_seek(&mut t); +} + +fn test_seek_read(t: &mut SpooledTempFile) { + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + + let mut buf = Vec::new(); + + // we're at the end + assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); + assert_eq!(buf.as_slice(), b""); + buf.clear(); + + // seek to start, read whole thing + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); + assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstuvwxyz"); + buf.clear(); + + // now we're at the end again + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() + assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); + assert_eq!(buf.as_slice(), b""); + buf.clear(); + + // seek to somewhere in the middle, read a bit + assert_eq!(t.seek(SeekFrom::Start(5)).unwrap(), 5); + let mut buf = [0; 5]; + assert!(t.read_exact(&mut buf).is_ok()); + assert_eq!(buf, *b"fghij"); + + // read again from current spot + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() + assert!(t.read_exact(&mut buf).is_ok()); + assert_eq!(buf, *b"klmno"); + + let mut buf = [0; 15]; + // partial read + assert_eq!(t.read(&mut buf).unwrap(), 11); + assert_eq!(buf[0..11], *b"pqrstuvwxyz"); + + // try to read off the end: UnexpectedEof + assert!(t.read_exact(&mut buf).is_err()); +} + +#[test] +fn test_seek_read_buffer() { + let mut t = spooled_tempfile(100); + test_seek_read(&mut t); +} + +#[test] +fn test_seek_read_file() { + let mut t = SpooledTempFile::new(10); + test_seek_read(&mut t); +} + +fn test_overwrite_middle(t: &mut SpooledTempFile) { + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + + assert_eq!(t.seek(SeekFrom::Start(10)).unwrap(), 10); + assert_eq!(t.write(b"0123456789").unwrap(), 10); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + + let mut buf = Vec::new(); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 26); + assert_eq!(buf.as_slice(), b"abcdefghij0123456789uvwxyz"); +} + +#[test] +fn test_overwrite_middle_of_buffer() { + let mut t = spooled_tempfile(100); + test_overwrite_middle(&mut t); +} + +#[test] +fn test_overwrite_middle_of_file() { + let mut t = SpooledTempFile::new(10); + test_overwrite_middle(&mut t); +} + +#[test] +fn test_overwrite_and_extend_buffer() { + let mut t = spooled_tempfile(100); + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + assert_eq!(t.seek(SeekFrom::End(-5)).unwrap(), 21); + assert_eq!(t.write(b"0123456789").unwrap(), 10); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + let mut buf = Vec::new(); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 31); + assert_eq!(buf.as_slice(), b"abcdefghijklmnopqrstu0123456789"); + assert!(!t.is_rolled()); +} + +#[test] +fn test_overwrite_and_extend_rollover() { + let mut t = SpooledTempFile::new(20); + assert_eq!(t.write(b"abcdefghijklmno").unwrap(), 15); + assert!(!t.is_rolled()); + assert_eq!(t.seek(SeekFrom::End(-5)).unwrap(), 10); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() + assert!(!t.is_rolled()); + assert_eq!(t.write(b"0123456789)!@#$%^&*(").unwrap(), 20); + assert!(t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 30); // tell() + let mut buf = Vec::new(); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 30); + assert_eq!(buf.as_slice(), b"abcdefghij0123456789)!@#$%^&*("); +} + +fn test_sparse(t: &mut SpooledTempFile) { + assert_eq!(t.write(b"abcde").unwrap(), 5); + assert_eq!(t.seek(SeekFrom::Current(5)).unwrap(), 10); + assert_eq!(t.write(b"klmno").unwrap(), 5); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + let mut buf = Vec::new(); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 15); + assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0klmno"); +} + +#[test] +fn test_sparse_buffer() { + let mut t = spooled_tempfile(100); + test_sparse(&mut t); +} + +#[test] +fn test_sparse_file() { + let mut t = SpooledTempFile::new(1); + test_sparse(&mut t); +} + +#[test] +fn test_sparse_write_rollover() { + let mut t = spooled_tempfile(10); + assert_eq!(t.write(b"abcde").unwrap(), 5); + assert!(!t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(5)).unwrap(), 10); + assert!(!t.is_rolled()); + assert_eq!(t.write(b"klmno").unwrap(), 5); + assert!(t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + let mut buf = Vec::new(); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 15); + assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0klmno"); +} + +fn test_set_len(t: &mut SpooledTempFile) { + let mut buf: Vec = Vec::new(); + + assert_eq!(t.write(b"abcdefghijklmnopqrstuvwxyz").unwrap(), 26); + + // truncate to 10 bytes + assert!(t.set_len(10).is_ok()); + + // position should not have moved + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() + + assert_eq!(t.read_to_end(&mut buf).unwrap(), 0); + assert_eq!(buf.as_slice(), b""); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 26); // tell() + buf.clear(); + + // read whole thing + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 10); + assert_eq!(buf.as_slice(), b"abcdefghij"); + buf.clear(); + + // set_len to expand beyond the end + assert!(t.set_len(40).is_ok()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 10); // tell() + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 40); + assert_eq!( + buf.as_slice(), + &b"abcdefghij\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"[..] + ); +} + +#[test] +fn test_set_len_buffer() { + let mut t = spooled_tempfile(100); + test_set_len(&mut t); +} + +#[test] +fn test_set_len_file() { + let mut t = spooled_tempfile(100); + test_set_len(&mut t); +} + +#[test] +fn test_set_len_rollover() { + let mut buf: Vec = Vec::new(); + + let mut t = spooled_tempfile(10); + assert_eq!(t.write(b"abcde").unwrap(), 5); + assert!(!t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() + + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 5); + assert_eq!(buf.as_slice(), b"abcde"); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() + buf.clear(); + + assert!(t.set_len(20).is_ok()); + assert!(t.is_rolled()); + assert_eq!(t.seek(SeekFrom::Current(0)).unwrap(), 5); // tell() + assert_eq!(t.seek(SeekFrom::Start(0)).unwrap(), 0); + assert_eq!(t.read_to_end(&mut buf).unwrap(), 20); + assert_eq!(buf.as_slice(), b"abcde\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); +} diff --git a/vendor/registry-40351f815f426200/tempfile/tests/tempdir.rs b/vendor/registry-40351f815f426200/tempfile/tests/tempdir.rs new file mode 100644 index 000000000..9baccdccb --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/tests/tempdir.rs @@ -0,0 +1,261 @@ +// Copyright 2013-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. + +extern crate tempfile; + +use std::env; +use std::fs; +use std::path::Path; +use std::sync::mpsc::channel; +use std::thread; + +use tempfile::{Builder, TempDir}; + +macro_rules! t { + ($e:expr) => { + match $e { + Ok(n) => n, + Err(e) => panic!("error: {}", e), + } + }; +} + +trait PathExt { + fn exists(&self) -> bool; + fn is_dir(&self) -> bool; +} + +impl PathExt for Path { + fn exists(&self) -> bool { + fs::metadata(self).is_ok() + } + fn is_dir(&self) -> bool { + fs::metadata(self).map(|m| m.is_dir()).unwrap_or(false) + } +} + +fn test_tempdir() { + let path = { + let p = t!(Builder::new().prefix("foobar").tempdir_in(&Path::new("."))); + let p = p.path(); + assert!(p.to_str().unwrap().contains("foobar")); + p.to_path_buf() + }; + assert!(!path.exists()); +} + +#[test] +fn test_customnamed() { + let tmpfile = Builder::new() + .prefix("prefix") + .suffix("suffix") + .rand_bytes(12) + .tempdir() + .unwrap(); + let name = tmpfile.path().file_name().unwrap().to_str().unwrap(); + assert!(name.starts_with("prefix")); + assert!(name.ends_with("suffix")); + assert_eq!(name.len(), 24); +} + +fn test_rm_tempdir() { + let (tx, rx) = channel(); + let f = move || -> () { + let tmp = t!(TempDir::new()); + tx.send(tmp.path().to_path_buf()).unwrap(); + panic!("panic to unwind past `tmp`"); + }; + let _ = thread::spawn(f).join(); + let path = rx.recv().unwrap(); + assert!(!path.exists()); + + let tmp = t!(TempDir::new()); + let path = tmp.path().to_path_buf(); + let f = move || -> () { + let _tmp = tmp; + panic!("panic to unwind past `tmp`"); + }; + let _ = thread::spawn(f).join(); + assert!(!path.exists()); + + let path; + { + let f = move || t!(TempDir::new()); + + let tmp = thread::spawn(f).join().unwrap(); + path = tmp.path().to_path_buf(); + assert!(path.exists()); + } + assert!(!path.exists()); + + let path; + { + let tmp = t!(TempDir::new()); + path = tmp.into_path(); + } + assert!(path.exists()); + t!(fs::remove_dir_all(&path)); + assert!(!path.exists()); +} + +fn test_rm_tempdir_close() { + let (tx, rx) = channel(); + let f = move || -> () { + let tmp = t!(TempDir::new()); + tx.send(tmp.path().to_path_buf()).unwrap(); + t!(tmp.close()); + panic!("panic when unwinding past `tmp`"); + }; + let _ = thread::spawn(f).join(); + let path = rx.recv().unwrap(); + assert!(!path.exists()); + + let tmp = t!(TempDir::new()); + let path = tmp.path().to_path_buf(); + let f = move || -> () { + let tmp = tmp; + t!(tmp.close()); + panic!("panic when unwinding past `tmp`"); + }; + let _ = thread::spawn(f).join(); + assert!(!path.exists()); + + let path; + { + let f = move || t!(TempDir::new()); + + let tmp = thread::spawn(f).join().unwrap(); + path = tmp.path().to_path_buf(); + assert!(path.exists()); + t!(tmp.close()); + } + assert!(!path.exists()); + + let path; + { + let tmp = t!(TempDir::new()); + path = tmp.into_path(); + } + assert!(path.exists()); + t!(fs::remove_dir_all(&path)); + assert!(!path.exists()); +} + +// Ideally these would be in std::os but then core would need +// to depend on std +fn recursive_mkdir_rel() { + let path = Path::new("frob"); + let cwd = env::current_dir().unwrap(); + println!( + "recursive_mkdir_rel: Making: {} in cwd {} [{}]", + path.display(), + cwd.display(), + path.exists() + ); + t!(fs::create_dir(&path)); + assert!(path.is_dir()); + t!(fs::create_dir_all(&path)); + assert!(path.is_dir()); +} + +fn recursive_mkdir_dot() { + let dot = Path::new("."); + t!(fs::create_dir_all(&dot)); + let dotdot = Path::new(".."); + t!(fs::create_dir_all(&dotdot)); +} + +fn recursive_mkdir_rel_2() { + let path = Path::new("./frob/baz"); + let cwd = env::current_dir().unwrap(); + println!( + "recursive_mkdir_rel_2: Making: {} in cwd {} [{}]", + path.display(), + cwd.display(), + path.exists() + ); + t!(fs::create_dir_all(&path)); + assert!(path.is_dir()); + assert!(path.parent().unwrap().is_dir()); + let path2 = Path::new("quux/blat"); + println!( + "recursive_mkdir_rel_2: Making: {} in cwd {}", + path2.display(), + cwd.display() + ); + t!(fs::create_dir("quux")); + t!(fs::create_dir_all(&path2)); + assert!(path2.is_dir()); + assert!(path2.parent().unwrap().is_dir()); +} + +// Ideally this would be in core, but needs TempFile +pub fn test_remove_dir_all_ok() { + let tmpdir = t!(TempDir::new()); + let tmpdir = tmpdir.path(); + let root = tmpdir.join("foo"); + + println!("making {}", root.display()); + t!(fs::create_dir(&root)); + t!(fs::create_dir(&root.join("foo"))); + t!(fs::create_dir(&root.join("foo").join("bar"))); + t!(fs::create_dir(&root.join("foo").join("bar").join("blat"))); + t!(fs::remove_dir_all(&root)); + assert!(!root.exists()); + assert!(!root.join("bar").exists()); + assert!(!root.join("bar").join("blat").exists()); +} + +pub fn dont_double_panic() { + let r: Result<(), _> = thread::spawn(move || { + let tmpdir = TempDir::new().unwrap(); + // Remove the temporary directory so that TempDir sees + // an error on drop + t!(fs::remove_dir(tmpdir.path())); + // Panic. If TempDir panics *again* due to the rmdir + // error then the process will abort. + panic!(); + }) + .join(); + assert!(r.is_err()); +} + +fn in_tmpdir(f: F) +where + F: FnOnce(), +{ + let tmpdir = t!(TempDir::new()); + assert!(env::set_current_dir(tmpdir.path()).is_ok()); + + f(); +} + +pub fn pass_as_asref_path() { + let tempdir = t!(TempDir::new()); + takes_asref_path(&tempdir); + + fn takes_asref_path>(path: T) { + let path = path.as_ref(); + assert!(path.exists()); + } +} + +#[test] +fn main() { + in_tmpdir(test_tempdir); + in_tmpdir(test_rm_tempdir); + in_tmpdir(test_rm_tempdir_close); + in_tmpdir(recursive_mkdir_rel); + in_tmpdir(recursive_mkdir_dot); + in_tmpdir(recursive_mkdir_rel_2); + in_tmpdir(test_remove_dir_all_ok); + in_tmpdir(dont_double_panic); + in_tmpdir(pass_as_asref_path); +} diff --git a/vendor/registry-40351f815f426200/tempfile/tests/tempfile.rs b/vendor/registry-40351f815f426200/tempfile/tests/tempfile.rs new file mode 100644 index 000000000..4a19b29c6 --- /dev/null +++ b/vendor/registry-40351f815f426200/tempfile/tests/tempfile.rs @@ -0,0 +1,62 @@ +extern crate tempfile; +use std::fs; +use std::io::{Read, Seek, SeekFrom, Write}; +use std::sync::mpsc::{sync_channel, TryRecvError}; +use std::thread; + +#[test] +fn test_basic() { + let mut tmpfile = tempfile::tempfile().unwrap(); + write!(tmpfile, "abcde").unwrap(); + tmpfile.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + tmpfile.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); +} + +#[test] +fn test_cleanup() { + let tmpdir = tempfile::tempdir().unwrap(); + { + let mut tmpfile = tempfile::tempfile_in(&tmpdir).unwrap(); + write!(tmpfile, "abcde").unwrap(); + } + let num_files = fs::read_dir(&tmpdir).unwrap().count(); + assert!(num_files == 0); +} + +#[test] +fn test_pathological_cleaner() { + let tmpdir = tempfile::tempdir().unwrap(); + let (tx, rx) = sync_channel(0); + let cleaner_thread = thread::spawn(move || { + let tmp_path = rx.recv().unwrap(); + while rx.try_recv() == Err(TryRecvError::Empty) { + let files = fs::read_dir(&tmp_path).unwrap(); + for f in files { + // skip errors + if f.is_err() { + continue; + } + let f = f.unwrap(); + let _ = fs::remove_file(f.path()); + } + } + }); + + // block until cleaner_thread makes progress + tx.send(tmpdir.path().to_owned()).unwrap(); + // need 40-400 iterations to encounter race with cleaner on original system + for _ in 0..10000 { + let mut tmpfile = tempfile::tempfile_in(&tmpdir).unwrap(); + write!(tmpfile, "abcde").unwrap(); + tmpfile.seek(SeekFrom::Start(0)).unwrap(); + let mut buf = String::new(); + tmpfile.read_to_string(&mut buf).unwrap(); + assert_eq!("abcde", buf); + } + + // close the channel to make cleaner_thread exit + drop(tx); + cleaner_thread.join().expect("The cleaner thread failed"); +} diff --git a/vendor/registry-40351f815f426200/termion/.cargo-checksum.json b/vendor/registry-40351f815f426200/termion/.cargo-checksum.json new file mode 100644 index 000000000..3046fd7dc --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"d1a4b9ba6b396bb52a5040f430ee23a9c89b7abef8293c2698ec8fc30e5ad2ac","LICENSE":"6252f0c8d4a0df9b2dc0c6464cb2489dbe8859b0eb727e19c14e6af1ee432394","README.md":"24c722e29a22f6e4d1231f2ee48eaf93c58fb893c021a6dcb87c9a91edf58936","examples/alternate_screen.rs":"37978473e77331ad613843049b4f355e32a51a7b8ece9ee52efe02997391e4ec","examples/alternate_screen_raw.rs":"bfd68f86de929952aaed7e1e7175694d771be2a0b0943092fec4f58bf7473dc3","examples/async.rs":"2fdf5fe69edd3b407de3c1c8caf23f9e19a7f25b55578c84838e4305a9857c42","examples/click.rs":"bb3a76f4817292a82b00d92281a86a400038a8282b6c9d41a34dbaca84fb0caf","examples/color.rs":"48908188cfd7f9259167e0b7d2159459b9c0847c72eba9262ba006a21edd4ed6","examples/commie.rs":"7bb00a7f669c74ccb3a9e9c8ff39fd01aa984f7c38983e5c1cfe6940f90b0c73","examples/detect_color.rs":"764d6465c6879efc38aca8d980a433bac058c1f03d578ac764437af289931824","examples/is_tty.rs":"9a76bdfb11ea84e7b25f6efc06c8d3a8d13a03448bd826bd283b935852f409c7","examples/keys.rs":"cd89f31a21062486e7c014843b360cee35dcee07d8022fc0282eddc48e46bdc7","examples/mouse.rs":"eeccab8043cec987e40e175f03b63c9c6cdc7bcd5808f51a57d0e970cae1c04e","examples/rainbow.rs":"c015176eba7c7a81c6d302d6fc41abea8817935ee804af59d64e3098b127c333","examples/read.rs":"b95fb9b02d2cbf978096825b18ffa25772467df3417c3f3cf5edfe811181a67a","examples/rustc_fun.rs":"f39bd8dbe224cb592d58a0084d15d1eb80d86eade72423fe51acc455e0e1ea68","examples/simple.rs":"eac1aab0d251f884a7d7d7d0d017b6ac4854b38ffcfb244d6a80102ed7a981ab","examples/size.rs":"ae89e7b98a29040f1b641d75226f5738770e2e043cee3f49649accaaeaabbeac","examples/truecolor.rs":"67128ef4870e9e742b1090fa129097484633d82fb015009b1760295f7a24e6af","logo.svg":"09b7a6bca3185acddc217d3d3baab23627c5e03a192f815116e71cf00cb31ddc","src/async.rs":"465ec9b7c0fa2c5c731a1bc7ded6daef8dda5a75b9b301137552c7c232b24699","src/clear.rs":"a9cf9a9f92cef2430239dc33d8ecb4e291c46b650f1f71b63248d0a0215768ba","src/color.rs":"6b54aab96474cf21af7e2d9891f2c241255f23314da24cddba22db4e4c584e83","src/cursor.rs":"bdaf4d7d239ecbdf9553f988afb8d6372989e51f643eb89f83ca27cb317a0038","src/event.rs":"dd49cf87278ab48ccba1b930952473c12ab48cf4a32e1d12a998bdc86a813da1","src/input.rs":"708ea3849f83729f52c62b467a70ae4c95fb272ee62519e8a962494f3dc32f4c","src/lib.rs":"68ab5a9aefd7f35d3e68054a3f2da00b2d1863517af620a37a6b6c676d36acf6","src/macros.rs":"54818ebc9a374b1bf85fe16b64728b3f46dc0bba2cba4bec169f4e4be0c3d040","src/raw.rs":"95aa6dbf332cc1d56bb0c9aff860090160d77a3fe74c802419b2a7f69f8f51d6","src/screen.rs":"19a9a2c42abe2afdb75d4850dc6ee54f33808f6da7f59644668e683418cbce4a","src/scroll.rs":"d0ba08663127e09e111fafc9f84c1fe42662b74f9acbca6b5d26d0b335ee4136","src/style.rs":"b2c805d710cf553835a01482f014aff7395f79d5f71f1e5029ae679e002ac010","src/sys/redox/attr.rs":"834d21cc17090fb7989906ce885f4efed252d65086c05e32ecc05792eb69151a","src/sys/redox/mod.rs":"4066ba97f10c8b87a6ebf32257c89d36338366e1230781aeb5fca98bd5f5bae0","src/sys/redox/size.rs":"b892d0053f40c343eeb40ea06a10fb77abd2758eecda6a7cccb0b07c07fff6eb","src/sys/redox/tty.rs":"3a43c1f1a51fd96cac6eefb584b81d56013b44d50b4fa85c9c894ebee75b07d1","src/sys/unix/attr.rs":"7b17e4841eab69533d2561764506211e2967cd4d7464a309e6d2832473b75dd7","src/sys/unix/mod.rs":"8ddebce9f5b2dbbd419519beb7d41f6d6a7eaed40a70cd0d0676ee893549f7a7","src/sys/unix/size.rs":"d28d925d3ee70422e406c8e2fd79ce1f7f63be135acc1a4bbba2428718136710","src/sys/unix/tty.rs":"eeea0279f76838aa4badd807325403d32ab359334cf59f9574191afcbe86c811"},"package":"dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/termion/Cargo.toml b/vendor/registry-40351f815f426200/termion/Cargo.toml new file mode 100644 index 000000000..da11aad14 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/Cargo.toml @@ -0,0 +1,32 @@ +# 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 = "termion" +version = "1.5.2" +authors = ["ticki ", "gycos ", "IGI-111 "] +exclude = ["target", "CHANGELOG.md", "image.png", "Cargo.lock"] +description = "A bindless library for manipulating terminals." +documentation = "https://docs.rs/termion" +keywords = ["tty", "color", "terminal", "password", "tui"] +license = "MIT" +repository = "https://gitlab.redox-os.org/redox-os/termion" +[dependencies.numtoa] +version = "0.1.0" +features = ["std"] +[target."cfg(not(target_os = \"redox\"))".dependencies.libc] +version = "0.2.8" +[target."cfg(target_os = \"redox\")".dependencies.redox_syscall] +version = "0.1" + +[target."cfg(target_os = \"redox\")".dependencies.redox_termios] +version = "0.1" diff --git a/vendor/registry-40351f815f426200/termion/LICENSE b/vendor/registry-40351f815f426200/termion/LICENSE new file mode 100644 index 000000000..3903091a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Ticki + +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/vendor/registry-40351f815f426200/termion/README.md b/vendor/registry-40351f815f426200/termion/README.md new file mode 100644 index 000000000..25346d94c --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/README.md @@ -0,0 +1,181 @@ +

+Termion logo +

+ +[![Build Status](https://travis-ci.org/redox-os/termion.svg?branch=master)](https://travis-ci.org/redox-os/termion) [![Latest Version](https://img.shields.io/crates/v/termion.svg)](https://crates.io/crates/termion) | [Documentation](https://docs.rs/termion) | [Examples](https://github.com/redox-os/termion/tree/master/examples) | [Changelog](https://github.com/redox-os/termion/tree/master/CHANGELOG.md) | [Tutorial](http://ticki.github.io/blog/making-terminal-applications-in-rust-with-termion/) +|----|----|----|----|---- + + +**Termion** is a pure Rust, bindless library for low-level handling, manipulating +and reading information about terminals. This provides a full-featured +alternative to Termbox. + +Termion aims to be simple and yet expressive. It is bindless, meaning that it +is not a front-end to some other library (e.g., ncurses or termbox), but a +standalone library directly talking to the TTY. + +Termion is quite convenient, due to its complete coverage of essential TTY +features, providing one consistent API. Termion is rather low-level containing +only abstraction aligned with what actually happens behind the scenes. For +something more high-level, refer to inquirer-rs, which uses Termion as backend. + +Termion generates escapes and API calls for the user. This makes it a whole lot +cleaner to use escapes. + +Supports Redox, Mac OS X, BSD, and Linux (or, in general, ANSI terminals). + +## A note on stability + +This crate is stable. + +## Cargo.toml + +```toml +[dependencies] +termion = "*" +``` + +## 0.1.0 to 1.0.0 guide + +This sample table gives an idea of how to go about converting to the new major +version of Termion. + +| 0.1.0 | 1.0.0 +|--------------------------------|--------------------------- +| `use termion::IntoRawMode` | `use termion::raw::IntoRawMode` +| `use termion::TermRead` | `use termion::input::TermRead` +| `stdout.color(color::Red);` | `write!(stdout, "{}", color::Fg(color::Red));` +| `stdout.color_bg(color::Red);` | `write!(stdout, "{}", color::Bg(color::Red));` +| `stdout.goto(x, y);` | `write!(stdout, "{}", cursor::Goto(x, y));` +| `color::rgb(r, g, b);` | `color::Rgb(r, g, b)` (truecolor) +| `x.with_mouse()` | `MouseTerminal::from(x)` + +## Features + +- Raw mode. +- TrueColor. +- 256-color mode. +- Cursor movement. +- Text formatting. +- Console size. +- TTY-only stream. +- Control sequences. +- Termios control. +- Password input. +- Redox support. +- Safe `isatty` wrapper. +- Panic-free error handling. +- Special keys events (modifiers, special keys, etc.). +- Allocation-free. +- Asynchronous key events. +- Mouse input. +- Carefully tested. +- Detailed documentation on every item. + +and much more. + +## Examples + +### Style and colors. + +```rust +extern crate termion; + +use termion::{color, style}; + +use std::io; + +fn main() { + println!("{}Red", color::Fg(color::Red)); + println!("{}Blue", color::Fg(color::Blue)); + println!("{}Blue'n'Bold{}", style::Bold, style::Reset); + println!("{}Just plain italic", style::Italic); +} +``` + +### Moving the cursor + +```rust +extern crate termion; + +fn main() { + print!("{}{}Stuff", termion::clear::All, termion::cursor::Goto(1, 1)); +} + +``` + +### Mouse + +```rust +extern crate termion; + +use termion::event::{Key, Event, MouseEvent}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = MouseTerminal::from(stdout().into_raw_mode().unwrap()); + + write!(stdout, "{}{}q to exit. Click, click, click!", termion::clear::All, termion::cursor::Goto(1, 1)).unwrap(); + stdout.flush().unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, x, y) => { + write!(stdout, "{}x", termion::cursor::Goto(x, y)).unwrap(); + }, + _ => (), + } + } + _ => {} + } + stdout.flush().unwrap(); + } +} +``` + +### Read a password + +```rust +extern crate termion; + +use termion::input::TermRead; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock(); + let stdin = stdin(); + let mut stdin = stdin.lock(); + + stdout.write_all(b"password: ").unwrap(); + stdout.flush().unwrap(); + + let pass = stdin.read_passwd(&mut stdout); + + if let Ok(Some(pass)) = pass { + stdout.write_all(pass.as_bytes()).unwrap(); + stdout.write_all(b"\n").unwrap(); + } else { + stdout.write_all(b"Error\n").unwrap(); + } +} +``` + +## Usage + +See `examples/`, and the documentation, which can be rendered using `cargo doc`. + +For a more complete example, see [a minesweeper implementation](https://github.com/redox-os/games-for-redox/blob/master/src/minesweeper/main.rs), that I made for Redox using termion. + + + +## License + +MIT/X11. diff --git a/vendor/registry-40351f815f426200/termion/examples/alternate_screen.rs b/vendor/registry-40351f815f426200/termion/examples/alternate_screen.rs new file mode 100644 index 000000000..91d28b170 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/alternate_screen.rs @@ -0,0 +1,17 @@ +extern crate termion; + +use termion::screen::*; +use std::io::{Write, stdout}; +use std::{time, thread}; + +fn main() { + { + let mut screen = AlternateScreen::from(stdout()); + write!(screen, "Welcome to the alternate screen.\n\nPlease wait patiently until we arrive back at the main screen in a about three seconds.").unwrap(); + screen.flush().unwrap(); + + thread::sleep(time::Duration::from_secs(3)); + } + + println!("Phew! We are back."); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/alternate_screen_raw.rs b/vendor/registry-40351f815f426200/termion/examples/alternate_screen_raw.rs new file mode 100644 index 000000000..7ba788880 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/alternate_screen_raw.rs @@ -0,0 +1,40 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use termion::screen::*; +use std::io::{Write, stdout, stdin}; + +fn write_alt_screen_msg(screen: &mut W) { + write!(screen, "{}{}Welcome to the alternate screen.{}Press '1' to switch to the main screen or '2' to switch to the alternate screen.{}Press 'q' to exit (and switch back to the main screen).", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Goto(1, 3), + termion::cursor::Goto(1, 4)).unwrap(); +} + +fn main() { + let stdin = stdin(); + let mut screen = AlternateScreen::from(stdout().into_raw_mode().unwrap()); + write!(screen, "{}", termion::cursor::Hide).unwrap(); + write_alt_screen_msg(&mut screen); + + screen.flush().unwrap(); + + for c in stdin.keys() { + match c.unwrap() { + Key::Char('q') => break, + Key::Char('1') => { + write!(screen, "{}", ToMainScreen).unwrap(); + } + Key::Char('2') => { + write!(screen, "{}", ToAlternateScreen).unwrap(); + write_alt_screen_msg(&mut screen); + } + _ => {} + } + screen.flush().unwrap(); + } + write!(screen, "{}", termion::cursor::Show).unwrap(); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/async.rs b/vendor/registry-40351f815f426200/termion/examples/async.rs new file mode 100644 index 000000000..b16bb7861 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/async.rs @@ -0,0 +1,39 @@ +extern crate termion; + +use termion::raw::IntoRawMode; +use termion::async_stdin; +use std::io::{Read, Write, stdout}; +use std::thread; +use std::time::Duration; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock().into_raw_mode().unwrap(); + let mut stdin = async_stdin().bytes(); + + write!(stdout, + "{}{}", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + + loop { + write!(stdout, "{}", termion::clear::CurrentLine).unwrap(); + + let b = stdin.next(); + write!(stdout, "\r{:?} <- This demonstrates the async read input char. Between each update a 100 ms. is waited, simply to demonstrate the async fashion. \n\r", b).unwrap(); + if let Some(Ok(b'q')) = b { + break; + } + + stdout.flush().unwrap(); + + thread::sleep(Duration::from_millis(50)); + stdout.write_all(b"# ").unwrap(); + stdout.flush().unwrap(); + thread::sleep(Duration::from_millis(50)); + stdout.write_all(b"\r #").unwrap(); + write!(stdout, "{}", termion::cursor::Goto(1, 1)).unwrap(); + stdout.flush().unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/click.rs b/vendor/registry-40351f815f426200/termion/examples/click.rs new file mode 100644 index 000000000..fe903d837 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/click.rs @@ -0,0 +1,35 @@ +extern crate termion; + +use termion::event::{Key, Event, MouseEvent}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = MouseTerminal::from(stdout().into_raw_mode().unwrap()); + + write!(stdout, + "{}{}q to exit. Click, click, click!", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + stdout.flush().unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, x, y) => { + write!(stdout, "{}x", termion::cursor::Goto(x, y)).unwrap(); + } + _ => (), + } + } + _ => {} + } + stdout.flush().unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/color.rs b/vendor/registry-40351f815f426200/termion/examples/color.rs new file mode 100644 index 000000000..72c521d70 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/color.rs @@ -0,0 +1,10 @@ +extern crate termion; + +use termion::{color, style}; + +fn main() { + println!("{}Red", color::Fg(color::Red)); + println!("{}Blue", color::Fg(color::Blue)); + println!("{}Blue'n'Bold{}", style::Bold, style::Reset); + println!("{}Just plain italic{}", style::Italic, style::Reset); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/commie.rs b/vendor/registry-40351f815f426200/termion/examples/commie.rs new file mode 100644 index 000000000..32f8820e5 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/commie.rs @@ -0,0 +1,51 @@ +extern crate termion; + +use termion::{clear, color, cursor}; + +use std::{time, thread}; + +const COMMUNISM: &'static str = r#" + !######### # + !########! ##! + !########! ### + !########## #### + ######### ##### ###### + !###! !####! ###### + ! ##### ######! + !####! ####### + ##### ####### + !####! #######! + ####!######## + ## ########## + ,######! !############# + ,#### ########################!####! + ,####' ##################!' ##### + ,####' ####### !####! + ####' ##### + ~## ##~ +"#; + +fn main() { + let mut state = 0; + + println!("\n{}{}{}{}{}{}", + cursor::Hide, + clear::All, + cursor::Goto(1, 1), + color::Fg(color::Black), + color::Bg(color::Red), + COMMUNISM); + loop { + println!("{}{} ☭ GAY ☭ SPACE ☭ COMMUNISM ☭ ", + cursor::Goto(1, 1), + color::Bg(color::AnsiValue(state))); + println!("{}{} WILL PREVAIL, COMRADES! ", + cursor::Goto(1, 20), + color::Bg(color::AnsiValue(state))); + + state += 1; + state %= 8; + + thread::sleep(time::Duration::from_millis(90)); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/detect_color.rs b/vendor/registry-40351f815f426200/termion/examples/detect_color.rs new file mode 100644 index 000000000..ecfdd5b45 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/detect_color.rs @@ -0,0 +1,19 @@ +extern crate termion; + +use termion::color::{DetectColors, AnsiValue, Bg}; +use termion::raw::IntoRawMode; +use std::io::stdout; + +fn main() { + let count; + { + let mut term = stdout().into_raw_mode().unwrap(); + count = term.available_colors().unwrap(); + } + + println!("This terminal supports {} colors.", count); + for i in 0..count { + print!("{} {}", Bg(AnsiValue(i as u8)), Bg(AnsiValue(0))); + } + println!(); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/is_tty.rs b/vendor/registry-40351f815f426200/termion/examples/is_tty.rs new file mode 100644 index 000000000..52d1bc1d2 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/is_tty.rs @@ -0,0 +1,11 @@ +extern crate termion; + +use std::fs; + +fn main() { + if termion::is_tty(&fs::File::create("/dev/stdout").unwrap()) { + println!("This is a TTY!"); + } else { + println!("This is not a TTY :("); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/keys.rs b/vendor/registry-40351f815f426200/termion/examples/keys.rs new file mode 100644 index 000000000..272ffd1b9 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/keys.rs @@ -0,0 +1,44 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdin = stdin(); + let mut stdout = stdout().into_raw_mode().unwrap(); + + write!(stdout, + "{}{}q to exit. Type stuff, use alt, and so on.{}", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Hide) + .unwrap(); + stdout.flush().unwrap(); + + for c in stdin.keys() { + write!(stdout, + "{}{}", + termion::cursor::Goto(1, 1), + termion::clear::CurrentLine) + .unwrap(); + + match c.unwrap() { + Key::Char('q') => break, + Key::Char(c) => println!("{}", c), + Key::Alt(c) => println!("^{}", c), + Key::Ctrl(c) => println!("*{}", c), + Key::Esc => println!("ESC"), + Key::Left => println!("←"), + Key::Right => println!("→"), + Key::Up => println!("↑"), + Key::Down => println!("↓"), + Key::Backspace => println!("×"), + _ => {} + } + stdout.flush().unwrap(); + } + + write!(stdout, "{}", termion::cursor::Show).unwrap(); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/mouse.rs b/vendor/registry-40351f815f426200/termion/examples/mouse.rs new file mode 100644 index 000000000..cbe8baf46 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/mouse.rs @@ -0,0 +1,46 @@ +extern crate termion; + +use termion::event::*; +use termion::cursor::{self, DetectCursorPos}; +use termion::input::{TermRead, MouseTerminal}; +use termion::raw::IntoRawMode; +use std::io::{self, Write}; + +fn main() { + let stdin = io::stdin(); + let mut stdout = MouseTerminal::from(io::stdout().into_raw_mode().unwrap()); + + writeln!(stdout, + "{}{}q to exit. Type stuff, use alt, click around...", + termion::clear::All, + termion::cursor::Goto(1, 1)) + .unwrap(); + + for c in stdin.events() { + let evt = c.unwrap(); + match evt { + Event::Key(Key::Char('q')) => break, + Event::Mouse(me) => { + match me { + MouseEvent::Press(_, a, b) | + MouseEvent::Release(a, b) | + MouseEvent::Hold(a, b) => { + write!(stdout, "{}", cursor::Goto(a, b)).unwrap(); + let (x, y) = stdout.cursor_pos().unwrap(); + write!(stdout, + "{}{}Cursor is at: ({},{}){}", + cursor::Goto(5, 5), + termion::clear::UntilNewline, + x, + y, + cursor::Goto(a, b)) + .unwrap(); + } + } + } + _ => {} + } + + stdout.flush().unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/rainbow.rs b/vendor/registry-40351f815f426200/termion/examples/rainbow.rs new file mode 100644 index 000000000..4ee4000d0 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/rainbow.rs @@ -0,0 +1,60 @@ +extern crate termion; + +use termion::event::Key; +use termion::input::TermRead; +use termion::raw::IntoRawMode; +use std::io::{Write, stdout, stdin}; + +fn rainbow(stdout: &mut W, blue: u8) { + write!(stdout, + "{}{}", + termion::cursor::Goto(1, 1), + termion::clear::All) + .unwrap(); + + for red in 0..32 { + let red = red * 8; + for green in 0..64 { + let green = green * 4; + write!(stdout, + "{} ", + termion::color::Bg(termion::color::Rgb(red, green, blue))) + .unwrap(); + } + write!(stdout, "\n\r").unwrap(); + } + + writeln!(stdout, "{}b = {}", termion::style::Reset, blue).unwrap(); +} + +fn main() { + let stdin = stdin(); + let mut stdout = stdout().into_raw_mode().unwrap(); + + writeln!(stdout, + "{}{}{}Use the up/down arrow keys to change the blue in the rainbow.", + termion::clear::All, + termion::cursor::Goto(1, 1), + termion::cursor::Hide) + .unwrap(); + + let mut blue = 172u8; + + for c in stdin.keys() { + match c.unwrap() { + Key::Up => { + blue = blue.saturating_add(4); + rainbow(&mut stdout, blue); + } + Key::Down => { + blue = blue.saturating_sub(4); + rainbow(&mut stdout, blue); + } + Key::Char('q') => break, + _ => {} + } + stdout.flush().unwrap(); + } + + write!(stdout, "{}", termion::cursor::Show).unwrap(); +} diff --git a/vendor/registry-40351f815f426200/termion/examples/read.rs b/vendor/registry-40351f815f426200/termion/examples/read.rs new file mode 100644 index 000000000..8d53e1bf7 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/read.rs @@ -0,0 +1,23 @@ +extern crate termion; + +use termion::input::TermRead; +use std::io::{Write, stdout, stdin}; + +fn main() { + let stdout = stdout(); + let mut stdout = stdout.lock(); + let stdin = stdin(); + let mut stdin = stdin.lock(); + + stdout.write_all(b"password: ").unwrap(); + stdout.flush().unwrap(); + + let pass = stdin.read_passwd(&mut stdout); + + if let Ok(Some(pass)) = pass { + stdout.write_all(pass.as_bytes()).unwrap(); + stdout.write_all(b"\n").unwrap(); + } else { + stdout.write_all(b"Error\n").unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/rustc_fun.rs b/vendor/registry-40351f815f426200/termion/examples/rustc_fun.rs new file mode 100644 index 000000000..734e89f42 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/rustc_fun.rs @@ -0,0 +1,24 @@ +extern crate termion; + +use termion::{color, style}; + +fn main() { + println!("{lighgreen}-- src/test/ui/borrow-errors.rs at 82:18 --\n\ + {red}error: {reset}{bold}two closures require unique access to `vec` at the same time {reset}{bold}{magenta}[E0524]{reset}\n\ + {line_num_fg}{line_num_bg}79 {reset} let append = |e| {{\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}first closure is constructed here\n\ + {line_num_fg}{line_num_bg}80 {reset} vec.push(e)\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^^^{reset} {error_fg}previous borrow occurs due to use of `vec` in closure\n\ + {line_num_fg}{line_num_bg}84 {reset} }};\n\ + {line_num_fg}{line_num_bg}85 {reset} }}\n\ + {line_num_fg}{line_num_bg}{info_line}{reset} {red}^{reset} {error_fg}borrow from first closure ends here", + lighgreen = color::Fg(color::LightGreen), + red = color::Fg(color::Red), + bold = style::Bold, + reset = style::Reset, + magenta = color::Fg(color::Magenta), + line_num_bg = color::Bg(color::AnsiValue::grayscale(3)), + line_num_fg = color::Fg(color::AnsiValue::grayscale(18)), + info_line = "| ", + error_fg = color::Fg(color::AnsiValue::grayscale(17))) +} diff --git a/vendor/registry-40351f815f426200/termion/examples/simple.rs b/vendor/registry-40351f815f426200/termion/examples/simple.rs new file mode 100644 index 000000000..93ef1df3a --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/simple.rs @@ -0,0 +1,42 @@ +extern crate termion; + +use termion::color; +use termion::raw::IntoRawMode; +use std::io::{Read, Write, stdout, stdin}; + +fn main() { + // Initialize 'em all. + let stdout = stdout(); + let mut stdout = stdout.lock().into_raw_mode().unwrap(); + let stdin = stdin(); + let stdin = stdin.lock(); + + write!(stdout, + "{}{}{}yo, 'q' will exit.{}{}", + termion::clear::All, + termion::cursor::Goto(5, 5), + termion::style::Bold, + termion::style::Reset, + termion::cursor::Goto(20, 10)) + .unwrap(); + stdout.flush().unwrap(); + + let mut bytes = stdin.bytes(); + loop { + let b = bytes.next().unwrap().unwrap(); + + match b { + // Quit + b'q' => return, + // Clear the screen + b'c' => write!(stdout, "{}", termion::clear::All), + // Set red color + b'r' => write!(stdout, "{}", color::Fg(color::Rgb(5, 0, 0))), + // Write it to stdout. + a => write!(stdout, "{}", a), + } + .unwrap(); + + stdout.flush().unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/examples/size.rs b/vendor/registry-40351f815f426200/termion/examples/size.rs new file mode 100644 index 000000000..e91fa5430 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/size.rs @@ -0,0 +1,7 @@ +extern crate termion; + +use termion::terminal_size; + +fn main() { + println!("Size is {:?}", terminal_size().unwrap()) +} diff --git a/vendor/registry-40351f815f426200/termion/examples/truecolor.rs b/vendor/registry-40351f815f426200/termion/examples/truecolor.rs new file mode 100644 index 000000000..ba5c8685b --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/examples/truecolor.rs @@ -0,0 +1,12 @@ +extern crate termion; + +use termion::{color, cursor, clear}; +use std::{thread, time}; + +fn main() { + for r in 0..255 { + let c = color::Rgb(r, !r, 2 * ((r % 128) as i8 - 64).abs() as u8); + println!("{}{}{}wow", cursor::Goto(1, 1), color::Bg(c), clear::All); + thread::sleep(time::Duration::from_millis(100)); + } +} diff --git a/vendor/registry-40351f815f426200/termion/logo.svg b/vendor/registry-40351f815f426200/termion/logo.svg new file mode 100644 index 000000000..39bc574b6 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/logo.svg @@ -0,0 +1,9 @@ + + + + + + + diff --git a/vendor/registry-40351f815f426200/termion/src/async.rs b/vendor/registry-40351f815f426200/termion/src/async.rs new file mode 100644 index 000000000..ea0248916 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/async.rs @@ -0,0 +1,101 @@ +use std::io::{self, Read}; +use std::sync::mpsc; +use std::thread; + +use sys::tty::get_tty; + +/// Construct an asynchronous handle to the TTY standard input, with a delimiter byte. +/// +/// This has the same advantages as async_stdin(), but also allows specifying a delimiter byte. The +/// reader will stop reading after consuming the delimiter byte. +pub fn async_stdin_until(delimiter: u8) -> AsyncReader { + let (send, recv) = mpsc::channel(); + + thread::spawn(move || for i in get_tty().unwrap().bytes() { + + match i { + Ok(byte) => { + let end_of_stream = &byte == &delimiter; + let send_error = send.send(Ok(byte)).is_err(); + + if end_of_stream || send_error { return; } + }, + Err(_) => { return; } + } + }); + + AsyncReader { recv: recv } +} + +/// Construct an asynchronous handle to the TTY standard input. +/// +/// This allows you to read from standard input _without blocking_ the current thread. +/// Specifically, it works by firing up another thread to handle the event stream, which will then +/// be buffered in a mpsc queue, which will eventually be read by the current thread. +/// +/// This will not read the piped standard input, but rather read from the TTY device, since reading +/// asyncronized from piped input would rarely make sense. In other words, if you pipe standard +/// output from another process, it won't be reflected in the stream returned by this function, as +/// this represents the TTY device, and not the piped standard input. +pub fn async_stdin() -> AsyncReader { + let (send, recv) = mpsc::channel(); + + thread::spawn(move || for i in get_tty().unwrap().bytes() { + if send.send(i).is_err() { + return; + } + }); + + AsyncReader { recv: recv } +} + +/// An asynchronous reader. +/// +/// This acts as any other stream, with the exception that reading from it won't block. Instead, +/// the buffer will only be partially updated based on how much the internal buffer holds. +pub struct AsyncReader { + /// The underlying mpsc receiver. + recv: mpsc::Receiver>, +} + +// FIXME: Allow constructing an async reader from an arbitrary stream. + +impl Read for AsyncReader { + /// Read from the byte stream. + /// + /// This will never block, but try to drain the event queue until empty. If the total number of + /// bytes written is lower than the buffer's length, the event queue is empty or that the event + /// stream halted. + fn read(&mut self, buf: &mut [u8]) -> io::Result { + let mut total = 0; + + loop { + if total >= buf.len() { + break; + } + + match self.recv.try_recv() { + Ok(Ok(b)) => { + buf[total] = b; + total += 1; + } + Ok(Err(e)) => return Err(e), + Err(_) => break, + } + } + + Ok(total) + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::Read; + + #[test] + fn test_async_stdin() { + let stdin = async_stdin(); + stdin.bytes().next(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/clear.rs b/vendor/registry-40351f815f426200/termion/src/clear.rs new file mode 100644 index 000000000..d37f2c6b9 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/clear.rs @@ -0,0 +1,9 @@ +//! Clearing the screen. + +use std::fmt; + +derive_csi_sequence!("Clear the entire screen.", All, "2J"); +derive_csi_sequence!("Clear everything after the cursor.", AfterCursor, "J"); +derive_csi_sequence!("Clear everything before the cursor.", BeforeCursor, "1J"); +derive_csi_sequence!("Clear the current line.", CurrentLine, "2K"); +derive_csi_sequence!("Clear from cursor to newline.", UntilNewline, "K"); diff --git a/vendor/registry-40351f815f426200/termion/src/color.rs b/vendor/registry-40351f815f426200/termion/src/color.rs new file mode 100644 index 000000000..6c543b695 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/color.rs @@ -0,0 +1,306 @@ +//! Color managemement. +//! +//! # Example +//! +//! ```rust +//! use termion::color; +//! +//! fn main() { +//! println!("{}Red", color::Fg(color::Red)); +//! println!("{}Blue", color::Fg(color::Blue)); +//! println!("{}Back again", color::Fg(color::Reset)); +//! } +//! ``` + +use std::fmt; +use raw::CONTROL_SEQUENCE_TIMEOUT; +use std::io::{self, Write, Read}; +use std::time::{SystemTime, Duration}; +use async::async_stdin; +use std::env; +use std::fmt::Debug; +use numtoa::NumToA; + +/// A terminal color. +pub trait Color: Debug { + /// Write the foreground version of this color. + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result; + /// Write the background version of this color. + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result; +} + +macro_rules! derive_color { + ($doc:expr, $name:ident, $value:expr) => { + #[doc = $doc] + #[derive(Copy, Clone, Debug)] + pub struct $name; + + impl Color for $name { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.fg_str()) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(self.bg_str()) + } + } + + impl $name { + #[inline] + /// Returns the ANSI escape sequence as a string. + pub fn fg_str(&self) -> &'static str { csi!("38;5;", $value, "m") } + + #[inline] + /// Returns the ANSI escape sequences as a string. + pub fn bg_str(&self) -> &'static str { csi!("48;5;", $value, "m") } + } + }; +} + +derive_color!("Black.", Black, "0"); +derive_color!("Red.", Red, "1"); +derive_color!("Green.", Green, "2"); +derive_color!("Yellow.", Yellow, "3"); +derive_color!("Blue.", Blue, "4"); +derive_color!("Magenta.", Magenta, "5"); +derive_color!("Cyan.", Cyan, "6"); +derive_color!("White.", White, "7"); +derive_color!("High-intensity light black.", LightBlack, "8"); +derive_color!("High-intensity light red.", LightRed, "9"); +derive_color!("High-intensity light green.", LightGreen, "10"); +derive_color!("High-intensity light yellow.", LightYellow, "11"); +derive_color!("High-intensity light blue.", LightBlue, "12"); +derive_color!("High-intensity light magenta.", LightMagenta, "13"); +derive_color!("High-intensity light cyan.", LightCyan, "14"); +derive_color!("High-intensity light white.", LightWhite, "15"); + +impl<'a> Color for &'a Color { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + (*self).write_fg(f) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + (*self).write_bg(f) + } +} + +/// An arbitrary ANSI color value. +#[derive(Clone, Copy, Debug)] +pub struct AnsiValue(pub u8); + +impl AnsiValue { + /// 216-color (r, g, b ≤ 5) RGB. + pub fn rgb(r: u8, g: u8, b: u8) -> AnsiValue { + debug_assert!(r <= 5, + "Red color fragment (r = {}) is out of bound. Make sure r ≤ 5.", + r); + debug_assert!(g <= 5, + "Green color fragment (g = {}) is out of bound. Make sure g ≤ 5.", + g); + debug_assert!(b <= 5, + "Blue color fragment (b = {}) is out of bound. Make sure b ≤ 5.", + b); + + AnsiValue(16 + 36 * r + 6 * g + b) + } + + /// Grayscale color. + /// + /// There are 24 shades of gray. + pub fn grayscale(shade: u8) -> AnsiValue { + // Unfortunately, there are a little less than fifty shades. + debug_assert!(shade < 24, + "Grayscale out of bound (shade = {}). There are only 24 shades of \ + gray.", + shade); + + AnsiValue(0xE8 + shade) + } +} + +impl AnsiValue { + /// Returns the ANSI sequence as a string. + pub fn fg_string(self) -> String { + let mut x = [0u8; 20]; + let x = self.0.numtoa_str(10, &mut x); + [csi!("38;5;"), x, "m"].concat() + } + + /// Returns the ANSI sequence as a string. + pub fn bg_string(self) -> String { + let mut x = [0u8; 20]; + let x = self.0.numtoa_str(10, &mut x); + [csi!("48;5;"), x, "m"].concat() + } +} + +impl Color for AnsiValue { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&self.fg_string()) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&self.bg_string()) + } +} + +/// A truecolor RGB. +#[derive(Debug, Clone, Copy, PartialEq)] +pub struct Rgb(pub u8, pub u8, pub u8); + +impl Rgb { + /// Returns the ANSI sequence as a string. + pub fn fg_string(self) -> String { + let (mut x, mut y, mut z) = ([0u8; 20], [0u8; 20], [0u8; 20]); + let (x, y, z) = ( + self.0.numtoa_str(10, &mut x), + self.1.numtoa_str(10, &mut y), + self.2.numtoa_str(10, &mut z), + ); + + [csi!("38;2;"), x, ";", y, ";", z, "m"].concat() + } + + /// Returns the ANSI sequence as a string. + pub fn bg_string(self) -> String { + let (mut x, mut y, mut z) = ([0u8; 20], [0u8; 20], [0u8; 20]); + let (x, y, z) = ( + self.0.numtoa_str(10, &mut x), + self.1.numtoa_str(10, &mut y), + self.2.numtoa_str(10, &mut z), + ); + + [csi!("48;2;"), x, ";", y, ";", z, "m"].concat() + } +} + +impl Color for Rgb { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&self.fg_string()) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&self.bg_string()) + } +} + +/// Reset colors to defaults. +#[derive(Debug, Clone, Copy)] +pub struct Reset; + +const RESET_FG: &str = csi!("39m"); +const RESET_BG: &str = csi!("49m"); + +impl Reset { + /// Returns the ANSI sequence as a string. + pub fn fg_str(self) -> &'static str { RESET_FG } + /// Returns the ANSI sequence as a string. + pub fn bg_str(self) -> &'static str { RESET_BG } +} + +impl Color for Reset { + #[inline] + fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(RESET_FG) + } + + #[inline] + fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(RESET_BG) + } +} + +/// A foreground color. +#[derive(Debug, Clone, Copy)] +pub struct Fg(pub C); + +impl fmt::Display for Fg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.write_fg(f) + } +} + +/// A background color. +#[derive(Debug, Clone, Copy)] +pub struct Bg(pub C); + +impl fmt::Display for Bg { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.write_bg(f) + } +} + +/// Types that allow detection of the colors they support. +pub trait DetectColors { + /// How many ANSI colors are supported (from 8 to 256)? + /// + /// Beware: the information given isn't authoritative, it's infered through escape codes or the + /// value of `TERM`, more colors may be available. + fn available_colors(&mut self) -> io::Result; +} + +impl DetectColors for W { + fn available_colors(&mut self) -> io::Result { + let mut stdin = async_stdin(); + + if detect_color(self, &mut stdin, 0)? { + // OSC 4 is supported, detect how many colors there are. + // Do a binary search of the last supported color. + let mut min = 8; + let mut max = 256; + let mut i; + while min + 1 < max { + i = (min + max) / 2; + if detect_color(self, &mut stdin, i)? { + min = i + } else { + max = i + } + } + Ok(max) + } else { + // OSC 4 is not supported, trust TERM contents. + Ok(match env::var_os("TERM") { + Some(val) => { + if val.to_str().unwrap_or("").contains("256color") { + 256 + } else { + 8 + } + } + None => 8, + }) + } + } +} + +/// Detect a color using OSC 4. +fn detect_color(stdout: &mut Write, stdin: &mut Read, color: u16) -> io::Result { + // Is the color available? + // Use `ESC ] 4 ; color ; ? BEL`. + write!(stdout, "\x1B]4;{};?\x07", color)?; + stdout.flush()?; + + let mut buf: [u8; 1] = [0]; + let mut total_read = 0; + + let timeout = Duration::from_millis(CONTROL_SEQUENCE_TIMEOUT); + let now = SystemTime::now(); + let bell = 7u8; + + // Either consume all data up to bell or wait for a timeout. + while buf[0] != bell && now.elapsed().unwrap() < timeout { + total_read += stdin.read(&mut buf)?; + } + + // If there was a response, the color is supported. + Ok(total_read > 0) +} diff --git a/vendor/registry-40351f815f426200/termion/src/cursor.rs b/vendor/registry-40351f815f426200/termion/src/cursor.rs new file mode 100644 index 000000000..bbc039406 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/cursor.rs @@ -0,0 +1,222 @@ +//! Cursor movement. + +use std::fmt; +use std::ops; +use std::io::{self, Write, Error, ErrorKind, Read}; +use async::async_stdin_until; +use std::time::{SystemTime, Duration}; +use raw::CONTROL_SEQUENCE_TIMEOUT; +use numtoa::NumToA; + +derive_csi_sequence!("Hide the cursor.", Hide, "?25l"); +derive_csi_sequence!("Show the cursor.", Show, "?25h"); + +derive_csi_sequence!("Restore the cursor.", Restore, "u"); +derive_csi_sequence!("Save the cursor.", Save, "s"); + +/// Goto some position ((1,1)-based). +/// +/// # Why one-based? +/// +/// ANSI escapes are very poorly designed, and one of the many odd aspects is being one-based. This +/// can be quite strange at first, but it is not that big of an obstruction once you get used to +/// it. +/// +/// # Example +/// +/// ```rust +/// extern crate termion; +/// +/// fn main() { +/// print!("{}{}Stuff", termion::clear::All, termion::cursor::Goto(5, 3)); +/// } +/// ``` +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Goto(pub u16, pub u16); + +impl From for String { + fn from(this: Goto) -> String { + let (mut x, mut y) = ([0u8; 20], [0u8; 20]); + ["\x1B[", this.1.numtoa_str(10, &mut x), ";", this.0.numtoa_str(10, &mut y), "H"].concat() + } +} + +impl Default for Goto { + fn default() -> Goto { + Goto(1, 1) + } +} + +impl fmt::Display for Goto { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + debug_assert!(self != &Goto(0, 0), "Goto is one-based."); + f.write_str(&String::from(*self)) + } +} + +/// Move cursor left. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Left(pub u16); + +impl From for String { + fn from(this: Left) -> String { + let mut buf = [0u8; 20]; + ["\x1B[", this.0.numtoa_str(10, &mut buf), "D"].concat() + } +} + +impl fmt::Display for Left { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&String::from(*self)) + } +} + +/// Move cursor right. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Right(pub u16); + +impl From for String { + fn from(this: Right) -> String { + let mut buf = [0u8; 20]; + ["\x1B[", this.0.numtoa_str(10, &mut buf), "C"].concat() + } +} + +impl fmt::Display for Right { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&String::from(*self)) + } +} + +/// Move cursor up. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Up(pub u16); + +impl From for String { + fn from(this: Up) -> String { + let mut buf = [0u8; 20]; + ["\x1B[", this.0.numtoa_str(10, &mut buf), "A"].concat() + } +} + +impl fmt::Display for Up { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&String::from(*self)) + } +} + +/// Move cursor down. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Down(pub u16); + +impl From for String { + fn from(this: Down) -> String { + let mut buf = [0u8; 20]; + ["\x1B[", this.0.numtoa_str(10, &mut buf), "B"].concat() + } +} + +impl fmt::Display for Down { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.write_str(&String::from(*self)) + } +} + +/// Types that allow detection of the cursor position. +pub trait DetectCursorPos { + /// Get the (1,1)-based cursor position from the terminal. + fn cursor_pos(&mut self) -> io::Result<(u16, u16)>; +} + +impl DetectCursorPos for W { + fn cursor_pos(&mut self) -> io::Result<(u16, u16)> { + let delimiter = b'R'; + let mut stdin = async_stdin_until(delimiter); + + // Where is the cursor? + // Use `ESC [ 6 n`. + write!(self, "\x1B[6n")?; + self.flush()?; + + let mut buf: [u8; 1] = [0]; + let mut read_chars = Vec::new(); + + let timeout = Duration::from_millis(CONTROL_SEQUENCE_TIMEOUT); + let now = SystemTime::now(); + + // Either consume all data up to R or wait for a timeout. + while buf[0] != delimiter && now.elapsed().unwrap() < timeout { + if stdin.read(&mut buf)? > 0 { + read_chars.push(buf[0]); + } + } + + if read_chars.is_empty() { + return Err(Error::new(ErrorKind::Other, "Cursor position detection timed out.")); + } + + // The answer will look like `ESC [ Cy ; Cx R`. + + read_chars.pop(); // remove trailing R. + let read_str = String::from_utf8(read_chars).unwrap(); + let beg = read_str.rfind('[').unwrap(); + let coords: String = read_str.chars().skip(beg + 1).collect(); + let mut nums = coords.split(';'); + + let cy = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cx = nums.next() + .unwrap() + .parse::() + .unwrap(); + + Ok((cx, cy)) + } +} + +/// Hide the cursor for the lifetime of this struct. +/// It will hide the cursor on creation with from() and show it back on drop(). +pub struct HideCursor { + /// The output target. + output: W, +} + +impl HideCursor { + /// Create a hide cursor wrapper struct for the provided output and hides the cursor. + pub fn from(mut output: W) -> Self { + write!(output, "{}", Hide).expect("hide the cursor"); + HideCursor { output: output } + } +} + +impl Drop for HideCursor { + fn drop(&mut self) { + write!(self, "{}", Show).expect("show the cursor"); + } +} + +impl ops::Deref for HideCursor { + type Target = W; + + fn deref(&self) -> &W { + &self.output + } +} + +impl ops::DerefMut for HideCursor { + fn deref_mut(&mut self) -> &mut W { + &mut self.output + } +} + +impl Write for HideCursor { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.output.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.output.flush() + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/event.rs b/vendor/registry-40351f815f426200/termion/src/event.rs new file mode 100644 index 000000000..6e383a1cd --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/event.rs @@ -0,0 +1,350 @@ +//! Mouse and key events. + +use std::io::{Error, ErrorKind}; +use std::str; + +/// An event reported by the terminal. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum Event { + /// A key press. + Key(Key), + /// A mouse button press, release or wheel use at specific coordinates. + Mouse(MouseEvent), + /// An event that cannot currently be evaluated. + Unsupported(Vec), +} + +/// A mouse related event. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum MouseEvent { + /// A mouse button was pressed. + /// + /// The coordinates are one-based. + Press(MouseButton, u16, u16), + /// A mouse button was released. + /// + /// The coordinates are one-based. + Release(u16, u16), + /// A mouse button is held over the given coordinates. + /// + /// The coordinates are one-based. + Hold(u16, u16), +} + +/// A mouse button. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum MouseButton { + /// The left mouse button. + Left, + /// The right mouse button. + Right, + /// The middle mouse button. + Middle, + /// Mouse wheel is going up. + /// + /// This event is typically only used with Mouse::Press. + WheelUp, + /// Mouse wheel is going down. + /// + /// This event is typically only used with Mouse::Press. + WheelDown, +} + +/// A key. +#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] +pub enum Key { + /// Backspace. + Backspace, + /// Left arrow. + Left, + /// Right arrow. + Right, + /// Up arrow. + Up, + /// Down arrow. + Down, + /// Home key. + Home, + /// End key. + End, + /// Page Up key. + PageUp, + /// Page Down key. + PageDown, + /// Delete key. + Delete, + /// Insert key. + Insert, + /// Function keys. + /// + /// Only function keys 1 through 12 are supported. + F(u8), + /// Normal character. + Char(char), + /// Alt modified character. + Alt(char), + /// Ctrl modified character. + /// + /// Note that certain keys may not be modifiable with `ctrl`, due to limitations of terminals. + Ctrl(char), + /// Null byte. + Null, + /// Esc key. + Esc, + + #[doc(hidden)] + __IsNotComplete, +} + +/// Parse an Event from `item` and possibly subsequent bytes through `iter`. +pub fn parse_event(item: u8, iter: &mut I) -> Result + where I: Iterator> +{ + let error = Error::new(ErrorKind::Other, "Could not parse an event"); + match item { + b'\x1B' => { + // This is an escape character, leading a control sequence. + Ok(match iter.next() { + Some(Ok(b'O')) => { + match iter.next() { + // F1-F4 + Some(Ok(val @ b'P'...b'S')) => Event::Key(Key::F(1 + val - b'P')), + _ => return Err(error), + } + } + Some(Ok(b'[')) => { + // This is a CSI sequence. + parse_csi(iter).ok_or(error)? + } + Some(Ok(c)) => { + let ch = parse_utf8_char(c, iter); + Event::Key(Key::Alt(try!(ch))) + } + Some(Err(_)) | None => return Err(error), + }) + } + b'\n' | b'\r' => Ok(Event::Key(Key::Char('\n'))), + b'\t' => Ok(Event::Key(Key::Char('\t'))), + b'\x7F' => Ok(Event::Key(Key::Backspace)), + c @ b'\x01'...b'\x1A' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1 + b'a') as char))), + c @ b'\x1C'...b'\x1F' => Ok(Event::Key(Key::Ctrl((c as u8 - 0x1C + b'4') as char))), + b'\0' => Ok(Event::Key(Key::Null)), + c => { + Ok({ + let ch = parse_utf8_char(c, iter); + Event::Key(Key::Char(try!(ch))) + }) + } + } +} + +/// Parses a CSI sequence, just after reading ^[ +/// +/// Returns None if an unrecognized sequence is found. +fn parse_csi(iter: &mut I) -> Option + where I: Iterator> +{ + Some(match iter.next() { + Some(Ok(b'[')) => match iter.next() { + Some(Ok(val @ b'A'...b'E')) => Event::Key(Key::F(1 + val - b'A')), + _ => return None, + }, + Some(Ok(b'D')) => Event::Key(Key::Left), + Some(Ok(b'C')) => Event::Key(Key::Right), + Some(Ok(b'A')) => Event::Key(Key::Up), + Some(Ok(b'B')) => Event::Key(Key::Down), + Some(Ok(b'H')) => Event::Key(Key::Home), + Some(Ok(b'F')) => Event::Key(Key::End), + Some(Ok(b'M')) => { + // X10 emulation mouse encoding: ESC [ CB Cx Cy (6 characters only). + let mut next = || iter.next().unwrap().unwrap(); + + let cb = next() as i8 - 32; + // (1, 1) are the coords for upper left. + let cx = next().saturating_sub(32) as u16; + let cy = next().saturating_sub(32) as u16; + Event::Mouse(match cb & 0b11 { + 0 => { + if cb & 0x40 != 0 { + MouseEvent::Press(MouseButton::WheelUp, cx, cy) + } else { + MouseEvent::Press(MouseButton::Left, cx, cy) + } + } + 1 => { + if cb & 0x40 != 0 { + MouseEvent::Press(MouseButton::WheelDown, cx, cy) + } else { + MouseEvent::Press(MouseButton::Middle, cx, cy) + } + } + 2 => MouseEvent::Press(MouseButton::Right, cx, cy), + 3 => MouseEvent::Release(cx, cy), + _ => return None, + }) + } + Some(Ok(b'<')) => { + // xterm mouse encoding: + // ESC [ < Cb ; Cx ; Cy (;) (M or m) + let mut buf = Vec::new(); + let mut c = iter.next().unwrap().unwrap(); + while match c { + b'm' | b'M' => false, + _ => true, + } { + buf.push(c); + c = iter.next().unwrap().unwrap(); + } + let str_buf = String::from_utf8(buf).unwrap(); + let nums = &mut str_buf.split(';'); + + let cb = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cx = nums.next() + .unwrap() + .parse::() + .unwrap(); + let cy = nums.next() + .unwrap() + .parse::() + .unwrap(); + + let event = match cb { + 0...2 | 64...65 => { + let button = match cb { + 0 => MouseButton::Left, + 1 => MouseButton::Middle, + 2 => MouseButton::Right, + 64 => MouseButton::WheelUp, + 65 => MouseButton::WheelDown, + _ => unreachable!(), + }; + match c { + b'M' => MouseEvent::Press(button, cx, cy), + b'm' => MouseEvent::Release(cx, cy), + _ => return None, + } + } + 32 => MouseEvent::Hold(cx, cy), + 3 => MouseEvent::Release(cx, cy), + _ => return None, + }; + + Event::Mouse(event) + } + Some(Ok(c @ b'0'...b'9')) => { + // Numbered escape code. + let mut buf = Vec::new(); + buf.push(c); + let mut c = iter.next().unwrap().unwrap(); + // The final byte of a CSI sequence can be in the range 64-126, so + // let's keep reading anything else. + while c < 64 || c > 126 { + buf.push(c); + c = iter.next().unwrap().unwrap(); + } + + match c { + // rxvt mouse encoding: + // ESC [ Cb ; Cx ; Cy ; M + b'M' => { + let str_buf = String::from_utf8(buf).unwrap(); + + let nums: Vec = str_buf.split(';').map(|n| n.parse().unwrap()).collect(); + + let cb = nums[0]; + let cx = nums[1]; + let cy = nums[2]; + + let event = match cb { + 32 => MouseEvent::Press(MouseButton::Left, cx, cy), + 33 => MouseEvent::Press(MouseButton::Middle, cx, cy), + 34 => MouseEvent::Press(MouseButton::Right, cx, cy), + 35 => MouseEvent::Release(cx, cy), + 64 => MouseEvent::Hold(cx, cy), + 96 | 97 => MouseEvent::Press(MouseButton::WheelUp, cx, cy), + _ => return None, + }; + + Event::Mouse(event) + } + // Special key code. + b'~' => { + let str_buf = String::from_utf8(buf).unwrap(); + + // This CSI sequence can be a list of semicolon-separated + // numbers. + let nums: Vec = str_buf.split(';').map(|n| n.parse().unwrap()).collect(); + + if nums.is_empty() { + return None; + } + + // TODO: handle multiple values for key modififiers (ex: values + // [3, 2] means Shift+Delete) + if nums.len() > 1 { + return None; + } + + match nums[0] { + 1 | 7 => Event::Key(Key::Home), + 2 => Event::Key(Key::Insert), + 3 => Event::Key(Key::Delete), + 4 | 8 => Event::Key(Key::End), + 5 => Event::Key(Key::PageUp), + 6 => Event::Key(Key::PageDown), + v @ 11...15 => Event::Key(Key::F(v - 10)), + v @ 17...21 => Event::Key(Key::F(v - 11)), + v @ 23...24 => Event::Key(Key::F(v - 12)), + _ => return None, + } + } + _ => return None, + } + } + _ => return None, + }) + +} + +/// Parse `c` as either a single byte ASCII char or a variable size UTF-8 char. +fn parse_utf8_char(c: u8, iter: &mut I) -> Result + where I: Iterator> +{ + let error = Err(Error::new(ErrorKind::Other, "Input character is not valid UTF-8")); + if c.is_ascii() { + Ok(c as char) + } else { + let bytes = &mut Vec::new(); + bytes.push(c); + + loop { + match iter.next() { + Some(Ok(next)) => { + bytes.push(next); + if let Ok(st) = str::from_utf8(bytes) { + return Ok(st.chars().next().unwrap()); + } + if bytes.len() >= 4 { + return error; + } + } + _ => return error, + } + } + } +} + +#[cfg(test)] +#[test] +fn test_parse_utf8() { + let st = "abcéŷ¤£€ù%323"; + let ref mut bytes = st.bytes().map(|x| Ok(x)); + let chars = st.chars(); + for c in chars { + let b = bytes.next().unwrap().unwrap(); + assert!(c == parse_utf8_char(b, bytes).unwrap()); + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/input.rs b/vendor/registry-40351f815f426200/termion/src/input.rs new file mode 100644 index 000000000..5c8ecf466 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/input.rs @@ -0,0 +1,388 @@ +//! User input. + +use std::io::{self, Read, Write}; +use std::ops; + +use event::{self, Event, Key}; +use raw::IntoRawMode; + +/// An iterator over input keys. +pub struct Keys { + iter: Events, +} + +impl Iterator for Keys { + type Item = Result; + + fn next(&mut self) -> Option> { + loop { + match self.iter.next() { + Some(Ok(Event::Key(k))) => return Some(Ok(k)), + Some(Ok(_)) => continue, + e @ Some(Err(_)) => e, + None => return None, + }; + } + } +} + +/// An iterator over input events. +pub struct Events { + inner: EventsAndRaw +} + +impl Iterator for Events { + type Item = Result; + + fn next(&mut self) -> Option> { + self.inner.next().map(|tuple| tuple.map(|(event, _raw)| event)) + } +} + +/// An iterator over input events and the bytes that define them. +pub struct EventsAndRaw { + source: R, + leftover: Option, +} + +impl Iterator for EventsAndRaw { + type Item = Result<(Event, Vec), io::Error>; + + fn next(&mut self) -> Option), io::Error>> { + let source = &mut self.source; + + if let Some(c) = self.leftover { + // we have a leftover byte, use it + self.leftover = None; + return Some(parse_event(c, &mut source.bytes())); + } + + // Here we read two bytes at a time. We need to distinguish between single ESC key presses, + // and escape sequences (which start with ESC or a x1B byte). The idea is that if this is + // an escape sequence, we will read multiple bytes (the first byte being ESC) but if this + // is a single ESC keypress, we will only read a single byte. + let mut buf = [0u8; 2]; + let res = match source.read(&mut buf) { + Ok(0) => return None, + Ok(1) => { + match buf[0] { + b'\x1B' => Ok((Event::Key(Key::Esc), vec![b'\x1B'])), + c => parse_event(c, &mut source.bytes()), + } + } + Ok(2) => { + let mut option_iter = &mut Some(buf[1]).into_iter(); + let result = { + let mut iter = option_iter.map(|c| Ok(c)).chain(source.bytes()); + parse_event(buf[0], &mut iter) + }; + // If the option_iter wasn't consumed, keep the byte for later. + self.leftover = option_iter.next(); + result + } + Ok(_) => unreachable!(), + Err(e) => Err(e), + }; + + Some(res) + } +} + +fn parse_event(item: u8, iter: &mut I) -> Result<(Event, Vec), io::Error> + where I: Iterator> +{ + let mut buf = vec![item]; + let result = { + let mut iter = iter.inspect(|byte| if let &Ok(byte) = byte { + buf.push(byte); + }); + event::parse_event(item, &mut iter) + }; + result.or(Ok(Event::Unsupported(buf.clone()))).map(|e| (e, buf)) +} + + +/// Extension to `Read` trait. +pub trait TermRead { + /// An iterator over input events. + fn events(self) -> Events where Self: Sized; + + /// An iterator over key inputs. + fn keys(self) -> Keys where Self: Sized; + + /// Read a line. + /// + /// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will + /// complete the input. + fn read_line(&mut self) -> io::Result>; + + /// Read a password. + /// + /// EOT and ETX will abort the prompt, returning `None`. Newline or carriage return will + /// complete the input. + fn read_passwd(&mut self, writer: &mut W) -> io::Result> { + let _raw = try!(writer.into_raw_mode()); + self.read_line() + } +} + + +impl TermRead for R { + fn events(self) -> Events { + Events { + inner: self.events_and_raw() + } + } + fn keys(self) -> Keys { + Keys { iter: self.events() } + } + + fn read_line(&mut self) -> io::Result> { + let mut buf = Vec::with_capacity(30); + + for c in self.bytes() { + match c { + Err(e) => return Err(e), + Ok(0) | Ok(3) | Ok(4) => return Ok(None), + Ok(0x7f) => { + buf.pop(); + } + Ok(b'\n') | Ok(b'\r') => break, + Ok(c) => buf.push(c), + } + } + + let string = try!(String::from_utf8(buf) + .map_err(|e| io::Error::new(io::ErrorKind::InvalidData, e))); + Ok(Some(string)) + } +} + +/// Extension to `TermRead` trait. A separate trait in order to maintain backwards compatibility. +pub trait TermReadEventsAndRaw { + /// An iterator over input events and the bytes that define them. + fn events_and_raw(self) -> EventsAndRaw where Self: Sized; +} + +impl TermReadEventsAndRaw for R { + fn events_and_raw(self) -> EventsAndRaw { + EventsAndRaw { + source: self, + leftover: None, + } + } +} + +/// A sequence of escape codes to enable terminal mouse support. +const ENTER_MOUSE_SEQUENCE: &'static str = csi!("?1000h\x1b[?1002h\x1b[?1015h\x1b[?1006h"); + +/// A sequence of escape codes to disable terminal mouse support. +const EXIT_MOUSE_SEQUENCE: &'static str = csi!("?1006l\x1b[?1015l\x1b[?1002l\x1b[?1000l"); + +/// A terminal with added mouse support. +/// +/// This can be obtained through the `From` implementations. +pub struct MouseTerminal { + term: W, +} + +impl From for MouseTerminal { + fn from(mut from: W) -> MouseTerminal { + from.write_all(ENTER_MOUSE_SEQUENCE.as_bytes()).unwrap(); + + MouseTerminal { term: from } + } +} + +impl Drop for MouseTerminal { + fn drop(&mut self) { + self.term.write_all(EXIT_MOUSE_SEQUENCE.as_bytes()).unwrap(); + } +} + +impl ops::Deref for MouseTerminal { + type Target = W; + + fn deref(&self) -> &W { + &self.term + } +} + +impl ops::DerefMut for MouseTerminal { + fn deref_mut(&mut self) -> &mut W { + &mut self.term + } +} + +impl Write for MouseTerminal { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.term.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.term.flush() + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io; + use event::{Key, Event, MouseEvent, MouseButton}; + + #[test] + fn test_keys() { + let mut i = b"\x1Bayo\x7F\x1B[D".keys(); + + assert_eq!(i.next().unwrap().unwrap(), Key::Alt('a')); + assert_eq!(i.next().unwrap().unwrap(), Key::Char('y')); + assert_eq!(i.next().unwrap().unwrap(), Key::Char('o')); + assert_eq!(i.next().unwrap().unwrap(), Key::Backspace); + assert_eq!(i.next().unwrap().unwrap(), Key::Left); + assert!(i.next().is_none()); + } + + #[test] + fn test_events() { + let mut i = + b"\x1B[\x00bc\x7F\x1B[D\ + \x1B[M\x00\x22\x24\x1B[<0;2;4;M\x1B[32;2;4M\x1B[<0;2;4;m\x1B[35;2;4Mb" + .events(); + + assert_eq!(i.next().unwrap().unwrap(), + Event::Unsupported(vec![0x1B, b'[', 0x00])); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('b'))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('c'))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Backspace)); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Left)); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::WheelUp, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap().unwrap(), Event::Key(Key::Char('b'))); + assert!(i.next().is_none()); + } + + #[test] + fn test_events_and_raw() { + let input = b"\x1B[\x00bc\x7F\x1B[D\ + \x1B[M\x00\x22\x24\x1B[<0;2;4;M\x1B[32;2;4M\x1B[<0;2;4;m\x1B[35;2;4Mb"; + let mut output = Vec::::new(); + { + let mut i = input.events_and_raw().map(|res| res.unwrap()) + .inspect(|&(_, ref raw)| { output.extend(raw); }).map(|(event, _)| event); + + assert_eq!(i.next().unwrap(), + Event::Unsupported(vec![0x1B, b'[', 0x00])); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('b'))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('c'))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Backspace)); + assert_eq!(i.next().unwrap(), Event::Key(Key::Left)); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::WheelUp, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Press(MouseButton::Left, 2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap(), + Event::Mouse(MouseEvent::Release(2, 4))); + assert_eq!(i.next().unwrap(), Event::Key(Key::Char('b'))); + assert!(i.next().is_none()); + } + + assert_eq!(input.iter().map(|b| *b).collect::>(), output) + } + + #[test] + fn test_function_keys() { + let mut st = b"\x1BOP\x1BOQ\x1BOR\x1BOS".keys(); + for i in 1..5 { + assert_eq!(st.next().unwrap().unwrap(), Key::F(i)); + } + + let mut st = b"\x1B[11~\x1B[12~\x1B[13~\x1B[14~\x1B[15~\ + \x1B[17~\x1B[18~\x1B[19~\x1B[20~\x1B[21~\x1B[23~\x1B[24~" + .keys(); + for i in 1..13 { + assert_eq!(st.next().unwrap().unwrap(), Key::F(i)); + } + } + + #[test] + fn test_special_keys() { + let mut st = b"\x1B[2~\x1B[H\x1B[7~\x1B[5~\x1B[3~\x1B[F\x1B[8~\x1B[6~".keys(); + assert_eq!(st.next().unwrap().unwrap(), Key::Insert); + assert_eq!(st.next().unwrap().unwrap(), Key::Home); + assert_eq!(st.next().unwrap().unwrap(), Key::Home); + assert_eq!(st.next().unwrap().unwrap(), Key::PageUp); + assert_eq!(st.next().unwrap().unwrap(), Key::Delete); + assert_eq!(st.next().unwrap().unwrap(), Key::End); + assert_eq!(st.next().unwrap().unwrap(), Key::End); + assert_eq!(st.next().unwrap().unwrap(), Key::PageDown); + assert!(st.next().is_none()); + } + + #[test] + fn test_esc_key() { + let mut st = b"\x1B".keys(); + assert_eq!(st.next().unwrap().unwrap(), Key::Esc); + assert!(st.next().is_none()); + } + + fn line_match(a: &str, b: Option<&str>) { + let mut sink = io::sink(); + + let line = a.as_bytes().read_line().unwrap(); + let pass = a.as_bytes().read_passwd(&mut sink).unwrap(); + + // godammit rustc + + assert_eq!(line, pass); + + if let Some(l) = line { + assert_eq!(Some(l.as_str()), b); + } else { + assert!(b.is_none()); + } + } + + #[test] + fn test_read() { + let test1 = "this is the first test"; + let test2 = "this is the second test"; + + line_match(test1, Some(test1)); + line_match(test2, Some(test2)); + } + + #[test] + fn test_backspace() { + line_match("this is the\x7f first\x7f\x7f test", + Some("this is th fir test")); + line_match("this is the seco\x7fnd test\x7f", + Some("this is the secnd tes")); + } + + #[test] + fn test_end() { + line_match("abc\nhttps://www.youtube.com/watch?v=dQw4w9WgXcQ", + Some("abc")); + line_match("hello\rhttps://www.youtube.com/watch?v=yPYZpwSpKmA", + Some("hello")); + } + + #[test] + fn test_abort() { + line_match("abc\x03https://www.youtube.com/watch?v=dQw4w9WgXcQ", None); + line_match("hello\x04https://www.youtube.com/watch?v=yPYZpwSpKmA", None); + } + +} diff --git a/vendor/registry-40351f815f426200/termion/src/lib.rs b/vendor/registry-40351f815f426200/termion/src/lib.rs new file mode 100644 index 000000000..24917ad76 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/lib.rs @@ -0,0 +1,63 @@ +//! Termion is a pure Rust, bindless library for low-level handling, manipulating +//! and reading information about terminals. This provides a full-featured +//! alternative to Termbox. +//! +//! Termion aims to be simple and yet expressive. It is bindless, meaning that it +//! is not a front-end to some other library (e.g., ncurses or termbox), but a +//! standalone library directly talking to the TTY. +//! +//! Supports Redox, Mac OS X, and Linux (or, in general, ANSI terminals). +//! +//! For more information refer to the [README](https://github.com/redox-os/termion). +#![warn(missing_docs)] + +extern crate numtoa; + +#[cfg(target_os = "redox")] +#[path="sys/redox/mod.rs"] +mod sys; + +#[cfg(all(unix, not(target_os = "redox")))] +#[path="sys/unix/mod.rs"] +mod sys; + +pub use sys::size::terminal_size; +pub use sys::tty::{is_tty, get_tty}; + +mod async; +pub use async::{AsyncReader, async_stdin}; + +#[macro_use] +mod macros; +pub mod clear; +pub mod color; +pub mod cursor; +pub mod event; +pub mod input; +pub mod raw; +pub mod screen; +pub mod scroll; +pub mod style; + +#[cfg(test)] +mod test { + use super::sys; + + #[test] + fn test_get_terminal_attr() { + sys::attr::get_terminal_attr().unwrap(); + sys::attr::get_terminal_attr().unwrap(); + sys::attr::get_terminal_attr().unwrap(); + } + + #[test] + fn test_set_terminal_attr() { + let ios = sys::attr::get_terminal_attr().unwrap(); + sys::attr::set_terminal_attr(&ios).unwrap(); + } + + #[test] + fn test_size() { + sys::size::terminal_size().unwrap(); + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/macros.rs b/vendor/registry-40351f815f426200/termion/src/macros.rs new file mode 100644 index 000000000..5fd70b933 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/macros.rs @@ -0,0 +1,27 @@ +/// Create a CSI-introduced sequence. +macro_rules! csi { + ($( $l:expr ),*) => { concat!("\x1B[", $( $l ),*) }; +} + +/// Derive a CSI sequence struct. +macro_rules! derive_csi_sequence { + ($doc:expr, $name:ident, $value:expr) => { + #[doc = $doc] + #[derive(Copy, Clone)] + pub struct $name; + + impl fmt::Display for $name { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!($value)) + } + } + + impl AsRef<[u8]> for $name { + fn as_ref(&self) -> &'static [u8] { csi!($value).as_bytes() } + } + + impl AsRef for $name { + fn as_ref(&self) -> &'static str { csi!($value) } + } + }; +} diff --git a/vendor/registry-40351f815f426200/termion/src/raw.rs b/vendor/registry-40351f815f426200/termion/src/raw.rs new file mode 100644 index 000000000..0dbfb569e --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/raw.rs @@ -0,0 +1,131 @@ +//! Managing raw mode. +//! +//! Raw mode is a particular state a TTY can have. It signifies that: +//! +//! 1. No line buffering (the input is given byte-by-byte). +//! 2. The input is not written out, instead it has to be done manually by the programmer. +//! 3. The output is not canonicalized (for example, `\n` means "go one line down", not "line +//! break"). +//! +//! It is essential to design terminal programs. +//! +//! # Example +//! +//! ```rust,no_run +//! use termion::raw::IntoRawMode; +//! use std::io::{Write, stdout}; +//! +//! fn main() { +//! let mut stdout = stdout().into_raw_mode().unwrap(); +//! +//! write!(stdout, "Hey there.").unwrap(); +//! } +//! ``` + +use std::io::{self, Write}; +use std::ops; + +use sys::Termios; +use sys::attr::{get_terminal_attr, raw_terminal_attr, set_terminal_attr}; + +/// The timeout of an escape code control sequence, in milliseconds. +pub const CONTROL_SEQUENCE_TIMEOUT: u64 = 100; + +/// A terminal restorer, which keeps the previous state of the terminal, and restores it, when +/// dropped. +/// +/// Restoring will entirely bring back the old TTY state. +pub struct RawTerminal { + prev_ios: Termios, + output: W, +} + +impl Drop for RawTerminal { + fn drop(&mut self) { + set_terminal_attr(&self.prev_ios).unwrap(); + } +} + +impl ops::Deref for RawTerminal { + type Target = W; + + fn deref(&self) -> &W { + &self.output + } +} + +impl ops::DerefMut for RawTerminal { + fn deref_mut(&mut self) -> &mut W { + &mut self.output + } +} + +impl Write for RawTerminal { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.output.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.output.flush() + } +} + +/// Types which can be converted into "raw mode". +/// +/// # Why is this type defined on writers and not readers? +/// +/// TTYs has their state controlled by the writer, not the reader. You use the writer to clear the +/// screen, move the cursor and so on, so naturally you use the writer to change the mode as well. +pub trait IntoRawMode: Write + Sized { + /// Switch to raw mode. + /// + /// Raw mode means that stdin won't be printed (it will instead have to be written manually by + /// the program). Furthermore, the input isn't canonicalised or buffered (that is, you can + /// read from stdin one byte of a time). The output is neither modified in any way. + fn into_raw_mode(self) -> io::Result>; +} + +impl IntoRawMode for W { + fn into_raw_mode(self) -> io::Result> { + let mut ios = get_terminal_attr()?; + let prev_ios = ios; + + raw_terminal_attr(&mut ios); + + set_terminal_attr(&ios)?; + + Ok(RawTerminal { + prev_ios: prev_ios, + output: self, + }) + } +} + +impl RawTerminal { + pub fn suspend_raw_mode(&self) -> io::Result<()> { + set_terminal_attr(&self.prev_ios)?; + Ok(()) + } + + pub fn activate_raw_mode(&self) -> io::Result<()> { + let mut ios = get_terminal_attr()?; + raw_terminal_attr(&mut ios); + set_terminal_attr(&ios)?; + Ok(()) + } +} + +#[cfg(test)] +mod test { + use super::*; + use std::io::{Write, stdout}; + + #[test] + fn test_into_raw_mode() { + let mut out = stdout().into_raw_mode().unwrap(); + + out.write_all(b"this is a test, muahhahahah\r\n").unwrap(); + + drop(out); + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/screen.rs b/vendor/registry-40351f815f426200/termion/src/screen.rs new file mode 100644 index 000000000..822399e27 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/screen.rs @@ -0,0 +1,91 @@ +//! Managing switching between main and alternate screen buffers. +//! +//! Note that this implementation uses xterm's new escape sequences for screen switching and thus +//! only works for xterm compatible terminals (which should be most terminals nowadays). +//! +//! # Example +//! +//! ```rust +//! use termion::screen::AlternateScreen; +//! use std::io::{Write, stdout}; +//! +//! fn main() { +//! { +//! let mut screen = AlternateScreen::from(stdout()); +//! write!(screen, "Writing to alternate screen!").unwrap(); +//! screen.flush().unwrap(); +//! } +//! println!("Writing to main screen."); +//! } +//! ``` + +use std::io::{self, Write}; +use std::ops; +use std::fmt; + +/// Switch to the main screen buffer of the terminal. +pub struct ToMainScreen; + +impl fmt::Display for ToMainScreen { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("?1049l")) + } +} + +/// Switch to the alternate screen buffer of the terminal. +pub struct ToAlternateScreen; + +impl fmt::Display for ToAlternateScreen { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("?1049h")) + } +} + +/// A terminal restorer, which wraps a type implementing Write, and causes all writes to be written +/// to an alternate screen. +/// +/// This is achieved by switching the terminal to the alternate screen on creation and +/// automatically switching it back to the original screen on drop. +pub struct AlternateScreen { + /// The output target. + output: W, +} + +impl AlternateScreen { + /// Create an alternate screen wrapper struct for the provided output and switch the terminal + /// to the alternate screen. + pub fn from(mut output: W) -> Self { + write!(output, "{}", ToAlternateScreen).expect("switch to alternate screen"); + AlternateScreen { output: output } + } +} + +impl Drop for AlternateScreen { + fn drop(&mut self) { + write!(self, "{}", ToMainScreen).expect("switch to main screen"); + } +} + +impl ops::Deref for AlternateScreen { + type Target = W; + + fn deref(&self) -> &W { + &self.output + } +} + +impl ops::DerefMut for AlternateScreen { + fn deref_mut(&mut self) -> &mut W { + &mut self.output + } +} + +impl Write for AlternateScreen { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.output.write(buf) + } + + fn flush(&mut self) -> io::Result<()> { + self.output.flush() + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/scroll.rs b/vendor/registry-40351f815f426200/termion/src/scroll.rs new file mode 100644 index 000000000..2744507f3 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/scroll.rs @@ -0,0 +1,23 @@ +//! Scrolling. + +use std::fmt; + +/// Scroll up. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Up(pub u16); + +impl fmt::Display for Up { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}S"), self.0) + } +} + +/// Scroll down. +#[derive(Copy, Clone, PartialEq, Eq)] +pub struct Down(pub u16); + +impl fmt::Display for Down { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, csi!("{}T"), self.0) + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/style.rs b/vendor/registry-40351f815f426200/termion/src/style.rs new file mode 100644 index 000000000..58e9a78b8 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/style.rs @@ -0,0 +1,22 @@ +//! Text styling management. + +use std::fmt; + +derive_csi_sequence!("Reset SGR parameters.", Reset, "m"); +derive_csi_sequence!("Bold text.", Bold, "1m"); +derive_csi_sequence!("Fainted text (not widely supported).", Faint, "2m"); +derive_csi_sequence!("Italic text.", Italic, "3m"); +derive_csi_sequence!("Underlined text.", Underline, "4m"); +derive_csi_sequence!("Blinking text (not widely supported).", Blink, "5m"); +derive_csi_sequence!("Inverted colors (negative mode).", Invert, "7m"); +derive_csi_sequence!("Crossed out text (not widely supported).", CrossedOut, "9m"); +derive_csi_sequence!("Undo bold text.", NoBold, "21m"); +derive_csi_sequence!("Undo fainted text (not widely supported).", NoFaint, "22m"); +derive_csi_sequence!("Undo italic text.", NoItalic, "23m"); +derive_csi_sequence!("Undo underlined text.", NoUnderline, "24m"); +derive_csi_sequence!("Undo blinking text (not widely supported).", NoBlink, "25m"); +derive_csi_sequence!("Undo inverted colors (negative mode).", NoInvert, "27m"); +derive_csi_sequence!("Undo crossed out text (not widely supported).", + NoCrossedOut, + "29m"); +derive_csi_sequence!("Framed text (not widely supported).", Framed, "51m"); diff --git a/vendor/registry-40351f815f426200/termion/src/sys/redox/attr.rs b/vendor/registry-40351f815f426200/termion/src/sys/redox/attr.rs new file mode 100644 index 000000000..c6489a510 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/redox/attr.rs @@ -0,0 +1,33 @@ +use std::io; + +use super::{cvt, syscall, Termios}; + +pub fn get_terminal_attr() -> io::Result { + let mut termios = Termios::default(); + + let fd = cvt(syscall::dup(0, b"termios"))?; + let res = cvt(syscall::read(fd, &mut termios)); + let _ = syscall::close(fd); + + if res? == termios.len() { + Ok(termios) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to get the terminal attributes.")) + } +} + +pub fn set_terminal_attr(termios: &Termios) -> io::Result<()> { + let fd = cvt(syscall::dup(0, b"termios"))?; + let res = cvt(syscall::write(fd, termios)); + let _ = syscall::close(fd); + + if res? == termios.len() { + Ok(()) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to set the terminal attributes.")) + } +} + +pub fn raw_terminal_attr(ios: &mut Termios) { + ios.make_raw() +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/redox/mod.rs b/vendor/registry-40351f815f426200/termion/src/sys/redox/mod.rs new file mode 100644 index 000000000..2a9b875e3 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/redox/mod.rs @@ -0,0 +1,15 @@ +extern crate redox_termios; +extern crate syscall; + +use std::io; + +pub use self::redox_termios::Termios; + +pub mod attr; +pub mod size; +pub mod tty; + +// Support function for converting syscall error to io error +fn cvt(result: Result) -> io::Result { + result.map_err(|err| io::Error::from_raw_os_error(err.errno)) +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/redox/size.rs b/vendor/registry-40351f815f426200/termion/src/sys/redox/size.rs new file mode 100644 index 000000000..07f64a243 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/redox/size.rs @@ -0,0 +1,18 @@ +use std::io; + +use super::{cvt, redox_termios, syscall}; + +/// Get the size of the terminal. +pub fn terminal_size() -> io::Result<(u16, u16)> { + let mut winsize = redox_termios::Winsize::default(); + + let fd = cvt(syscall::dup(1, b"winsize"))?; + let res = cvt(syscall::read(fd, &mut winsize)); + let _ = syscall::close(fd); + + if res? == winsize.len() { + Ok((winsize.ws_col, winsize.ws_row)) + } else { + Err(io::Error::new(io::ErrorKind::Other, "Unable to get the terminal size.")) + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/redox/tty.rs b/vendor/registry-40351f815f426200/termion/src/sys/redox/tty.rs new file mode 100644 index 000000000..8e21ff8e5 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/redox/tty.rs @@ -0,0 +1,22 @@ +use std::{env, fs, io}; +use std::os::unix::io::AsRawFd; + +use super::syscall; + +/// Is this stream a TTY? +pub fn is_tty(stream: &T) -> bool { + if let Ok(fd) = syscall::dup(stream.as_raw_fd() as _, b"termios") { + let _ = syscall::close(fd); + true + } else { + false + } +} + +/// Get the TTY device. +/// +/// This allows for getting stdio representing _only_ the TTY, and not other streams. +pub fn get_tty() -> io::Result { + let tty = try!(env::var("TTY").map_err(|x| io::Error::new(io::ErrorKind::NotFound, x))); + fs::OpenOptions::new().read(true).write(true).open(tty) +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/unix/attr.rs b/vendor/registry-40351f815f426200/termion/src/sys/unix/attr.rs new file mode 100644 index 000000000..5e21fbac8 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/unix/attr.rs @@ -0,0 +1,29 @@ +use std::{io, mem}; + +use super::{cvt, Termios}; +use super::libc::c_int; + +pub fn get_terminal_attr() -> io::Result { + extern "C" { + pub fn tcgetattr(fd: c_int, termptr: *mut Termios) -> c_int; + } + unsafe { + let mut termios = mem::zeroed(); + cvt(tcgetattr(0, &mut termios))?; + Ok(termios) + } +} + +pub fn set_terminal_attr(termios: &Termios) -> io::Result<()> { + extern "C" { + pub fn tcsetattr(fd: c_int, opt: c_int, termptr: *const Termios) -> c_int; + } + cvt(unsafe { tcsetattr(0, 0, termios) }).and(Ok(())) +} + +pub fn raw_terminal_attr(termios: &mut Termios) { + extern "C" { + pub fn cfmakeraw(termptr: *mut Termios); + } + unsafe { cfmakeraw(termios) } +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/unix/mod.rs b/vendor/registry-40351f815f426200/termion/src/sys/unix/mod.rs new file mode 100644 index 000000000..08d73feb1 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/unix/mod.rs @@ -0,0 +1,33 @@ +extern crate libc; + +use std::io; + +pub use self::libc::termios as Termios; + +pub mod attr; +pub mod size; +pub mod tty; + +// Support functions for converting libc return values to io errors { +trait IsMinusOne { + fn is_minus_one(&self) -> bool; +} + +macro_rules! impl_is_minus_one { + ($($t:ident)*) => ($(impl IsMinusOne for $t { + fn is_minus_one(&self) -> bool { + *self == -1 + } + })*) + } + +impl_is_minus_one! { i8 i16 i32 i64 isize } + +fn cvt(t: T) -> io::Result { + if t.is_minus_one() { + Err(io::Error::last_os_error()) + } else { + Ok(t) + } +} +// } End of support functions diff --git a/vendor/registry-40351f815f426200/termion/src/sys/unix/size.rs b/vendor/registry-40351f815f426200/termion/src/sys/unix/size.rs new file mode 100644 index 000000000..17f2515ae --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/unix/size.rs @@ -0,0 +1,20 @@ +use std::{io, mem}; + +use super::cvt; +use super::libc::{c_ushort, ioctl, STDOUT_FILENO, TIOCGWINSZ}; + +#[repr(C)] +struct TermSize { + row: c_ushort, + col: c_ushort, + _x: c_ushort, + _y: c_ushort, +} +/// Get the size of the terminal. +pub fn terminal_size() -> io::Result<(u16, u16)> { + unsafe { + let mut size: TermSize = mem::zeroed(); + cvt(ioctl(STDOUT_FILENO, TIOCGWINSZ.into(), &mut size as *mut _))?; + Ok((size.col as u16, size.row as u16)) + } +} diff --git a/vendor/registry-40351f815f426200/termion/src/sys/unix/tty.rs b/vendor/registry-40351f815f426200/termion/src/sys/unix/tty.rs new file mode 100644 index 000000000..2be936347 --- /dev/null +++ b/vendor/registry-40351f815f426200/termion/src/sys/unix/tty.rs @@ -0,0 +1,17 @@ +use std::{fs, io}; +use std::os::unix::io::AsRawFd; + +use super::libc; + + +/// Is this stream a TTY? +pub fn is_tty(stream: &T) -> bool { + unsafe { libc::isatty(stream.as_raw_fd()) == 1 } +} + +/// Get the TTY device. +/// +/// This allows for getting stdio representing _only_ the TTY, and not other streams. +pub fn get_tty() -> io::Result { + fs::OpenOptions::new().read(true).write(true).open("/dev/tty") +} diff --git a/vendor/registry-40351f815f426200/textwrap/.cargo-checksum.json b/vendor/registry-40351f815f426200/textwrap/.cargo-checksum.json new file mode 100644 index 000000000..fef68eef8 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"cb72f8ac90e87d794252acfe2e957fbe0effe937ab2eded759af1daad4bc052d","LICENSE":"ce93600c49fbb3e14df32efe752264644f6a2f8e08a735ba981725799e5309ef","README.md":"9cd343e0b056f823677521bfe96b3ff1440d6a5e4455179ae3fe28cd6c4038da","benches/linear.rs":"0484029d32f3f0e8e0d61085db9cdae610019241a73f05485f9b9a9a7a5e1c53","examples/layout.rs":"7758e5526a8b1718c7a69748a4f63703545b6ac13042d753a6d14de0a1b3edcf","examples/termwidth.rs":"f969e869802d21daf59d1ae23c668539bfb493d5b9ef9c7cbc9de30ce315a529","src/lib.rs":"2c42a300a12236d36d855c2799dae69b1a9de69de97e655d4ced409e814d5c7b","tests/version-numbers.rs":"0d75532e72e9054cb8c8c12b8851e55fad7319ed14482b562f6806872f18dd0f"},"package":"c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/textwrap/Cargo.toml b/vendor/registry-40351f815f426200/textwrap/Cargo.toml new file mode 100644 index 000000000..73e8d0f8c --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/Cargo.toml @@ -0,0 +1,49 @@ +# 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 = "textwrap" +version = "0.9.0" +authors = ["Martin Geisler "] +exclude = [".dir-locals.el"] +description = "Textwrap is a small library for word wrapping, indenting, and\ndedenting strings.\n\nYou can use it to format strings (such as help and error messages) for\ndisplay in commandline applications. It is designed to be efficient\nand handle Unicode characters correctly.\n" +documentation = "https://docs.rs/textwrap/" +readme = "README.md" +keywords = ["text", "formatting", "wrap", "typesetting", "hyphenation"] +categories = ["text-processing", "command-line-interface"] +license = "MIT" +repository = "https://github.com/mgeisler/textwrap" +[package.metadata.docs.rs] +all-features = true +[dependencies.unicode-width] +version = "0.1.3" + +[dependencies.hyphenation] +version = "0.6.1" +optional = true + +[dependencies.term_size] +version = "0.3.0" +optional = true +[dev-dependencies.lipsum] +version = "0.3" + +[dev-dependencies.version-sync] +version = "0.2" + +[dev-dependencies.rand] +version = "0.3" +[badges.appveyor] +repository = "mgeisler/textwrap" + +[badges.travis-ci] +repository = "mgeisler/textwrap" diff --git a/vendor/registry-40351f815f426200/textwrap/LICENSE b/vendor/registry-40351f815f426200/textwrap/LICENSE new file mode 100644 index 000000000..0d37ec389 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Martin Geisler + +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/vendor/registry-40351f815f426200/textwrap/README.md b/vendor/registry-40351f815f426200/textwrap/README.md new file mode 100644 index 000000000..7cdfb6006 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/README.md @@ -0,0 +1,323 @@ +# Textwrap + +[![](https://img.shields.io/crates/v/textwrap.svg)][crates-io] +[![](https://docs.rs/textwrap/badge.svg)][api-docs] +[![](https://travis-ci.org/mgeisler/textwrap.svg?branch=master)][travis-ci] +[![](https://ci.appveyor.com/api/projects/status/yo6iak55nraupjw3/branch/master?svg=true)][appveyor] + +Textwrap is a small Rust crate for word wrapping text. You can use it +to format strings for display in commandline applications. The crate +name and interface is inspired by +the [Python textwrap module][py-textwrap]. + +## Usage + +Add this to your `Cargo.toml`: +```toml +[dependencies] +textwrap = "0.9" +``` + +and this to your crate root: +```rust +extern crate textwrap; +``` + +If you would like to have automatic hyphenation, specify the +dependency as: +```toml +[dependencies] +textwrap = { version = "0.9", features = ["hyphenation"] } +``` + +To conveniently wrap text at the current terminal width, enable the +`term_size` feature: + +```toml +[dependencies] +textwrap = { version = "0.9", features = ["term_size"] } +``` + +## Documentation + +**[API documentation][api-docs]** + +## Getting Started + +Word wrapping single strings is easy using the `fill` function: +```rust +extern crate textwrap; +use textwrap::fill; + +fn main() { + let text = "textwrap: a small library for wrapping text."; + println!("{}", fill(text, 18)); +} +``` +The output is +``` +textwrap: a small +library for +wrapping text. +``` + +With the `hyphenation` feature, you can get automatic hyphenation +for [about 70 languages][patterns]. Your program must load and +configure the hyphenation patterns to use: +```rust +extern crate hyphenation; +extern crate textwrap; + +use hyphenation::Language; +use textwrap::Wrapper; + +fn main() { + let corpus = hyphenation::load(Language::English_US).unwrap(); + let wrapper = Wrapper::with_splitter(18, corpus); + let text = "textwrap: a small library for wrapping text."; + println!("{}", wrapper.fill(text)) +} +``` + +The output now looks like this: +``` +textwrap: a small +library for wrap- +ping text. +``` + +The hyphenation uses high-quality TeX hyphenation patterns. + +## Examples + +The library comes with some small example programs that shows various +features. + +### Layout Example + +The `layout` example shows how a fixed example string is wrapped at +different widths. Run the example with: + +```shell +$ cargo run --features hyphenation --example layout +``` + +The program will use the following string: + +> Memory safety without garbage collection. Concurrency without data +> races. Zero-cost abstractions. + +The string is wrapped at all widths between 15 and 60 columns. With +narrow columns the output looks like this: + +``` +.--- Width: 15 ---. +| Memory safety | +| without garbage | +| collection. | +| Concurrency | +| without data | +| races. Zero- | +| cost abstrac- | +| tions. | +.--- Width: 16 ----. +| Memory safety | +| without garbage | +| collection. Con- | +| currency without | +| data races. Ze- | +| ro-cost abstrac- | +| tions. | +``` + +Later, longer lines are used and the output now looks like this: + +``` +.-------------------- Width: 49 --------------------. +| Memory safety without garbage collection. Concur- | +| rency without data races. Zero-cost abstractions. | +.---------------------- Width: 53 ----------------------. +| Memory safety without garbage collection. Concurrency | +| without data races. Zero-cost abstractions. | +.------------------------- Width: 59 -------------------------. +| Memory safety without garbage collection. Concurrency with- | +| out data races. Zero-cost abstractions. | +``` + +Notice how words are split at hyphens (such as "zero-cost") but also +how words are hyphenated using automatic/machine hyphenation. + +### Terminal Width Example + +The `termwidth` example simply shows how the width can be set +automatically to the current terminal width. Run it with this command: + +``` +$ cargo run --example termwidth +``` + +If you run it in a narrow terminal, you'll see output like this: +``` +Formatted in within 60 columns: +---- +Memory safety without garbage collection. Concurrency +without data races. Zero-cost abstractions. +---- +``` + +If `stdout` is not connected to the terminal, the program will use a +default of 80 columns for the width: + +``` +$ cargo run --example termwidth | cat +Formatted in within 80 columns: +---- +Memory safety without garbage collection. Concurrency without data races. Zero- +cost abstractions. +---- +``` + +## Release History + +This section lists the largest changes per release. + +### Version 0.9.0 — October 5th, 2017 + +The dependency on `term_size` is now optional, and by default this +feature is not enabled. This is a *breaking change* for users of +`Wrapper::with_termwidth`. Enable the `term_size` feature to restore +the old functionality. + +Added a regression test for case where width is set to usize::MAX. +Thanks @Fraser999! All public structs now implement `Debug`. + +Issues closed: + +* Fixed [#101][issue-101]: Remove `term_size` as a (hard required) + dependency. + +### Version 0.8.0 — September 4th, 2017 + +The `Wrapper` stuct is now generic over the type of word splitter +being used. This means less boxing and a nicer API. The +`Wrapper::word_splitter` method has been removed. This is a *breaking +API change* if you used the method to change the word splitter. + +The `Wrapper` struct has two new methods that will wrap the input text +lazily: `Wrapper::wrap_iter` and `Wrapper::into_wrap_iter`. Use those +if you will be iterating over the wrapped lines one by one. + +Issues closed: + +* Fixed [#59][issue-59]: `wrap` could return an iterator. Thanks + @hcpl! + +* Fixed [#81][issue-81]: Set `html_root_url` + +### Version 0.7.0 — July 20th, 2017 + +Version 0.7.0 changes the return type of `Wrapper::wrap` from +`Vec` to `Vec>`. This means that the output lines +borrow data from the input string. This is a *breaking API change* if +you relied on the exact return type of `Wrapper::wrap`. Callers of the +`textwrap::fill` convenience function will see no breakage. + +The above change and other optimizations makes version 0.7.0 roughly +15-30% faster than version 0.6.0. + +The `squeeze_whitespace` option has been removed since it was +complicating the above optimization. Let us know if this option is +important for you so we can provide a work around. + +Issues closed: + +* Fixed [#58][issue-58]: Add a "fast_wrap" function that reuses the + input string + +* Fixed [#61][issue-61]: Documentation errors + +### Version 0.6.0 — May 22nd, 2017 + +Version 0.6.0 adds builder methods to `Wrapper` for easy one-line +initialization and configuration: + +```rust +let wrapper = Wrapper::new(60).break_words(false); +``` + +It also add a new `NoHyphenation` word splitter that will never split +words, not even at existing hyphens. + +Issues closed: + +* Fixed [#28][issue-28]: Support not squeezing whitespace + +### Version 0.5.0 — May 15th, 2017 + +Version 0.5.0 has *breaking API changes*. However, this only affects +code using the hyphenation feature. The feature is now optional, so +you will first need to enable the `hyphenation` feature as described +above. Afterwards, please change your code from +```rust +wrapper.corpus = Some(&corpus); +``` +to +```rust +wrapper.splitter = Box::new(corpus); +``` + +Other changes include optimizations, so version 0.5.0 is roughly +10-15% faster than version 0.4.0. + +Issues closed: + +* Fixed [#19][issue-19]: Add support for finding terminal size +* Fixed [#25][issue-25]: Handle words longer than `self.width` +* Fixed [#26][issue-26]: Support custom indentation +* Fixed [#36][issue-36]: Support building without `hyphenation` +* Fixed [#39][issue-39]: Respect non-breaking spaces + +### Version 0.4.0 — January 24th, 2017 + +Documented complexities and tested these via `cargo bench`. + +* Fixed [#13][issue-13]: Immediatedly add word if it fits +* Fixed [#14][issue-14]: Avoid splitting on initial hyphens in `--foo-bar` + +### Version 0.3.0 — January 7th, 2017 + +Added support for automatic hyphenation. + +### Version 0.2.0 — December 28th, 2016 + +Introduced `Wrapper` struct. Added support for wrapping on hyphens. + +### Version 0.1.0 — December 17th, 2016 + +First public release with support for wrapping strings on whitespace. + +## License + +Textwrap can be distributed according to the [MIT license][mit]. +Contributions will be accepted under the same license. + +[crates-io]: https://crates.io/crates/textwrap +[travis-ci]: https://travis-ci.org/mgeisler/textwrap +[appveyor]: https://ci.appveyor.com/project/mgeisler/textwrap +[py-textwrap]: https://docs.python.org/library/textwrap +[patterns]: https://github.com/tapeinosyne/hyphenation/tree/master/patterns-tex +[api-docs]: https://docs.rs/textwrap/ +[issue-13]: https://github.com/mgeisler/textwrap/issues/13 +[issue-14]: https://github.com/mgeisler/textwrap/issues/14 +[issue-19]: https://github.com/mgeisler/textwrap/issues/19 +[issue-25]: https://github.com/mgeisler/textwrap/issues/25 +[issue-26]: https://github.com/mgeisler/textwrap/issues/26 +[issue-28]: https://github.com/mgeisler/textwrap/issues/28 +[issue-36]: https://github.com/mgeisler/textwrap/issues/36 +[issue-39]: https://github.com/mgeisler/textwrap/issues/39 +[issue-58]: https://github.com/mgeisler/textwrap/issues/58 +[issue-59]: https://github.com/mgeisler/textwrap/issues/59 +[issue-61]: https://github.com/mgeisler/textwrap/issues/61 +[issue-81]: https://github.com/mgeisler/textwrap/issues/81 +[issue-101]: https://github.com/mgeisler/textwrap/issues/101 +[mit]: LICENSE diff --git a/vendor/registry-40351f815f426200/textwrap/benches/linear.rs b/vendor/registry-40351f815f426200/textwrap/benches/linear.rs new file mode 100644 index 000000000..cc805474d --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/benches/linear.rs @@ -0,0 +1,122 @@ +#![feature(test)] + +// The benchmarks here verify that the complexity grows as O(*n*) +// where *n* is the number of characters in the text to be wrapped. + +extern crate test; +extern crate rand; +extern crate lipsum; +extern crate textwrap; +#[cfg(feature = "hyphenation")] +extern crate hyphenation; + +use test::Bencher; +#[cfg(feature = "hyphenation")] +use hyphenation::Language; +#[cfg(feature = "hyphenation")] +use textwrap::Wrapper; +use rand::XorShiftRng; +use lipsum::MarkovChain; + +const LINE_LENGTH: usize = 60; + +/// Generate a lorem ipsum text with the given number of characters. +fn lorem_ipsum(length: usize) -> String { + // The average word length in the lorem ipsum text is somewhere + // between 6 and 7. So we conservatively divide by 5 to have a + // long enough text that we can truncate below. + let rng = XorShiftRng::new_unseeded(); + let mut chain = MarkovChain::new_with_rng(rng); + chain.learn(lipsum::LOREM_IPSUM); + chain.learn(lipsum::LIBER_PRIMUS); + + let mut text = chain.generate_from(length / 5, ("Lorem", "ipsum")); + text.truncate(length); + text +} + +#[bench] +fn fill_100(b: &mut Bencher) { + let text = &lorem_ipsum(100); + b.iter(|| textwrap::fill(text, LINE_LENGTH)) +} + +#[bench] +fn fill_200(b: &mut Bencher) { + let text = &lorem_ipsum(200); + b.iter(|| textwrap::fill(text, LINE_LENGTH)) +} + +#[bench] +fn fill_400(b: &mut Bencher) { + let text = &lorem_ipsum(400); + b.iter(|| textwrap::fill(text, LINE_LENGTH)) +} + +#[bench] +fn fill_800(b: &mut Bencher) { + let text = &lorem_ipsum(800); + b.iter(|| textwrap::fill(text, LINE_LENGTH)) +} + + +#[bench] +fn wrap_100(b: &mut Bencher) { + let text = &lorem_ipsum(100); + b.iter(|| textwrap::wrap(text, LINE_LENGTH)) +} + +#[bench] +fn wrap_200(b: &mut Bencher) { + let text = &lorem_ipsum(200); + b.iter(|| textwrap::wrap(text, LINE_LENGTH)) +} + +#[bench] +fn wrap_400(b: &mut Bencher) { + let text = &lorem_ipsum(400); + b.iter(|| textwrap::wrap(text, LINE_LENGTH)) +} + +#[bench] +fn wrap_800(b: &mut Bencher) { + let text = &lorem_ipsum(800); + b.iter(|| textwrap::wrap(text, LINE_LENGTH)) +} + + +#[bench] +#[cfg(feature = "hyphenation")] +fn hyphenation_fill_100(b: &mut Bencher) { + let text = &lorem_ipsum(100); + let corpus = hyphenation::load(Language::Latin).unwrap(); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); + b.iter(|| wrapper.fill(text)) +} + +#[bench] +#[cfg(feature = "hyphenation")] +fn hyphenation_fill_200(b: &mut Bencher) { + let text = &lorem_ipsum(200); + let corpus = hyphenation::load(Language::Latin).unwrap(); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); + b.iter(|| wrapper.fill(text)) +} + +#[bench] +#[cfg(feature = "hyphenation")] +fn hyphenation_fill_400(b: &mut Bencher) { + let text = &lorem_ipsum(400); + let corpus = hyphenation::load(Language::Latin).unwrap(); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); + b.iter(|| wrapper.fill(text)) +} + +#[bench] +#[cfg(feature = "hyphenation")] +fn hyphenation_fill_800(b: &mut Bencher) { + let text = &lorem_ipsum(800); + let corpus = hyphenation::load(Language::Latin).unwrap(); + let wrapper = Wrapper::with_splitter(LINE_LENGTH, corpus); + b.iter(|| wrapper.fill(text)) +} diff --git a/vendor/registry-40351f815f426200/textwrap/examples/layout.rs b/vendor/registry-40351f815f426200/textwrap/examples/layout.rs new file mode 100644 index 000000000..6d3d10242 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/examples/layout.rs @@ -0,0 +1,39 @@ +#[cfg(feature = "hyphenation")] +extern crate hyphenation; +extern crate textwrap; + +#[cfg(feature = "hyphenation")] +use hyphenation::Language; +use textwrap::Wrapper; + + +#[cfg(not(feature = "hyphenation"))] +fn new_wrapper<'a>() -> Wrapper<'a, textwrap::HyphenSplitter> { + Wrapper::new(0) +} + +#[cfg(feature = "hyphenation")] +fn new_wrapper<'a>() -> Wrapper<'a, hyphenation::Corpus> { + let corpus = hyphenation::load(Language::English_US).unwrap(); + Wrapper::with_splitter(0, corpus) +} + +fn main() { + let example = "Memory safety without garbage collection. \ + Concurrency without data races. \ + Zero-cost abstractions."; + let mut prev_lines = vec![]; + let mut wrapper = new_wrapper(); + for width in 15..60 { + wrapper.width = width; + let lines = wrapper.wrap(example); + if lines != prev_lines { + let title = format!(" Width: {} ", width); + println!(".{:-^1$}.", title, width + 2); + for line in &lines { + println!("| {:1$} |", line, width); + } + prev_lines = lines; + } + } +} diff --git a/vendor/registry-40351f815f426200/textwrap/examples/termwidth.rs b/vendor/registry-40351f815f426200/textwrap/examples/termwidth.rs new file mode 100644 index 000000000..7d81a5c65 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/examples/termwidth.rs @@ -0,0 +1,21 @@ +#[cfg(feature = "term_size")] +extern crate textwrap; + +#[cfg(not(feature = "term_size"))] +fn main() { + println!("Please enable the term_size feature to run this example."); +} + +#[cfg(feature = "term_size")] +fn main() { + let example = "Memory safety without garbage collection. \ + Concurrency without data races. \ + Zero-cost abstractions."; + // Create a new Wrapper -- automatically set the width to the + // current terminal width. + let wrapper = textwrap::Wrapper::with_termwidth(); + println!("Formatted in within {} columns:", wrapper.width); + println!("----"); + println!("{}", wrapper.fill(example)); + println!("----"); +} diff --git a/vendor/registry-40351f815f426200/textwrap/src/lib.rs b/vendor/registry-40351f815f426200/textwrap/src/lib.rs new file mode 100644 index 000000000..14476b36c --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/src/lib.rs @@ -0,0 +1,1216 @@ +//! `textwrap` provides functions for word wrapping and filling text. +//! +//! Wrapping text can be very useful in commandline programs where you +//! want to format dynamic output nicely so it looks good in a +//! terminal. A quick example: +//! +//! ```no_run +//! extern crate textwrap; +//! use textwrap::fill; +//! +//! fn main() { +//! let text = "textwrap: a small library for wrapping text."; +//! println!("{}", fill(text, 18)); +//! } +//! ``` +//! +//! This will display the following output: +//! +//! ```text +//! textwrap: a small +//! library for +//! wrapping text. +//! ``` +//! +//! # Displayed Width vs Byte Size +//! +//! To word wrap text, one must know the width of each word so one can +//! know when to break lines. This library measures the width of text +//! using the [displayed width][unicode-width], not the size in bytes. +//! +//! This is important for non-ASCII text. ASCII characters such as `a` +//! and `!` are simple and take up one column each. This means that +//! the displayed width is equal to the string length in bytes. +//! However, non-ASCII characters and symbols take up more than one +//! byte when UTF-8 encoded: `é` is `0xc3 0xa9` (two bytes) and `⚙` is +//! `0xe2 0x9a 0x99` (three bytes) in UTF-8, respectively. +//! +//! This is why we take care to use the displayed width instead of the +//! byte count when computing line lengths. All functions in this +//! library handle Unicode characters like this. +//! +//! [unicode-width]: https://docs.rs/unicode-width/ + +#![doc(html_root_url = "https://docs.rs/textwrap/0.9.0")] +#![deny(missing_docs)] +#![deny(missing_debug_implementations)] + +extern crate unicode_width; +#[cfg(feature = "term_size")] +extern crate term_size; +#[cfg(feature = "hyphenation")] +extern crate hyphenation; + +use std::fmt; +use std::borrow::Cow; +use std::str::CharIndices; + +use unicode_width::UnicodeWidthStr; +use unicode_width::UnicodeWidthChar; +#[cfg(feature = "hyphenation")] +use hyphenation::{Hyphenation, Corpus}; + +/// A non-breaking space. +const NBSP: char = '\u{a0}'; + +/// An interface for splitting words. +/// +/// When the [`wrap_iter`] method will try to fit text into a line, it +/// will eventually find a word that it too large the current text +/// width. It will then call the currently configured `WordSplitter` to +/// have it attempt to split the word into smaller parts. This trait +/// describes that functionality via the [`split`] method. +/// +/// If the `textwrap` crate has been compiled with the `hyphenation` +/// feature enabled, you will find an implementation of `WordSplitter` +/// by the `hyphenation::language::Corpus` struct. Use this struct for +/// language-aware hyphenation. See the [`hyphenation` documentation] +/// for details. +/// +/// [`wrap_iter`]: struct.Wrapper.html#method.wrap_iter +/// [`split`]: #tymethod.split +/// [`hyphenation` documentation]: https://docs.rs/hyphenation/ +pub trait WordSplitter { + /// Return all possible splits of word. Each split is a triple + /// with a head, a hyphen, and a tail where `head + &hyphen + + /// &tail == word`. The hyphen can be empty if there is already a + /// hyphen in the head. + /// + /// The splits should go from smallest to longest and should + /// include no split at all. So the word "technology" could be + /// split into + /// + /// ```no_run + /// vec![("tech", "-", "nology"), + /// ("technol", "-", "ogy"), + /// ("technolo", "-", "gy"), + /// ("technology", "", "")]; + /// ``` + fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)>; +} + +/// Use this as a [`Wrapper.splitter`] to avoid any kind of +/// hyphenation: +/// +/// ``` +/// use textwrap::{Wrapper, NoHyphenation}; +/// +/// let wrapper = Wrapper::with_splitter(8, NoHyphenation); +/// assert_eq!(wrapper.wrap("foo bar-baz"), vec!["foo", "bar-baz"]); +/// ``` +/// +/// [`Wrapper.splitter`]: struct.Wrapper.html#structfield.splitter +#[derive(Clone, Debug)] +pub struct NoHyphenation; + +/// `NoHyphenation` implements `WordSplitter` by not splitting the +/// word at all. +impl WordSplitter for NoHyphenation { + fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)> { + vec![(word, "", "")] + } +} + +/// Simple and default way to split words: splitting on existing +/// hyphens only. +/// +/// You probably don't need to use this type since it's already used +/// by default by `Wrapper::new`. +#[derive(Clone, Debug)] +pub struct HyphenSplitter; + +/// `HyphenSplitter` is the default `WordSplitter` used by +/// `Wrapper::new`. It will split words on any existing hyphens in the +/// word. +/// +/// It will only use hyphens that are surrounded by alphanumeric +/// characters, which prevents a word like "--foo-bar" from being +/// split on the first or second hyphen. +impl WordSplitter for HyphenSplitter { + fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)> { + let mut triples = Vec::new(); + // Split on hyphens, smallest split first. We only use hyphens + // that are surrounded by alphanumeric characters. This is to + // avoid splitting on repeated hyphens, such as those found in + // --foo-bar. + let mut char_indices = word.char_indices(); + // Early return if the word is empty. + let mut prev = match char_indices.next() { + None => return vec![(word, "", "")], + Some((_, ch)) => ch, + }; + + // Find current word, or return early if the word only has a + // single character. + let (mut idx, mut cur) = match char_indices.next() { + None => return vec![(word, "", "")], + Some((idx, cur)) => (idx, cur), + }; + + for (i, next) in char_indices { + if prev.is_alphanumeric() && cur == '-' && next.is_alphanumeric() { + let (head, tail) = word.split_at(idx + 1); + triples.push((head, "", tail)); + } + prev = cur; + idx = i; + cur = next; + } + + // Finally option is no split at all. + triples.push((word, "", "")); + + triples + } +} + +/// A hyphenation Corpus can be used to do language-specific +/// hyphenation using patterns from the hyphenation crate. +#[cfg(feature = "hyphenation")] +impl WordSplitter for Corpus { + fn split<'w>(&self, word: &'w str) -> Vec<(&'w str, &'w str, &'w str)> { + // Find splits based on language corpus. + let mut triples = Vec::new(); + for n in word.opportunities(self) { + let (head, tail) = word.split_at(n); + let hyphen = if head.ends_with('-') { "" } else { "-" }; + triples.push((head, hyphen, tail)); + } + // Finally option is no split at all. + triples.push((word, "", "")); + + triples + } +} + +/// Backport of the `AddAssign` trait implementation from Rust 1.14. +fn cow_add_assign<'a>(lhs: &mut Cow<'a, str>, rhs: &'a str) { + if lhs.is_empty() { + *lhs = Cow::Borrowed(rhs) + } else if rhs.is_empty() { + return; + } else { + if let Cow::Borrowed(inner) = *lhs { + let mut s = String::with_capacity(lhs.len() + rhs.len()); + s.push_str(inner); + *lhs = Cow::Owned(s); + } + lhs.to_mut().push_str(rhs); + } +} + + +/// A Wrapper holds settings for wrapping and filling text. Use it +/// when the convenience [`wrap_iter`], [`wrap`] and [`fill`] functions +/// are not flexible enough. +/// +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`wrap`]: fn.wrap.html +/// [`fill`]: fn.fill.html +/// +/// The algorithm used by the `WrapIter` iterator (returned from the +/// `wrap_iter` method) works by doing successive partial scans over +/// words in the input string (where each single scan yields a single +/// line) so that the overall time and memory complexity is O(*n*) where +/// *n* is the length of the input string. +#[derive(Clone, Debug)] +pub struct Wrapper<'a, S: WordSplitter> { + /// The width in columns at which the text will be wrapped. + pub width: usize, + /// Indentation used for the first line of output. + pub initial_indent: &'a str, + /// Indentation used for subsequent lines of output. + pub subsequent_indent: &'a str, + /// Allow long words to be broken if they cannot fit on a line. + /// When set to `false`, some lines may be longer than + /// `self.width`. + pub break_words: bool, + /// The method for splitting words. If the `hyphenation` feature + /// is enabled, you can use a `hyphenation::language::Corpus` here + /// to get language-aware hyphenation. + pub splitter: S, +} + +impl<'a> Wrapper<'a, HyphenSplitter> { + /// Create a new Wrapper for wrapping at the specified width. By + /// default, we allow words longer than `width` to be broken. A + /// [`HyphenSplitter`] will be used by default for splitting + /// words. See the [`WordSplitter`] trait for other options. + /// + /// [`HyphenSplitter`]: struct.HyphenSplitter.html + /// [`WordSplitter`]: trait.WordSplitter.html + pub fn new(width: usize) -> Wrapper<'a, HyphenSplitter> { + Wrapper::with_splitter(width, HyphenSplitter) + } + + /// Create a new Wrapper for wrapping text at the current terminal + /// width. If the terminal width cannot be determined (typically + /// because the standard input and output is not connected to a + /// terminal), a width of 80 characters will be used. Other + /// settings use the same defaults as `Wrapper::new`. + /// + /// Equivalent to: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::{Wrapper, termwidth}; + /// + /// let wrapper = Wrapper::new(termwidth()); + /// ``` + #[cfg(feature = "term_size")] + pub fn with_termwidth() -> Wrapper<'a, HyphenSplitter> { + Wrapper::new(termwidth()) + } +} + +impl<'w, 'a: 'w, S: WordSplitter> Wrapper<'a, S> { + /// Use the given [`WordSplitter`] to create a new Wrapper for + /// wrapping at the specified width. By default, we allow words + /// longer than `width` to be broken. + /// + /// [`WordSplitter`]: trait.WordSplitter.html + pub fn with_splitter(width: usize, splitter: S) -> Wrapper<'a, S> { + Wrapper { + width: width, + initial_indent: "", + subsequent_indent: "", + break_words: true, + splitter: splitter, + } + } + + /// Change [`self.initial_indent`]. The initial indentation is + /// used on the very first line of output. + /// + /// # Examples + /// + /// Classic paragraph indentation can be achieved by specifying an + /// initial indentation and wrapping each paragraph by itself: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::Wrapper; + /// + /// let wrapper = Wrapper::new(15).initial_indent(" "); + /// ``` + /// + /// [`self.initial_indent`]: #structfield.initial_indent + pub fn initial_indent(self, indent: &'a str) -> Wrapper<'a, S> { + Wrapper { initial_indent: indent, ..self } + } + + /// Change [`self.subsequent_indent`]. The subsequent indentation + /// is used on lines following the first line of output. + /// + /// # Examples + /// + /// Combining initial and subsequent indentation lets you format a + /// single paragraph as a bullet list: + /// + /// ```no_run + /// # #![allow(unused_variables)] + /// use textwrap::Wrapper; + /// + /// let wrapper = Wrapper::new(15) + /// .initial_indent("* ") + /// .subsequent_indent(" "); + /// ``` + /// + /// [`self.subsequent_indent`]: #structfield.subsequent_indent + pub fn subsequent_indent(self, indent: &'a str) -> Wrapper<'a, S> { + Wrapper { subsequent_indent: indent, ..self } + } + + /// Change [`self.break_words`]. This controls if words longer + /// than `self.width` can be broken, or if they will be left + /// sticking out into the right margin. + /// + /// [`self.break_words`]: #structfield.break_words + pub fn break_words(self, setting: bool) -> Wrapper<'a, S> { + Wrapper { break_words: setting, ..self } + } + + /// Fill a line of text at `self.width` characters. Strings are + /// wrapped based on their displayed width, not their size in + /// bytes. + /// + /// The result is a string with newlines between each line. Use + /// the `wrap` method if you need access to the individual lines. + /// + /// # Complexities + /// + /// This method simply joins the lines produced by `wrap_iter`. As + /// such, it inherits the O(*n*) time and memory complexity where + /// *n* is the input string length. + /// + /// # Examples + /// + /// ``` + /// use textwrap::Wrapper; + /// + /// let wrapper = Wrapper::new(15); + /// assert_eq!(wrapper.fill("Memory safety without garbage collection."), + /// "Memory safety\nwithout garbage\ncollection."); + /// ``` + pub fn fill(&self, s: &str) -> String { + // This will avoid reallocation in simple cases (no + // indentation, no hyphenation). + let mut result = String::with_capacity(s.len()); + + for (i, line) in self.wrap_iter(s).enumerate() { + if i > 0 { + result.push('\n'); + } + result.push_str(&line); + } + + result + } + + /// Wrap a line of text at `self.width` characters. Strings are + /// wrapped based on their displayed width, not their size in + /// bytes. + /// + /// # Complexities + /// + /// This method simply collects the lines produced by `wrap_iter`. + /// As such, it inherits the O(*n*) overall time and memory + /// complexity where *n* is the input string length. + /// + /// # Examples + /// + /// ``` + /// use textwrap::Wrapper; + /// + /// let wrap15 = Wrapper::new(15); + /// assert_eq!(wrap15.wrap("Concurrency without data races."), + /// vec!["Concurrency", + /// "without data", + /// "races."]); + /// + /// let wrap20 = Wrapper::new(20); + /// assert_eq!(wrap20.wrap("Concurrency without data races."), + /// vec!["Concurrency without", + /// "data races."]); + /// ``` + pub fn wrap(&self, s: &'a str) -> Vec> { + self.wrap_iter(s).collect::>() + } + + /// Lazily wrap a line of text at `self.width` characters. Strings + /// are wrapped based on their displayed width, not their size in + /// bytes. + /// + /// The [`WordSplitter`] stored in [`self.splitter`] is used + /// whenever when a word is too large to fit on the current line. + /// By changing the field, different hyphenation strategies can be + /// implemented. + /// + /// # Complexities + /// + /// This method returns a [`WrapIter`] iterator which borrows this + /// `Wrapper`. The algorithm used has a linear complexity, so + /// getting the next line from the iterator will take O(*w*) time, + /// where *w* is the wrapping width. Fully processing the iterator + /// will take O(*n*) time for an input string of length *n*. + /// + /// When no indentation is used, each line returned is a slice of + /// the input string and the memory overhead is thus constant. + /// Otherwise new memory is allocated for each line returned. + /// + /// # Examples + /// + /// ``` + /// use std::borrow::Cow; + /// use textwrap::Wrapper; + /// + /// let wrap20 = Wrapper::new(20); + /// let mut wrap20_iter = wrap20.wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); + /// assert_eq!(wrap20_iter.next(), None); + /// + /// let wrap25 = Wrapper::new(25); + /// let mut wrap25_iter = wrap25.wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap25_iter.next(), Some(Cow::from("Zero-cost abstractions."))); + /// assert_eq!(wrap25_iter.next(), None); + /// ``` + /// + /// [`self.splitter`]: #structfield.splitter + /// [`WordSplitter`]: trait.WordSplitter.html + /// [`WrapIter`]: struct.WrapIter.html + pub fn wrap_iter(&'w self, s: &'a str) -> WrapIter<'w, 'a, S> { + WrapIter { + wrapper: self, + wrap_iter_impl: WrapIterImpl::new(self, s), + } + } + + /// Lazily wrap a line of text at `self.width` characters. Strings + /// are wrapped based on their displayed width, not their size in + /// bytes. + /// + /// The [`WordSplitter`] stored in [`self.splitter`] is used + /// whenever when a word is too large to fit on the current line. + /// By changing the field, different hyphenation strategies can be + /// implemented. + /// + /// # Complexities + /// + /// This method consumes the `Wrapper` and returns a + /// [`IntoWrapIter`] iterator. Fully processing the iterator has + /// the same O(*n*) time complexity as [`wrap_iter`], where *n* is + /// the length of the input string. + /// + /// # Examples + /// + /// ``` + /// use std::borrow::Cow; + /// use textwrap::Wrapper; + /// + /// let wrap20 = Wrapper::new(20); + /// let mut wrap20_iter = wrap20.into_wrap_iter("Zero-cost abstractions."); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); + /// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); + /// assert_eq!(wrap20_iter.next(), None); + /// ``` + /// + /// [`self.splitter`]: #structfield.splitter + /// [`WordSplitter`]: trait.WordSplitter.html + /// [`IntoWrapIter`]: struct.IntoWrapIter.html + /// [`wrap_iter`]: #method.wrap_iter + pub fn into_wrap_iter(self, s: &'a str) -> IntoWrapIter<'a, S> { + let wrap_iter_impl = WrapIterImpl::new(&self, s); + + IntoWrapIter { + wrapper: self, + wrap_iter_impl: wrap_iter_impl, + } + } +} + + +/// An iterator over the lines of the input string which owns a +/// `Wrapper`. An instance of `IntoWrapIter` is typically obtained +/// through either [`wrap_iter`] or [`Wrapper::into_wrap_iter`]. +/// +/// Each call of `.next()` method yields a line wrapped in `Some` if the +/// input hasn't been fully processed yet. Otherwise it returns `None`. +/// +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`Wrapper::into_wrap_iter`]: struct.Wrapper.html#method.into_wrap_iter +#[derive(Debug)] +pub struct IntoWrapIter<'a, S: WordSplitter> { + wrapper: Wrapper<'a, S>, + wrap_iter_impl: WrapIterImpl<'a>, +} + +impl<'a, S: WordSplitter> Iterator for IntoWrapIter<'a, S> { + type Item = Cow<'a, str>; + + fn next(&mut self) -> Option> { + self.wrap_iter_impl.impl_next(&self.wrapper) + } +} + +/// An iterator over the lines of the input string which borrows a +/// `Wrapper`. An instance of `WrapIter` is typically obtained +/// through the [`Wrapper::wrap_iter`] method. +/// +/// Each call of `.next()` method yields a line wrapped in `Some` if the +/// input hasn't been fully processed yet. Otherwise it returns `None`. +/// +/// [`Wrapper::wrap_iter`]: struct.Wrapper.html#method.wrap_iter +#[derive(Debug)] +pub struct WrapIter<'w, 'a: 'w, S: WordSplitter + 'w> { + wrapper: &'w Wrapper<'a, S>, + wrap_iter_impl: WrapIterImpl<'a>, +} + +impl<'w, 'a: 'w, S: WordSplitter> Iterator for WrapIter<'w, 'a, S> { + type Item = Cow<'a, str>; + + fn next(&mut self) -> Option> { + self.wrap_iter_impl.impl_next(self.wrapper) + } +} + +struct WrapIterImpl<'a> { + // String to wrap. + source: &'a str, + // CharIndices iterator over self.source. + char_indices: CharIndices<'a>, + // Is the next element the first one ever produced? + is_next_first: bool, + // Byte index where the current line starts. + start: usize, + // Byte index of the last place where the string can be split. + split: usize, + // Size in bytes of the character at self.source[self.split]. + split_len: usize, + // Width of self.source[self.start..idx]. + line_width: usize, + // Width of self.source[self.start..self.split]. + line_width_at_split: usize, + // Tracking runs of whitespace characters. + in_whitespace: bool, + // Has iterator finished producing elements? + finished: bool, +} + +impl<'a> fmt::Debug for WrapIterImpl<'a> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("WrapIterImpl") + .field("source", &self.source) + .field("char_indices", &"CharIndices { ... }") + .field("is_next_first", &self.is_next_first) + .field("start", &self.start) + .field("split", &self.split) + .field("split_len", &self.split_len) + .field("line_width", &self.line_width) + .field("line_width_at_split", &self.line_width_at_split) + .field("in_whitespace", &self.in_whitespace) + .field("finished", &self.finished) + .finish() + } +} + +impl<'a> WrapIterImpl<'a> { + fn new(wrapper: &Wrapper<'a, S>, s: &'a str) -> WrapIterImpl<'a> { + WrapIterImpl { + source: s, + char_indices: s.char_indices(), + is_next_first: true, + start: 0, + split: 0, + split_len: 0, + line_width: wrapper.initial_indent.width(), + line_width_at_split: wrapper.initial_indent.width(), + in_whitespace: false, + finished: false, + } + } + + fn create_result_line(&mut self, wrapper: &Wrapper<'a, S>) -> Cow<'a, str> { + if self.is_next_first { + self.is_next_first = false; + Cow::from(wrapper.initial_indent) + } else { + Cow::from(wrapper.subsequent_indent) + } + } + + fn impl_next(&mut self, wrapper: &Wrapper<'a, S>) -> Option> { + if self.finished { + return None; + } + + while let Some((idx, ch)) = self.char_indices.next() { + let char_width = ch.width().unwrap_or(0); + let char_len = ch.len_utf8(); + if ch.is_whitespace() && ch != NBSP { + // Extend the previous split or create a new one. + if self.in_whitespace { + self.split_len += char_len; + } else { + self.split = idx; + self.split_len = char_len; + } + self.line_width_at_split = self.line_width + char_width; + self.in_whitespace = true; + } else if self.line_width + char_width > wrapper.width { + // There is no room for this character on the current + // line. Try to split the final word. + let remaining_text = &self.source[self.split + self.split_len..]; + let final_word = match remaining_text + .find(|ch: char| ch.is_whitespace() && ch != NBSP) { + Some(i) => &remaining_text[..i], + None => remaining_text, + }; + + let mut hyphen = ""; + let splits = wrapper.splitter.split(final_word); + for &(head, hyp, _) in splits.iter().rev() { + if self.line_width_at_split + head.width() + hyp.width() <= wrapper.width { + self.split += head.len(); + self.split_len = 0; + hyphen = hyp; + break; + } + } + + if self.start >= self.split { + // The word is too big to fit on a single line, so we + // need to split it at the current index. + if wrapper.break_words { + // Break work at current index. + self.split = idx; + self.split_len = 0; + self.line_width_at_split = self.line_width; + } else { + // Add smallest split. + self.split = self.start + splits[0].0.len(); + self.split_len = 0; + self.line_width_at_split = self.line_width; + } + } + + if self.start < self.split { + let mut result_line = self.create_result_line(wrapper); + cow_add_assign(&mut result_line, &self.source[self.start..self.split]); + cow_add_assign(&mut result_line, hyphen); + + self.start = self.split + self.split_len; + self.line_width += wrapper.subsequent_indent.width(); + self.line_width -= self.line_width_at_split; + self.line_width += char_width; + + return Some(result_line); + } + } else { + self.in_whitespace = false; + } + self.line_width += char_width; + } + + // Add final line. + let final_line = if self.start < self.source.len() { + let mut result_line = self.create_result_line(wrapper); + cow_add_assign(&mut result_line, &self.source[self.start..]); + + Some(result_line) + } else { + None + }; + + self.finished = true; + + final_line + } +} + + +/// Return the current terminal width. If the terminal width cannot be +/// determined (typically because the standard output is not connected +/// to a terminal), a default width of 80 characters will be used. +/// +/// # Examples +/// +/// Create a `Wrapper` for the current terminal with a two column +/// margin: +/// +/// ```no_run +/// # #![allow(unused_variables)] +/// use textwrap::{Wrapper, NoHyphenation, termwidth}; +/// +/// let width = termwidth() - 4; // Two columns on each side. +/// let wrapper = Wrapper::with_splitter(width, NoHyphenation) +/// .initial_indent(" ") +/// .subsequent_indent(" "); +/// ``` +#[cfg(feature = "term_size")] +pub fn termwidth() -> usize { + term_size::dimensions_stdout().map_or(80, |(w, _)| w) +} + +/// Fill a line of text at `width` characters. Strings are wrapped +/// based on their displayed width, not their size in bytes. +/// +/// The result is a string with newlines between each line. Use +/// [`wrap`] if you need access to the individual lines or +/// [`wrap_iter`] for its iterator counterpart. +/// +/// ``` +/// use textwrap::fill; +/// +/// assert_eq!(fill("Memory safety without garbage collection.", 15), +/// "Memory safety\nwithout garbage\ncollection."); +/// ``` +/// +/// This function creates a Wrapper on the fly with default settings. +/// If you need to set a language corpus for automatic hyphenation, or +/// need to fill many strings, then it is suggested to create a Wrapper +/// and call its [`fill` method]. +/// +/// [`wrap`]: fn.wrap.html +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`fill` method]: struct.Wrapper.html#method.fill +pub fn fill(s: &str, width: usize) -> String { + Wrapper::new(width).fill(s) +} + +/// Wrap a line of text at `width` characters. Strings are wrapped +/// based on their displayed width, not their size in bytes. +/// +/// This function creates a Wrapper on the fly with default settings. +/// If you need to set a language corpus for automatic hyphenation, or +/// need to wrap many strings, then it is suggested to create a Wrapper +/// and call its [`wrap` method]. +/// +/// The result is a vector of strings. Use [`wrap_iter`] if you need an +/// iterator version. +/// +/// # Examples +/// +/// ``` +/// use textwrap::wrap; +/// +/// assert_eq!(wrap("Concurrency without data races.", 15), +/// vec!["Concurrency", +/// "without data", +/// "races."]); +/// +/// assert_eq!(wrap("Concurrency without data races.", 20), +/// vec!["Concurrency without", +/// "data races."]); +/// ``` +/// +/// [`wrap_iter`]: fn.wrap_iter.html +/// [`wrap` method]: struct.Wrapper.html#method.wrap +pub fn wrap(s: &str, width: usize) -> Vec> { + Wrapper::new(width).wrap(s) +} + +/// Lazily wrap a line of text at `self.width` characters. Strings are +/// wrapped based on their displayed width, not their size in bytes. +/// +/// This function creates a Wrapper on the fly with default settings. +/// It then calls the [`into_wrap_iter`] method. Hence, the return +/// value is an [`IntoWrapIter`], not a [`WrapIter`] as the function +/// name would otherwise suggest. +/// +/// If you need to set a language corpus for automatic hyphenation, or +/// need to wrap many strings, then it is suggested to create a Wrapper +/// and call its [`wrap_iter`] or [`into_wrap_iter`] methods. +/// +/// # Examples +/// +/// ``` +/// use std::borrow::Cow; +/// use textwrap::wrap_iter; +/// +/// let mut wrap20_iter = wrap_iter("Zero-cost abstractions.", 20); +/// assert_eq!(wrap20_iter.next(), Some(Cow::from("Zero-cost"))); +/// assert_eq!(wrap20_iter.next(), Some(Cow::from("abstractions."))); +/// assert_eq!(wrap20_iter.next(), None); +/// +/// let mut wrap25_iter = wrap_iter("Zero-cost abstractions.", 25); +/// assert_eq!(wrap25_iter.next(), Some(Cow::from("Zero-cost abstractions."))); +/// assert_eq!(wrap25_iter.next(), None); +/// ``` +/// +/// [`wrap_iter`]: struct.Wrapper.html#method.wrap_iter +/// [`into_wrap_iter`]: struct.Wrapper.html#method.into_wrap_iter +/// [`IntoWrapIter`]: struct.IntoWrapIter.html +/// [`WrapIter`]: struct.WrapIter.html +pub fn wrap_iter(s: &str, width: usize) -> IntoWrapIter { + Wrapper::new(width).into_wrap_iter(s) +} + +/// Add prefix to each non-empty line. +/// +/// ``` +/// use textwrap::indent; +/// +/// assert_eq!(indent("Foo\nBar\n", " "), " Foo\n Bar\n"); +/// ``` +/// +/// Empty lines (lines consisting only of whitespace) are not indented +/// and the whitespace is replaced by a single newline (`\n`): +/// +/// ``` +/// use textwrap::indent; +/// +/// assert_eq!(indent("Foo\n\nBar\n \t \nBaz\n", " "), +/// " Foo\n\n Bar\n\n Baz\n"); +/// ``` +/// +/// Leading and trailing whitespace on non-empty lines is kept +/// unchanged: +/// +/// ``` +/// use textwrap::indent; +/// +/// assert_eq!(indent(" \t Foo ", " "), " \t Foo \n"); +/// ``` +pub fn indent(s: &str, prefix: &str) -> String { + let mut result = String::new(); + for line in s.lines() { + if line.chars().any(|c| !c.is_whitespace()) { + result.push_str(prefix); + result.push_str(line); + } + result.push('\n'); + } + result +} + +/// Removes common leading whitespace from each line. +/// +/// This will look at each non-empty line and determine the maximum +/// amount of whitespace that can be removed from the line. +/// +/// ``` +/// use textwrap::dedent; +/// +/// assert_eq!(dedent(" 1st line\n 2nd line\n"), +/// "1st line\n2nd line\n"); +/// ``` +pub fn dedent(s: &str) -> String { + let mut prefix = String::new(); + let mut lines = s.lines(); + + // We first search for a non-empty line to find a prefix. + for line in &mut lines { + let whitespace = line.chars() + .take_while(|c| c.is_whitespace()) + .collect::(); + // Check if the line had anything but whitespace + if whitespace.len() < line.len() { + prefix = whitespace; + break; + } + } + + // We then continue looking through the remaining lines to + // possibly shorten the prefix. + for line in &mut lines { + let whitespace = line.chars() + .zip(prefix.chars()) + .take_while(|&(a, b)| a == b) + .map(|(_, b)| b) + .collect::(); + // Check if we have found a shorter prefix + if whitespace.len() < prefix.len() { + prefix = whitespace; + } + } + + // We now go over the lines a second time to build the result. + let mut result = String::new(); + for line in s.lines() { + if line.starts_with(&prefix) && line.chars().any(|c| !c.is_whitespace()) { + let (_, tail) = line.split_at(prefix.len()); + result.push_str(tail); + } + result.push('\n'); + } + result +} + +#[cfg(test)] +mod tests { + #[cfg(feature = "hyphenation")] + extern crate hyphenation; + + #[cfg(feature = "hyphenation")] + use hyphenation::Language; + use super::*; + + /// Add newlines. Ensures that the final line in the vector also + /// has a newline. + fn add_nl(lines: &[&str]) -> String { + lines.join("\n") + "\n" + } + + #[test] + fn no_wrap() { + assert_eq!(wrap("foo", 10), vec!["foo"]); + } + + #[test] + fn simple() { + assert_eq!(wrap("foo bar baz", 5), vec!["foo", "bar", "baz"]); + } + + #[test] + fn multi_word_on_line() { + assert_eq!(wrap("foo bar baz", 10), vec!["foo bar", "baz"]); + } + + #[test] + fn long_word() { + assert_eq!(wrap("foo", 0), vec!["f", "o", "o"]); + } + + #[test] + fn long_words() { + assert_eq!(wrap("foo bar", 0), vec!["f", "o", "o", "b", "a", "r"]); + } + + #[test] + fn max_width() { + assert_eq!(wrap("foo bar", usize::max_value()), vec!["foo bar"]); + } + + #[test] + fn leading_whitespace() { + assert_eq!(wrap(" foo bar", 6), vec![" foo", "bar"]); + } + + #[test] + fn trailing_whitespace() { + assert_eq!(wrap("foo bar ", 6), vec!["foo", "bar "]); + } + + #[test] + fn interior_whitespace() { + assert_eq!(wrap("foo: bar baz", 10), vec!["foo: bar", "baz"]); + } + + #[test] + fn extra_whitespace_start_of_line() { + // Whitespace is only significant inside a line. After a line + // gets too long and is broken, the first word starts in + // column zero and is not indented. The line before might end + // up with trailing whitespace. + assert_eq!(wrap("foo bar", 5), vec!["foo", "bar"]); + } + + #[test] + fn wide_character_handling() { + assert_eq!(wrap("Hello, World!", 15), vec!["Hello, World!"]); + assert_eq!(wrap("Hello, World!", 15), + vec!["Hello,", "World!"]); + } + + #[test] + fn indent_empty() { + let wrapper = Wrapper::new(10).initial_indent("!!!"); + assert_eq!(wrapper.fill(""), ""); + } + + #[test] + fn indent_single_line() { + let wrapper = Wrapper::new(10).initial_indent(">>>"); // No trailing space + assert_eq!(wrapper.fill("foo"), ">>>foo"); + } + + #[test] + fn indent_multiple_lines() { + let wrapper = Wrapper::new(6).initial_indent("* ").subsequent_indent(" "); + assert_eq!(wrapper.wrap("foo bar baz"), vec!["* foo", " bar", " baz"]); + } + + #[test] + fn indent_break_words() { + let wrapper = Wrapper::new(5).initial_indent("* ").subsequent_indent(" "); + assert_eq!(wrapper.wrap("foobarbaz"), vec!["* foo", " bar", " baz"]); + } + + #[test] + fn hyphens() { + assert_eq!(wrap("foo-bar", 5), vec!["foo-", "bar"]); + } + + #[test] + fn trailing_hyphen() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.wrap("foobar-"), vec!["foobar-"]); + } + + #[test] + fn multiple_hyphens() { + assert_eq!(wrap("foo-bar-baz", 5), vec!["foo-", "bar-", "baz"]); + } + + #[test] + fn hyphens_flag() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.wrap("The --foo-bar flag."), + vec!["The", "--foo-", "bar", "flag."]); + } + + #[test] + fn repeated_hyphens() { + let wrapper = Wrapper::new(4).break_words(false); + assert_eq!(wrapper.wrap("foo--bar"), vec!["foo--bar"]); + } + + #[test] + fn hyphens_alphanumeric() { + assert_eq!(wrap("Na2-CH4", 5), vec!["Na2-", "CH4"]); + } + + #[test] + fn hyphens_non_alphanumeric() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.wrap("foo(-)bar"), vec!["foo(-)bar"]); + } + + #[test] + fn multiple_splits() { + assert_eq!(wrap("foo-bar-baz", 9), vec!["foo-bar-", "baz"]); + } + + #[test] + fn forced_split() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.wrap("foobar-baz"), vec!["foobar-", "baz"]); + } + + #[test] + fn no_hyphenation() { + let wrapper = Wrapper::with_splitter(8, NoHyphenation); + assert_eq!(wrapper.wrap("foo bar-baz"), vec!["foo", "bar-baz"]); + } + + #[test] + #[cfg(feature = "hyphenation")] + fn auto_hyphenation() { + let corpus = hyphenation::load(Language::English_US).unwrap(); + let wrapper = Wrapper::new(10); + assert_eq!(wrapper.wrap("Internationalization"), + vec!["Internatio", "nalization"]); + + let wrapper = Wrapper::with_splitter(10, corpus); + assert_eq!(wrapper.wrap("Internationalization"), + vec!["Interna-", "tionaliza-", "tion"]); + } + + #[test] + #[cfg(feature = "hyphenation")] + fn borrowed_lines() { + // Lines that end with an extra hyphen are owned, the final + // line is borrowed. + use std::borrow::Cow::{Borrowed, Owned}; + let corpus = hyphenation::load(Language::English_US).unwrap(); + let wrapper = Wrapper::with_splitter(10, corpus); + let lines = wrapper.wrap("Internationalization"); + if let Borrowed(s) = lines[0] { + assert!(false, "should not have been borrowed: {:?}", s); + } + if let Borrowed(s) = lines[1] { + assert!(false, "should not have been borrowed: {:?}", s); + } + if let Owned(ref s) = lines[2] { + assert!(false, "should not have been owned: {:?}", s); + } + } + + #[test] + #[cfg(feature = "hyphenation")] + fn auto_hyphenation_with_hyphen() { + let corpus = hyphenation::load(Language::English_US).unwrap(); + let wrapper = Wrapper::new(8).break_words(false); + assert_eq!(wrapper.wrap("over-caffinated"), vec!["over-", "caffinated"]); + + let wrapper = Wrapper::with_splitter(8, corpus).break_words(false); + assert_eq!(wrapper.wrap("over-caffinated"), + vec!["over-", "caffi-", "nated"]); + } + + #[test] + fn break_words() { + assert_eq!(wrap("foobarbaz", 3), vec!["foo", "bar", "baz"]); + } + + #[test] + fn break_words_wide_characters() { + assert_eq!(wrap("Hello", 5), vec!["He", "ll", "o"]); + } + + #[test] + fn break_words_zero_width() { + assert_eq!(wrap("foobar", 0), vec!["f", "o", "o", "b", "a", "r"]); + } + + #[test] + fn test_non_breaking_space() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.fill("foo bar baz"), "foo bar baz"); + } + + #[test] + fn test_non_breaking_hyphen() { + let wrapper = Wrapper::new(5).break_words(false); + assert_eq!(wrapper.fill("foo‑bar‑baz"), "foo‑bar‑baz"); + } + + #[test] + fn test_fill() { + assert_eq!(fill("foo bar baz", 10), "foo bar\nbaz"); + } + + #[test] + fn test_indent_empty() { + assert_eq!(indent("\n", " "), "\n"); + } + + #[test] + #[cfg_attr(rustfmt, rustfmt_skip)] + fn test_indent_nonempty() { + let x = vec![" foo", + "bar", + " baz"]; + let y = vec!["// foo", + "//bar", + "// baz"]; + assert_eq!(indent(&add_nl(&x), "//"), add_nl(&y)); + } + + #[test] + #[cfg_attr(rustfmt, rustfmt_skip)] + fn test_indent_empty_line() { + let x = vec![" foo", + "bar", + "", + " baz"]; + let y = vec!["// foo", + "//bar", + "", + "// baz"]; + assert_eq!(indent(&add_nl(&x), "//"), add_nl(&y)); + } + + #[test] + fn test_dedent_empty() { + assert_eq!(dedent(""), ""); + } + + #[test] + #[cfg_attr(rustfmt, rustfmt_skip)] + fn test_dedent_multi_line() { + let x = vec![" foo", + " bar", + " baz"]; + let y = vec![" foo", + "bar", + " baz"]; + assert_eq!(dedent(&add_nl(&x)), add_nl(&y)); + } + + #[test] + #[cfg_attr(rustfmt, rustfmt_skip)] + fn test_dedent_empty_line() { + let x = vec![" foo", + " bar", + " ", + " baz"]; + let y = vec![" foo", + "bar", + "", + " baz"]; + assert_eq!(dedent(&add_nl(&x)), add_nl(&y)); + } + + #[test] + #[cfg_attr(rustfmt, rustfmt_skip)] + fn test_dedent_mixed_whitespace() { + let x = vec!["\tfoo", + " bar"]; + let y = vec!["\tfoo", + " bar"]; + assert_eq!(dedent(&add_nl(&x)), add_nl(&y)); + } +} diff --git a/vendor/registry-40351f815f426200/textwrap/tests/version-numbers.rs b/vendor/registry-40351f815f426200/textwrap/tests/version-numbers.rs new file mode 100644 index 000000000..411eea548 --- /dev/null +++ b/vendor/registry-40351f815f426200/textwrap/tests/version-numbers.rs @@ -0,0 +1,12 @@ +#[macro_use] +extern crate version_sync; + +#[test] +fn test_readme_deps() { + assert_markdown_deps_updated!("README.md"); +} + +#[test] +fn test_html_root_url() { + assert_html_root_url_updated!("src/lib.rs"); +} diff --git a/vendor/registry-40351f815f426200/unicode-width/.cargo-checksum.json b/vendor/registry-40351f815f426200/unicode-width/.cargo-checksum.json new file mode 100644 index 000000000..573a196e6 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"3c986dc1e4bf274721f92020fed64b0314ac8f3e0149ca4ae72c8694935d0482","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"03829a3c35812ff0bbf047fd156bde5f7d5cc55b5dd67c0a95ede6009f8b5f11","scripts/unicode.py":"ba4b17f8715364e2a06e28f26c46a840757891716a835fce1663370c774dc570","src/lib.rs":"38c44436eac069bd8d11203f31ecfef8adfe92da1fce19ba00bdd25aa3fbbe20","src/tables.rs":"2f8eaf78bdab8e67108211c2617a3ea96d0eed259f9bdd9d78814af00601d32c","src/tests.rs":"b8ca0b224a70f0c12ae5f533c25f8ee1c6a445a6e615d64027f486b8e100f7f2"},"package":"882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/unicode-width/COPYRIGHT b/vendor/registry-40351f815f426200/unicode-width/COPYRIGHT new file mode 100644 index 000000000..b286ec16a --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/COPYRIGHT @@ -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. diff --git a/vendor/registry-40351f815f426200/unicode-width/Cargo.toml b/vendor/registry-40351f815f426200/unicode-width/Cargo.toml new file mode 100644 index 000000000..0b15c461c --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/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 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 = "unicode-width" +version = "0.1.5" +authors = ["kwantam "] +exclude = ["target/*", "Cargo.lock"] +description = "Determine displayed width of `char` and `str` types\naccording to Unicode Standard Annex #11 rules.\n" +homepage = "https://github.com/unicode-rs/unicode-width" +documentation = "https://unicode-rs.github.io/unicode-width" +readme = "README.md" +keywords = ["text", "width", "unicode"] +license = "MIT/Apache-2.0" +repository = "https://github.com/unicode-rs/unicode-width" + +[features] +bench = [] +default = [] +no_std = [] diff --git a/vendor/registry-40351f815f426200/unicode-width/LICENSE-APACHE b/vendor/registry-40351f815f426200/unicode-width/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/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/vendor/registry-40351f815f426200/unicode-width/LICENSE-MIT b/vendor/registry-40351f815f426200/unicode-width/LICENSE-MIT new file mode 100644 index 000000000..e69282e38 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 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/vendor/registry-40351f815f426200/unicode-width/README.md b/vendor/registry-40351f815f426200/unicode-width/README.md new file mode 100644 index 000000000..53a096d77 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/README.md @@ -0,0 +1,39 @@ +# unicode-width + +Determine displayed width of `char` and `str` types according to +[Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) +rules. + +[![Build Status](https://travis-ci.org/unicode-rs/unicode-width.svg)](https://travis-ci.org/unicode-rs/unicode-width) + +[Documentation](https://unicode-rs.github.io/unicode-width/unicode_width/index.html) + +```rust +extern crate unicode_width; + +use unicode_width::UnicodeWidthStr; + +fn main() { + let teststr = "Hello, world!"; + let width = UnicodeWidthStr::width(teststr); + println!("{}", teststr); + println!("The above string is {} columns wide.", width); + let width = teststr.width_cjk(); + println!("The above string is {} columns wide (CJK).", width); +} +``` + +## features + +unicode-width does not depend on libstd, so it can be used in crates +with the `#![no_std]` attribute. + +## crates.io + +You can use this package in your project by adding the following +to your `Cargo.toml`: + +```toml +[dependencies] +unicode-width = "0.1.5" +``` diff --git a/vendor/registry-40351f815f426200/unicode-width/scripts/unicode.py b/vendor/registry-40351f815f426200/unicode-width/scripts/unicode.py new file mode 100755 index 000000000..203e16afa --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/scripts/unicode.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# +# Copyright 2011-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. + +# This script uses the following Unicode tables: +# - EastAsianWidth.txt +# - ReadMe.txt +# - UnicodeData.txt +# +# Since this should not require frequent updates, we just store this +# out-of-line and check the unicode.rs file into git. + +import fileinput, re, os, sys, operator + +preamble = '''// Copyright 2012-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. + +// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly + +#![allow(missing_docs, non_upper_case_globals, non_snake_case)] +''' + +# Mapping taken from Table 12 from: +# http://www.unicode.org/reports/tr44/#General_Category_Values +expanded_categories = { + 'Lu': ['LC', 'L'], 'Ll': ['LC', 'L'], 'Lt': ['LC', 'L'], + 'Lm': ['L'], 'Lo': ['L'], + 'Mn': ['M'], 'Mc': ['M'], 'Me': ['M'], + 'Nd': ['N'], 'Nl': ['N'], 'No': ['No'], + 'Pc': ['P'], 'Pd': ['P'], 'Ps': ['P'], 'Pe': ['P'], + 'Pi': ['P'], 'Pf': ['P'], 'Po': ['P'], + 'Sm': ['S'], 'Sc': ['S'], 'Sk': ['S'], 'So': ['S'], + 'Zs': ['Z'], 'Zl': ['Z'], 'Zp': ['Z'], + 'Cc': ['C'], 'Cf': ['C'], 'Cs': ['C'], 'Co': ['C'], 'Cn': ['C'], +} + +# these are the surrogate codepoints, which are not valid rust characters +surrogate_codepoints = (0xd800, 0xdfff) + +def fetch(f): + if not os.path.exists(os.path.basename(f)): + os.system("curl -O http://www.unicode.org/Public/UNIDATA/%s" + % f) + + if not os.path.exists(os.path.basename(f)): + sys.stderr.write("cannot load %s" % f) + exit(1) + +def is_surrogate(n): + return surrogate_codepoints[0] <= n <= surrogate_codepoints[1] + +def load_unicode_data(f): + fetch(f) + gencats = {} + + udict = {}; + range_start = -1; + for line in fileinput.input(f): + data = line.split(';'); + if len(data) != 15: + continue + cp = int(data[0], 16); + if is_surrogate(cp): + continue + if range_start >= 0: + for i in xrange(range_start, cp): + udict[i] = data; + range_start = -1; + if data[1].endswith(", First>"): + range_start = cp; + continue; + udict[cp] = data; + + for code in udict: + [code_org, name, gencat, combine, bidi, + decomp, deci, digit, num, mirror, + old, iso, upcase, lowcase, titlecase ] = udict[code]; + + # place letter in categories as appropriate + for cat in [gencat, "Assigned"] + expanded_categories.get(gencat, []): + if cat not in gencats: + gencats[cat] = [] + gencats[cat].append(code) + + gencats = group_cats(gencats) + + return gencats + +def group_cats(cats): + cats_out = {} + for cat in cats: + cats_out[cat] = group_cat(cats[cat]) + return cats_out + +def group_cat(cat): + cat_out = [] + letters = sorted(set(cat)) + cur_start = letters.pop(0) + cur_end = cur_start + for letter in letters: + assert letter > cur_end, \ + "cur_end: %s, letter: %s" % (hex(cur_end), hex(letter)) + if letter == cur_end + 1: + cur_end = letter + else: + cat_out.append((cur_start, cur_end)) + cur_start = cur_end = letter + cat_out.append((cur_start, cur_end)) + return cat_out + +def format_table_content(f, content, indent): + line = " "*indent + first = True + for chunk in content.split(","): + if len(line) + len(chunk) < 98: + if first: + line += chunk + else: + line += ", " + chunk + first = False + else: + f.write(line + ",\n") + line = " "*indent + chunk + f.write(line) + +# load all widths of want_widths, except those in except_cats +def load_east_asian_width(want_widths, except_cats): + f = "EastAsianWidth.txt" + fetch(f) + widths = {} + re1 = re.compile("^([0-9A-F]+);(\w+) +# (\w+)") + re2 = re.compile("^([0-9A-F]+)\.\.([0-9A-F]+);(\w+) +# (\w+)") + + for line in fileinput.input(f): + width = None + d_lo = 0 + d_hi = 0 + cat = None + m = re1.match(line) + if m: + d_lo = m.group(1) + d_hi = m.group(1) + width = m.group(2) + cat = m.group(3) + else: + m = re2.match(line) + if m: + d_lo = m.group(1) + d_hi = m.group(2) + width = m.group(3) + cat = m.group(4) + else: + continue + if cat in except_cats or width not in want_widths: + continue + d_lo = int(d_lo, 16) + d_hi = int(d_hi, 16) + if width not in widths: + widths[width] = [] + widths[width].append((d_lo, d_hi)) + return widths + +def escape_char(c): + return "'\\u{%x}'" % c + +def emit_table(f, name, t_data, t_type = "&'static [(char, char)]", is_pub=True, + pfun=lambda x: "(%s,%s)" % (escape_char(x[0]), escape_char(x[1])), is_const=True): + pub_string = "const" + if not is_const: + pub_string = "let" + if is_pub: + pub_string = "pub " + pub_string + f.write(" %s %s: %s = &[\n" % (pub_string, name, t_type)) + data = "" + first = True + for dat in t_data: + if not first: + data += "," + first = False + data += pfun(dat) + format_table_content(f, data, 8) + f.write("\n ];\n\n") + +def emit_charwidth_module(f, width_table): + f.write("pub mod charwidth {") + f.write(""" + use core::option::Option::{self, Some, None}; + use core::result::Result::{Ok, Err}; + + #[inline] + fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 { + use core::cmp::Ordering::{Equal, Less, Greater}; + match r.binary_search_by(|&(lo, hi, _, _)| { + if lo <= c && c <= hi { Equal } + else if hi < c { Less } + else { Greater } + }) { + Ok(idx) => { + let (_, _, r_ncjk, r_cjk) = r[idx]; + if is_cjk { r_cjk } else { r_ncjk } + } + Err(_) => 1 + } + } +""") + + f.write(""" + #[inline] + pub fn width(c: char, is_cjk: bool) -> Option { + match c as usize { + _c @ 0 => Some(0), // null is zero width + cu if cu < 0x20 => None, // control sequences have no width + cu if cu < 0x7F => Some(1), // ASCII + cu if cu < 0xA0 => None, // more control sequences + _ => Some(bsearch_range_value_table(c, is_cjk, charwidth_table) as usize) + } + } + +""") + + f.write(" // character width table. Based on Markus Kuhn's free wcwidth() implementation,\n") + f.write(" // http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c\n") + emit_table(f, "charwidth_table", width_table, "&'static [(char, char, u8, u8)]", is_pub=False, + pfun=lambda x: "(%s,%s,%s,%s)" % (escape_char(x[0]), escape_char(x[1]), x[2], x[3])) + f.write("}\n\n") + +def remove_from_wtable(wtable, val): + wtable_out = [] + while wtable: + if wtable[0][1] < val: + wtable_out.append(wtable.pop(0)) + elif wtable[0][0] > val: + break + else: + (wt_lo, wt_hi, width, width_cjk) = wtable.pop(0) + if wt_lo == wt_hi == val: + continue + elif wt_lo == val: + wtable_out.append((wt_lo+1, wt_hi, width, width_cjk)) + elif wt_hi == val: + wtable_out.append((wt_lo, wt_hi-1, width, width_cjk)) + else: + wtable_out.append((wt_lo, val-1, width, width_cjk)) + wtable_out.append((val+1, wt_hi, width, width_cjk)) + if wtable: + wtable_out.extend(wtable) + return wtable_out + + + +def optimize_width_table(wtable): + wtable_out = [] + w_this = wtable.pop(0) + while wtable: + if w_this[1] == wtable[0][0] - 1 and w_this[2:3] == wtable[0][2:3]: + w_tmp = wtable.pop(0) + w_this = (w_this[0], w_tmp[1], w_tmp[2], w_tmp[3]) + else: + wtable_out.append(w_this) + w_this = wtable.pop(0) + wtable_out.append(w_this) + return wtable_out + +if __name__ == "__main__": + r = "tables.rs" + if os.path.exists(r): + os.remove(r) + with open(r, "w") as rf: + # write the file's preamble + rf.write(preamble) + + # download and parse all the data + fetch("ReadMe.txt") + with open("ReadMe.txt") as readme: + pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode" + unicode_version = re.search(pattern, readme.read()).groups() + rf.write(""" +/// The version of [Unicode](http://www.unicode.org/) +/// that this version of unicode-width is based on. +pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s); + +""" % unicode_version) + gencats = load_unicode_data("UnicodeData.txt") + + ### character width module + width_table = [] + for zwcat in ["Me", "Mn", "Cf"]: + width_table.extend(map(lambda (lo, hi): (lo, hi, 0, 0), gencats[zwcat])) + width_table.append((4448, 4607, 0, 0)) + + # get widths, except those that are explicitly marked zero-width above + ea_widths = load_east_asian_width(["W", "F", "A"], ["Me", "Mn", "Cf"]) + # these are doublewidth + for dwcat in ["W", "F"]: + width_table.extend(map(lambda (lo, hi): (lo, hi, 2, 2), ea_widths[dwcat])) + width_table.extend(map(lambda (lo, hi): (lo, hi, 1, 2), ea_widths["A"])) + + width_table.sort(key=lambda w: w[0]) + + # soft hyphen is not zero width in preformatted text; it's used to indicate + # a hyphen inserted to facilitate a linebreak. + width_table = remove_from_wtable(width_table, 173) + + # optimize the width table by collapsing adjacent entities when possible + width_table = optimize_width_table(width_table) + emit_charwidth_module(rf, width_table) diff --git a/vendor/registry-40351f815f426200/unicode-width/src/lib.rs b/vendor/registry-40351f815f426200/unicode-width/src/lib.rs new file mode 100644 index 000000000..1ee35c85d --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/src/lib.rs @@ -0,0 +1,131 @@ +// Copyright 2012-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. + +//! Determine displayed width of `char` and `str` types according to +//! [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) +//! rules. +//! +//! ```rust +//! extern crate unicode_width; +//! +//! use unicode_width::UnicodeWidthStr; +//! +//! fn main() { +//! let teststr = "Hello, world!"; +//! let width = UnicodeWidthStr::width(teststr); +//! println!("{}", teststr); +//! println!("The above string is {} columns wide.", width); +//! let width = teststr.width_cjk(); +//! println!("The above string is {} columns wide (CJK).", width); +//! } +//! ``` +//! +//! # features +//! +//! unicode-width supports a `no_std` feature. This eliminates dependence +//! on std, and instead uses equivalent functions from core. +//! +//! # crates.io +//! +//! You can use this package in your project by adding the following +//! to your `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! unicode-width = "0.1.5" +//! ``` + +#![deny(missing_docs, unsafe_code)] +#![doc(html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png", + html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png")] + +#![cfg_attr(feature = "bench", feature(test))] +#![no_std] + +#[cfg(test)] +#[macro_use] +extern crate std; + +#[cfg(feature = "bench")] +extern crate test; + +use tables::charwidth as cw; +pub use tables::UNICODE_VERSION; + +use core::ops::Add; + +mod tables; + +#[cfg(test)] +mod tests; + +/// Methods for determining displayed width of Unicode characters. +pub trait UnicodeWidthChar { + /// Returns the character's displayed width in columns, or `None` if the + /// character is a control character other than `'\x00'`. + /// + /// This function treats characters in the Ambiguous category according + /// to [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) + /// as 1 column wide. This is consistent with the recommendations for non-CJK + /// contexts, or when the context cannot be reliably determined. + fn width(self) -> Option; + + /// Returns the character's displayed width in columns, or `None` if the + /// character is a control character other than `'\x00'`. + /// + /// This function treats characters in the Ambiguous category according + /// to [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) + /// as 2 columns wide. This is consistent with the recommendations for + /// CJK contexts. + fn width_cjk(self) -> Option; +} + +impl UnicodeWidthChar for char { + #[inline] + fn width(self) -> Option { cw::width(self, false) } + + #[inline] + fn width_cjk(self) -> Option { cw::width(self, true) } +} + +/// Methods for determining displayed width of Unicode strings. +pub trait UnicodeWidthStr { + /// Returns the string's displayed width in columns. + /// + /// Control characters are treated as having zero width. + /// + /// This function treats characters in the Ambiguous category according + /// to [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) + /// as 1 column wide. This is consistent with the recommendations for + /// non-CJK contexts, or when the context cannot be reliably determined. + fn width<'a>(&'a self) -> usize; + + /// Returns the string's displayed width in columns. + /// + /// Control characters are treated as having zero width. + /// + /// This function treats characters in the Ambiguous category according + /// to [Unicode Standard Annex #11](http://www.unicode.org/reports/tr11/) + /// as 2 column wide. This is consistent with the recommendations for + /// CJK contexts. + fn width_cjk<'a>(&'a self) -> usize; +} + +impl UnicodeWidthStr for str { + #[inline] + fn width(&self) -> usize { + self.chars().map(|c| cw::width(c, false).unwrap_or(0)).fold(0, Add::add) + } + + #[inline] + fn width_cjk(&self) -> usize { + self.chars().map(|c| cw::width(c, true).unwrap_or(0)).fold(0, Add::add) + } +} diff --git a/vendor/registry-40351f815f426200/unicode-width/src/tables.rs b/vendor/registry-40351f815f426200/unicode-width/src/tables.rs new file mode 100644 index 000000000..3acb93212 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/src/tables.rs @@ -0,0 +1,273 @@ +// Copyright 2012-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. + +// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly + +#![allow(missing_docs, non_upper_case_globals, non_snake_case)] + +/// The version of [Unicode](http://www.unicode.org/) +/// that this version of unicode-width is based on. +pub const UNICODE_VERSION: (u64, u64, u64) = (10, 0, 0); + +pub mod charwidth { + use core::option::Option::{self, Some, None}; + use core::result::Result::{Ok, Err}; + + #[inline] + fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 { + use core::cmp::Ordering::{Equal, Less, Greater}; + match r.binary_search_by(|&(lo, hi, _, _)| { + if lo <= c && c <= hi { Equal } + else if hi < c { Less } + else { Greater } + }) { + Ok(idx) => { + let (_, _, r_ncjk, r_cjk) = r[idx]; + if is_cjk { r_cjk } else { r_ncjk } + } + Err(_) => 1 + } + } + + #[inline] + pub fn width(c: char, is_cjk: bool) -> Option { + match c as usize { + _c @ 0 => Some(0), // null is zero width + cu if cu < 0x20 => None, // control sequences have no width + cu if cu < 0x7F => Some(1), // ASCII + cu if cu < 0xA0 => None, // more control sequences + _ => Some(bsearch_range_value_table(c, is_cjk, charwidth_table) as usize) + } + } + + // character width table. Based on Markus Kuhn's free wcwidth() implementation, + // http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + const charwidth_table: &'static [(char, char, u8, u8)] = &[ + ('\u{a1}', '\u{a1}', 1, 2), ('\u{a4}', '\u{a4}', 1, 2), ('\u{a7}', '\u{a8}', 1, 2), + ('\u{aa}', '\u{aa}', 1, 2), ('\u{ae}', '\u{ae}', 1, 2), ('\u{b0}', '\u{b4}', 1, 2), + ('\u{b6}', '\u{ba}', 1, 2), ('\u{bc}', '\u{bf}', 1, 2), ('\u{c6}', '\u{c6}', 1, 2), + ('\u{d0}', '\u{d0}', 1, 2), ('\u{d7}', '\u{d8}', 1, 2), ('\u{de}', '\u{e1}', 1, 2), + ('\u{e6}', '\u{e6}', 1, 2), ('\u{e8}', '\u{ea}', 1, 2), ('\u{ec}', '\u{ed}', 1, 2), + ('\u{f0}', '\u{f0}', 1, 2), ('\u{f2}', '\u{f3}', 1, 2), ('\u{f7}', '\u{fa}', 1, 2), + ('\u{fc}', '\u{fc}', 1, 2), ('\u{fe}', '\u{fe}', 1, 2), ('\u{101}', '\u{101}', 1, 2), + ('\u{111}', '\u{111}', 1, 2), ('\u{113}', '\u{113}', 1, 2), ('\u{11b}', '\u{11b}', 1, 2), + ('\u{126}', '\u{127}', 1, 2), ('\u{12b}', '\u{12b}', 1, 2), ('\u{131}', '\u{133}', 1, 2), + ('\u{138}', '\u{138}', 1, 2), ('\u{13f}', '\u{142}', 1, 2), ('\u{144}', '\u{144}', 1, 2), + ('\u{148}', '\u{14b}', 1, 2), ('\u{14d}', '\u{14d}', 1, 2), ('\u{152}', '\u{153}', 1, 2), + ('\u{166}', '\u{167}', 1, 2), ('\u{16b}', '\u{16b}', 1, 2), ('\u{1ce}', '\u{1ce}', 1, 2), + ('\u{1d0}', '\u{1d0}', 1, 2), ('\u{1d2}', '\u{1d2}', 1, 2), ('\u{1d4}', '\u{1d4}', 1, 2), + ('\u{1d6}', '\u{1d6}', 1, 2), ('\u{1d8}', '\u{1d8}', 1, 2), ('\u{1da}', '\u{1da}', 1, 2), + ('\u{1dc}', '\u{1dc}', 1, 2), ('\u{251}', '\u{251}', 1, 2), ('\u{261}', '\u{261}', 1, 2), + ('\u{2c4}', '\u{2c4}', 1, 2), ('\u{2c7}', '\u{2c7}', 1, 2), ('\u{2c9}', '\u{2cb}', 1, 2), + ('\u{2cd}', '\u{2cd}', 1, 2), ('\u{2d0}', '\u{2d0}', 1, 2), ('\u{2d8}', '\u{2db}', 1, 2), + ('\u{2dd}', '\u{2dd}', 1, 2), ('\u{2df}', '\u{2df}', 1, 2), ('\u{300}', '\u{36f}', 0, 0), + ('\u{391}', '\u{3a1}', 1, 2), ('\u{3a3}', '\u{3a9}', 1, 2), ('\u{3b1}', '\u{3c1}', 1, 2), + ('\u{3c3}', '\u{3c9}', 1, 2), ('\u{401}', '\u{401}', 1, 2), ('\u{410}', '\u{44f}', 1, 2), + ('\u{451}', '\u{451}', 1, 2), ('\u{483}', '\u{489}', 0, 0), ('\u{591}', '\u{5bd}', 0, 0), + ('\u{5bf}', '\u{5bf}', 0, 0), ('\u{5c1}', '\u{5c2}', 0, 0), ('\u{5c4}', '\u{5c5}', 0, 0), + ('\u{5c7}', '\u{5c7}', 0, 0), ('\u{600}', '\u{605}', 0, 0), ('\u{610}', '\u{61a}', 0, 0), + ('\u{61c}', '\u{61c}', 0, 0), ('\u{64b}', '\u{65f}', 0, 0), ('\u{670}', '\u{670}', 0, 0), + ('\u{6d6}', '\u{6dd}', 0, 0), ('\u{6df}', '\u{6e4}', 0, 0), ('\u{6e7}', '\u{6e8}', 0, 0), + ('\u{6ea}', '\u{6ed}', 0, 0), ('\u{70f}', '\u{70f}', 0, 0), ('\u{711}', '\u{711}', 0, 0), + ('\u{730}', '\u{74a}', 0, 0), ('\u{7a6}', '\u{7b0}', 0, 0), ('\u{7eb}', '\u{7f3}', 0, 0), + ('\u{816}', '\u{819}', 0, 0), ('\u{81b}', '\u{823}', 0, 0), ('\u{825}', '\u{827}', 0, 0), + ('\u{829}', '\u{82d}', 0, 0), ('\u{859}', '\u{85b}', 0, 0), ('\u{8d4}', '\u{902}', 0, 0), + ('\u{93a}', '\u{93a}', 0, 0), ('\u{93c}', '\u{93c}', 0, 0), ('\u{941}', '\u{948}', 0, 0), + ('\u{94d}', '\u{94d}', 0, 0), ('\u{951}', '\u{957}', 0, 0), ('\u{962}', '\u{963}', 0, 0), + ('\u{981}', '\u{981}', 0, 0), ('\u{9bc}', '\u{9bc}', 0, 0), ('\u{9c1}', '\u{9c4}', 0, 0), + ('\u{9cd}', '\u{9cd}', 0, 0), ('\u{9e2}', '\u{9e3}', 0, 0), ('\u{a01}', '\u{a02}', 0, 0), + ('\u{a3c}', '\u{a3c}', 0, 0), ('\u{a41}', '\u{a42}', 0, 0), ('\u{a47}', '\u{a48}', 0, 0), + ('\u{a4b}', '\u{a4d}', 0, 0), ('\u{a51}', '\u{a51}', 0, 0), ('\u{a70}', '\u{a71}', 0, 0), + ('\u{a75}', '\u{a75}', 0, 0), ('\u{a81}', '\u{a82}', 0, 0), ('\u{abc}', '\u{abc}', 0, 0), + ('\u{ac1}', '\u{ac5}', 0, 0), ('\u{ac7}', '\u{ac8}', 0, 0), ('\u{acd}', '\u{acd}', 0, 0), + ('\u{ae2}', '\u{ae3}', 0, 0), ('\u{afa}', '\u{aff}', 0, 0), ('\u{b01}', '\u{b01}', 0, 0), + ('\u{b3c}', '\u{b3c}', 0, 0), ('\u{b3f}', '\u{b3f}', 0, 0), ('\u{b41}', '\u{b44}', 0, 0), + ('\u{b4d}', '\u{b4d}', 0, 0), ('\u{b56}', '\u{b56}', 0, 0), ('\u{b62}', '\u{b63}', 0, 0), + ('\u{b82}', '\u{b82}', 0, 0), ('\u{bc0}', '\u{bc0}', 0, 0), ('\u{bcd}', '\u{bcd}', 0, 0), + ('\u{c00}', '\u{c00}', 0, 0), ('\u{c3e}', '\u{c40}', 0, 0), ('\u{c46}', '\u{c48}', 0, 0), + ('\u{c4a}', '\u{c4d}', 0, 0), ('\u{c55}', '\u{c56}', 0, 0), ('\u{c62}', '\u{c63}', 0, 0), + ('\u{c81}', '\u{c81}', 0, 0), ('\u{cbc}', '\u{cbc}', 0, 0), ('\u{cbf}', '\u{cbf}', 0, 0), + ('\u{cc6}', '\u{cc6}', 0, 0), ('\u{ccc}', '\u{ccd}', 0, 0), ('\u{ce2}', '\u{ce3}', 0, 0), + ('\u{d00}', '\u{d01}', 0, 0), ('\u{d3b}', '\u{d3c}', 0, 0), ('\u{d41}', '\u{d44}', 0, 0), + ('\u{d4d}', '\u{d4d}', 0, 0), ('\u{d62}', '\u{d63}', 0, 0), ('\u{dca}', '\u{dca}', 0, 0), + ('\u{dd2}', '\u{dd4}', 0, 0), ('\u{dd6}', '\u{dd6}', 0, 0), ('\u{e31}', '\u{e31}', 0, 0), + ('\u{e34}', '\u{e3a}', 0, 0), ('\u{e47}', '\u{e4e}', 0, 0), ('\u{eb1}', '\u{eb1}', 0, 0), + ('\u{eb4}', '\u{eb9}', 0, 0), ('\u{ebb}', '\u{ebc}', 0, 0), ('\u{ec8}', '\u{ecd}', 0, 0), + ('\u{f18}', '\u{f19}', 0, 0), ('\u{f35}', '\u{f35}', 0, 0), ('\u{f37}', '\u{f37}', 0, 0), + ('\u{f39}', '\u{f39}', 0, 0), ('\u{f71}', '\u{f7e}', 0, 0), ('\u{f80}', '\u{f84}', 0, 0), + ('\u{f86}', '\u{f87}', 0, 0), ('\u{f8d}', '\u{f97}', 0, 0), ('\u{f99}', '\u{fbc}', 0, 0), + ('\u{fc6}', '\u{fc6}', 0, 0), ('\u{102d}', '\u{1030}', 0, 0), ('\u{1032}', '\u{1037}', 0, + 0), ('\u{1039}', '\u{103a}', 0, 0), ('\u{103d}', '\u{103e}', 0, 0), ('\u{1058}', '\u{1059}', + 0, 0), ('\u{105e}', '\u{1060}', 0, 0), ('\u{1071}', '\u{1074}', 0, 0), ('\u{1082}', + '\u{1082}', 0, 0), ('\u{1085}', '\u{1086}', 0, 0), ('\u{108d}', '\u{108d}', 0, 0), + ('\u{109d}', '\u{109d}', 0, 0), ('\u{1100}', '\u{115f}', 2, 2), ('\u{1160}', '\u{11ff}', 0, + 0), ('\u{135d}', '\u{135f}', 0, 0), ('\u{1712}', '\u{1714}', 0, 0), ('\u{1732}', '\u{1734}', + 0, 0), ('\u{1752}', '\u{1753}', 0, 0), ('\u{1772}', '\u{1773}', 0, 0), ('\u{17b4}', + '\u{17b5}', 0, 0), ('\u{17b7}', '\u{17bd}', 0, 0), ('\u{17c6}', '\u{17c6}', 0, 0), + ('\u{17c9}', '\u{17d3}', 0, 0), ('\u{17dd}', '\u{17dd}', 0, 0), ('\u{180b}', '\u{180e}', 0, + 0), ('\u{1885}', '\u{1886}', 0, 0), ('\u{18a9}', '\u{18a9}', 0, 0), ('\u{1920}', '\u{1922}', + 0, 0), ('\u{1927}', '\u{1928}', 0, 0), ('\u{1932}', '\u{1932}', 0, 0), ('\u{1939}', + '\u{193b}', 0, 0), ('\u{1a17}', '\u{1a18}', 0, 0), ('\u{1a1b}', '\u{1a1b}', 0, 0), + ('\u{1a56}', '\u{1a56}', 0, 0), ('\u{1a58}', '\u{1a5e}', 0, 0), ('\u{1a60}', '\u{1a60}', 0, + 0), ('\u{1a62}', '\u{1a62}', 0, 0), ('\u{1a65}', '\u{1a6c}', 0, 0), ('\u{1a73}', '\u{1a7c}', + 0, 0), ('\u{1a7f}', '\u{1a7f}', 0, 0), ('\u{1ab0}', '\u{1abe}', 0, 0), ('\u{1b00}', + '\u{1b03}', 0, 0), ('\u{1b34}', '\u{1b34}', 0, 0), ('\u{1b36}', '\u{1b3a}', 0, 0), + ('\u{1b3c}', '\u{1b3c}', 0, 0), ('\u{1b42}', '\u{1b42}', 0, 0), ('\u{1b6b}', '\u{1b73}', 0, + 0), ('\u{1b80}', '\u{1b81}', 0, 0), ('\u{1ba2}', '\u{1ba5}', 0, 0), ('\u{1ba8}', '\u{1ba9}', + 0, 0), ('\u{1bab}', '\u{1bad}', 0, 0), ('\u{1be6}', '\u{1be6}', 0, 0), ('\u{1be8}', + '\u{1be9}', 0, 0), ('\u{1bed}', '\u{1bed}', 0, 0), ('\u{1bef}', '\u{1bf1}', 0, 0), + ('\u{1c2c}', '\u{1c33}', 0, 0), ('\u{1c36}', '\u{1c37}', 0, 0), ('\u{1cd0}', '\u{1cd2}', 0, + 0), ('\u{1cd4}', '\u{1ce0}', 0, 0), ('\u{1ce2}', '\u{1ce8}', 0, 0), ('\u{1ced}', '\u{1ced}', + 0, 0), ('\u{1cf4}', '\u{1cf4}', 0, 0), ('\u{1cf8}', '\u{1cf9}', 0, 0), ('\u{1dc0}', + '\u{1df9}', 0, 0), ('\u{1dfb}', '\u{1dff}', 0, 0), ('\u{200b}', '\u{200f}', 0, 0), + ('\u{2010}', '\u{2010}', 1, 2), ('\u{2013}', '\u{2016}', 1, 2), ('\u{2018}', '\u{2019}', 1, + 2), ('\u{201c}', '\u{201d}', 1, 2), ('\u{2020}', '\u{2022}', 1, 2), ('\u{2024}', '\u{2027}', + 1, 2), ('\u{202a}', '\u{202e}', 0, 0), ('\u{2030}', '\u{2030}', 1, 2), ('\u{2032}', + '\u{2033}', 1, 2), ('\u{2035}', '\u{2035}', 1, 2), ('\u{203b}', '\u{203b}', 1, 2), + ('\u{203e}', '\u{203e}', 1, 2), ('\u{2060}', '\u{2064}', 0, 0), ('\u{2066}', '\u{206f}', 0, + 0), ('\u{2074}', '\u{2074}', 1, 2), ('\u{207f}', '\u{207f}', 1, 2), ('\u{2081}', '\u{2084}', + 1, 2), ('\u{20ac}', '\u{20ac}', 1, 2), ('\u{20d0}', '\u{20f0}', 0, 0), ('\u{2103}', + '\u{2103}', 1, 2), ('\u{2105}', '\u{2105}', 1, 2), ('\u{2109}', '\u{2109}', 1, 2), + ('\u{2113}', '\u{2113}', 1, 2), ('\u{2116}', '\u{2116}', 1, 2), ('\u{2121}', '\u{2122}', 1, + 2), ('\u{2126}', '\u{2126}', 1, 2), ('\u{212b}', '\u{212b}', 1, 2), ('\u{2153}', '\u{2154}', + 1, 2), ('\u{215b}', '\u{215e}', 1, 2), ('\u{2160}', '\u{216b}', 1, 2), ('\u{2170}', + '\u{2179}', 1, 2), ('\u{2189}', '\u{2189}', 1, 2), ('\u{2190}', '\u{2199}', 1, 2), + ('\u{21b8}', '\u{21b9}', 1, 2), ('\u{21d2}', '\u{21d2}', 1, 2), ('\u{21d4}', '\u{21d4}', 1, + 2), ('\u{21e7}', '\u{21e7}', 1, 2), ('\u{2200}', '\u{2200}', 1, 2), ('\u{2202}', '\u{2203}', + 1, 2), ('\u{2207}', '\u{2208}', 1, 2), ('\u{220b}', '\u{220b}', 1, 2), ('\u{220f}', + '\u{220f}', 1, 2), ('\u{2211}', '\u{2211}', 1, 2), ('\u{2215}', '\u{2215}', 1, 2), + ('\u{221a}', '\u{221a}', 1, 2), ('\u{221d}', '\u{2220}', 1, 2), ('\u{2223}', '\u{2223}', 1, + 2), ('\u{2225}', '\u{2225}', 1, 2), ('\u{2227}', '\u{222c}', 1, 2), ('\u{222e}', '\u{222e}', + 1, 2), ('\u{2234}', '\u{2237}', 1, 2), ('\u{223c}', '\u{223d}', 1, 2), ('\u{2248}', + '\u{2248}', 1, 2), ('\u{224c}', '\u{224c}', 1, 2), ('\u{2252}', '\u{2252}', 1, 2), + ('\u{2260}', '\u{2261}', 1, 2), ('\u{2264}', '\u{2267}', 1, 2), ('\u{226a}', '\u{226b}', 1, + 2), ('\u{226e}', '\u{226f}', 1, 2), ('\u{2282}', '\u{2283}', 1, 2), ('\u{2286}', '\u{2287}', + 1, 2), ('\u{2295}', '\u{2295}', 1, 2), ('\u{2299}', '\u{2299}', 1, 2), ('\u{22a5}', + '\u{22a5}', 1, 2), ('\u{22bf}', '\u{22bf}', 1, 2), ('\u{2312}', '\u{2312}', 1, 2), + ('\u{231a}', '\u{231b}', 2, 2), ('\u{2329}', '\u{232a}', 2, 2), ('\u{23e9}', '\u{23ec}', 2, + 2), ('\u{23f0}', '\u{23f0}', 2, 2), ('\u{23f3}', '\u{23f3}', 2, 2), ('\u{2460}', '\u{24e9}', + 1, 2), ('\u{24eb}', '\u{254b}', 1, 2), ('\u{2550}', '\u{2573}', 1, 2), ('\u{2580}', + '\u{258f}', 1, 2), ('\u{2592}', '\u{2595}', 1, 2), ('\u{25a0}', '\u{25a1}', 1, 2), + ('\u{25a3}', '\u{25a9}', 1, 2), ('\u{25b2}', '\u{25b3}', 1, 2), ('\u{25b6}', '\u{25b7}', 1, + 2), ('\u{25bc}', '\u{25bd}', 1, 2), ('\u{25c0}', '\u{25c1}', 1, 2), ('\u{25c6}', '\u{25c8}', + 1, 2), ('\u{25cb}', '\u{25cb}', 1, 2), ('\u{25ce}', '\u{25d1}', 1, 2), ('\u{25e2}', + '\u{25e5}', 1, 2), ('\u{25ef}', '\u{25ef}', 1, 2), ('\u{25fd}', '\u{25fe}', 2, 2), + ('\u{2605}', '\u{2606}', 1, 2), ('\u{2609}', '\u{2609}', 1, 2), ('\u{260e}', '\u{260f}', 1, + 2), ('\u{2614}', '\u{2615}', 2, 2), ('\u{261c}', '\u{261c}', 1, 2), ('\u{261e}', '\u{261e}', + 1, 2), ('\u{2640}', '\u{2640}', 1, 2), ('\u{2642}', '\u{2642}', 1, 2), ('\u{2648}', + '\u{2653}', 2, 2), ('\u{2660}', '\u{2661}', 1, 2), ('\u{2663}', '\u{2665}', 1, 2), + ('\u{2667}', '\u{266a}', 1, 2), ('\u{266c}', '\u{266d}', 1, 2), ('\u{266f}', '\u{266f}', 1, + 2), ('\u{267f}', '\u{267f}', 2, 2), ('\u{2693}', '\u{2693}', 2, 2), ('\u{269e}', '\u{269f}', + 1, 2), ('\u{26a1}', '\u{26a1}', 2, 2), ('\u{26aa}', '\u{26ab}', 2, 2), ('\u{26bd}', + '\u{26be}', 2, 2), ('\u{26bf}', '\u{26bf}', 1, 2), ('\u{26c4}', '\u{26c5}', 2, 2), + ('\u{26c6}', '\u{26cd}', 1, 2), ('\u{26ce}', '\u{26ce}', 2, 2), ('\u{26cf}', '\u{26d3}', 1, + 2), ('\u{26d4}', '\u{26d4}', 2, 2), ('\u{26d5}', '\u{26e1}', 1, 2), ('\u{26e3}', '\u{26e3}', + 1, 2), ('\u{26e8}', '\u{26e9}', 1, 2), ('\u{26ea}', '\u{26ea}', 2, 2), ('\u{26eb}', + '\u{26f1}', 1, 2), ('\u{26f2}', '\u{26f3}', 2, 2), ('\u{26f4}', '\u{26f4}', 1, 2), + ('\u{26f5}', '\u{26f5}', 2, 2), ('\u{26f6}', '\u{26f9}', 1, 2), ('\u{26fa}', '\u{26fa}', 2, + 2), ('\u{26fb}', '\u{26fc}', 1, 2), ('\u{26fd}', '\u{26fd}', 2, 2), ('\u{26fe}', '\u{26ff}', + 1, 2), ('\u{2705}', '\u{2705}', 2, 2), ('\u{270a}', '\u{270b}', 2, 2), ('\u{2728}', + '\u{2728}', 2, 2), ('\u{273d}', '\u{273d}', 1, 2), ('\u{274c}', '\u{274c}', 2, 2), + ('\u{274e}', '\u{274e}', 2, 2), ('\u{2753}', '\u{2755}', 2, 2), ('\u{2757}', '\u{2757}', 2, + 2), ('\u{2776}', '\u{277f}', 1, 2), ('\u{2795}', '\u{2797}', 2, 2), ('\u{27b0}', '\u{27b0}', + 2, 2), ('\u{27bf}', '\u{27bf}', 2, 2), ('\u{2b1b}', '\u{2b1c}', 2, 2), ('\u{2b50}', + '\u{2b50}', 2, 2), ('\u{2b55}', '\u{2b55}', 2, 2), ('\u{2b56}', '\u{2b59}', 1, 2), + ('\u{2cef}', '\u{2cf1}', 0, 0), ('\u{2d7f}', '\u{2d7f}', 0, 0), ('\u{2de0}', '\u{2dff}', 0, + 0), ('\u{2e80}', '\u{2e99}', 2, 2), ('\u{2e9b}', '\u{2ef3}', 2, 2), ('\u{2f00}', '\u{2fd5}', + 2, 2), ('\u{2ff0}', '\u{2ffb}', 2, 2), ('\u{3000}', '\u{3029}', 2, 2), ('\u{302a}', + '\u{302d}', 0, 0), ('\u{302e}', '\u{303e}', 2, 2), ('\u{3041}', '\u{3096}', 2, 2), + ('\u{3099}', '\u{309a}', 0, 0), ('\u{309b}', '\u{30ff}', 2, 2), ('\u{3105}', '\u{312e}', 2, + 2), ('\u{3131}', '\u{318e}', 2, 2), ('\u{3190}', '\u{31ba}', 2, 2), ('\u{31c0}', '\u{31e3}', + 2, 2), ('\u{31f0}', '\u{321e}', 2, 2), ('\u{3220}', '\u{3247}', 2, 2), ('\u{3248}', + '\u{324f}', 1, 2), ('\u{3250}', '\u{32fe}', 2, 2), ('\u{3300}', '\u{4dbf}', 2, 2), + ('\u{4e00}', '\u{a48c}', 2, 2), ('\u{a490}', '\u{a4c6}', 2, 2), ('\u{a66f}', '\u{a672}', 0, + 0), ('\u{a674}', '\u{a67d}', 0, 0), ('\u{a69e}', '\u{a69f}', 0, 0), ('\u{a6f0}', '\u{a6f1}', + 0, 0), ('\u{a802}', '\u{a802}', 0, 0), ('\u{a806}', '\u{a806}', 0, 0), ('\u{a80b}', + '\u{a80b}', 0, 0), ('\u{a825}', '\u{a826}', 0, 0), ('\u{a8c4}', '\u{a8c5}', 0, 0), + ('\u{a8e0}', '\u{a8f1}', 0, 0), ('\u{a926}', '\u{a92d}', 0, 0), ('\u{a947}', '\u{a951}', 0, + 0), ('\u{a960}', '\u{a97c}', 2, 2), ('\u{a980}', '\u{a982}', 0, 0), ('\u{a9b3}', '\u{a9b3}', + 0, 0), ('\u{a9b6}', '\u{a9b9}', 0, 0), ('\u{a9bc}', '\u{a9bc}', 0, 0), ('\u{a9e5}', + '\u{a9e5}', 0, 0), ('\u{aa29}', '\u{aa2e}', 0, 0), ('\u{aa31}', '\u{aa32}', 0, 0), + ('\u{aa35}', '\u{aa36}', 0, 0), ('\u{aa43}', '\u{aa43}', 0, 0), ('\u{aa4c}', '\u{aa4c}', 0, + 0), ('\u{aa7c}', '\u{aa7c}', 0, 0), ('\u{aab0}', '\u{aab0}', 0, 0), ('\u{aab2}', '\u{aab4}', + 0, 0), ('\u{aab7}', '\u{aab8}', 0, 0), ('\u{aabe}', '\u{aabf}', 0, 0), ('\u{aac1}', + '\u{aac1}', 0, 0), ('\u{aaec}', '\u{aaed}', 0, 0), ('\u{aaf6}', '\u{aaf6}', 0, 0), + ('\u{abe5}', '\u{abe5}', 0, 0), ('\u{abe8}', '\u{abe8}', 0, 0), ('\u{abed}', '\u{abed}', 0, + 0), ('\u{ac00}', '\u{d7a3}', 2, 2), ('\u{e000}', '\u{f8ff}', 1, 2), ('\u{f900}', '\u{faff}', + 2, 2), ('\u{fb1e}', '\u{fb1e}', 0, 0), ('\u{fe00}', '\u{fe0f}', 0, 0), ('\u{fe10}', + '\u{fe19}', 2, 2), ('\u{fe20}', '\u{fe2f}', 0, 0), ('\u{fe30}', '\u{fe52}', 2, 2), + ('\u{fe54}', '\u{fe66}', 2, 2), ('\u{fe68}', '\u{fe6b}', 2, 2), ('\u{feff}', '\u{feff}', 0, + 0), ('\u{ff01}', '\u{ff60}', 2, 2), ('\u{ffe0}', '\u{ffe6}', 2, 2), ('\u{fff9}', '\u{fffb}', + 0, 0), ('\u{fffd}', '\u{fffd}', 1, 2), ('\u{101fd}', '\u{101fd}', 0, 0), ('\u{102e0}', + '\u{102e0}', 0, 0), ('\u{10376}', '\u{1037a}', 0, 0), ('\u{10a01}', '\u{10a03}', 0, 0), + ('\u{10a05}', '\u{10a06}', 0, 0), ('\u{10a0c}', '\u{10a0f}', 0, 0), ('\u{10a38}', + '\u{10a3a}', 0, 0), ('\u{10a3f}', '\u{10a3f}', 0, 0), ('\u{10ae5}', '\u{10ae6}', 0, 0), + ('\u{11001}', '\u{11001}', 0, 0), ('\u{11038}', '\u{11046}', 0, 0), ('\u{1107f}', + '\u{11081}', 0, 0), ('\u{110b3}', '\u{110b6}', 0, 0), ('\u{110b9}', '\u{110ba}', 0, 0), + ('\u{110bd}', '\u{110bd}', 0, 0), ('\u{11100}', '\u{11102}', 0, 0), ('\u{11127}', + '\u{1112b}', 0, 0), ('\u{1112d}', '\u{11134}', 0, 0), ('\u{11173}', '\u{11173}', 0, 0), + ('\u{11180}', '\u{11181}', 0, 0), ('\u{111b6}', '\u{111be}', 0, 0), ('\u{111ca}', + '\u{111cc}', 0, 0), ('\u{1122f}', '\u{11231}', 0, 0), ('\u{11234}', '\u{11234}', 0, 0), + ('\u{11236}', '\u{11237}', 0, 0), ('\u{1123e}', '\u{1123e}', 0, 0), ('\u{112df}', + '\u{112df}', 0, 0), ('\u{112e3}', '\u{112ea}', 0, 0), ('\u{11300}', '\u{11301}', 0, 0), + ('\u{1133c}', '\u{1133c}', 0, 0), ('\u{11340}', '\u{11340}', 0, 0), ('\u{11366}', + '\u{1136c}', 0, 0), ('\u{11370}', '\u{11374}', 0, 0), ('\u{11438}', '\u{1143f}', 0, 0), + ('\u{11442}', '\u{11444}', 0, 0), ('\u{11446}', '\u{11446}', 0, 0), ('\u{114b3}', + '\u{114b8}', 0, 0), ('\u{114ba}', '\u{114ba}', 0, 0), ('\u{114bf}', '\u{114c0}', 0, 0), + ('\u{114c2}', '\u{114c3}', 0, 0), ('\u{115b2}', '\u{115b5}', 0, 0), ('\u{115bc}', + '\u{115bd}', 0, 0), ('\u{115bf}', '\u{115c0}', 0, 0), ('\u{115dc}', '\u{115dd}', 0, 0), + ('\u{11633}', '\u{1163a}', 0, 0), ('\u{1163d}', '\u{1163d}', 0, 0), ('\u{1163f}', + '\u{11640}', 0, 0), ('\u{116ab}', '\u{116ab}', 0, 0), ('\u{116ad}', '\u{116ad}', 0, 0), + ('\u{116b0}', '\u{116b5}', 0, 0), ('\u{116b7}', '\u{116b7}', 0, 0), ('\u{1171d}', + '\u{1171f}', 0, 0), ('\u{11722}', '\u{11725}', 0, 0), ('\u{11727}', '\u{1172b}', 0, 0), + ('\u{11a01}', '\u{11a06}', 0, 0), ('\u{11a09}', '\u{11a0a}', 0, 0), ('\u{11a33}', + '\u{11a38}', 0, 0), ('\u{11a3b}', '\u{11a3e}', 0, 0), ('\u{11a47}', '\u{11a47}', 0, 0), + ('\u{11a51}', '\u{11a56}', 0, 0), ('\u{11a59}', '\u{11a5b}', 0, 0), ('\u{11a8a}', + '\u{11a96}', 0, 0), ('\u{11a98}', '\u{11a99}', 0, 0), ('\u{11c30}', '\u{11c36}', 0, 0), + ('\u{11c38}', '\u{11c3d}', 0, 0), ('\u{11c3f}', '\u{11c3f}', 0, 0), ('\u{11c92}', + '\u{11ca7}', 0, 0), ('\u{11caa}', '\u{11cb0}', 0, 0), ('\u{11cb2}', '\u{11cb3}', 0, 0), + ('\u{11cb5}', '\u{11cb6}', 0, 0), ('\u{11d31}', '\u{11d36}', 0, 0), ('\u{11d3a}', + '\u{11d3a}', 0, 0), ('\u{11d3c}', '\u{11d3d}', 0, 0), ('\u{11d3f}', '\u{11d45}', 0, 0), + ('\u{11d47}', '\u{11d47}', 0, 0), ('\u{16af0}', '\u{16af4}', 0, 0), ('\u{16b30}', + '\u{16b36}', 0, 0), ('\u{16f8f}', '\u{16f92}', 0, 0), ('\u{16fe0}', '\u{16fe1}', 2, 2), + ('\u{17000}', '\u{187ec}', 2, 2), ('\u{18800}', '\u{18af2}', 2, 2), ('\u{1b000}', + '\u{1b11e}', 2, 2), ('\u{1b170}', '\u{1b2fb}', 2, 2), ('\u{1bc9d}', '\u{1bc9e}', 0, 0), + ('\u{1bca0}', '\u{1bca3}', 0, 0), ('\u{1d167}', '\u{1d169}', 0, 0), ('\u{1d173}', + '\u{1d182}', 0, 0), ('\u{1d185}', '\u{1d18b}', 0, 0), ('\u{1d1aa}', '\u{1d1ad}', 0, 0), + ('\u{1d242}', '\u{1d244}', 0, 0), ('\u{1da00}', '\u{1da36}', 0, 0), ('\u{1da3b}', + '\u{1da6c}', 0, 0), ('\u{1da75}', '\u{1da75}', 0, 0), ('\u{1da84}', '\u{1da84}', 0, 0), + ('\u{1da9b}', '\u{1da9f}', 0, 0), ('\u{1daa1}', '\u{1daaf}', 0, 0), ('\u{1e000}', + '\u{1e006}', 0, 0), ('\u{1e008}', '\u{1e018}', 0, 0), ('\u{1e01b}', '\u{1e021}', 0, 0), + ('\u{1e023}', '\u{1e024}', 0, 0), ('\u{1e026}', '\u{1e02a}', 0, 0), ('\u{1e8d0}', + '\u{1e8d6}', 0, 0), ('\u{1e944}', '\u{1e94a}', 0, 0), ('\u{1f004}', '\u{1f004}', 2, 2), + ('\u{1f0cf}', '\u{1f0cf}', 2, 2), ('\u{1f100}', '\u{1f10a}', 1, 2), ('\u{1f110}', + '\u{1f12d}', 1, 2), ('\u{1f130}', '\u{1f169}', 1, 2), ('\u{1f170}', '\u{1f18d}', 1, 2), + ('\u{1f18e}', '\u{1f18e}', 2, 2), ('\u{1f18f}', '\u{1f190}', 1, 2), ('\u{1f191}', + '\u{1f19a}', 2, 2), ('\u{1f19b}', '\u{1f1ac}', 1, 2), ('\u{1f200}', '\u{1f202}', 2, 2), + ('\u{1f210}', '\u{1f23b}', 2, 2), ('\u{1f240}', '\u{1f248}', 2, 2), ('\u{1f250}', + '\u{1f251}', 2, 2), ('\u{1f260}', '\u{1f265}', 2, 2), ('\u{1f300}', '\u{1f320}', 2, 2), + ('\u{1f32d}', '\u{1f335}', 2, 2), ('\u{1f337}', '\u{1f37c}', 2, 2), ('\u{1f37e}', + '\u{1f393}', 2, 2), ('\u{1f3a0}', '\u{1f3ca}', 2, 2), ('\u{1f3cf}', '\u{1f3d3}', 2, 2), + ('\u{1f3e0}', '\u{1f3f0}', 2, 2), ('\u{1f3f4}', '\u{1f3f4}', 2, 2), ('\u{1f3f8}', + '\u{1f43e}', 2, 2), ('\u{1f440}', '\u{1f440}', 2, 2), ('\u{1f442}', '\u{1f4fc}', 2, 2), + ('\u{1f4ff}', '\u{1f53d}', 2, 2), ('\u{1f54b}', '\u{1f54e}', 2, 2), ('\u{1f550}', + '\u{1f567}', 2, 2), ('\u{1f57a}', '\u{1f57a}', 2, 2), ('\u{1f595}', '\u{1f596}', 2, 2), + ('\u{1f5a4}', '\u{1f5a4}', 2, 2), ('\u{1f5fb}', '\u{1f64f}', 2, 2), ('\u{1f680}', + '\u{1f6c5}', 2, 2), ('\u{1f6cc}', '\u{1f6cc}', 2, 2), ('\u{1f6d0}', '\u{1f6d2}', 2, 2), + ('\u{1f6eb}', '\u{1f6ec}', 2, 2), ('\u{1f6f4}', '\u{1f6f8}', 2, 2), ('\u{1f910}', + '\u{1f93e}', 2, 2), ('\u{1f940}', '\u{1f94c}', 2, 2), ('\u{1f950}', '\u{1f96b}', 2, 2), + ('\u{1f980}', '\u{1f997}', 2, 2), ('\u{1f9c0}', '\u{1f9c0}', 2, 2), ('\u{1f9d0}', + '\u{1f9e6}', 2, 2), ('\u{20000}', '\u{2fffd}', 2, 2), ('\u{30000}', '\u{3fffd}', 2, 2), + ('\u{e0001}', '\u{e0001}', 0, 0), ('\u{e0020}', '\u{e007f}', 0, 0), ('\u{e0100}', + '\u{e01ef}', 0, 0), ('\u{f0000}', '\u{ffffd}', 1, 2), ('\u{100000}', '\u{10fffd}', 1, 2) + ]; + +} + diff --git a/vendor/registry-40351f815f426200/unicode-width/src/tests.rs b/vendor/registry-40351f815f426200/unicode-width/src/tests.rs new file mode 100644 index 000000000..2ba1e23d7 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-width/src/tests.rs @@ -0,0 +1,156 @@ +// Copyright 2012-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. + +#[cfg(feature = "bench")] +use std::iter; +#[cfg(feature = "bench")] +use test::{self, Bencher}; +#[cfg(feature = "bench")] +use super::UnicodeWidthChar; + +use std::prelude::v1::*; + +#[cfg(feature = "bench")] +#[bench] +fn cargo(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.iter(|| { + for c in string.chars() { + test::black_box(UnicodeWidthChar::width(c)); + } + }); +} + +#[cfg(feature = "bench")] +#[bench] +#[allow(deprecated)] +fn stdlib(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.iter(|| { + for c in string.chars() { + test::black_box(c.width()); + } + }); +} + +#[cfg(feature = "bench")] +#[bench] +fn simple_if(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.iter(|| { + for c in string.chars() { + test::black_box(simple_width_if(c)); + } + }); +} + +#[cfg(feature = "bench")] +#[bench] +fn simple_match(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.iter(|| { + for c in string.chars() { + test::black_box(simple_width_match(c)); + } + }); +} + +#[cfg(feature = "bench")] +#[inline] +fn simple_width_if(c: char) -> Option { + let cu = c as u32; + if cu < 127 { + if cu > 31 { + Some(1) + } else if cu == 0 { + Some(0) + } else { + None + } + } else { + UnicodeWidthChar::width(c) + } +} + +#[cfg(feature = "bench")] +#[inline] +fn simple_width_match(c: char) -> Option { + match c as u32 { + cu if cu == 0 => Some(0), + cu if cu < 0x20 => None, + cu if cu < 0x7f => Some(1), + _ => UnicodeWidthChar::width(c) + } +} + +#[test] +fn test_str() { + use super::UnicodeWidthStr; + + assert_eq!(UnicodeWidthStr::width("hello"), 10); + assert_eq!("hello".width_cjk(), 10); + assert_eq!(UnicodeWidthStr::width("\0\0\0\x01\x01"), 0); + assert_eq!("\0\0\0\x01\x01".width_cjk(), 0); + assert_eq!(UnicodeWidthStr::width(""), 0); + assert_eq!("".width_cjk(), 0); + assert_eq!(UnicodeWidthStr::width("\u{2081}\u{2082}\u{2083}\u{2084}"), 4); + assert_eq!("\u{2081}\u{2082}\u{2083}\u{2084}".width_cjk(), 8); +} + +#[test] +fn test_char() { + use super::UnicodeWidthChar; + #[cfg(feature = "no_std")] + use core::option::Option::{Some, None}; + + assert_eq!(UnicodeWidthChar::width('h'), Some(2)); + assert_eq!('h'.width_cjk(), Some(2)); + assert_eq!(UnicodeWidthChar::width('\x00'), Some(0)); + assert_eq!('\x00'.width_cjk(), Some(0)); + assert_eq!(UnicodeWidthChar::width('\x01'), None); + assert_eq!('\x01'.width_cjk(), None); + assert_eq!(UnicodeWidthChar::width('\u{2081}'), Some(1)); + assert_eq!('\u{2081}'.width_cjk(), Some(2)); +} + +#[test] +fn test_char2() { + use super::UnicodeWidthChar; + #[cfg(feature = "no_std")] + use core::option::Option::{Some, None}; + + assert_eq!(UnicodeWidthChar::width('\x00'),Some(0)); + assert_eq!('\x00'.width_cjk(),Some(0)); + + assert_eq!(UnicodeWidthChar::width('\x0A'),None); + assert_eq!('\x0A'.width_cjk(),None); + + assert_eq!(UnicodeWidthChar::width('w'),Some(1)); + assert_eq!('w'.width_cjk(),Some(1)); + + assert_eq!(UnicodeWidthChar::width('h'),Some(2)); + assert_eq!('h'.width_cjk(),Some(2)); + + assert_eq!(UnicodeWidthChar::width('\u{AD}'),Some(1)); + assert_eq!('\u{AD}'.width_cjk(),Some(1)); + + assert_eq!(UnicodeWidthChar::width('\u{1160}'),Some(0)); + assert_eq!('\u{1160}'.width_cjk(),Some(0)); + + assert_eq!(UnicodeWidthChar::width('\u{a1}'),Some(1)); + assert_eq!('\u{a1}'.width_cjk(),Some(2)); + + assert_eq!(UnicodeWidthChar::width('\u{300}'),Some(0)); + assert_eq!('\u{300}'.width_cjk(),Some(0)); +} diff --git a/vendor/registry-40351f815f426200/unicode-xid/.cargo-checksum.json b/vendor/registry-40351f815f426200/unicode-xid/.cargo-checksum.json new file mode 100644 index 000000000..60faf25bf --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"COPYRIGHT":"23860c2a7b5d96b21569afedf033469bab9fe14a1b24a35068b8641c578ce24d","Cargo.toml":"aafcae4002bee71546a6aa40a97b9124a69f169ee7e3a9e3262338e32b4c2b9b","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"7b63ecd5f1902af1b63729947373683c32745c16a10e8e6292e2e2dcd7e90ae0","README.md":"67998486b32f4fe46abbbaa411b92528750e7f0e22452dc8a5b95d87d80fde75","scripts/unicode.py":"762eea92dd51238c6bf877570bde1149932ba15cf87be1618fc21cd53e941733","src/lib.rs":"4a89fadf452ae7c53536eaa4496f951a3153f8189dd1cbc532648731d30f0b11","src/tables.rs":"0643459b6ebeeed83aecd7604f0ea29c06bea7ce6c1cd9acd4988d27ace1ec53","src/tests.rs":"35a459382e190197e7b9a78832ae79f310b48a02a5b4227bf9bbc89d46c8deac"},"package":"fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/unicode-xid/COPYRIGHT b/vendor/registry-40351f815f426200/unicode-xid/COPYRIGHT new file mode 100644 index 000000000..b286ec16a --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/COPYRIGHT @@ -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. diff --git a/vendor/registry-40351f815f426200/unicode-xid/Cargo.toml b/vendor/registry-40351f815f426200/unicode-xid/Cargo.toml new file mode 100644 index 000000000..b9b69b293 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/Cargo.toml @@ -0,0 +1,26 @@ +[package] + +name = "unicode-xid" +version = "0.1.0" +authors = ["erick.tryzelaar ", + "kwantam ", + ] + +homepage = "https://github.com/unicode-rs/unicode-xid" +repository = "https://github.com/unicode-rs/unicode-xid" +documentation = "https://unicode-rs.github.io/unicode-xid" +license = "MIT/Apache-2.0" +keywords = ["text", "unicode", "xid"] +readme = "README.md" +description = """ +Determine whether characters have the XID_Start +or XID_Continue properties according to +Unicode Standard Annex #31. +""" + +exclude = [ "target/*", "Cargo.lock" ] + +[features] +default = [] +no_std = [] +bench = [] diff --git a/vendor/registry-40351f815f426200/unicode-xid/LICENSE-APACHE b/vendor/registry-40351f815f426200/unicode-xid/LICENSE-APACHE new file mode 100644 index 000000000..16fe87b06 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/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/vendor/registry-40351f815f426200/unicode-xid/LICENSE-MIT b/vendor/registry-40351f815f426200/unicode-xid/LICENSE-MIT new file mode 100644 index 000000000..e69282e38 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 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/vendor/registry-40351f815f426200/unicode-xid/README.md b/vendor/registry-40351f815f426200/unicode-xid/README.md new file mode 100644 index 000000000..3a2be472d --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/README.md @@ -0,0 +1,34 @@ +# unicode-xid + +Determine if a `char` is a valid identifier for a parser and/or lexer according to +[Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules. + +[![Build Status](https://travis-ci.org/unicode-rs/unicode-xid.svg)](https://travis-ci.org/unicode-rs/unicode-xid) + +[Documentation](https://unicode-rs.github.io/unicode-xid/unicode_xid/index.html) + +```rust +extern crate unicode_xid; + +use unicode_xid::UnicodeXID; + +fn main() { + let ch = 'a'; + println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch)); +} +``` + +# features + +unicode-xid supports a `no_std` feature. This eliminates dependence +on std, and instead uses equivalent functions from core. + +# crates.io + +You can use this package in your project by adding the following +to your `Cargo.toml`: + +```toml +[dependencies] +unicode-xid = "0.0.4" +``` diff --git a/vendor/registry-40351f815f426200/unicode-xid/scripts/unicode.py b/vendor/registry-40351f815f426200/unicode-xid/scripts/unicode.py new file mode 100755 index 000000000..a30d2f2a7 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/scripts/unicode.py @@ -0,0 +1,187 @@ +#!/usr/bin/env python +# +# Copyright 2011-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. + +# This script uses the following Unicode tables: +# - DerivedCoreProperties.txt +# - ReadMe.txt +# +# Since this should not require frequent updates, we just store this +# out-of-line and check the unicode.rs file into git. + +import fileinput, re, os, sys + +preamble = '''// Copyright 2012-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. + +// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly + +#![allow(missing_docs, non_upper_case_globals, non_snake_case)] +''' + +def fetch(f): + if not os.path.exists(os.path.basename(f)): + os.system("curl -O http://www.unicode.org/Public/UNIDATA/%s" + % f) + + if not os.path.exists(os.path.basename(f)): + sys.stderr.write("cannot load %s" % f) + exit(1) + +def group_cat(cat): + cat_out = [] + letters = sorted(set(cat)) + cur_start = letters.pop(0) + cur_end = cur_start + for letter in letters: + assert letter > cur_end, \ + "cur_end: %s, letter: %s" % (hex(cur_end), hex(letter)) + if letter == cur_end + 1: + cur_end = letter + else: + cat_out.append((cur_start, cur_end)) + cur_start = cur_end = letter + cat_out.append((cur_start, cur_end)) + return cat_out + +def ungroup_cat(cat): + cat_out = [] + for (lo, hi) in cat: + while lo <= hi: + cat_out.append(lo) + lo += 1 + return cat_out + +def format_table_content(f, content, indent): + line = " "*indent + first = True + for chunk in content.split(","): + if len(line) + len(chunk) < 98: + if first: + line += chunk + else: + line += ", " + chunk + first = False + else: + f.write(line + ",\n") + line = " "*indent + chunk + f.write(line) + +def load_properties(f, interestingprops): + fetch(f) + props = {} + re1 = re.compile("^ *([0-9A-F]+) *; *(\w+)") + re2 = re.compile("^ *([0-9A-F]+)\.\.([0-9A-F]+) *; *(\w+)") + + for line in fileinput.input(os.path.basename(f)): + prop = None + d_lo = 0 + d_hi = 0 + m = re1.match(line) + if m: + d_lo = m.group(1) + d_hi = m.group(1) + prop = m.group(2) + else: + m = re2.match(line) + if m: + d_lo = m.group(1) + d_hi = m.group(2) + prop = m.group(3) + else: + continue + if interestingprops and prop not in interestingprops: + continue + d_lo = int(d_lo, 16) + d_hi = int(d_hi, 16) + if prop not in props: + props[prop] = [] + props[prop].append((d_lo, d_hi)) + + # optimize if possible + for prop in props: + props[prop] = group_cat(ungroup_cat(props[prop])) + + return props + +def escape_char(c): + return "'\\u{%x}'" % c + +def emit_bsearch_range_table(f): + f.write(""" +fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { + use core::cmp::Ordering::{Equal, Less, Greater}; + + r.binary_search_by(|&(lo,hi)| { + if lo <= c && c <= hi { Equal } + else if hi < c { Less } + else { Greater } + }).is_ok() +}\n +""") + +def emit_table(f, name, t_data, t_type = "&'static [(char, char)]", is_pub=True, + pfun=lambda x: "(%s,%s)" % (escape_char(x[0]), escape_char(x[1])), is_const=True): + pub_string = "const" + if not is_const: + pub_string = "let" + if is_pub: + pub_string = "pub " + pub_string + f.write(" %s %s: %s = &[\n" % (pub_string, name, t_type)) + data = "" + first = True + for dat in t_data: + if not first: + data += "," + first = False + data += pfun(dat) + format_table_content(f, data, 8) + f.write("\n ];\n\n") + +def emit_property_module(f, mod, tbl, emit): + f.write("pub mod %s {\n" % mod) + for cat in sorted(emit): + emit_table(f, "%s_table" % cat, tbl[cat]) + f.write(" pub fn %s(c: char) -> bool {\n" % cat) + f.write(" super::bsearch_range_table(c, %s_table)\n" % cat) + f.write(" }\n\n") + f.write("}\n\n") + +if __name__ == "__main__": + r = "tables.rs" + if os.path.exists(r): + os.remove(r) + with open(r, "w") as rf: + # write the file's preamble + rf.write(preamble) + + # download and parse all the data + fetch("ReadMe.txt") + with open("ReadMe.txt") as readme: + pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode" + unicode_version = re.search(pattern, readme.read()).groups() + rf.write(""" +/// The version of [Unicode](http://www.unicode.org/) +/// that this version of unicode-xid is based on. +pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s); +""" % unicode_version) + emit_bsearch_range_table(rf) + + want_derived = ["XID_Start", "XID_Continue"] + derived = load_properties("DerivedCoreProperties.txt", want_derived) + emit_property_module(rf, "derived_property", derived, want_derived) diff --git a/vendor/registry-40351f815f426200/unicode-xid/src/lib.rs b/vendor/registry-40351f815f426200/unicode-xid/src/lib.rs new file mode 100644 index 000000000..09faf9726 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/src/lib.rs @@ -0,0 +1,87 @@ +// Copyright 2012-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. + +//! Determine if a `char` is a valid identifier for a parser and/or lexer according to +//! [Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules. +//! +//! ```rust +//! extern crate unicode_xid; +//! +//! use unicode_xid::UnicodeXID; +//! +//! fn main() { +//! let ch = 'a'; +//! println!("Is {} a valid start of an identifier? {}", ch, UnicodeXID::is_xid_start(ch)); +//! } +//! ``` +//! +//! # features +//! +//! unicode-xid supports a `no_std` feature. This eliminates dependence +//! on std, and instead uses equivalent functions from core. +//! +//! # crates.io +//! +//! You can use this package in your project by adding the following +//! to your `Cargo.toml`: +//! +//! ```toml +//! [dependencies] +//! unicode-xid = "0.0.4" +//! ``` + +#![deny(missing_docs, unsafe_code)] +#![doc(html_logo_url = "https://unicode-rs.github.io/unicode-rs_sm.png", + html_favicon_url = "https://unicode-rs.github.io/unicode-rs_sm.png")] + +#![no_std] +#![cfg_attr(feature = "bench", feature(test, unicode))] + +#[cfg(test)] +#[macro_use] +extern crate std; + +#[cfg(feature = "bench")] +extern crate test; + +use tables::derived_property; +pub use tables::UNICODE_VERSION; + +mod tables; + +#[cfg(test)] +mod tests; + +/// Methods for determining if a character is a valid identifier character. +pub trait UnicodeXID { + /// Returns whether the specified character satisfies the 'XID_Start' + /// Unicode property. + /// + /// 'XID_Start' is a Unicode Derived Property specified in + /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications), + /// mostly similar to ID_Start but modified for closure under NFKx. + fn is_xid_start(self) -> bool; + + /// Returns whether the specified `char` satisfies the 'XID_Continue' + /// Unicode property. + /// + /// 'XID_Continue' is a Unicode Derived Property specified in + /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications), + /// mostly similar to 'ID_Continue' but modified for closure under NFKx. + fn is_xid_continue(self) -> bool; +} + +impl UnicodeXID for char { + #[inline] + fn is_xid_start(self) -> bool { derived_property::XID_Start(self) } + + #[inline] + fn is_xid_continue(self) -> bool { derived_property::XID_Continue(self) } +} diff --git a/vendor/registry-40351f815f426200/unicode-xid/src/tables.rs b/vendor/registry-40351f815f426200/unicode-xid/src/tables.rs new file mode 100644 index 000000000..3fe0d3d11 --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/src/tables.rs @@ -0,0 +1,426 @@ +// Copyright 2012-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. + +// NOTE: The following code was generated by "scripts/unicode.py", do not edit directly + +#![allow(missing_docs, non_upper_case_globals, non_snake_case)] + +/// The version of [Unicode](http://www.unicode.org/) +/// that this version of unicode-xid is based on. +pub const UNICODE_VERSION: (u64, u64, u64) = (9, 0, 0); + +fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { + use core::cmp::Ordering::{Equal, Less, Greater}; + + r.binary_search_by(|&(lo,hi)| { + if lo <= c && c <= hi { Equal } + else if hi < c { Less } + else { Greater } + }).is_ok() +} + +pub mod derived_property { + pub const XID_Continue_table: &'static [(char, char)] = &[ + ('\u{30}', '\u{39}'), ('\u{41}', '\u{5a}'), ('\u{5f}', '\u{5f}'), ('\u{61}', '\u{7a}'), + ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{b7}', '\u{b7}'), ('\u{ba}', '\u{ba}'), + ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), ('\u{2c6}', '\u{2d1}'), + ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', '\u{2ee}'), ('\u{300}', + '\u{374}'), ('\u{376}', '\u{377}'), ('\u{37b}', '\u{37d}'), ('\u{37f}', '\u{37f}'), + ('\u{386}', '\u{38a}'), ('\u{38c}', '\u{38c}'), ('\u{38e}', '\u{3a1}'), ('\u{3a3}', + '\u{3f5}'), ('\u{3f7}', '\u{481}'), ('\u{483}', '\u{487}'), ('\u{48a}', '\u{52f}'), + ('\u{531}', '\u{556}'), ('\u{559}', '\u{559}'), ('\u{561}', '\u{587}'), ('\u{591}', + '\u{5bd}'), ('\u{5bf}', '\u{5bf}'), ('\u{5c1}', '\u{5c2}'), ('\u{5c4}', '\u{5c5}'), + ('\u{5c7}', '\u{5c7}'), ('\u{5d0}', '\u{5ea}'), ('\u{5f0}', '\u{5f2}'), ('\u{610}', + '\u{61a}'), ('\u{620}', '\u{669}'), ('\u{66e}', '\u{6d3}'), ('\u{6d5}', '\u{6dc}'), + ('\u{6df}', '\u{6e8}'), ('\u{6ea}', '\u{6fc}'), ('\u{6ff}', '\u{6ff}'), ('\u{710}', + '\u{74a}'), ('\u{74d}', '\u{7b1}'), ('\u{7c0}', '\u{7f5}'), ('\u{7fa}', '\u{7fa}'), + ('\u{800}', '\u{82d}'), ('\u{840}', '\u{85b}'), ('\u{8a0}', '\u{8b4}'), ('\u{8b6}', + '\u{8bd}'), ('\u{8d4}', '\u{8e1}'), ('\u{8e3}', '\u{963}'), ('\u{966}', '\u{96f}'), + ('\u{971}', '\u{983}'), ('\u{985}', '\u{98c}'), ('\u{98f}', '\u{990}'), ('\u{993}', + '\u{9a8}'), ('\u{9aa}', '\u{9b0}'), ('\u{9b2}', '\u{9b2}'), ('\u{9b6}', '\u{9b9}'), + ('\u{9bc}', '\u{9c4}'), ('\u{9c7}', '\u{9c8}'), ('\u{9cb}', '\u{9ce}'), ('\u{9d7}', + '\u{9d7}'), ('\u{9dc}', '\u{9dd}'), ('\u{9df}', '\u{9e3}'), ('\u{9e6}', '\u{9f1}'), + ('\u{a01}', '\u{a03}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', '\u{a10}'), ('\u{a13}', + '\u{a28}'), ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), ('\u{a35}', '\u{a36}'), + ('\u{a38}', '\u{a39}'), ('\u{a3c}', '\u{a3c}'), ('\u{a3e}', '\u{a42}'), ('\u{a47}', + '\u{a48}'), ('\u{a4b}', '\u{a4d}'), ('\u{a51}', '\u{a51}'), ('\u{a59}', '\u{a5c}'), + ('\u{a5e}', '\u{a5e}'), ('\u{a66}', '\u{a75}'), ('\u{a81}', '\u{a83}'), ('\u{a85}', + '\u{a8d}'), ('\u{a8f}', '\u{a91}'), ('\u{a93}', '\u{aa8}'), ('\u{aaa}', '\u{ab0}'), + ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', '\u{ab9}'), ('\u{abc}', '\u{ac5}'), ('\u{ac7}', + '\u{ac9}'), ('\u{acb}', '\u{acd}'), ('\u{ad0}', '\u{ad0}'), ('\u{ae0}', '\u{ae3}'), + ('\u{ae6}', '\u{aef}'), ('\u{af9}', '\u{af9}'), ('\u{b01}', '\u{b03}'), ('\u{b05}', + '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', '\u{b28}'), ('\u{b2a}', '\u{b30}'), + ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), ('\u{b3c}', '\u{b44}'), ('\u{b47}', + '\u{b48}'), ('\u{b4b}', '\u{b4d}'), ('\u{b56}', '\u{b57}'), ('\u{b5c}', '\u{b5d}'), + ('\u{b5f}', '\u{b63}'), ('\u{b66}', '\u{b6f}'), ('\u{b71}', '\u{b71}'), ('\u{b82}', + '\u{b83}'), ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), ('\u{b92}', '\u{b95}'), + ('\u{b99}', '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', '\u{b9f}'), ('\u{ba3}', + '\u{ba4}'), ('\u{ba8}', '\u{baa}'), ('\u{bae}', '\u{bb9}'), ('\u{bbe}', '\u{bc2}'), + ('\u{bc6}', '\u{bc8}'), ('\u{bca}', '\u{bcd}'), ('\u{bd0}', '\u{bd0}'), ('\u{bd7}', + '\u{bd7}'), ('\u{be6}', '\u{bef}'), ('\u{c00}', '\u{c03}'), ('\u{c05}', '\u{c0c}'), + ('\u{c0e}', '\u{c10}'), ('\u{c12}', '\u{c28}'), ('\u{c2a}', '\u{c39}'), ('\u{c3d}', + '\u{c44}'), ('\u{c46}', '\u{c48}'), ('\u{c4a}', '\u{c4d}'), ('\u{c55}', '\u{c56}'), + ('\u{c58}', '\u{c5a}'), ('\u{c60}', '\u{c63}'), ('\u{c66}', '\u{c6f}'), ('\u{c80}', + '\u{c83}'), ('\u{c85}', '\u{c8c}'), ('\u{c8e}', '\u{c90}'), ('\u{c92}', '\u{ca8}'), + ('\u{caa}', '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), ('\u{cbc}', '\u{cc4}'), ('\u{cc6}', + '\u{cc8}'), ('\u{cca}', '\u{ccd}'), ('\u{cd5}', '\u{cd6}'), ('\u{cde}', '\u{cde}'), + ('\u{ce0}', '\u{ce3}'), ('\u{ce6}', '\u{cef}'), ('\u{cf1}', '\u{cf2}'), ('\u{d01}', + '\u{d03}'), ('\u{d05}', '\u{d0c}'), ('\u{d0e}', '\u{d10}'), ('\u{d12}', '\u{d3a}'), + ('\u{d3d}', '\u{d44}'), ('\u{d46}', '\u{d48}'), ('\u{d4a}', '\u{d4e}'), ('\u{d54}', + '\u{d57}'), ('\u{d5f}', '\u{d63}'), ('\u{d66}', '\u{d6f}'), ('\u{d7a}', '\u{d7f}'), + ('\u{d82}', '\u{d83}'), ('\u{d85}', '\u{d96}'), ('\u{d9a}', '\u{db1}'), ('\u{db3}', + '\u{dbb}'), ('\u{dbd}', '\u{dbd}'), ('\u{dc0}', '\u{dc6}'), ('\u{dca}', '\u{dca}'), + ('\u{dcf}', '\u{dd4}'), ('\u{dd6}', '\u{dd6}'), ('\u{dd8}', '\u{ddf}'), ('\u{de6}', + '\u{def}'), ('\u{df2}', '\u{df3}'), ('\u{e01}', '\u{e3a}'), ('\u{e40}', '\u{e4e}'), + ('\u{e50}', '\u{e59}'), ('\u{e81}', '\u{e82}'), ('\u{e84}', '\u{e84}'), ('\u{e87}', + '\u{e88}'), ('\u{e8a}', '\u{e8a}'), ('\u{e8d}', '\u{e8d}'), ('\u{e94}', '\u{e97}'), + ('\u{e99}', '\u{e9f}'), ('\u{ea1}', '\u{ea3}'), ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', + '\u{ea7}'), ('\u{eaa}', '\u{eab}'), ('\u{ead}', '\u{eb9}'), ('\u{ebb}', '\u{ebd}'), + ('\u{ec0}', '\u{ec4}'), ('\u{ec6}', '\u{ec6}'), ('\u{ec8}', '\u{ecd}'), ('\u{ed0}', + '\u{ed9}'), ('\u{edc}', '\u{edf}'), ('\u{f00}', '\u{f00}'), ('\u{f18}', '\u{f19}'), + ('\u{f20}', '\u{f29}'), ('\u{f35}', '\u{f35}'), ('\u{f37}', '\u{f37}'), ('\u{f39}', + '\u{f39}'), ('\u{f3e}', '\u{f47}'), ('\u{f49}', '\u{f6c}'), ('\u{f71}', '\u{f84}'), + ('\u{f86}', '\u{f97}'), ('\u{f99}', '\u{fbc}'), ('\u{fc6}', '\u{fc6}'), ('\u{1000}', + '\u{1049}'), ('\u{1050}', '\u{109d}'), ('\u{10a0}', '\u{10c5}'), ('\u{10c7}', '\u{10c7}'), + ('\u{10cd}', '\u{10cd}'), ('\u{10d0}', '\u{10fa}'), ('\u{10fc}', '\u{1248}'), ('\u{124a}', + '\u{124d}'), ('\u{1250}', '\u{1256}'), ('\u{1258}', '\u{1258}'), ('\u{125a}', '\u{125d}'), + ('\u{1260}', '\u{1288}'), ('\u{128a}', '\u{128d}'), ('\u{1290}', '\u{12b0}'), ('\u{12b2}', + '\u{12b5}'), ('\u{12b8}', '\u{12be}'), ('\u{12c0}', '\u{12c0}'), ('\u{12c2}', '\u{12c5}'), + ('\u{12c8}', '\u{12d6}'), ('\u{12d8}', '\u{1310}'), ('\u{1312}', '\u{1315}'), ('\u{1318}', + '\u{135a}'), ('\u{135d}', '\u{135f}'), ('\u{1369}', '\u{1371}'), ('\u{1380}', '\u{138f}'), + ('\u{13a0}', '\u{13f5}'), ('\u{13f8}', '\u{13fd}'), ('\u{1401}', '\u{166c}'), ('\u{166f}', + '\u{167f}'), ('\u{1681}', '\u{169a}'), ('\u{16a0}', '\u{16ea}'), ('\u{16ee}', '\u{16f8}'), + ('\u{1700}', '\u{170c}'), ('\u{170e}', '\u{1714}'), ('\u{1720}', '\u{1734}'), ('\u{1740}', + '\u{1753}'), ('\u{1760}', '\u{176c}'), ('\u{176e}', '\u{1770}'), ('\u{1772}', '\u{1773}'), + ('\u{1780}', '\u{17d3}'), ('\u{17d7}', '\u{17d7}'), ('\u{17dc}', '\u{17dd}'), ('\u{17e0}', + '\u{17e9}'), ('\u{180b}', '\u{180d}'), ('\u{1810}', '\u{1819}'), ('\u{1820}', '\u{1877}'), + ('\u{1880}', '\u{18aa}'), ('\u{18b0}', '\u{18f5}'), ('\u{1900}', '\u{191e}'), ('\u{1920}', + '\u{192b}'), ('\u{1930}', '\u{193b}'), ('\u{1946}', '\u{196d}'), ('\u{1970}', '\u{1974}'), + ('\u{1980}', '\u{19ab}'), ('\u{19b0}', '\u{19c9}'), ('\u{19d0}', '\u{19da}'), ('\u{1a00}', + '\u{1a1b}'), ('\u{1a20}', '\u{1a5e}'), ('\u{1a60}', '\u{1a7c}'), ('\u{1a7f}', '\u{1a89}'), + ('\u{1a90}', '\u{1a99}'), ('\u{1aa7}', '\u{1aa7}'), ('\u{1ab0}', '\u{1abd}'), ('\u{1b00}', + '\u{1b4b}'), ('\u{1b50}', '\u{1b59}'), ('\u{1b6b}', '\u{1b73}'), ('\u{1b80}', '\u{1bf3}'), + ('\u{1c00}', '\u{1c37}'), ('\u{1c40}', '\u{1c49}'), ('\u{1c4d}', '\u{1c7d}'), ('\u{1c80}', + '\u{1c88}'), ('\u{1cd0}', '\u{1cd2}'), ('\u{1cd4}', '\u{1cf6}'), ('\u{1cf8}', '\u{1cf9}'), + ('\u{1d00}', '\u{1df5}'), ('\u{1dfb}', '\u{1f15}'), ('\u{1f18}', '\u{1f1d}'), ('\u{1f20}', + '\u{1f45}'), ('\u{1f48}', '\u{1f4d}'), ('\u{1f50}', '\u{1f57}'), ('\u{1f59}', '\u{1f59}'), + ('\u{1f5b}', '\u{1f5b}'), ('\u{1f5d}', '\u{1f5d}'), ('\u{1f5f}', '\u{1f7d}'), ('\u{1f80}', + '\u{1fb4}'), ('\u{1fb6}', '\u{1fbc}'), ('\u{1fbe}', '\u{1fbe}'), ('\u{1fc2}', '\u{1fc4}'), + ('\u{1fc6}', '\u{1fcc}'), ('\u{1fd0}', '\u{1fd3}'), ('\u{1fd6}', '\u{1fdb}'), ('\u{1fe0}', + '\u{1fec}'), ('\u{1ff2}', '\u{1ff4}'), ('\u{1ff6}', '\u{1ffc}'), ('\u{203f}', '\u{2040}'), + ('\u{2054}', '\u{2054}'), ('\u{2071}', '\u{2071}'), ('\u{207f}', '\u{207f}'), ('\u{2090}', + '\u{209c}'), ('\u{20d0}', '\u{20dc}'), ('\u{20e1}', '\u{20e1}'), ('\u{20e5}', '\u{20f0}'), + ('\u{2102}', '\u{2102}'), ('\u{2107}', '\u{2107}'), ('\u{210a}', '\u{2113}'), ('\u{2115}', + '\u{2115}'), ('\u{2118}', '\u{211d}'), ('\u{2124}', '\u{2124}'), ('\u{2126}', '\u{2126}'), + ('\u{2128}', '\u{2128}'), ('\u{212a}', '\u{2139}'), ('\u{213c}', '\u{213f}'), ('\u{2145}', + '\u{2149}'), ('\u{214e}', '\u{214e}'), ('\u{2160}', '\u{2188}'), ('\u{2c00}', '\u{2c2e}'), + ('\u{2c30}', '\u{2c5e}'), ('\u{2c60}', '\u{2ce4}'), ('\u{2ceb}', '\u{2cf3}'), ('\u{2d00}', + '\u{2d25}'), ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}'), ('\u{2d30}', '\u{2d67}'), + ('\u{2d6f}', '\u{2d6f}'), ('\u{2d7f}', '\u{2d96}'), ('\u{2da0}', '\u{2da6}'), ('\u{2da8}', + '\u{2dae}'), ('\u{2db0}', '\u{2db6}'), ('\u{2db8}', '\u{2dbe}'), ('\u{2dc0}', '\u{2dc6}'), + ('\u{2dc8}', '\u{2dce}'), ('\u{2dd0}', '\u{2dd6}'), ('\u{2dd8}', '\u{2dde}'), ('\u{2de0}', + '\u{2dff}'), ('\u{3005}', '\u{3007}'), ('\u{3021}', '\u{302f}'), ('\u{3031}', '\u{3035}'), + ('\u{3038}', '\u{303c}'), ('\u{3041}', '\u{3096}'), ('\u{3099}', '\u{309a}'), ('\u{309d}', + '\u{309f}'), ('\u{30a1}', '\u{30fa}'), ('\u{30fc}', '\u{30ff}'), ('\u{3105}', '\u{312d}'), + ('\u{3131}', '\u{318e}'), ('\u{31a0}', '\u{31ba}'), ('\u{31f0}', '\u{31ff}'), ('\u{3400}', + '\u{4db5}'), ('\u{4e00}', '\u{9fd5}'), ('\u{a000}', '\u{a48c}'), ('\u{a4d0}', '\u{a4fd}'), + ('\u{a500}', '\u{a60c}'), ('\u{a610}', '\u{a62b}'), ('\u{a640}', '\u{a66f}'), ('\u{a674}', + '\u{a67d}'), ('\u{a67f}', '\u{a6f1}'), ('\u{a717}', '\u{a71f}'), ('\u{a722}', '\u{a788}'), + ('\u{a78b}', '\u{a7ae}'), ('\u{a7b0}', '\u{a7b7}'), ('\u{a7f7}', '\u{a827}'), ('\u{a840}', + '\u{a873}'), ('\u{a880}', '\u{a8c5}'), ('\u{a8d0}', '\u{a8d9}'), ('\u{a8e0}', '\u{a8f7}'), + ('\u{a8fb}', '\u{a8fb}'), ('\u{a8fd}', '\u{a8fd}'), ('\u{a900}', '\u{a92d}'), ('\u{a930}', + '\u{a953}'), ('\u{a960}', '\u{a97c}'), ('\u{a980}', '\u{a9c0}'), ('\u{a9cf}', '\u{a9d9}'), + ('\u{a9e0}', '\u{a9fe}'), ('\u{aa00}', '\u{aa36}'), ('\u{aa40}', '\u{aa4d}'), ('\u{aa50}', + '\u{aa59}'), ('\u{aa60}', '\u{aa76}'), ('\u{aa7a}', '\u{aac2}'), ('\u{aadb}', '\u{aadd}'), + ('\u{aae0}', '\u{aaef}'), ('\u{aaf2}', '\u{aaf6}'), ('\u{ab01}', '\u{ab06}'), ('\u{ab09}', + '\u{ab0e}'), ('\u{ab11}', '\u{ab16}'), ('\u{ab20}', '\u{ab26}'), ('\u{ab28}', '\u{ab2e}'), + ('\u{ab30}', '\u{ab5a}'), ('\u{ab5c}', '\u{ab65}'), ('\u{ab70}', '\u{abea}'), ('\u{abec}', + '\u{abed}'), ('\u{abf0}', '\u{abf9}'), ('\u{ac00}', '\u{d7a3}'), ('\u{d7b0}', '\u{d7c6}'), + ('\u{d7cb}', '\u{d7fb}'), ('\u{f900}', '\u{fa6d}'), ('\u{fa70}', '\u{fad9}'), ('\u{fb00}', + '\u{fb06}'), ('\u{fb13}', '\u{fb17}'), ('\u{fb1d}', '\u{fb28}'), ('\u{fb2a}', '\u{fb36}'), + ('\u{fb38}', '\u{fb3c}'), ('\u{fb3e}', '\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', + '\u{fb44}'), ('\u{fb46}', '\u{fbb1}'), ('\u{fbd3}', '\u{fc5d}'), ('\u{fc64}', '\u{fd3d}'), + ('\u{fd50}', '\u{fd8f}'), ('\u{fd92}', '\u{fdc7}'), ('\u{fdf0}', '\u{fdf9}'), ('\u{fe00}', + '\u{fe0f}'), ('\u{fe20}', '\u{fe2f}'), ('\u{fe33}', '\u{fe34}'), ('\u{fe4d}', '\u{fe4f}'), + ('\u{fe71}', '\u{fe71}'), ('\u{fe73}', '\u{fe73}'), ('\u{fe77}', '\u{fe77}'), ('\u{fe79}', + '\u{fe79}'), ('\u{fe7b}', '\u{fe7b}'), ('\u{fe7d}', '\u{fe7d}'), ('\u{fe7f}', '\u{fefc}'), + ('\u{ff10}', '\u{ff19}'), ('\u{ff21}', '\u{ff3a}'), ('\u{ff3f}', '\u{ff3f}'), ('\u{ff41}', + '\u{ff5a}'), ('\u{ff66}', '\u{ffbe}'), ('\u{ffc2}', '\u{ffc7}'), ('\u{ffca}', '\u{ffcf}'), + ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}', '\u{ffdc}'), ('\u{10000}', '\u{1000b}'), + ('\u{1000d}', '\u{10026}'), ('\u{10028}', '\u{1003a}'), ('\u{1003c}', '\u{1003d}'), + ('\u{1003f}', '\u{1004d}'), ('\u{10050}', '\u{1005d}'), ('\u{10080}', '\u{100fa}'), + ('\u{10140}', '\u{10174}'), ('\u{101fd}', '\u{101fd}'), ('\u{10280}', '\u{1029c}'), + ('\u{102a0}', '\u{102d0}'), ('\u{102e0}', '\u{102e0}'), ('\u{10300}', '\u{1031f}'), + ('\u{10330}', '\u{1034a}'), ('\u{10350}', '\u{1037a}'), ('\u{10380}', '\u{1039d}'), + ('\u{103a0}', '\u{103c3}'), ('\u{103c8}', '\u{103cf}'), ('\u{103d1}', '\u{103d5}'), + ('\u{10400}', '\u{1049d}'), ('\u{104a0}', '\u{104a9}'), ('\u{104b0}', '\u{104d3}'), + ('\u{104d8}', '\u{104fb}'), ('\u{10500}', '\u{10527}'), ('\u{10530}', '\u{10563}'), + ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), ('\u{10760}', '\u{10767}'), + ('\u{10800}', '\u{10805}'), ('\u{10808}', '\u{10808}'), ('\u{1080a}', '\u{10835}'), + ('\u{10837}', '\u{10838}'), ('\u{1083c}', '\u{1083c}'), ('\u{1083f}', '\u{10855}'), + ('\u{10860}', '\u{10876}'), ('\u{10880}', '\u{1089e}'), ('\u{108e0}', '\u{108f2}'), + ('\u{108f4}', '\u{108f5}'), ('\u{10900}', '\u{10915}'), ('\u{10920}', '\u{10939}'), + ('\u{10980}', '\u{109b7}'), ('\u{109be}', '\u{109bf}'), ('\u{10a00}', '\u{10a03}'), + ('\u{10a05}', '\u{10a06}'), ('\u{10a0c}', '\u{10a13}'), ('\u{10a15}', '\u{10a17}'), + ('\u{10a19}', '\u{10a33}'), ('\u{10a38}', '\u{10a3a}'), ('\u{10a3f}', '\u{10a3f}'), + ('\u{10a60}', '\u{10a7c}'), ('\u{10a80}', '\u{10a9c}'), ('\u{10ac0}', '\u{10ac7}'), + ('\u{10ac9}', '\u{10ae6}'), ('\u{10b00}', '\u{10b35}'), ('\u{10b40}', '\u{10b55}'), + ('\u{10b60}', '\u{10b72}'), ('\u{10b80}', '\u{10b91}'), ('\u{10c00}', '\u{10c48}'), + ('\u{10c80}', '\u{10cb2}'), ('\u{10cc0}', '\u{10cf2}'), ('\u{11000}', '\u{11046}'), + ('\u{11066}', '\u{1106f}'), ('\u{1107f}', '\u{110ba}'), ('\u{110d0}', '\u{110e8}'), + ('\u{110f0}', '\u{110f9}'), ('\u{11100}', '\u{11134}'), ('\u{11136}', '\u{1113f}'), + ('\u{11150}', '\u{11173}'), ('\u{11176}', '\u{11176}'), ('\u{11180}', '\u{111c4}'), + ('\u{111ca}', '\u{111cc}'), ('\u{111d0}', '\u{111da}'), ('\u{111dc}', '\u{111dc}'), + ('\u{11200}', '\u{11211}'), ('\u{11213}', '\u{11237}'), ('\u{1123e}', '\u{1123e}'), + ('\u{11280}', '\u{11286}'), ('\u{11288}', '\u{11288}'), ('\u{1128a}', '\u{1128d}'), + ('\u{1128f}', '\u{1129d}'), ('\u{1129f}', '\u{112a8}'), ('\u{112b0}', '\u{112ea}'), + ('\u{112f0}', '\u{112f9}'), ('\u{11300}', '\u{11303}'), ('\u{11305}', '\u{1130c}'), + ('\u{1130f}', '\u{11310}'), ('\u{11313}', '\u{11328}'), ('\u{1132a}', '\u{11330}'), + ('\u{11332}', '\u{11333}'), ('\u{11335}', '\u{11339}'), ('\u{1133c}', '\u{11344}'), + ('\u{11347}', '\u{11348}'), ('\u{1134b}', '\u{1134d}'), ('\u{11350}', '\u{11350}'), + ('\u{11357}', '\u{11357}'), ('\u{1135d}', '\u{11363}'), ('\u{11366}', '\u{1136c}'), + ('\u{11370}', '\u{11374}'), ('\u{11400}', '\u{1144a}'), ('\u{11450}', '\u{11459}'), + ('\u{11480}', '\u{114c5}'), ('\u{114c7}', '\u{114c7}'), ('\u{114d0}', '\u{114d9}'), + ('\u{11580}', '\u{115b5}'), ('\u{115b8}', '\u{115c0}'), ('\u{115d8}', '\u{115dd}'), + ('\u{11600}', '\u{11640}'), ('\u{11644}', '\u{11644}'), ('\u{11650}', '\u{11659}'), + ('\u{11680}', '\u{116b7}'), ('\u{116c0}', '\u{116c9}'), ('\u{11700}', '\u{11719}'), + ('\u{1171d}', '\u{1172b}'), ('\u{11730}', '\u{11739}'), ('\u{118a0}', '\u{118e9}'), + ('\u{118ff}', '\u{118ff}'), ('\u{11ac0}', '\u{11af8}'), ('\u{11c00}', '\u{11c08}'), + ('\u{11c0a}', '\u{11c36}'), ('\u{11c38}', '\u{11c40}'), ('\u{11c50}', '\u{11c59}'), + ('\u{11c72}', '\u{11c8f}'), ('\u{11c92}', '\u{11ca7}'), ('\u{11ca9}', '\u{11cb6}'), + ('\u{12000}', '\u{12399}'), ('\u{12400}', '\u{1246e}'), ('\u{12480}', '\u{12543}'), + ('\u{13000}', '\u{1342e}'), ('\u{14400}', '\u{14646}'), ('\u{16800}', '\u{16a38}'), + ('\u{16a40}', '\u{16a5e}'), ('\u{16a60}', '\u{16a69}'), ('\u{16ad0}', '\u{16aed}'), + ('\u{16af0}', '\u{16af4}'), ('\u{16b00}', '\u{16b36}'), ('\u{16b40}', '\u{16b43}'), + ('\u{16b50}', '\u{16b59}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), + ('\u{16f00}', '\u{16f44}'), ('\u{16f50}', '\u{16f7e}'), ('\u{16f8f}', '\u{16f9f}'), + ('\u{16fe0}', '\u{16fe0}'), ('\u{17000}', '\u{187ec}'), ('\u{18800}', '\u{18af2}'), + ('\u{1b000}', '\u{1b001}'), ('\u{1bc00}', '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), + ('\u{1bc80}', '\u{1bc88}'), ('\u{1bc90}', '\u{1bc99}'), ('\u{1bc9d}', '\u{1bc9e}'), + ('\u{1d165}', '\u{1d169}'), ('\u{1d16d}', '\u{1d172}'), ('\u{1d17b}', '\u{1d182}'), + ('\u{1d185}', '\u{1d18b}'), ('\u{1d1aa}', '\u{1d1ad}'), ('\u{1d242}', '\u{1d244}'), + ('\u{1d400}', '\u{1d454}'), ('\u{1d456}', '\u{1d49c}'), ('\u{1d49e}', '\u{1d49f}'), + ('\u{1d4a2}', '\u{1d4a2}'), ('\u{1d4a5}', '\u{1d4a6}'), ('\u{1d4a9}', '\u{1d4ac}'), + ('\u{1d4ae}', '\u{1d4b9}'), ('\u{1d4bb}', '\u{1d4bb}'), ('\u{1d4bd}', '\u{1d4c3}'), + ('\u{1d4c5}', '\u{1d505}'), ('\u{1d507}', '\u{1d50a}'), ('\u{1d50d}', '\u{1d514}'), + ('\u{1d516}', '\u{1d51c}'), ('\u{1d51e}', '\u{1d539}'), ('\u{1d53b}', '\u{1d53e}'), + ('\u{1d540}', '\u{1d544}'), ('\u{1d546}', '\u{1d546}'), ('\u{1d54a}', '\u{1d550}'), + ('\u{1d552}', '\u{1d6a5}'), ('\u{1d6a8}', '\u{1d6c0}'), ('\u{1d6c2}', '\u{1d6da}'), + ('\u{1d6dc}', '\u{1d6fa}'), ('\u{1d6fc}', '\u{1d714}'), ('\u{1d716}', '\u{1d734}'), + ('\u{1d736}', '\u{1d74e}'), ('\u{1d750}', '\u{1d76e}'), ('\u{1d770}', '\u{1d788}'), + ('\u{1d78a}', '\u{1d7a8}'), ('\u{1d7aa}', '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7cb}'), + ('\u{1d7ce}', '\u{1d7ff}'), ('\u{1da00}', '\u{1da36}'), ('\u{1da3b}', '\u{1da6c}'), + ('\u{1da75}', '\u{1da75}'), ('\u{1da84}', '\u{1da84}'), ('\u{1da9b}', '\u{1da9f}'), + ('\u{1daa1}', '\u{1daaf}'), ('\u{1e000}', '\u{1e006}'), ('\u{1e008}', '\u{1e018}'), + ('\u{1e01b}', '\u{1e021}'), ('\u{1e023}', '\u{1e024}'), ('\u{1e026}', '\u{1e02a}'), + ('\u{1e800}', '\u{1e8c4}'), ('\u{1e8d0}', '\u{1e8d6}'), ('\u{1e900}', '\u{1e94a}'), + ('\u{1e950}', '\u{1e959}'), ('\u{1ee00}', '\u{1ee03}'), ('\u{1ee05}', '\u{1ee1f}'), + ('\u{1ee21}', '\u{1ee22}'), ('\u{1ee24}', '\u{1ee24}'), ('\u{1ee27}', '\u{1ee27}'), + ('\u{1ee29}', '\u{1ee32}'), ('\u{1ee34}', '\u{1ee37}'), ('\u{1ee39}', '\u{1ee39}'), + ('\u{1ee3b}', '\u{1ee3b}'), ('\u{1ee42}', '\u{1ee42}'), ('\u{1ee47}', '\u{1ee47}'), + ('\u{1ee49}', '\u{1ee49}'), ('\u{1ee4b}', '\u{1ee4b}'), ('\u{1ee4d}', '\u{1ee4f}'), + ('\u{1ee51}', '\u{1ee52}'), ('\u{1ee54}', '\u{1ee54}'), ('\u{1ee57}', '\u{1ee57}'), + ('\u{1ee59}', '\u{1ee59}'), ('\u{1ee5b}', '\u{1ee5b}'), ('\u{1ee5d}', '\u{1ee5d}'), + ('\u{1ee5f}', '\u{1ee5f}'), ('\u{1ee61}', '\u{1ee62}'), ('\u{1ee64}', '\u{1ee64}'), + ('\u{1ee67}', '\u{1ee6a}'), ('\u{1ee6c}', '\u{1ee72}'), ('\u{1ee74}', '\u{1ee77}'), + ('\u{1ee79}', '\u{1ee7c}'), ('\u{1ee7e}', '\u{1ee7e}'), ('\u{1ee80}', '\u{1ee89}'), + ('\u{1ee8b}', '\u{1ee9b}'), ('\u{1eea1}', '\u{1eea3}'), ('\u{1eea5}', '\u{1eea9}'), + ('\u{1eeab}', '\u{1eebb}'), ('\u{20000}', '\u{2a6d6}'), ('\u{2a700}', '\u{2b734}'), + ('\u{2b740}', '\u{2b81d}'), ('\u{2b820}', '\u{2cea1}'), ('\u{2f800}', '\u{2fa1d}'), + ('\u{e0100}', '\u{e01ef}') + ]; + + pub fn XID_Continue(c: char) -> bool { + super::bsearch_range_table(c, XID_Continue_table) + } + + pub const XID_Start_table: &'static [(char, char)] = &[ + ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), + ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), + ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', + '\u{2ee}'), ('\u{370}', '\u{374}'), ('\u{376}', '\u{377}'), ('\u{37b}', '\u{37d}'), + ('\u{37f}', '\u{37f}'), ('\u{386}', '\u{386}'), ('\u{388}', '\u{38a}'), ('\u{38c}', + '\u{38c}'), ('\u{38e}', '\u{3a1}'), ('\u{3a3}', '\u{3f5}'), ('\u{3f7}', '\u{481}'), + ('\u{48a}', '\u{52f}'), ('\u{531}', '\u{556}'), ('\u{559}', '\u{559}'), ('\u{561}', + '\u{587}'), ('\u{5d0}', '\u{5ea}'), ('\u{5f0}', '\u{5f2}'), ('\u{620}', '\u{64a}'), + ('\u{66e}', '\u{66f}'), ('\u{671}', '\u{6d3}'), ('\u{6d5}', '\u{6d5}'), ('\u{6e5}', + '\u{6e6}'), ('\u{6ee}', '\u{6ef}'), ('\u{6fa}', '\u{6fc}'), ('\u{6ff}', '\u{6ff}'), + ('\u{710}', '\u{710}'), ('\u{712}', '\u{72f}'), ('\u{74d}', '\u{7a5}'), ('\u{7b1}', + '\u{7b1}'), ('\u{7ca}', '\u{7ea}'), ('\u{7f4}', '\u{7f5}'), ('\u{7fa}', '\u{7fa}'), + ('\u{800}', '\u{815}'), ('\u{81a}', '\u{81a}'), ('\u{824}', '\u{824}'), ('\u{828}', + '\u{828}'), ('\u{840}', '\u{858}'), ('\u{8a0}', '\u{8b4}'), ('\u{8b6}', '\u{8bd}'), + ('\u{904}', '\u{939}'), ('\u{93d}', '\u{93d}'), ('\u{950}', '\u{950}'), ('\u{958}', + '\u{961}'), ('\u{971}', '\u{980}'), ('\u{985}', '\u{98c}'), ('\u{98f}', '\u{990}'), + ('\u{993}', '\u{9a8}'), ('\u{9aa}', '\u{9b0}'), ('\u{9b2}', '\u{9b2}'), ('\u{9b6}', + '\u{9b9}'), ('\u{9bd}', '\u{9bd}'), ('\u{9ce}', '\u{9ce}'), ('\u{9dc}', '\u{9dd}'), + ('\u{9df}', '\u{9e1}'), ('\u{9f0}', '\u{9f1}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', + '\u{a10}'), ('\u{a13}', '\u{a28}'), ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), + ('\u{a35}', '\u{a36}'), ('\u{a38}', '\u{a39}'), ('\u{a59}', '\u{a5c}'), ('\u{a5e}', + '\u{a5e}'), ('\u{a72}', '\u{a74}'), ('\u{a85}', '\u{a8d}'), ('\u{a8f}', '\u{a91}'), + ('\u{a93}', '\u{aa8}'), ('\u{aaa}', '\u{ab0}'), ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', + '\u{ab9}'), ('\u{abd}', '\u{abd}'), ('\u{ad0}', '\u{ad0}'), ('\u{ae0}', '\u{ae1}'), + ('\u{af9}', '\u{af9}'), ('\u{b05}', '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', + '\u{b28}'), ('\u{b2a}', '\u{b30}'), ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), + ('\u{b3d}', '\u{b3d}'), ('\u{b5c}', '\u{b5d}'), ('\u{b5f}', '\u{b61}'), ('\u{b71}', + '\u{b71}'), ('\u{b83}', '\u{b83}'), ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), + ('\u{b92}', '\u{b95}'), ('\u{b99}', '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', + '\u{b9f}'), ('\u{ba3}', '\u{ba4}'), ('\u{ba8}', '\u{baa}'), ('\u{bae}', '\u{bb9}'), + ('\u{bd0}', '\u{bd0}'), ('\u{c05}', '\u{c0c}'), ('\u{c0e}', '\u{c10}'), ('\u{c12}', + '\u{c28}'), ('\u{c2a}', '\u{c39}'), ('\u{c3d}', '\u{c3d}'), ('\u{c58}', '\u{c5a}'), + ('\u{c60}', '\u{c61}'), ('\u{c80}', '\u{c80}'), ('\u{c85}', '\u{c8c}'), ('\u{c8e}', + '\u{c90}'), ('\u{c92}', '\u{ca8}'), ('\u{caa}', '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), + ('\u{cbd}', '\u{cbd}'), ('\u{cde}', '\u{cde}'), ('\u{ce0}', '\u{ce1}'), ('\u{cf1}', + '\u{cf2}'), ('\u{d05}', '\u{d0c}'), ('\u{d0e}', '\u{d10}'), ('\u{d12}', '\u{d3a}'), + ('\u{d3d}', '\u{d3d}'), ('\u{d4e}', '\u{d4e}'), ('\u{d54}', '\u{d56}'), ('\u{d5f}', + '\u{d61}'), ('\u{d7a}', '\u{d7f}'), ('\u{d85}', '\u{d96}'), ('\u{d9a}', '\u{db1}'), + ('\u{db3}', '\u{dbb}'), ('\u{dbd}', '\u{dbd}'), ('\u{dc0}', '\u{dc6}'), ('\u{e01}', + '\u{e30}'), ('\u{e32}', '\u{e32}'), ('\u{e40}', '\u{e46}'), ('\u{e81}', '\u{e82}'), + ('\u{e84}', '\u{e84}'), ('\u{e87}', '\u{e88}'), ('\u{e8a}', '\u{e8a}'), ('\u{e8d}', + '\u{e8d}'), ('\u{e94}', '\u{e97}'), ('\u{e99}', '\u{e9f}'), ('\u{ea1}', '\u{ea3}'), + ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', '\u{ea7}'), ('\u{eaa}', '\u{eab}'), ('\u{ead}', + '\u{eb0}'), ('\u{eb2}', '\u{eb2}'), ('\u{ebd}', '\u{ebd}'), ('\u{ec0}', '\u{ec4}'), + ('\u{ec6}', '\u{ec6}'), ('\u{edc}', '\u{edf}'), ('\u{f00}', '\u{f00}'), ('\u{f40}', + '\u{f47}'), ('\u{f49}', '\u{f6c}'), ('\u{f88}', '\u{f8c}'), ('\u{1000}', '\u{102a}'), + ('\u{103f}', '\u{103f}'), ('\u{1050}', '\u{1055}'), ('\u{105a}', '\u{105d}'), ('\u{1061}', + '\u{1061}'), ('\u{1065}', '\u{1066}'), ('\u{106e}', '\u{1070}'), ('\u{1075}', '\u{1081}'), + ('\u{108e}', '\u{108e}'), ('\u{10a0}', '\u{10c5}'), ('\u{10c7}', '\u{10c7}'), ('\u{10cd}', + '\u{10cd}'), ('\u{10d0}', '\u{10fa}'), ('\u{10fc}', '\u{1248}'), ('\u{124a}', '\u{124d}'), + ('\u{1250}', '\u{1256}'), ('\u{1258}', '\u{1258}'), ('\u{125a}', '\u{125d}'), ('\u{1260}', + '\u{1288}'), ('\u{128a}', '\u{128d}'), ('\u{1290}', '\u{12b0}'), ('\u{12b2}', '\u{12b5}'), + ('\u{12b8}', '\u{12be}'), ('\u{12c0}', '\u{12c0}'), ('\u{12c2}', '\u{12c5}'), ('\u{12c8}', + '\u{12d6}'), ('\u{12d8}', '\u{1310}'), ('\u{1312}', '\u{1315}'), ('\u{1318}', '\u{135a}'), + ('\u{1380}', '\u{138f}'), ('\u{13a0}', '\u{13f5}'), ('\u{13f8}', '\u{13fd}'), ('\u{1401}', + '\u{166c}'), ('\u{166f}', '\u{167f}'), ('\u{1681}', '\u{169a}'), ('\u{16a0}', '\u{16ea}'), + ('\u{16ee}', '\u{16f8}'), ('\u{1700}', '\u{170c}'), ('\u{170e}', '\u{1711}'), ('\u{1720}', + '\u{1731}'), ('\u{1740}', '\u{1751}'), ('\u{1760}', '\u{176c}'), ('\u{176e}', '\u{1770}'), + ('\u{1780}', '\u{17b3}'), ('\u{17d7}', '\u{17d7}'), ('\u{17dc}', '\u{17dc}'), ('\u{1820}', + '\u{1877}'), ('\u{1880}', '\u{18a8}'), ('\u{18aa}', '\u{18aa}'), ('\u{18b0}', '\u{18f5}'), + ('\u{1900}', '\u{191e}'), ('\u{1950}', '\u{196d}'), ('\u{1970}', '\u{1974}'), ('\u{1980}', + '\u{19ab}'), ('\u{19b0}', '\u{19c9}'), ('\u{1a00}', '\u{1a16}'), ('\u{1a20}', '\u{1a54}'), + ('\u{1aa7}', '\u{1aa7}'), ('\u{1b05}', '\u{1b33}'), ('\u{1b45}', '\u{1b4b}'), ('\u{1b83}', + '\u{1ba0}'), ('\u{1bae}', '\u{1baf}'), ('\u{1bba}', '\u{1be5}'), ('\u{1c00}', '\u{1c23}'), + ('\u{1c4d}', '\u{1c4f}'), ('\u{1c5a}', '\u{1c7d}'), ('\u{1c80}', '\u{1c88}'), ('\u{1ce9}', + '\u{1cec}'), ('\u{1cee}', '\u{1cf1}'), ('\u{1cf5}', '\u{1cf6}'), ('\u{1d00}', '\u{1dbf}'), + ('\u{1e00}', '\u{1f15}'), ('\u{1f18}', '\u{1f1d}'), ('\u{1f20}', '\u{1f45}'), ('\u{1f48}', + '\u{1f4d}'), ('\u{1f50}', '\u{1f57}'), ('\u{1f59}', '\u{1f59}'), ('\u{1f5b}', '\u{1f5b}'), + ('\u{1f5d}', '\u{1f5d}'), ('\u{1f5f}', '\u{1f7d}'), ('\u{1f80}', '\u{1fb4}'), ('\u{1fb6}', + '\u{1fbc}'), ('\u{1fbe}', '\u{1fbe}'), ('\u{1fc2}', '\u{1fc4}'), ('\u{1fc6}', '\u{1fcc}'), + ('\u{1fd0}', '\u{1fd3}'), ('\u{1fd6}', '\u{1fdb}'), ('\u{1fe0}', '\u{1fec}'), ('\u{1ff2}', + '\u{1ff4}'), ('\u{1ff6}', '\u{1ffc}'), ('\u{2071}', '\u{2071}'), ('\u{207f}', '\u{207f}'), + ('\u{2090}', '\u{209c}'), ('\u{2102}', '\u{2102}'), ('\u{2107}', '\u{2107}'), ('\u{210a}', + '\u{2113}'), ('\u{2115}', '\u{2115}'), ('\u{2118}', '\u{211d}'), ('\u{2124}', '\u{2124}'), + ('\u{2126}', '\u{2126}'), ('\u{2128}', '\u{2128}'), ('\u{212a}', '\u{2139}'), ('\u{213c}', + '\u{213f}'), ('\u{2145}', '\u{2149}'), ('\u{214e}', '\u{214e}'), ('\u{2160}', '\u{2188}'), + ('\u{2c00}', '\u{2c2e}'), ('\u{2c30}', '\u{2c5e}'), ('\u{2c60}', '\u{2ce4}'), ('\u{2ceb}', + '\u{2cee}'), ('\u{2cf2}', '\u{2cf3}'), ('\u{2d00}', '\u{2d25}'), ('\u{2d27}', '\u{2d27}'), + ('\u{2d2d}', '\u{2d2d}'), ('\u{2d30}', '\u{2d67}'), ('\u{2d6f}', '\u{2d6f}'), ('\u{2d80}', + '\u{2d96}'), ('\u{2da0}', '\u{2da6}'), ('\u{2da8}', '\u{2dae}'), ('\u{2db0}', '\u{2db6}'), + ('\u{2db8}', '\u{2dbe}'), ('\u{2dc0}', '\u{2dc6}'), ('\u{2dc8}', '\u{2dce}'), ('\u{2dd0}', + '\u{2dd6}'), ('\u{2dd8}', '\u{2dde}'), ('\u{3005}', '\u{3007}'), ('\u{3021}', '\u{3029}'), + ('\u{3031}', '\u{3035}'), ('\u{3038}', '\u{303c}'), ('\u{3041}', '\u{3096}'), ('\u{309d}', + '\u{309f}'), ('\u{30a1}', '\u{30fa}'), ('\u{30fc}', '\u{30ff}'), ('\u{3105}', '\u{312d}'), + ('\u{3131}', '\u{318e}'), ('\u{31a0}', '\u{31ba}'), ('\u{31f0}', '\u{31ff}'), ('\u{3400}', + '\u{4db5}'), ('\u{4e00}', '\u{9fd5}'), ('\u{a000}', '\u{a48c}'), ('\u{a4d0}', '\u{a4fd}'), + ('\u{a500}', '\u{a60c}'), ('\u{a610}', '\u{a61f}'), ('\u{a62a}', '\u{a62b}'), ('\u{a640}', + '\u{a66e}'), ('\u{a67f}', '\u{a69d}'), ('\u{a6a0}', '\u{a6ef}'), ('\u{a717}', '\u{a71f}'), + ('\u{a722}', '\u{a788}'), ('\u{a78b}', '\u{a7ae}'), ('\u{a7b0}', '\u{a7b7}'), ('\u{a7f7}', + '\u{a801}'), ('\u{a803}', '\u{a805}'), ('\u{a807}', '\u{a80a}'), ('\u{a80c}', '\u{a822}'), + ('\u{a840}', '\u{a873}'), ('\u{a882}', '\u{a8b3}'), ('\u{a8f2}', '\u{a8f7}'), ('\u{a8fb}', + '\u{a8fb}'), ('\u{a8fd}', '\u{a8fd}'), ('\u{a90a}', '\u{a925}'), ('\u{a930}', '\u{a946}'), + ('\u{a960}', '\u{a97c}'), ('\u{a984}', '\u{a9b2}'), ('\u{a9cf}', '\u{a9cf}'), ('\u{a9e0}', + '\u{a9e4}'), ('\u{a9e6}', '\u{a9ef}'), ('\u{a9fa}', '\u{a9fe}'), ('\u{aa00}', '\u{aa28}'), + ('\u{aa40}', '\u{aa42}'), ('\u{aa44}', '\u{aa4b}'), ('\u{aa60}', '\u{aa76}'), ('\u{aa7a}', + '\u{aa7a}'), ('\u{aa7e}', '\u{aaaf}'), ('\u{aab1}', '\u{aab1}'), ('\u{aab5}', '\u{aab6}'), + ('\u{aab9}', '\u{aabd}'), ('\u{aac0}', '\u{aac0}'), ('\u{aac2}', '\u{aac2}'), ('\u{aadb}', + '\u{aadd}'), ('\u{aae0}', '\u{aaea}'), ('\u{aaf2}', '\u{aaf4}'), ('\u{ab01}', '\u{ab06}'), + ('\u{ab09}', '\u{ab0e}'), ('\u{ab11}', '\u{ab16}'), ('\u{ab20}', '\u{ab26}'), ('\u{ab28}', + '\u{ab2e}'), ('\u{ab30}', '\u{ab5a}'), ('\u{ab5c}', '\u{ab65}'), ('\u{ab70}', '\u{abe2}'), + ('\u{ac00}', '\u{d7a3}'), ('\u{d7b0}', '\u{d7c6}'), ('\u{d7cb}', '\u{d7fb}'), ('\u{f900}', + '\u{fa6d}'), ('\u{fa70}', '\u{fad9}'), ('\u{fb00}', '\u{fb06}'), ('\u{fb13}', '\u{fb17}'), + ('\u{fb1d}', '\u{fb1d}'), ('\u{fb1f}', '\u{fb28}'), ('\u{fb2a}', '\u{fb36}'), ('\u{fb38}', + '\u{fb3c}'), ('\u{fb3e}', '\u{fb3e}'), ('\u{fb40}', '\u{fb41}'), ('\u{fb43}', '\u{fb44}'), + ('\u{fb46}', '\u{fbb1}'), ('\u{fbd3}', '\u{fc5d}'), ('\u{fc64}', '\u{fd3d}'), ('\u{fd50}', + '\u{fd8f}'), ('\u{fd92}', '\u{fdc7}'), ('\u{fdf0}', '\u{fdf9}'), ('\u{fe71}', '\u{fe71}'), + ('\u{fe73}', '\u{fe73}'), ('\u{fe77}', '\u{fe77}'), ('\u{fe79}', '\u{fe79}'), ('\u{fe7b}', + '\u{fe7b}'), ('\u{fe7d}', '\u{fe7d}'), ('\u{fe7f}', '\u{fefc}'), ('\u{ff21}', '\u{ff3a}'), + ('\u{ff41}', '\u{ff5a}'), ('\u{ff66}', '\u{ff9d}'), ('\u{ffa0}', '\u{ffbe}'), ('\u{ffc2}', + '\u{ffc7}'), ('\u{ffca}', '\u{ffcf}'), ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}', '\u{ffdc}'), + ('\u{10000}', '\u{1000b}'), ('\u{1000d}', '\u{10026}'), ('\u{10028}', '\u{1003a}'), + ('\u{1003c}', '\u{1003d}'), ('\u{1003f}', '\u{1004d}'), ('\u{10050}', '\u{1005d}'), + ('\u{10080}', '\u{100fa}'), ('\u{10140}', '\u{10174}'), ('\u{10280}', '\u{1029c}'), + ('\u{102a0}', '\u{102d0}'), ('\u{10300}', '\u{1031f}'), ('\u{10330}', '\u{1034a}'), + ('\u{10350}', '\u{10375}'), ('\u{10380}', '\u{1039d}'), ('\u{103a0}', '\u{103c3}'), + ('\u{103c8}', '\u{103cf}'), ('\u{103d1}', '\u{103d5}'), ('\u{10400}', '\u{1049d}'), + ('\u{104b0}', '\u{104d3}'), ('\u{104d8}', '\u{104fb}'), ('\u{10500}', '\u{10527}'), + ('\u{10530}', '\u{10563}'), ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), + ('\u{10760}', '\u{10767}'), ('\u{10800}', '\u{10805}'), ('\u{10808}', '\u{10808}'), + ('\u{1080a}', '\u{10835}'), ('\u{10837}', '\u{10838}'), ('\u{1083c}', '\u{1083c}'), + ('\u{1083f}', '\u{10855}'), ('\u{10860}', '\u{10876}'), ('\u{10880}', '\u{1089e}'), + ('\u{108e0}', '\u{108f2}'), ('\u{108f4}', '\u{108f5}'), ('\u{10900}', '\u{10915}'), + ('\u{10920}', '\u{10939}'), ('\u{10980}', '\u{109b7}'), ('\u{109be}', '\u{109bf}'), + ('\u{10a00}', '\u{10a00}'), ('\u{10a10}', '\u{10a13}'), ('\u{10a15}', '\u{10a17}'), + ('\u{10a19}', '\u{10a33}'), ('\u{10a60}', '\u{10a7c}'), ('\u{10a80}', '\u{10a9c}'), + ('\u{10ac0}', '\u{10ac7}'), ('\u{10ac9}', '\u{10ae4}'), ('\u{10b00}', '\u{10b35}'), + ('\u{10b40}', '\u{10b55}'), ('\u{10b60}', '\u{10b72}'), ('\u{10b80}', '\u{10b91}'), + ('\u{10c00}', '\u{10c48}'), ('\u{10c80}', '\u{10cb2}'), ('\u{10cc0}', '\u{10cf2}'), + ('\u{11003}', '\u{11037}'), ('\u{11083}', '\u{110af}'), ('\u{110d0}', '\u{110e8}'), + ('\u{11103}', '\u{11126}'), ('\u{11150}', '\u{11172}'), ('\u{11176}', '\u{11176}'), + ('\u{11183}', '\u{111b2}'), ('\u{111c1}', '\u{111c4}'), ('\u{111da}', '\u{111da}'), + ('\u{111dc}', '\u{111dc}'), ('\u{11200}', '\u{11211}'), ('\u{11213}', '\u{1122b}'), + ('\u{11280}', '\u{11286}'), ('\u{11288}', '\u{11288}'), ('\u{1128a}', '\u{1128d}'), + ('\u{1128f}', '\u{1129d}'), ('\u{1129f}', '\u{112a8}'), ('\u{112b0}', '\u{112de}'), + ('\u{11305}', '\u{1130c}'), ('\u{1130f}', '\u{11310}'), ('\u{11313}', '\u{11328}'), + ('\u{1132a}', '\u{11330}'), ('\u{11332}', '\u{11333}'), ('\u{11335}', '\u{11339}'), + ('\u{1133d}', '\u{1133d}'), ('\u{11350}', '\u{11350}'), ('\u{1135d}', '\u{11361}'), + ('\u{11400}', '\u{11434}'), ('\u{11447}', '\u{1144a}'), ('\u{11480}', '\u{114af}'), + ('\u{114c4}', '\u{114c5}'), ('\u{114c7}', '\u{114c7}'), ('\u{11580}', '\u{115ae}'), + ('\u{115d8}', '\u{115db}'), ('\u{11600}', '\u{1162f}'), ('\u{11644}', '\u{11644}'), + ('\u{11680}', '\u{116aa}'), ('\u{11700}', '\u{11719}'), ('\u{118a0}', '\u{118df}'), + ('\u{118ff}', '\u{118ff}'), ('\u{11ac0}', '\u{11af8}'), ('\u{11c00}', '\u{11c08}'), + ('\u{11c0a}', '\u{11c2e}'), ('\u{11c40}', '\u{11c40}'), ('\u{11c72}', '\u{11c8f}'), + ('\u{12000}', '\u{12399}'), ('\u{12400}', '\u{1246e}'), ('\u{12480}', '\u{12543}'), + ('\u{13000}', '\u{1342e}'), ('\u{14400}', '\u{14646}'), ('\u{16800}', '\u{16a38}'), + ('\u{16a40}', '\u{16a5e}'), ('\u{16ad0}', '\u{16aed}'), ('\u{16b00}', '\u{16b2f}'), + ('\u{16b40}', '\u{16b43}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}'), + ('\u{16f00}', '\u{16f44}'), ('\u{16f50}', '\u{16f50}'), ('\u{16f93}', '\u{16f9f}'), + ('\u{16fe0}', '\u{16fe0}'), ('\u{17000}', '\u{187ec}'), ('\u{18800}', '\u{18af2}'), + ('\u{1b000}', '\u{1b001}'), ('\u{1bc00}', '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), + ('\u{1bc80}', '\u{1bc88}'), ('\u{1bc90}', '\u{1bc99}'), ('\u{1d400}', '\u{1d454}'), + ('\u{1d456}', '\u{1d49c}'), ('\u{1d49e}', '\u{1d49f}'), ('\u{1d4a2}', '\u{1d4a2}'), + ('\u{1d4a5}', '\u{1d4a6}'), ('\u{1d4a9}', '\u{1d4ac}'), ('\u{1d4ae}', '\u{1d4b9}'), + ('\u{1d4bb}', '\u{1d4bb}'), ('\u{1d4bd}', '\u{1d4c3}'), ('\u{1d4c5}', '\u{1d505}'), + ('\u{1d507}', '\u{1d50a}'), ('\u{1d50d}', '\u{1d514}'), ('\u{1d516}', '\u{1d51c}'), + ('\u{1d51e}', '\u{1d539}'), ('\u{1d53b}', '\u{1d53e}'), ('\u{1d540}', '\u{1d544}'), + ('\u{1d546}', '\u{1d546}'), ('\u{1d54a}', '\u{1d550}'), ('\u{1d552}', '\u{1d6a5}'), + ('\u{1d6a8}', '\u{1d6c0}'), ('\u{1d6c2}', '\u{1d6da}'), ('\u{1d6dc}', '\u{1d6fa}'), + ('\u{1d6fc}', '\u{1d714}'), ('\u{1d716}', '\u{1d734}'), ('\u{1d736}', '\u{1d74e}'), + ('\u{1d750}', '\u{1d76e}'), ('\u{1d770}', '\u{1d788}'), ('\u{1d78a}', '\u{1d7a8}'), + ('\u{1d7aa}', '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7cb}'), ('\u{1e800}', '\u{1e8c4}'), + ('\u{1e900}', '\u{1e943}'), ('\u{1ee00}', '\u{1ee03}'), ('\u{1ee05}', '\u{1ee1f}'), + ('\u{1ee21}', '\u{1ee22}'), ('\u{1ee24}', '\u{1ee24}'), ('\u{1ee27}', '\u{1ee27}'), + ('\u{1ee29}', '\u{1ee32}'), ('\u{1ee34}', '\u{1ee37}'), ('\u{1ee39}', '\u{1ee39}'), + ('\u{1ee3b}', '\u{1ee3b}'), ('\u{1ee42}', '\u{1ee42}'), ('\u{1ee47}', '\u{1ee47}'), + ('\u{1ee49}', '\u{1ee49}'), ('\u{1ee4b}', '\u{1ee4b}'), ('\u{1ee4d}', '\u{1ee4f}'), + ('\u{1ee51}', '\u{1ee52}'), ('\u{1ee54}', '\u{1ee54}'), ('\u{1ee57}', '\u{1ee57}'), + ('\u{1ee59}', '\u{1ee59}'), ('\u{1ee5b}', '\u{1ee5b}'), ('\u{1ee5d}', '\u{1ee5d}'), + ('\u{1ee5f}', '\u{1ee5f}'), ('\u{1ee61}', '\u{1ee62}'), ('\u{1ee64}', '\u{1ee64}'), + ('\u{1ee67}', '\u{1ee6a}'), ('\u{1ee6c}', '\u{1ee72}'), ('\u{1ee74}', '\u{1ee77}'), + ('\u{1ee79}', '\u{1ee7c}'), ('\u{1ee7e}', '\u{1ee7e}'), ('\u{1ee80}', '\u{1ee89}'), + ('\u{1ee8b}', '\u{1ee9b}'), ('\u{1eea1}', '\u{1eea3}'), ('\u{1eea5}', '\u{1eea9}'), + ('\u{1eeab}', '\u{1eebb}'), ('\u{20000}', '\u{2a6d6}'), ('\u{2a700}', '\u{2b734}'), + ('\u{2b740}', '\u{2b81d}'), ('\u{2b820}', '\u{2cea1}'), ('\u{2f800}', '\u{2fa1d}') + ]; + + pub fn XID_Start(c: char) -> bool { + super::bsearch_range_table(c, XID_Start_table) + } + +} + diff --git a/vendor/registry-40351f815f426200/unicode-xid/src/tests.rs b/vendor/registry-40351f815f426200/unicode-xid/src/tests.rs new file mode 100644 index 000000000..f4333967f --- /dev/null +++ b/vendor/registry-40351f815f426200/unicode-xid/src/tests.rs @@ -0,0 +1,113 @@ +// Copyright 2012-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. + +#[cfg(feature = "bench")] +use std::iter; +#[cfg(feature = "bench")] +use test::Bencher; +#[cfg(feature = "bench")] +use std::prelude::v1::*; + +use super::UnicodeXID; + +#[cfg(feature = "bench")] +#[bench] +fn cargo_is_xid_start(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.bytes = string.len() as u64; + b.iter(|| { + string.chars().all(UnicodeXID::is_xid_start) + }); +} + +#[cfg(feature = "bench")] +#[bench] +fn stdlib_is_xid_start(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.bytes = string.len() as u64; + b.iter(|| { + string.chars().all(char::is_xid_start) + }); +} + +#[cfg(feature = "bench")] +#[bench] +fn cargo_xid_continue(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.bytes = string.len() as u64; + b.iter(|| { + string.chars().all(UnicodeXID::is_xid_continue) + }); +} + +#[cfg(feature = "bench")] +#[bench] +fn stdlib_xid_continue(b: &mut Bencher) { + let string = iter::repeat('a').take(4096).collect::(); + + b.bytes = string.len() as u64; + b.iter(|| { + string.chars().all(char::is_xid_continue) + }); +} + +#[test] +fn test_is_xid_start() { + let chars = [ + 'A', 'Z', 'a', 'z', + '\u{1000d}', '\u{10026}', + ]; + + for ch in &chars { + assert!(UnicodeXID::is_xid_start(*ch), "{}", ch); + } +} + +#[test] +fn test_is_not_xid_start() { + let chars = [ + '\x00', '\x01', + '0', '9', + ' ', '[', '<', '{', '(', + '\u{02c2}', '\u{ffff}', + ]; + + for ch in &chars { + assert!(!UnicodeXID::is_xid_start(*ch), "{}", ch); + } +} + +#[test] +fn test_is_xid_continue() { + let chars = [ + '0', '9', 'A', 'Z', 'a', 'z', '_', + '\u{1000d}', '\u{10026}', + ]; + + for ch in &chars { + assert!(UnicodeXID::is_xid_continue(*ch), "{}", ch); + } +} + +#[test] +fn test_is_not_xid_continue() { + let chars = [ + '\x00', '\x01', + ' ', '[', '<', '{', '(', + '\u{02c2}', '\u{ffff}', + ]; + + for &ch in &chars { + assert!(!UnicodeXID::is_xid_continue(ch), "{}", ch); + } +} diff --git a/vendor/registry-40351f815f426200/vec_map/.cargo-checksum.json b/vendor/registry-40351f815f426200/vec_map/.cargo-checksum.json new file mode 100644 index 000000000..d0277836f --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"22996d0c0b9d6988865764445f041d7735cf5946d1878a71c4147ea1677fc032","LICENSE-APACHE":"1ac50a5abd5cff5331d59928d83369b66b0099a88f0111dc2175526b3c666dec","LICENSE-MIT":"fceec72e827b021cda4ce5e838aaa6c8eaf35ce199af802437bbe4ee70bbb7c0","README.md":"227ab82c9b6041cdb44eee84a0d6c59fdc5cab1e6e7109da3d20c5f2c9da5ce1","deploy-docs.sh":"18cd5862144f5391879aa74b1aaafd0546550aa356a7bdc0dedbdd6993d5076f","src/lib.rs":"b82ca5572cb6e0b6ff49e7f07f24af7a8f474528b753d6dee180e58c59033089"},"package":"05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/vec_map/Cargo.toml b/vendor/registry-40351f815f426200/vec_map/Cargo.toml new file mode 100644 index 000000000..14691db92 --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/Cargo.toml @@ -0,0 +1,30 @@ +# 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 = "vec_map" +version = "0.8.1" +authors = ["Alex Crichton ", "Jorge Aparicio ", "Alexis Beingessner ", "Brian Anderson <>", "tbu- <>", "Manish Goregaokar <>", "Aaron Turon ", "Adolfo Ochagavía <>", "Niko Matsakis <>", "Steven Fackler <>", "Chase Southwood ", "Eduard Burtescu <>", "Florian Wilkens <>", "Félix Raimundo <>", "Tibor Benke <>", "Markus Siemens ", "Josh Branchaud ", "Huon Wilson ", "Corey Farwell ", "Aaron Liblong <>", "Nick Cameron ", "Patrick Walton ", "Felix S Klock II <>", "Andrew Paseltiner ", "Sean McArthur ", "Vadim Petrochenkov <>"] +description = "A simple map based on a vector for small integer keys" +homepage = "https://github.com/contain-rs/vec-map" +documentation = "https://contain-rs.github.io/vec-map/vec_map" +readme = "README.md" +keywords = ["data-structures", "collections", "vecmap", "vec_map", "contain-rs"] +license = "MIT/Apache-2.0" +repository = "https://github.com/contain-rs/vec-map" +[dependencies.serde] +version = "1.0" +features = ["derive"] +optional = true + +[features] +eders = ["serde"] diff --git a/vendor/registry-40351f815f426200/vec_map/LICENSE-APACHE b/vendor/registry-40351f815f426200/vec_map/LICENSE-APACHE new file mode 100644 index 000000000..583bd5a98 --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/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/vendor/registry-40351f815f426200/vec_map/LICENSE-MIT b/vendor/registry-40351f815f426200/vec_map/LICENSE-MIT new file mode 100644 index 000000000..bf85e629c --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/LICENSE-MIT @@ -0,0 +1,25 @@ +Copyright (c) 2015 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/vendor/registry-40351f815f426200/vec_map/README.md b/vendor/registry-40351f815f426200/vec_map/README.md new file mode 100644 index 000000000..82394df8c --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/README.md @@ -0,0 +1,15 @@ +**WARNING: THIS PROJECT IS IN MAINTENANCE MODE, DUE TO INSUFFICIENT MAINTAINER RESOURCES** + +It works fine, but will generally no longer be improved. + +We are currently only accepting changes which: + +* keep this compiling with the latest versions of Rust or its dependencies. +* have minimal review requirements, such as documentation changes (so not totally new APIs). + +------ + + +A simple map based on a vector for small integer keys. + +Documentation is available at https://contain-rs.github.io/vec-map/vec_map. diff --git a/vendor/registry-40351f815f426200/vec_map/deploy-docs.sh b/vendor/registry-40351f815f426200/vec_map/deploy-docs.sh new file mode 100644 index 000000000..305be53e6 --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/deploy-docs.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +set -o errexit -o nounset + +rev=$(git rev-parse --short HEAD) + +cd target/doc + +git init +git config user.email 'FlashCat@users.noreply.github.com' +git config user.name 'FlashCat' +git remote add upstream "https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git" +git fetch upstream gh-pages +git reset upstream/gh-pages + +touch . + +git add -A . +git commit -m "rebuild pages at ${rev}" +git push -q upstream HEAD:gh-pages diff --git a/vendor/registry-40351f815f426200/vec_map/src/lib.rs b/vendor/registry-40351f815f426200/vec_map/src/lib.rs new file mode 100644 index 000000000..2bb7b3c96 --- /dev/null +++ b/vendor/registry-40351f815f426200/vec_map/src/lib.rs @@ -0,0 +1,1623 @@ +// Copyright 2012-2018 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. + +#![deny(missing_docs)] + +//! A simple map based on a vector for small integer keys. Space requirements +//! are O(highest integer key). + +// optional serde support +#[cfg(feature = "serde")] +#[macro_use] +extern crate serde; + +use self::Entry::*; + +use std::cmp::{Ordering, max}; +use std::fmt; +use std::hash::{Hash, Hasher}; +use std::iter::{Enumerate, FilterMap, FromIterator}; +use std::mem::{replace, swap}; +use std::ops::{Index, IndexMut}; +use std::slice; +use std::vec; + +/// A map optimized for small integer keys. +/// +/// # Examples +/// +/// ``` +/// use vec_map::VecMap; +/// +/// let mut months = VecMap::new(); +/// months.insert(1, "Jan"); +/// months.insert(2, "Feb"); +/// months.insert(3, "Mar"); +/// +/// if !months.contains_key(12) { +/// println!("The end is near!"); +/// } +/// +/// assert_eq!(months.get(1), Some(&"Jan")); +/// +/// if let Some(value) = months.get_mut(3) { +/// *value = "Venus"; +/// } +/// +/// assert_eq!(months.get(3), Some(&"Venus")); +/// +/// // Print out all months +/// for (key, value) in &months { +/// println!("month {} is {}", key, value); +/// } +/// +/// months.clear(); +/// assert!(months.is_empty()); +/// ``` +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] +pub struct VecMap { + n: usize, + v: Vec>, +} + +/// A view into a single entry in a map, which may either be vacant or occupied. +pub enum Entry<'a, V: 'a> { + /// A vacant Entry + Vacant(VacantEntry<'a, V>), + + /// An occupied Entry + Occupied(OccupiedEntry<'a, V>), +} + +/// A vacant Entry. +pub struct VacantEntry<'a, V: 'a> { + map: &'a mut VecMap, + index: usize, +} + +/// An occupied Entry. +pub struct OccupiedEntry<'a, V: 'a> { + map: &'a mut VecMap, + index: usize, +} + +impl Default for VecMap { + #[inline] + fn default() -> Self { Self::new() } +} + +impl Hash for VecMap { + fn hash(&self, state: &mut H) { + // In order to not traverse the `VecMap` twice, count the elements + // during iteration. + let mut count: usize = 0; + for elt in self { + elt.hash(state); + count += 1; + } + count.hash(state); + } +} + +impl VecMap { + /// Creates an empty `VecMap`. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let mut map: VecMap<&str> = VecMap::new(); + /// ``` + pub fn new() -> Self { VecMap { n: 0, v: vec![] } } + + /// Creates an empty `VecMap` with space for at least `capacity` + /// elements before resizing. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let mut map: VecMap<&str> = VecMap::with_capacity(10); + /// ``` + pub fn with_capacity(capacity: usize) -> Self { + VecMap { n: 0, v: Vec::with_capacity(capacity) } + } + + /// Returns the number of elements the `VecMap` can hold without + /// reallocating. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let map: VecMap = VecMap::with_capacity(10); + /// assert!(map.capacity() >= 10); + /// ``` + #[inline] + pub fn capacity(&self) -> usize { + self.v.capacity() + } + + /// Reserves capacity for the given `VecMap` to contain `len` distinct keys. + /// In the case of `VecMap` this means reallocations will not occur as long + /// as all inserted keys are less than `len`. + /// + /// The collection may reserve more space to avoid frequent reallocations. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let mut map: VecMap<&str> = VecMap::new(); + /// map.reserve_len(10); + /// assert!(map.capacity() >= 10); + /// ``` + pub fn reserve_len(&mut self, len: usize) { + let cur_len = self.v.len(); + if len >= cur_len { + self.v.reserve(len - cur_len); + } + } + + /// Reserves the minimum capacity for the given `VecMap` to contain `len` distinct keys. + /// In the case of `VecMap` this means reallocations will not occur as long as all inserted + /// keys are less than `len`. + /// + /// Note that the allocator may give the collection more space than it requests. + /// Therefore capacity cannot be relied upon to be precisely minimal. Prefer + /// `reserve_len` if future insertions are expected. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let mut map: VecMap<&str> = VecMap::new(); + /// map.reserve_len_exact(10); + /// assert!(map.capacity() >= 10); + /// ``` + pub fn reserve_len_exact(&mut self, len: usize) { + let cur_len = self.v.len(); + if len >= cur_len { + self.v.reserve_exact(len - cur_len); + } + } + + /// Trims the `VecMap` of any excess capacity. + /// + /// The collection may reserve more space to avoid frequent reallocations. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// let mut map: VecMap<&str> = VecMap::with_capacity(10); + /// map.shrink_to_fit(); + /// assert_eq!(map.capacity(), 0); + /// ``` + pub fn shrink_to_fit(&mut self) { + // strip off trailing `None`s + if let Some(idx) = self.v.iter().rposition(Option::is_some) { + self.v.truncate(idx + 1); + } else { + self.v.clear(); + } + + self.v.shrink_to_fit() + } + + /// Returns an iterator visiting all keys in ascending order of the keys. + /// The iterator's element type is `usize`. + pub fn keys(&self) -> Keys { + Keys { iter: self.iter() } + } + + /// Returns an iterator visiting all values in ascending order of the keys. + /// The iterator's element type is `&'r V`. + pub fn values(&self) -> Values { + Values { iter: self.iter() } + } + + /// Returns an iterator visiting all values in ascending order of the keys. + /// The iterator's element type is `&'r mut V`. + pub fn values_mut(&mut self) -> ValuesMut { + ValuesMut { iter_mut: self.iter_mut() } + } + + /// Returns an iterator visiting all key-value pairs in ascending order of the keys. + /// The iterator's element type is `(usize, &'r V)`. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// map.insert(3, "c"); + /// map.insert(2, "b"); + /// + /// // Print `1: a` then `2: b` then `3: c` + /// for (key, value) in map.iter() { + /// println!("{}: {}", key, value); + /// } + /// ``` + pub fn iter(&self) -> Iter { + Iter { + front: 0, + back: self.v.len(), + n: self.n, + yielded: 0, + iter: self.v.iter() + } + } + + /// Returns an iterator visiting all key-value pairs in ascending order of the keys, + /// with mutable references to the values. + /// The iterator's element type is `(usize, &'r mut V)`. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// map.insert(2, "b"); + /// map.insert(3, "c"); + /// + /// for (key, value) in map.iter_mut() { + /// *value = "x"; + /// } + /// + /// for (key, value) in &map { + /// assert_eq!(value, &"x"); + /// } + /// ``` + pub fn iter_mut(&mut self) -> IterMut { + IterMut { + front: 0, + back: self.v.len(), + n: self.n, + yielded: 0, + iter: self.v.iter_mut() + } + } + + /// Moves all elements from `other` into the map while overwriting existing keys. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut a = VecMap::new(); + /// a.insert(1, "a"); + /// a.insert(2, "b"); + /// + /// let mut b = VecMap::new(); + /// b.insert(3, "c"); + /// b.insert(4, "d"); + /// + /// a.append(&mut b); + /// + /// assert_eq!(a.len(), 4); + /// assert_eq!(b.len(), 0); + /// assert_eq!(a[1], "a"); + /// assert_eq!(a[2], "b"); + /// assert_eq!(a[3], "c"); + /// assert_eq!(a[4], "d"); + /// ``` + pub fn append(&mut self, other: &mut Self) { + self.extend(other.drain()); + } + + /// Splits the collection into two at the given key. + /// + /// Returns a newly allocated `Self`. `self` contains elements `[0, at)`, + /// and the returned `Self` contains elements `[at, max_key)`. + /// + /// Note that the capacity of `self` does not change. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut a = VecMap::new(); + /// a.insert(1, "a"); + /// a.insert(2, "b"); + /// a.insert(3, "c"); + /// a.insert(4, "d"); + /// + /// let b = a.split_off(3); + /// + /// assert_eq!(a[1], "a"); + /// assert_eq!(a[2], "b"); + /// + /// assert_eq!(b[3], "c"); + /// assert_eq!(b[4], "d"); + /// ``` + pub fn split_off(&mut self, at: usize) -> Self { + let mut other = VecMap::new(); + + if at == 0 { + // Move all elements to other + // The swap will also fix .n + swap(self, &mut other); + return other + } else if at >= self.v.len() { + // No elements to copy + return other; + } + + // Look up the index of the first non-None item + let first_index = self.v.iter().position(|el| el.is_some()); + let start_index = match first_index { + Some(index) => max(at, index), + None => { + // self has no elements + return other; + } + }; + + // Fill the new VecMap with `None`s until `start_index` + other.v.extend((0..start_index).map(|_| None)); + + // Move elements beginning with `start_index` from `self` into `other` + let mut taken = 0; + other.v.extend(self.v[start_index..].iter_mut().map(|el| { + let el = el.take(); + if el.is_some() { + taken += 1; + } + el + })); + other.n = taken; + self.n -= taken; + + other + } + + /// Returns an iterator visiting all key-value pairs in ascending order of + /// the keys, emptying (but not consuming) the original `VecMap`. + /// The iterator's element type is `(usize, &'r V)`. Keeps the allocated memory for reuse. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// map.insert(3, "c"); + /// map.insert(2, "b"); + /// + /// let vec: Vec<(usize, &str)> = map.drain().collect(); + /// + /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]); + /// ``` + pub fn drain(&mut self) -> Drain { + fn filter
((i, v): (usize, Option)) -> Option<(usize, A)> { + v.map(|v| (i, v)) + } + let filter: fn((usize, Option)) -> Option<(usize, V)> = filter; // coerce to fn ptr + + self.n = 0; + Drain { iter: self.v.drain(..).enumerate().filter_map(filter) } + } + + /// Returns the number of elements in the map. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut a = VecMap::new(); + /// assert_eq!(a.len(), 0); + /// a.insert(1, "a"); + /// assert_eq!(a.len(), 1); + /// ``` + pub fn len(&self) -> usize { + self.n + } + + /// Returns true if the map contains no elements. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut a = VecMap::new(); + /// assert!(a.is_empty()); + /// a.insert(1, "a"); + /// assert!(!a.is_empty()); + /// ``` + pub fn is_empty(&self) -> bool { + self.n == 0 + } + + /// Clears the map, removing all key-value pairs. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut a = VecMap::new(); + /// a.insert(1, "a"); + /// a.clear(); + /// assert!(a.is_empty()); + /// ``` + pub fn clear(&mut self) { self.n = 0; self.v.clear() } + + /// Returns a reference to the value corresponding to the key. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// assert_eq!(map.get(1), Some(&"a")); + /// assert_eq!(map.get(2), None); + /// ``` + pub fn get(&self, key: usize) -> Option<&V> { + if key < self.v.len() { + self.v[key].as_ref() + } else { + None + } + } + + /// Returns true if the map contains a value for the specified key. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// assert_eq!(map.contains_key(1), true); + /// assert_eq!(map.contains_key(2), false); + /// ``` + #[inline] + pub fn contains_key(&self, key: usize) -> bool { + self.get(key).is_some() + } + + /// Returns a mutable reference to the value corresponding to the key. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// if let Some(x) = map.get_mut(1) { + /// *x = "b"; + /// } + /// assert_eq!(map[1], "b"); + /// ``` + pub fn get_mut(&mut self, key: usize) -> Option<&mut V> { + if key < self.v.len() { + self.v[key].as_mut() + } else { + None + } + } + + /// Inserts a key-value pair into the map. If the key already had a value + /// present in the map, that value is returned. Otherwise, `None` is returned. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// assert_eq!(map.insert(37, "a"), None); + /// assert_eq!(map.is_empty(), false); + /// + /// map.insert(37, "b"); + /// assert_eq!(map.insert(37, "c"), Some("b")); + /// assert_eq!(map[37], "c"); + /// ``` + pub fn insert(&mut self, key: usize, value: V) -> Option { + let len = self.v.len(); + if len <= key { + self.v.extend((0..key - len + 1).map(|_| None)); + } + let was = replace(&mut self.v[key], Some(value)); + if was.is_none() { + self.n += 1; + } + was + } + + /// Removes a key from the map, returning the value at the key if the key + /// was previously in the map. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// assert_eq!(map.remove(1), Some("a")); + /// assert_eq!(map.remove(1), None); + /// ``` + pub fn remove(&mut self, key: usize) -> Option { + if key >= self.v.len() { + return None; + } + let result = &mut self.v[key]; + let was = result.take(); + if was.is_some() { + self.n -= 1; + } + was + } + + /// Gets the given key's corresponding entry in the map for in-place manipulation. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut count: VecMap = VecMap::new(); + /// + /// // count the number of occurrences of numbers in the vec + /// for x in vec![1, 2, 1, 2, 3, 4, 1, 2, 4] { + /// *count.entry(x).or_insert(0) += 1; + /// } + /// + /// assert_eq!(count[1], 3); + /// ``` + pub fn entry(&mut self, key: usize) -> Entry { + // FIXME(Gankro): this is basically the dumbest implementation of + // entry possible, because weird non-lexical borrows issues make it + // completely insane to do any other way. That said, Entry is a border-line + // useless construct on VecMap, so it's hardly a big loss. + if self.contains_key(key) { + Occupied(OccupiedEntry { + map: self, + index: key, + }) + } else { + Vacant(VacantEntry { + map: self, + index: key, + }) + } + } + + /// Retains only the elements specified by the predicate. + /// + /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map: VecMap = (0..8).map(|x|(x, x*10)).collect(); + /// map.retain(|k, _| k % 2 == 0); + /// assert_eq!(map.len(), 4); + /// ``` + pub fn retain(&mut self, mut f: F) + where F: FnMut(usize, &mut V) -> bool + { + for (i, e) in self.v.iter_mut().enumerate() { + let remove = match *e { + Some(ref mut value) => !f(i, value), + None => false, + }; + if remove { + *e = None; + self.n -= 1; + } + } + } +} + +impl<'a, V> Entry<'a, V> { + /// Ensures a value is in the entry by inserting the default if empty, and + /// returns a mutable reference to the value in the entry. + pub fn or_insert(self, default: V) -> &'a mut V { + match self { + Occupied(entry) => entry.into_mut(), + Vacant(entry) => entry.insert(default), + } + } + + /// Ensures a value is in the entry by inserting the result of the default + /// function if empty, and returns a mutable reference to the value in the + /// entry. + pub fn or_insert_with V>(self, default: F) -> &'a mut V { + match self { + Occupied(entry) => entry.into_mut(), + Vacant(entry) => entry.insert(default()), + } + } +} + +impl<'a, V> VacantEntry<'a, V> { + /// Sets the value of the entry with the VacantEntry's key, + /// and returns a mutable reference to it. + pub fn insert(self, value: V) -> &'a mut V { + let index = self.index; + self.map.insert(index, value); + &mut self.map[index] + } +} + +impl<'a, V> OccupiedEntry<'a, V> { + /// Gets a reference to the value in the entry. + pub fn get(&self) -> &V { + let index = self.index; + &self.map[index] + } + + /// Gets a mutable reference to the value in the entry. + pub fn get_mut(&mut self) -> &mut V { + let index = self.index; + &mut self.map[index] + } + + /// Converts the entry into a mutable reference to its value. + pub fn into_mut(self) -> &'a mut V { + let index = self.index; + &mut self.map[index] + } + + /// Sets the value of the entry with the OccupiedEntry's key, + /// and returns the entry's old value. + pub fn insert(&mut self, value: V) -> V { + let index = self.index; + self.map.insert(index, value).unwrap() + } + + /// Takes the value of the entry out of the map, and returns it. + pub fn remove(self) -> V { + let index = self.index; + self.map.remove(index).unwrap() + } +} + +impl Clone for VecMap { + #[inline] + fn clone(&self) -> Self { + VecMap { n: self.n, v: self.v.clone() } + } + + #[inline] + fn clone_from(&mut self, source: &Self) { + self.v.clone_from(&source.v); + self.n = source.n; + } +} + +impl PartialEq for VecMap { + fn eq(&self, other: &Self) -> bool { + self.n == other.n && self.iter().eq(other.iter()) + } +} + +impl Eq for VecMap {} + +impl PartialOrd for VecMap { + #[inline] + fn partial_cmp(&self, other: &Self) -> Option { + self.iter().partial_cmp(other.iter()) + } +} + +impl Ord for VecMap { + #[inline] + fn cmp(&self, other: &Self) -> Ordering { + self.iter().cmp(other.iter()) + } +} + +impl fmt::Debug for VecMap { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_map().entries(self).finish() + } +} + +impl FromIterator<(usize, V)> for VecMap { + fn from_iter>(iter: I) -> Self { + let mut map = Self::new(); + map.extend(iter); + map + } +} + +impl IntoIterator for VecMap { + type Item = (usize, T); + type IntoIter = IntoIter; + + /// Returns an iterator visiting all key-value pairs in ascending order of + /// the keys, consuming the original `VecMap`. + /// The iterator's element type is `(usize, &'r V)`. + /// + /// # Examples + /// + /// ``` + /// use vec_map::VecMap; + /// + /// let mut map = VecMap::new(); + /// map.insert(1, "a"); + /// map.insert(3, "c"); + /// map.insert(2, "b"); + /// + /// let vec: Vec<(usize, &str)> = map.into_iter().collect(); + /// + /// assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]); + /// ``` + fn into_iter(self) -> IntoIter { + IntoIter { + n: self.n, + yielded: 0, + iter: self.v.into_iter().enumerate() + } + } +} + +impl<'a, T> IntoIterator for &'a VecMap { + type Item = (usize, &'a T); + type IntoIter = Iter<'a, T>; + + fn into_iter(self) -> Iter<'a, T> { + self.iter() + } +} + +impl<'a, T> IntoIterator for &'a mut VecMap { + type Item = (usize, &'a mut T); + type IntoIter = IterMut<'a, T>; + + fn into_iter(self) -> IterMut<'a, T> { + self.iter_mut() + } +} + +impl Extend<(usize, V)> for VecMap { + fn extend>(&mut self, iter: I) { + for (k, v) in iter { + self.insert(k, v); + } + } +} + +impl<'a, V: Copy> Extend<(usize, &'a V)> for VecMap { + fn extend>(&mut self, iter: I) { + self.extend(iter.into_iter().map(|(key, &value)| (key, value))); + } +} + +impl Index for VecMap { + type Output = V; + + #[inline] + fn index(&self, i: usize) -> &V { + self.get(i).expect("key not present") + } +} + +impl<'a, V> Index<&'a usize> for VecMap { + type Output = V; + + #[inline] + fn index(&self, i: &usize) -> &V { + self.get(*i).expect("key not present") + } +} + +impl IndexMut for VecMap { + #[inline] + fn index_mut(&mut self, i: usize) -> &mut V { + self.get_mut(i).expect("key not present") + } +} + +impl<'a, V> IndexMut<&'a usize> for VecMap { + #[inline] + fn index_mut(&mut self, i: &usize) -> &mut V { + self.get_mut(*i).expect("key not present") + } +} + +macro_rules! iterator { + (impl $name:ident -> $elem:ty, $($getter:ident),+) => { + impl<'a, V> Iterator for $name<'a, V> { + type Item = $elem; + + #[inline] + fn next(&mut self) -> Option<$elem> { + while self.front < self.back { + if let Some(elem) = self.iter.next() { + if let Some(x) = elem$(. $getter ())+ { + let index = self.front; + self.front += 1; + self.yielded += 1; + return Some((index, x)); + } + } + self.front += 1; + } + None + } + + #[inline] + fn size_hint(&self) -> (usize, Option) { + (self.n - self.yielded, Some(self.n - self.yielded)) + } + } + } +} + +macro_rules! double_ended_iterator { + (impl $name:ident -> $elem:ty, $($getter:ident),+) => { + impl<'a, V> DoubleEndedIterator for $name<'a, V> { + #[inline] + fn next_back(&mut self) -> Option<$elem> { + while self.front < self.back { + if let Some(elem) = self.iter.next_back() { + if let Some(x) = elem$(. $getter ())+ { + self.back -= 1; + return Some((self.back, x)); + } + } + self.back -= 1; + } + None + } + } + } +} + +/// An iterator over the key-value pairs of a map. +pub struct Iter<'a, V: 'a> { + front: usize, + back: usize, + n: usize, + yielded: usize, + iter: slice::Iter<'a, Option> +} + +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` +impl<'a, V> Clone for Iter<'a, V> { + fn clone(&self) -> Iter<'a, V> { + Iter { + front: self.front, + back: self.back, + n: self.n, + yielded: self.yielded, + iter: self.iter.clone() + } + } +} + +iterator! { impl Iter -> (usize, &'a V), as_ref } +impl<'a, V> ExactSizeIterator for Iter<'a, V> {} +double_ended_iterator! { impl Iter -> (usize, &'a V), as_ref } + +/// An iterator over the key-value pairs of a map, with the +/// values being mutable. +pub struct IterMut<'a, V: 'a> { + front: usize, + back: usize, + n: usize, + yielded: usize, + iter: slice::IterMut<'a, Option> +} + +iterator! { impl IterMut -> (usize, &'a mut V), as_mut } +impl<'a, V> ExactSizeIterator for IterMut<'a, V> {} +double_ended_iterator! { impl IterMut -> (usize, &'a mut V), as_mut } + +/// An iterator over the keys of a map. +pub struct Keys<'a, V: 'a> { + iter: Iter<'a, V>, +} + +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` +impl<'a, V> Clone for Keys<'a, V> { + fn clone(&self) -> Keys<'a, V> { + Keys { + iter: self.iter.clone() + } + } +} + +/// An iterator over the values of a map. +pub struct Values<'a, V: 'a> { + iter: Iter<'a, V>, +} + +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` +impl<'a, V> Clone for Values<'a, V> { + fn clone(&self) -> Values<'a, V> { + Values { + iter: self.iter.clone() + } + } +} + +/// An iterator over the values of a map. +pub struct ValuesMut<'a, V: 'a> { + iter_mut: IterMut<'a, V>, +} + +/// A consuming iterator over the key-value pairs of a map. +pub struct IntoIter { + n: usize, + yielded: usize, + iter: Enumerate>>, +} + +/// A draining iterator over the key-value pairs of a map. +pub struct Drain<'a, V: 'a> { + iter: FilterMap< + Enumerate>>, + fn((usize, Option)) -> Option<(usize, V)>> +} + +impl<'a, V> Iterator for Drain<'a, V> { + type Item = (usize, V); + + fn next(&mut self) -> Option<(usize, V)> { self.iter.next() } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } +} + +impl<'a, V> ExactSizeIterator for Drain<'a, V> {} + +impl<'a, V> DoubleEndedIterator for Drain<'a, V> { + fn next_back(&mut self) -> Option<(usize, V)> { self.iter.next_back() } +} + +impl<'a, V> Iterator for Keys<'a, V> { + type Item = usize; + + fn next(&mut self) -> Option { self.iter.next().map(|e| e.0) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } +} + +impl<'a, V> ExactSizeIterator for Keys<'a, V> {} + +impl<'a, V> DoubleEndedIterator for Keys<'a, V> { + fn next_back(&mut self) -> Option { self.iter.next_back().map(|e| e.0) } +} + +impl<'a, V> Iterator for Values<'a, V> { + type Item = &'a V; + + fn next(&mut self) -> Option<(&'a V)> { self.iter.next().map(|e| e.1) } + fn size_hint(&self) -> (usize, Option) { self.iter.size_hint() } +} + +impl<'a, V> ExactSizeIterator for Values<'a, V> {} + +impl<'a, V> DoubleEndedIterator for Values<'a, V> { + fn next_back(&mut self) -> Option<(&'a V)> { self.iter.next_back().map(|e| e.1) } +} + +impl<'a, V> Iterator for ValuesMut<'a, V> { + type Item = &'a mut V; + + fn next(&mut self) -> Option<(&'a mut V)> { self.iter_mut.next().map(|e| e.1) } + fn size_hint(&self) -> (usize, Option) { self.iter_mut.size_hint() } +} + +impl<'a, V> ExactSizeIterator for ValuesMut<'a, V> {} + +impl<'a, V> DoubleEndedIterator for ValuesMut<'a, V> { + fn next_back(&mut self) -> Option<&'a mut V> { self.iter_mut.next_back().map(|e| e.1) } +} + +impl Iterator for IntoIter { + type Item = (usize, V); + + fn next(&mut self) -> Option<(usize, V)> { + loop { + match self.iter.next() { + None => return None, + Some((i, Some(value))) => { + self.yielded += 1; + return Some((i, value)) + }, + _ => {} + } + } + } + + fn size_hint(&self) -> (usize, Option) { + (self.n - self.yielded, Some(self.n - self.yielded)) + } +} + +impl ExactSizeIterator for IntoIter {} + +impl DoubleEndedIterator for IntoIter { + fn next_back(&mut self) -> Option<(usize, V)> { + loop { + match self.iter.next_back() { + None => return None, + Some((i, Some(value))) => return Some((i, value)), + _ => {} + } + } + } +} + +#[allow(dead_code)] +fn assert_properties() { + fn vec_map_covariant<'a, T>(map: VecMap<&'static T>) -> VecMap<&'a T> { map } + + fn into_iter_covariant<'a, T>(iter: IntoIter<&'static T>) -> IntoIter<&'a T> { iter } + + fn iter_covariant<'i, 'a, T>(iter: Iter<'i, &'static T>) -> Iter<'i, &'a T> { iter } + + fn keys_covariant<'i, 'a, T>(iter: Keys<'i, &'static T>) -> Keys<'i, &'a T> { iter } + + fn values_covariant<'i, 'a, T>(iter: Values<'i, &'static T>) -> Values<'i, &'a T> { iter } +} + +#[cfg(test)] +mod test { + use super::VecMap; + use super::Entry::{Occupied, Vacant}; + use std::hash::{Hash, Hasher}; + use std::collections::hash_map::DefaultHasher; + + #[test] + fn test_get_mut() { + let mut m = VecMap::new(); + assert!(m.insert(1, 12).is_none()); + assert!(m.insert(2, 8).is_none()); + assert!(m.insert(5, 14).is_none()); + let new = 100; + match m.get_mut(5) { + None => panic!(), Some(x) => *x = new + } + assert_eq!(m.get(5), Some(&new)); + } + + #[test] + fn test_len() { + let mut map = VecMap::new(); + assert_eq!(map.len(), 0); + assert!(map.is_empty()); + assert!(map.insert(5, 20).is_none()); + assert_eq!(map.len(), 1); + assert!(!map.is_empty()); + assert!(map.insert(11, 12).is_none()); + assert_eq!(map.len(), 2); + assert!(!map.is_empty()); + assert!(map.insert(14, 22).is_none()); + assert_eq!(map.len(), 3); + assert!(!map.is_empty()); + } + + #[test] + fn test_clear() { + let mut map = VecMap::new(); + assert!(map.insert(5, 20).is_none()); + assert!(map.insert(11, 12).is_none()); + assert!(map.insert(14, 22).is_none()); + map.clear(); + assert!(map.is_empty()); + assert!(map.get(5).is_none()); + assert!(map.get(11).is_none()); + assert!(map.get(14).is_none()); + } + + #[test] + fn test_insert() { + let mut m = VecMap::new(); + assert_eq!(m.insert(1, 2), None); + assert_eq!(m.insert(1, 3), Some(2)); + assert_eq!(m.insert(1, 4), Some(3)); + } + + #[test] + fn test_remove() { + let mut m = VecMap::new(); + m.insert(1, 2); + assert_eq!(m.remove(1), Some(2)); + assert_eq!(m.remove(1), None); + } + + #[test] + fn test_keys() { + let mut map = VecMap::new(); + map.insert(1, 'a'); + map.insert(2, 'b'); + map.insert(3, 'c'); + let keys: Vec<_> = map.keys().collect(); + assert_eq!(keys.len(), 3); + assert!(keys.contains(&1)); + assert!(keys.contains(&2)); + assert!(keys.contains(&3)); + } + + #[test] + fn test_values() { + let mut map = VecMap::new(); + map.insert(1, 'a'); + map.insert(2, 'b'); + map.insert(3, 'c'); + let values: Vec<_> = map.values().cloned().collect(); + assert_eq!(values.len(), 3); + assert!(values.contains(&'a')); + assert!(values.contains(&'b')); + assert!(values.contains(&'c')); + } + + #[test] + fn test_iterator() { + let mut m = VecMap::new(); + + assert!(m.insert(0, 1).is_none()); + assert!(m.insert(1, 2).is_none()); + assert!(m.insert(3, 5).is_none()); + assert!(m.insert(6, 10).is_none()); + assert!(m.insert(10, 11).is_none()); + + let mut it = m.iter(); + assert_eq!(it.size_hint(), (5, Some(5))); + assert_eq!(it.next().unwrap(), (0, &1)); + assert_eq!(it.size_hint(), (4, Some(4))); + assert_eq!(it.next().unwrap(), (1, &2)); + assert_eq!(it.size_hint(), (3, Some(3))); + assert_eq!(it.next().unwrap(), (3, &5)); + assert_eq!(it.size_hint(), (2, Some(2))); + assert_eq!(it.next().unwrap(), (6, &10)); + assert_eq!(it.size_hint(), (1, Some(1))); + assert_eq!(it.next().unwrap(), (10, &11)); + assert_eq!(it.size_hint(), (0, Some(0))); + assert!(it.next().is_none()); + } + + #[test] + fn test_iterator_size_hints() { + let mut m = VecMap::new(); + + assert!(m.insert(0, 1).is_none()); + assert!(m.insert(1, 2).is_none()); + assert!(m.insert(3, 5).is_none()); + assert!(m.insert(6, 10).is_none()); + assert!(m.insert(10, 11).is_none()); + + assert_eq!(m.iter().size_hint(), (5, Some(5))); + assert_eq!(m.iter().rev().size_hint(), (5, Some(5))); + assert_eq!(m.iter_mut().size_hint(), (5, Some(5))); + assert_eq!(m.iter_mut().rev().size_hint(), (5, Some(5))); + } + + #[test] + fn test_mut_iterator() { + let mut m = VecMap::new(); + + assert!(m.insert(0, 1).is_none()); + assert!(m.insert(1, 2).is_none()); + assert!(m.insert(3, 5).is_none()); + assert!(m.insert(6, 10).is_none()); + assert!(m.insert(10, 11).is_none()); + + for (k, v) in &mut m { + *v += k as isize; + } + + let mut it = m.iter(); + assert_eq!(it.next().unwrap(), (0, &1)); + assert_eq!(it.next().unwrap(), (1, &3)); + assert_eq!(it.next().unwrap(), (3, &8)); + assert_eq!(it.next().unwrap(), (6, &16)); + assert_eq!(it.next().unwrap(), (10, &21)); + assert!(it.next().is_none()); + } + + #[test] + fn test_rev_iterator() { + let mut m = VecMap::new(); + + assert!(m.insert(0, 1).is_none()); + assert!(m.insert(1, 2).is_none()); + assert!(m.insert(3, 5).is_none()); + assert!(m.insert(6, 10).is_none()); + assert!(m.insert(10, 11).is_none()); + + let mut it = m.iter().rev(); + assert_eq!(it.next().unwrap(), (10, &11)); + assert_eq!(it.next().unwrap(), (6, &10)); + assert_eq!(it.next().unwrap(), (3, &5)); + assert_eq!(it.next().unwrap(), (1, &2)); + assert_eq!(it.next().unwrap(), (0, &1)); + assert!(it.next().is_none()); + } + + #[test] + fn test_mut_rev_iterator() { + let mut m = VecMap::new(); + + assert!(m.insert(0, 1).is_none()); + assert!(m.insert(1, 2).is_none()); + assert!(m.insert(3, 5).is_none()); + assert!(m.insert(6, 10).is_none()); + assert!(m.insert(10, 11).is_none()); + + for (k, v) in m.iter_mut().rev() { + *v += k as isize; + } + + let mut it = m.iter(); + assert_eq!(it.next().unwrap(), (0, &1)); + assert_eq!(it.next().unwrap(), (1, &3)); + assert_eq!(it.next().unwrap(), (3, &8)); + assert_eq!(it.next().unwrap(), (6, &16)); + assert_eq!(it.next().unwrap(), (10, &21)); + assert!(it.next().is_none()); + } + + #[test] + fn test_move_iter() { + let mut m: VecMap> = VecMap::new(); + m.insert(1, Box::new(2)); + let mut called = false; + for (k, v) in m { + assert!(!called); + called = true; + assert_eq!(k, 1); + assert_eq!(v, Box::new(2)); + } + assert!(called); + } + + #[test] + fn test_drain_iterator() { + let mut map = VecMap::new(); + map.insert(1, "a"); + map.insert(3, "c"); + map.insert(2, "b"); + + let vec: Vec<_> = map.drain().collect(); + + assert_eq!(vec, [(1, "a"), (2, "b"), (3, "c")]); + assert_eq!(map.len(), 0); + } + + #[test] + fn test_append() { + let mut a = VecMap::new(); + a.insert(1, "a"); + a.insert(2, "b"); + a.insert(3, "c"); + + let mut b = VecMap::new(); + b.insert(3, "d"); // Overwrite element from a + b.insert(4, "e"); + b.insert(5, "f"); + + a.append(&mut b); + + assert_eq!(a.len(), 5); + assert_eq!(b.len(), 0); + // Capacity shouldn't change for possible reuse + assert!(b.capacity() >= 4); + + assert_eq!(a[1], "a"); + assert_eq!(a[2], "b"); + assert_eq!(a[3], "d"); + assert_eq!(a[4], "e"); + assert_eq!(a[5], "f"); + } + + #[test] + fn test_split_off() { + // Split within the key range + let mut a = VecMap::new(); + a.insert(1, "a"); + a.insert(2, "b"); + a.insert(3, "c"); + a.insert(4, "d"); + + let b = a.split_off(3); + + assert_eq!(a.len(), 2); + assert_eq!(b.len(), 2); + + assert_eq!(a[1], "a"); + assert_eq!(a[2], "b"); + + assert_eq!(b[3], "c"); + assert_eq!(b[4], "d"); + + // Split at 0 + a.clear(); + a.insert(1, "a"); + a.insert(2, "b"); + a.insert(3, "c"); + a.insert(4, "d"); + + let b = a.split_off(0); + + assert_eq!(a.len(), 0); + assert_eq!(b.len(), 4); + assert_eq!(b[1], "a"); + assert_eq!(b[2], "b"); + assert_eq!(b[3], "c"); + assert_eq!(b[4], "d"); + + // Split behind max_key + a.clear(); + a.insert(1, "a"); + a.insert(2, "b"); + a.insert(3, "c"); + a.insert(4, "d"); + + let b = a.split_off(5); + + assert_eq!(a.len(), 4); + assert_eq!(b.len(), 0); + assert_eq!(a[1], "a"); + assert_eq!(a[2], "b"); + assert_eq!(a[3], "c"); + assert_eq!(a[4], "d"); + } + + #[test] + fn test_show() { + let mut map = VecMap::new(); + let empty = VecMap::::new(); + + map.insert(1, 2); + map.insert(3, 4); + + let map_str = format!("{:?}", map); + assert!(map_str == "{1: 2, 3: 4}" || map_str == "{3: 4, 1: 2}"); + assert_eq!(format!("{:?}", empty), "{}"); + } + + #[test] + fn test_clone() { + let mut a = VecMap::new(); + + a.insert(1, 'x'); + a.insert(4, 'y'); + a.insert(6, 'z'); + + assert_eq!(a.clone().iter().collect::>(), [(1, &'x'), (4, &'y'), (6, &'z')]); + } + + #[test] + fn test_eq() { + let mut a = VecMap::new(); + let mut b = VecMap::new(); + + assert!(a == b); + assert!(a.insert(0, 5).is_none()); + assert!(a != b); + assert!(b.insert(0, 4).is_none()); + assert!(a != b); + assert!(a.insert(5, 19).is_none()); + assert!(a != b); + assert!(!b.insert(0, 5).is_none()); + assert!(a != b); + assert!(b.insert(5, 19).is_none()); + assert!(a == b); + + a = VecMap::new(); + b = VecMap::with_capacity(1); + assert!(a == b); + } + + #[test] + fn test_lt() { + let mut a = VecMap::new(); + let mut b = VecMap::new(); + + assert!(!(a < b) && !(b < a)); + assert!(b.insert(2, 5).is_none()); + assert!(a < b); + assert!(a.insert(2, 7).is_none()); + assert!(!(a < b) && b < a); + assert!(b.insert(1, 0).is_none()); + assert!(b < a); + assert!(a.insert(0, 6).is_none()); + assert!(a < b); + assert!(a.insert(6, 2).is_none()); + assert!(a < b && !(b < a)); + } + + #[test] + fn test_ord() { + let mut a = VecMap::new(); + let mut b = VecMap::new(); + + assert!(a <= b && a >= b); + assert!(a.insert(1, 1).is_none()); + assert!(a > b && a >= b); + assert!(b < a && b <= a); + assert!(b.insert(2, 2).is_none()); + assert!(b > a && b >= a); + assert!(a < b && a <= b); + } + + #[test] + fn test_hash() { + fn hash(t: &T) -> u64 { + let mut s = DefaultHasher::new(); + t.hash(&mut s); + s.finish() + } + + let mut x = VecMap::new(); + let mut y = VecMap::new(); + + assert!(hash(&x) == hash(&y)); + x.insert(1, 'a'); + x.insert(2, 'b'); + x.insert(3, 'c'); + + y.insert(3, 'c'); + y.insert(2, 'b'); + y.insert(1, 'a'); + + assert!(hash(&x) == hash(&y)); + + x.insert(1000, 'd'); + x.remove(1000); + + assert!(hash(&x) == hash(&y)); + } + + #[test] + fn test_from_iter() { + let xs = [(1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e')]; + + let map: VecMap<_> = xs.iter().cloned().collect(); + + for &(k, v) in &xs { + assert_eq!(map.get(k), Some(&v)); + } + } + + #[test] + fn test_index() { + let mut map = VecMap::new(); + + map.insert(1, 2); + map.insert(2, 1); + map.insert(3, 4); + + assert_eq!(map[3], 4); + } + + #[test] + #[should_panic] + fn test_index_nonexistent() { + let mut map = VecMap::new(); + + map.insert(1, 2); + map.insert(2, 1); + map.insert(3, 4); + + map[4]; + } + + #[test] + fn test_entry() { + let xs = [(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)]; + + let mut map: VecMap<_> = xs.iter().cloned().collect(); + + // Existing key (insert) + match map.entry(1) { + Vacant(_) => unreachable!(), + Occupied(mut view) => { + assert_eq!(view.get(), &10); + assert_eq!(view.insert(100), 10); + } + } + + assert_eq!(map.get(1).unwrap(), &100); + assert_eq!(map.len(), 6); + + // Existing key (update) + match map.entry(2) { + Vacant(_) => unreachable!(), + Occupied(mut view) => { + let v = view.get_mut(); + *v *= 10; + } + } + + assert_eq!(map.get(2).unwrap(), &200); + assert_eq!(map.len(), 6); + + // Existing key (take) + match map.entry(3) { + Vacant(_) => unreachable!(), + Occupied(view) => { + assert_eq!(view.remove(), 30); + } + } + + assert_eq!(map.get(3), None); + assert_eq!(map.len(), 5); + + // Inexistent key (insert) + match map.entry(10) { + Occupied(_) => unreachable!(), + Vacant(view) => { + assert_eq!(*view.insert(1000), 1000); + } + } + + assert_eq!(map.get(10).unwrap(), &1000); + assert_eq!(map.len(), 6); + } + + #[test] + fn test_extend_ref() { + let mut a = VecMap::new(); + a.insert(1, "one"); + let mut b = VecMap::new(); + b.insert(2, "two"); + b.insert(3, "three"); + + a.extend(&b); + + assert_eq!(a.len(), 3); + assert_eq!(a[&1], "one"); + assert_eq!(a[&2], "two"); + assert_eq!(a[&3], "three"); + } + + #[test] + #[cfg(feature = "serde")] + fn test_serde() { + use serde::{Serialize, Deserialize}; + fn impls_serde_traits<'de, S: Serialize + Deserialize<'de>>() {} + + impls_serde_traits::>(); + } + + #[test] + fn test_retain() { + let mut map = VecMap::new(); + map.insert(1, "one"); + map.insert(2, "two"); + map.insert(3, "three"); + map.retain(|k, v| match k { + 1 => false, + 2 => { + *v = "two changed"; + true + }, + 3 => false, + _ => panic!(), + }); + + assert_eq!(map.len(), 1); + assert_eq!(map.get(1), None); + assert_eq!(map[2], "two changed"); + assert_eq!(map.get(3), None); + } +} diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/.cargo-checksum.json b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/.cargo-checksum.json new file mode 100644 index 000000000..a17fa1b9e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/Cargo.toml b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/Cargo.toml new file mode 100644 index 000000000..e3bd0c6be --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/build.rs b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/build.rs new file mode 100644 index 000000000..7130b307e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a new file mode 100644 index 000000000..5ccf8e52a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_aclui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a new file mode 100644 index 000000000..e9132251f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_activeds.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a new file mode 100644 index 000000000..6c52a36b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a new file mode 100644 index 000000000..e7eae3cdf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_advpack.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a new file mode 100644 index 000000000..971e59798 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_amsi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 000000000..70f11d704 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a new file mode 100644 index 000000000..12f873885 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_apidll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a new file mode 100644 index 000000000..1b6c97add Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appmgmts.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a new file mode 100644 index 000000000..5bd2147ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_appnotify.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a new file mode 100644 index 000000000..1d443dc92 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_asycfilt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a new file mode 100644 index 000000000..a058f8ddd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_audioeng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a new file mode 100644 index 000000000..ace31de74 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a new file mode 100644 index 000000000..8b1033ddc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avifil32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a new file mode 100644 index 000000000..263dc0deb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_avrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a new file mode 100644 index 000000000..3694b3fa1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_basesrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a new file mode 100644 index 000000000..4e38eb04f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a new file mode 100644 index 000000000..4a73919f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bluetoothapis.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a new file mode 100644 index 000000000..17ddc90c5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_bthprops.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a new file mode 100644 index 000000000..7d55bc2b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a new file mode 100644 index 000000000..ea4783605 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certadm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a new file mode 100644 index 000000000..6a824a22f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_certpoleng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a new file mode 100644 index 000000000..8bcca8896 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cfgmgr32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a new file mode 100644 index 000000000..edd1a2f70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_chakrart.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a new file mode 100644 index 000000000..5b8b4a8bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cldapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a new file mode 100644 index 000000000..6879e86a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clfsw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a new file mode 100644 index 000000000..69ecbff39 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_clusapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a new file mode 100644 index 000000000..cb75459ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a new file mode 100644 index 000000000..9cfdcf660 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a new file mode 100644 index 000000000..081ae6c9e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comppkgsup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a new file mode 100644 index 000000000..f47a63865 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_compstui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a new file mode 100644 index 000000000..7378ba59a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_comsvcs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a new file mode 100644 index 000000000..b4a6f0224 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a new file mode 100644 index 000000000..10a1e5b7c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_credui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a new file mode 100644 index 000000000..48f43dfea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a new file mode 100644 index 000000000..71752c190 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a new file mode 100644 index 000000000..25d046d00 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a new file mode 100644 index 000000000..104e7afba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a new file mode 100644 index 000000000..e1d472523 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cryptxml.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a new file mode 100644 index 000000000..5c12838ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a new file mode 100644 index 000000000..25dfaad5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_cscdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a new file mode 100644 index 000000000..304db0716 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a new file mode 100644 index 000000000..dd59522bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a new file mode 100644 index 000000000..9b97e0720 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d10_1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a new file mode 100644 index 000000000..5ef0648bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a new file mode 100644 index 000000000..af625e99d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a new file mode 100644 index 000000000..639ac8d04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a new file mode 100644 index 000000000..1fd8e8ab1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcompiler.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a new file mode 100644 index 000000000..064611726 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a new file mode 100644 index 000000000..25e1db1e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_d3dcsxd.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a new file mode 100644 index 000000000..b6f0b9dcd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_davclnt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a new file mode 100644 index 000000000..e23a4e662 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbgeng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a new file mode 100644 index 000000000..e847dbc36 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dbghelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a new file mode 100644 index 000000000..0c4f056d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dciman32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a new file mode 100644 index 000000000..e38ec83f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dcomp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a new file mode 100644 index 000000000..9b0da8b7b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ddraw.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a new file mode 100644 index 000000000..70a1ae3a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a new file mode 100644 index 000000000..83badc674 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_devmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a new file mode 100644 index 000000000..90f7f495c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dflayout.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a new file mode 100644 index 000000000..4b9e89d87 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a new file mode 100644 index 000000000..94e7d193d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a new file mode 100644 index 000000000..9b5f149ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dhcpsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a new file mode 100644 index 000000000..38e0f7521 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a new file mode 100644 index 000000000..0def510a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dinput8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a new file mode 100644 index 000000000..4d0d6f5e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a new file mode 100644 index 000000000..32d6f44e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a new file mode 100644 index 000000000..e980e4bef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a new file mode 100644 index 000000000..98fd6ec20 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dnsrslvr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a new file mode 100644 index 000000000..11596b424 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dpx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a new file mode 100644 index 000000000..d73c32ca6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a new file mode 100644 index 000000000..e99a63597 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drtprov.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a new file mode 100644 index 000000000..48975dafb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_drttransport.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a new file mode 100644 index 000000000..e9bfe421e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsound.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a new file mode 100644 index 000000000..4b0706bb0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsprop.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a new file mode 100644 index 000000000..3de363e6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dssec.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a new file mode 100644 index 000000000..7a2c3e506 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dststlog.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a new file mode 100644 index 000000000..2f42acf7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dsuiext.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a new file mode 100644 index 000000000..3daa809c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwmapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a new file mode 100644 index 000000000..57af41635 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a new file mode 100644 index 000000000..3bae477b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a new file mode 100644 index 000000000..d495dc49e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_dxva2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a new file mode 100644 index 000000000..3069ee95c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappcfg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a new file mode 100644 index 000000000..5dda01c54 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_eappprxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a new file mode 100644 index 000000000..4d12d5357 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_easregprov.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a new file mode 100644 index 000000000..7e1a167d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_efswrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a new file mode 100644 index 000000000..1cebdc995 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_elscore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a new file mode 100644 index 000000000..b49e343cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a new file mode 100644 index 000000000..c8aa1a946 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_evr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a new file mode 100644 index 000000000..4de5c1e96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_faultrep.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a new file mode 100644 index 000000000..0a5cc4011 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_feclient.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a new file mode 100644 index 000000000..88de8293c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fhsvcctl.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a new file mode 100644 index 000000000..f6a962377 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a new file mode 100644 index 000000000..42d704e94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fontsub.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a new file mode 100644 index 000000000..ea8155244 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyd.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a new file mode 100644 index 000000000..2913ed6f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_framedyn.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a new file mode 100644 index 000000000..3e89cda3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fwpuclnt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a new file mode 100644 index 000000000..3465f81b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_fxsutility.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a new file mode 100644 index 000000000..5987d4741 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a new file mode 100644 index 000000000..a6056e89a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gdiplus.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a new file mode 100644 index 000000000..32b72a960 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glmf32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a new file mode 100644 index 000000000..d79482aef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_glu32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a new file mode 100644 index 000000000..a787bf86c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_gpedit.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a new file mode 100644 index 000000000..b2a136ce9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hbaapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a new file mode 100644 index 000000000..6d4b4ac3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hid.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a new file mode 100644 index 000000000..45734a14f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hlink.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a new file mode 100644 index 000000000..745618b20 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a new file mode 100644 index 000000000..f6030424b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_httpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a new file mode 100644 index 000000000..ab56ad2f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iashlpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a new file mode 100644 index 000000000..13d1ef7d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a new file mode 100644 index 000000000..5ced197c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icmui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a new file mode 100644 index 000000000..2a9be36ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuin.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a new file mode 100644 index 000000000..a3b6948fb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_icuuc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a new file mode 100644 index 000000000..c01e36995 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imagehlp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a new file mode 100644 index 000000000..48437d97b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imgutil.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a new file mode 100644 index 000000000..d500ee519 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_imm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a new file mode 100644 index 000000000..6753ecccd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_infocardapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a new file mode 100644 index 000000000..66cf097fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a new file mode 100644 index 000000000..00ec09731 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_inseng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a new file mode 100644 index 000000000..eb66c6396 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a new file mode 100644 index 000000000..9a7ef164b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iprop.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a new file mode 100644 index 000000000..20aeab6a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_irprops.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a new file mode 100644 index 000000000..d399a3c2d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_iscsidsc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a new file mode 100644 index 000000000..7e51deff6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_jsrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a new file mode 100644 index 000000000..69a7f7dde Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a new file mode 100644 index 000000000..9a4219fbf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksproxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a new file mode 100644 index 000000000..5f0e47bd9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ksuser.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a new file mode 100644 index 000000000..c158f8a85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ktmw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a new file mode 100644 index 000000000..f8512d0d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_loadperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a new file mode 100644 index 000000000..9b75f0530 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_lz32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a new file mode 100644 index 000000000..7f3ecbb88 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_magnification.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a new file mode 100644 index 000000000..74373c36d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a new file mode 100644 index 000000000..584e44bef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mciole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a new file mode 100644 index 000000000..c69ce2a28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a new file mode 100644 index 000000000..eb3431624 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mdmregistration.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a new file mode 100644 index 000000000..01ea7a85e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a new file mode 100644 index 000000000..004e4778c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a new file mode 100644 index 000000000..b24669fe3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a new file mode 100644 index 000000000..e3d553d07 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfplay.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a new file mode 100644 index 000000000..23c1acba4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a new file mode 100644 index 000000000..a53cc65ad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a new file mode 100644 index 000000000..6392a5fb6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a new file mode 100644 index 000000000..47b697df2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mgmtapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a new file mode 100644 index 000000000..9591de892 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..14c7d2f05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..b9b85dca2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..84e841ab8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..c5512bafe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..5cabc0673 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..3d966f083 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..2a3267cf8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..aa3f0e7f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..8e90a7433 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..7eb338f8d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..80283d9f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..84a229a92 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..2b55ef493 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..a362e4b0a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..21d4b3070 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..374c29bd8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..5d0f55a94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..5dd1442d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..fe0d52b5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..9c30fabb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..eedee5e68 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..621f7181c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..1f4f2a097 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..774a4f723 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..e413b4cd6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..721cd8900 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..384a2bc1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..c84610cac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..1ae7618cf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..06c276ab6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..f0eb4fdd2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..61041025a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..ce95b8db9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..37499453a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..c9c88e6e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..cee5059d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..45dd5592a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..30d1c51eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..1db1f247b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..c5175f361 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..0154f3be5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..55126ff62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..d4e8e239c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..e50b351fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..1eb532792 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..038cdfc5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..64bd0e78e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..119c5fd64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..81184f98e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..d0187b740 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..b91f642d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..f87a24791 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..2a231cb51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..37ce0f166 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..89d0f5f5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..be7983c01 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..834c92ca1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..402354e60 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..0f0ebacfe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..e758600b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..d672800a2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..f39ad97d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..969522d0a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..d204c52c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..fa97a5283 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..f552d0085 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..757d311d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..1720dd8f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..239f32792 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..819ac5add Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..5f32d9584 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..fa19448a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..f01007837 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..ec7063ec7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..4b09d25d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..c1424f57b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..79670761b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..00bc726c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..5afe8f7ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..7f23bddd7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..6bd2f7e5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..78ab95f2b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..89e491688 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..f0eda0339 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..01f5995f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..b7fe04489 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..746ad4665 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..4e9f38e6b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..9cbc37b12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..c13288c29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..ce77384f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..595f4e463 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..98be2bcd2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..4200883d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..9da785206 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..1f3537171 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..425efa28e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..8f5ed3fd1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..f22c0fd55 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..be6a66161 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..ccf64b8ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..2810b8ee5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..b53b5eef5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..53a2fd951 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..a35e1439c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..685f805f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..3ada2fbd7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a new file mode 100644 index 000000000..f12466634 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a new file mode 100644 index 000000000..2face461e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a new file mode 100644 index 000000000..a5e1060cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..b450a246a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..65da450ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..019825e96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..c5aea923f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..7c6a174f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..75c617016 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..fb632e15f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..3579e9ead Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..e677121f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..0c36fa5bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..c14203cfc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..1b6325928 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..32a362f36 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..ab6bd64c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..47962dbd7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..f5e489014 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..52398c242 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..70740248c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..d6a710996 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..14e437d0f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..4d123f23d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..ee666ae80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..7103b2c67 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..ad5dbab1d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..fb03fd94f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..422c9ba8b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..f482472cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a new file mode 100644 index 000000000..c30bf233b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a new file mode 100644 index 000000000..96f403f61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a new file mode 100644 index 000000000..91af31b28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a new file mode 100644 index 000000000..0e9567819 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a new file mode 100644 index 000000000..e7dc455bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a new file mode 100644 index 000000000..83dac37e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a new file mode 100644 index 000000000..6924427f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a new file mode 100644 index 000000000..9071743b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a new file mode 100644 index 000000000..2465dcb63 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a new file mode 100644 index 000000000..7b0ca0b89 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a new file mode 100644 index 000000000..4fed4d080 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a new file mode 100644 index 000000000..c2fbf6b06 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a new file mode 100644 index 000000000..7a5443738 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a new file mode 100644 index 000000000..0fb20c110 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a new file mode 100644 index 000000000..82ec85170 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a new file mode 100644 index 000000000..bcd80500e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a new file mode 100644 index 000000000..e85bdfe4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a new file mode 100644 index 000000000..76331925d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a new file mode 100644 index 000000000..667f7e097 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a new file mode 100644 index 000000000..4038590b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a new file mode 100644 index 000000000..6c9a31b3e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a new file mode 100644 index 000000000..64a299370 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a new file mode 100644 index 000000000..0252b877c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a new file mode 100644 index 000000000..854e4f45d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a new file mode 100644 index 000000000..4b4125e2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a new file mode 100644 index 000000000..86898941e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a new file mode 100644 index 000000000..9a2fcaf80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a new file mode 100644 index 000000000..cb7516778 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore.a new file mode 100644 index 000000000..1d283d8ab --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a new file mode 100644 index 000000000..7c2897d37 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a new file mode 100644 index 000000000..0894bd9e3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a new file mode 100644 index 000000000..d683aa686 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a new file mode 100644 index 000000000..058933057 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a new file mode 100644 index 000000000..6640c943d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a new file mode 100644 index 000000000..d72679f18 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a new file mode 100644 index 000000000..33cff853c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a new file mode 100644 index 000000000..c5a94c910 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a new file mode 100644 index 000000000..3507ea348 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a new file mode 100644 index 000000000..9b663e34c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a new file mode 100644 index 000000000..a4f7bbdd3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a new file mode 100644 index 000000000..5c41254a8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a new file mode 100644 index 000000000..f343e2a57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a new file mode 100644 index 000000000..34f2f4cdc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mprsnap.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a new file mode 100644 index 000000000..f3b36dc8c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mqrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a new file mode 100644 index 000000000..d3318cbcf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mrmsupport.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a new file mode 100644 index 000000000..71095a966 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msacm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a new file mode 100644 index 000000000..65d2c66d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a new file mode 100644 index 000000000..ed61a87ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mscms.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a new file mode 100644 index 000000000..d033b00a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msctfmonitor.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a new file mode 100644 index 000000000..0f2648c61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdelta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a new file mode 100644 index 000000000..27d746e7c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdmo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a new file mode 100644 index 000000000..ab8eab3ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msdrm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a new file mode 100644 index 000000000..84945d2e0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a new file mode 100644 index 000000000..dddd68901 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msimg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a new file mode 100644 index 000000000..a98c3198d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatcha.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a new file mode 100644 index 000000000..d3b4abe51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mspatchc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a new file mode 100644 index 000000000..22712892f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msports.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a new file mode 100644 index 000000000..4f0538f0f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msrating.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a new file mode 100644 index 000000000..aa60fc90e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mstask.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a new file mode 100644 index 000000000..a3942de67 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msv1_0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a new file mode 100644 index 000000000..af8b929d4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_msvfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a new file mode 100644 index 000000000..ce52ad2ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a new file mode 100644 index 000000000..d882f20cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a new file mode 100644 index 000000000..a2e9d8310 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_mtxdm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a new file mode 100644 index 000000000..7fc769ea0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a new file mode 100644 index 000000000..342763b35 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_nddeapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a new file mode 100644 index 000000000..84cb302d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ndfapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a new file mode 100644 index 000000000..c91114872 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a new file mode 100644 index 000000000..7d6171645 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_netsh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a new file mode 100644 index 000000000..ab8c3876d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a new file mode 100644 index 000000000..59c4f6dce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ninput.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a new file mode 100644 index 000000000..1d94079c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_normaliz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a new file mode 100644 index 000000000..80e70862c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a new file mode 100644 index 000000000..49ca435fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsa.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a new file mode 100644 index 000000000..0680ac294 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a new file mode 100644 index 000000000..6693dddc4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsatq.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a new file mode 100644 index 000000000..cd7ec6003 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntdsetup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a new file mode 100644 index 000000000..c7e9963ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntfrsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a new file mode 100644 index 000000000..edc6cc8fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntlanman.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a new file mode 100644 index 000000000..4ae7a31b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntmarta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a new file mode 100644 index 000000000..4d3de9e56 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntquery.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a new file mode 100644 index 000000000..3e89f0401 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ntvdm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a new file mode 100644 index 000000000..fd23646fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbc32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a new file mode 100644 index 000000000..757bfe6d4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_odbcbcp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a new file mode 100644 index 000000000..b4fa945dc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oemlicense.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a new file mode 100644 index 000000000..d67b9e39e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a new file mode 100644 index 000000000..7798bcc46 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a new file mode 100644 index 000000000..c4ca15d87 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a new file mode 100644 index 000000000..df0134c64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olecli32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a new file mode 100644 index 000000000..13ede5e8d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a new file mode 100644 index 000000000..0d72e0a52 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olepro32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a new file mode 100644 index 000000000..1a7bcc670 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_olesvr32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a new file mode 100644 index 000000000..9bc7f4100 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 000000000..c2c4ee863 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 000000000..7c61e5128 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..2db53c20b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..2ed3791a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..8c3b0a557 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..a44583d61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..debbd8786 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..6173eda17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 000000000..ccfb05faf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..513c3910d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..b855681d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 000000000..17292db49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..259340a26 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..e975367e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..8f6cf0ba1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..661692ef2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..42e2427a6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..d07ed0385 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..65ddcb5f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..ff137d7b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..6fb51251f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 000000000..99e1e1390 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..7ec7faea8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..fddd28338 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..be10c872c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..58b13cfc3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..d16ed5bd0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..b8f32c9bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..6a7be5ce7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..6e4bd974b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..0ec0998b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..7b2318df2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..81cbf56a6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..1a28c1143 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..3e154d831 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..095217830 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..30c22b839 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..41c50e019 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..46ee4004f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..6e9102c94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..85ccdbd54 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..fed64c7d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..6eba74957 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..cf11e4367 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..fbb77981a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..06c17f99b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..4583e29c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..c12dcbc00 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..147347f5b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..cb1ba6ef6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..475dabda2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..2283c4922 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 000000000..9df1ae4bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 000000000..28001702d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 000000000..f68f9455c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..99829cd76 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 000000000..fa8f4ca0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 000000000..3684462ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 000000000..f6b9b1f5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 000000000..5bd0df1ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 000000000..f92da9abb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 000000000..b6a285639 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..27329df39 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..eef9876c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..1e80258df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..4d3d079bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..91f3c8496 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..26ce43343 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..9a14a0dd3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..83379f201 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..fa02d6676 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..ea220e5c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..87596ba4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..eca5a6d28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..2b38223f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..d5eff90e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..b15224b8a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..13f8dac07 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..aacbef783 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..5856a2d3b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..cce807e74 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..80ed8f754 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..1f3847f9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..fbb9ae578 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..bb3a894b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..37c928673 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..73467bfa1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..d5ec99bc4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 000000000..bd95a8eda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 000000000..c315b803d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 000000000..e9ad789a5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 000000000..194897fb8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..f9b92406e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..d76446293 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..1ce0f27d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..7cc014589 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..380b17d93 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..f83978449 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..8184fdb9c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..adacab885 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..286451797 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 000000000..bd1821344 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..bf3ec6561 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..2fa688976 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..921994074 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..01cbecd49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..1004cc7d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..d57a76262 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..50bd71bd4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..d0681f414 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..6aa4e5e42 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..d498e105a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..2220e0b5b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 000000000..ef780e144 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..b8ebe48e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..90f300e88 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 000000000..6ce9bfe0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..689a9477b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..f38473fe3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 000000000..be660824c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 000000000..81d1d5563 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..b7f3b32b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..3ac0d3ef5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..802f6ab85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 000000000..6f976165b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 000000000..8575b1785 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 000000000..0cb8c5b16 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..81eb6fffa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..9f7c44bcb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..ddf3657f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..886978131 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..9502df400 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..32bc9b527 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..f7d3a71d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..96b44bada Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..0bcca4577 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..0b9b3448c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..ae2704a57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..1e776e607 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 000000000..072823889 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..cc8d2d1cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 000000000..b850a71b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 000000000..5be0ae24e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..4fe81e60b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..8540db991 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..4776cf04f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..42e9fc7a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..cae8f2b4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..66013bb97 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 000000000..d75ae32c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..e7bf92ddd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..c1d76108f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..02beef306 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..187c36d47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..5241405ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..36a836890 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..e04d55aa2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..58090362f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..4e2fc98d4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..87546a3b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..0a0efd3f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..c4b1b7ad1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..83383b567 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..9df889c2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..2a7c92564 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..0fadeb877 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..1d7150d50 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..6d2cc7f7c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..dbd9b16c1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..48f2bfc3b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..295bd5853 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..864abc42f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..c264aa5e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..ea213e681 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..4d50887bb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 000000000..3b1c82dad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..71e1e7830 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 000000000..e60e2ca8a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..fc97f88cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 000000000..96300ac19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 000000000..ad8d94c9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 000000000..1f6c661cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..4984baf6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 000000000..4a63543fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..15a75769b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..78fe45c0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..b72174dad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 000000000..7479dcbd0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..5ff5c77f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..01ca929ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..0b8c45440 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..1456aa253 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..fea42bc5b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..05bc54f58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..a40304e83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..c7d2ac5a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..ff570a4ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..70171ff3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..130a97ad3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..44769ba8c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..71abeae0d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..c76980ea0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 000000000..fb1ecf99c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 000000000..2bf98a222 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 000000000..8617b78cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..51823b6aa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..31cc7bda9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..08da8f909 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..26e05950b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..627d39a12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..1565aec04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 000000000..a52709c38 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 000000000..8640562d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 000000000..21a7b2522 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..060bb7e57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..16b4cfae0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..241fe8a03 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..090a76741 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 000000000..8ffbed652 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 000000000..85b89e511 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 000000000..e5cc513f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a new file mode 100644 index 000000000..dc567b93f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a new file mode 100644 index 000000000..342fb8114 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a new file mode 100644 index 000000000..6bdc6f73c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a new file mode 100644 index 000000000..969e65c1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a new file mode 100644 index 000000000..6ac75f375 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a new file mode 100644 index 000000000..6902bb9d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a new file mode 100644 index 000000000..21032cbf0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a new file mode 100644 index 000000000..1790b3282 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a new file mode 100644 index 000000000..7f3c47304 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a new file mode 100644 index 000000000..9a47f7322 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a new file mode 100644 index 000000000..64acccbc1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a new file mode 100644 index 000000000..4a4d3810e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a new file mode 100644 index 000000000..f1bedd2be Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a new file mode 100644 index 000000000..5eedf3e29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a new file mode 100644 index 000000000..9628c6ecf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a new file mode 100644 index 000000000..8c3ce43fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a new file mode 100644 index 000000000..507b4265f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a new file mode 100644 index 000000000..80bb8a3ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a new file mode 100644 index 000000000..082615290 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a new file mode 100644 index 000000000..a3c11c711 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a new file mode 100644 index 000000000..9c1963aba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-profapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a new file mode 100644 index 000000000..d31ddcf53 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a new file mode 100644 index 000000000..a152c1c94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a new file mode 100644 index 000000000..3710a6c20 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a new file mode 100644 index 000000000..22fedc088 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a new file mode 100644 index 000000000..0a757d80e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a new file mode 100644 index 000000000..cb011b9b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a new file mode 100644 index 000000000..e7380827c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a new file mode 100644 index 000000000..7132ea0e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a new file mode 100644 index 000000000..9663971cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a new file mode 100644 index 000000000..c81dae91f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a new file mode 100644 index 000000000..4204b029d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a new file mode 100644 index 000000000..dd6afac38 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a new file mode 100644 index 000000000..11a809b47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore.a new file mode 100644 index 000000000..c3ad6036b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a new file mode 100644 index 000000000..314d8104b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a new file mode 100644 index 000000000..2ef14fc3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a new file mode 100644 index 000000000..602b8d942 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a new file mode 100644 index 000000000..38f813a49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a new file mode 100644 index 000000000..dd5bb6f33 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a new file mode 100644 index 000000000..64b7af302 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a new file mode 100644 index 000000000..58d498878 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a new file mode 100644 index 000000000..50dbbceb1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a new file mode 100644 index 000000000..add0a8ae0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a new file mode 100644 index 000000000..04d65a598 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a new file mode 100644 index 000000000..684b7fe9c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a new file mode 100644 index 000000000..51066ec62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a new file mode 100644 index 000000000..6cec78021 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a new file mode 100644 index 000000000..dfed73c69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a new file mode 100644 index 000000000..148ebb692 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a new file mode 100644 index 000000000..9b7ad48a2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a new file mode 100644 index 000000000..db4cadb30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a new file mode 100644 index 000000000..2e350945c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a new file mode 100644 index 000000000..35392b55e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a new file mode 100644 index 000000000..cef1a98fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a new file mode 100644 index 000000000..2c39e820c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a new file mode 100644 index 000000000..8fb6e17f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a new file mode 100644 index 000000000..8a2da409e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a new file mode 100644 index 000000000..4c28c5eb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a new file mode 100644 index 000000000..5d29e5437 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a new file mode 100644 index 000000000..68c9cfcd3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a new file mode 100644 index 000000000..f64e27f41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a new file mode 100644 index 000000000..7580f0185 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a new file mode 100644 index 000000000..7c0324e1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a new file mode 100644 index 000000000..96c37d5ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a new file mode 100644 index 000000000..62408c8b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a new file mode 100644 index 000000000..310598efd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a new file mode 100644 index 000000000..03c219687 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a new file mode 100644 index 000000000..1fae183e3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a new file mode 100644 index 000000000..1f06d2cf7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 000000000..34c5cfe58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 000000000..537772400 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a new file mode 100644 index 000000000..9c2a560a6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 000000000..580b12189 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 000000000..ac6ad703d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..12c03a985 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..e651f7aaa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..ef3e28318 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 000000000..200562f76 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..d919aa0e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..fad1bbd00 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..0fbf6f034 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 000000000..f93dcca1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..86571f89f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..f05df95b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 000000000..0fdb740c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..17ad076ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..ad82476af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..d80882ca3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..120d9c297 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..5830e4014 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..3c79b22c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..4a549f572 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..eeff9d755 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..4cb11c521 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 000000000..cbf774dac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..9eaefd333 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..2e09d38e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..c6a811633 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..87b7de3e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..934487fba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..59142101f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..34bc395fb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..5be5cdc08 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..89f3886eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..33455c492 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..d5c537fa5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..fd16532c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..d9e9d6286 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..afd312af4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..c696160b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..3f2827f0e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..1a69ba4a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..a41758dcb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..b6b82a0a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..168c5d2fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..d6d8f330d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..a10670aa8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..66aa0a22a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..fb98b8cc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..66e3bc317 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..9e3f04a28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..7b2546042 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..e48f18ba4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..46c278a1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..8a373792a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 000000000..f6b963f24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 000000000..57f6c65a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 000000000..bfe0a0e2d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..b7b0e5d5d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 000000000..04032ed7d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 000000000..501a25d26 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 000000000..bff675bc7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 000000000..80385d364 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 000000000..6da5dbd1a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 000000000..28392aca4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..fb18a934b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..cc2f7f689 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..4bdd3e38d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..7f5b87aa6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..554bd2895 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..e8e2de644 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..592dfbdb1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..2ae920cf4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..fe5b83ebd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..e2802fb22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..13ace7e9d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..5ea3f7339 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..ad8ab0712 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..0ebc619df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..0cef9f3eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..753ae7713 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..09c84fbc1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..f0b46fd9d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..2507b504d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..9e6286d75 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..015ee5d12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..0428af61c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..f2cd0b133 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..cfc07843c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..5cbe569a2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..ffa155668 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 000000000..f05622b6c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 000000000..29798b631 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 000000000..ffcd31059 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 000000000..067a60c48 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..997ac98db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..695643a82 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..7cf42b417 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..6797fde0f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..2c4338ed7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..1e3138d42 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..6a586c10c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..57c3695eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..73ce0f567 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 000000000..ca8506382 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..b8ac19014 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..ad8a3a44c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..9ea89d75a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 000000000..10c384dc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..d5834e020 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..66c5c9490 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..26b7c19c5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..c9f33f561 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..e59b5ec56 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..ce96bf8e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..5a91f1674 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..1f0820d65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 000000000..fdcbb87d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..3145e29fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..e8cf8178d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 000000000..ea1726f07 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..beeee46a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..ba74c11dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 000000000..28def1843 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 000000000..aebb07b28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 000000000..ffc11e7ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..e72a4857f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..fcd0eb3e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..da27e7703 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 000000000..4e99c1df4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 000000000..d08cd3ccc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 000000000..59a2f6fb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..5639c68a6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..65827d54b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..afe68202d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..261985981 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..ed4e679c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..b04ac4510 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..cfc8edf7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..cf1d70238 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..59178e5bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..3200d4f10 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..45a2304bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..505b8f7b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 000000000..16cda2fe9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..7d171d4c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 000000000..f7f1ad7c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 000000000..53787d3b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..c19d288d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..fcd1bc190 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..e5117f9fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..7dd490afe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..3eb5e6b22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..389f92c0c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 000000000..3a293c6e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..1c463abd0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..deeae0696 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..61584e6cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..9bc4437eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..132ab0fad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..b9cddf3e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..5ad358845 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..e04bfdb19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..680d316f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..e55af956c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..254594c89 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..6c44c618c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..f14b696d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..f2dc119b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..d9c378d9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..6990a64a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..bc33f190a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..23a26f1e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..382765c51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..c8b3f5f7a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a new file mode 100644 index 000000000..ecf299c3e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a new file mode 100644 index 000000000..63ea82fc0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a new file mode 100644 index 000000000..e73c4a1cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a new file mode 100644 index 000000000..7403a4868 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a new file mode 100644 index 000000000..a1b5ed07d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..0802e2e6f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..016d94673 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..a98c8f49b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..21d208138 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..d4efbca8b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 000000000..aaa254bf9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..847c7e2d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 000000000..10e36b7df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..1a8fe0490 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 000000000..95fd7d194 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 000000000..597ff128b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 000000000..a56a94c8e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 000000000..c561c1ea3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 000000000..05cdb0072 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 000000000..086b68d82 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 000000000..20c3f1895 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 000000000..c2aa06c2d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a new file mode 100644 index 000000000..0a091d0c1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a new file mode 100644 index 000000000..358062ec4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a new file mode 100644 index 000000000..fa768e316 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a new file mode 100644 index 000000000..463e22e4e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 000000000..fd432fe69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a new file mode 100644 index 000000000..bdb658f24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 000000000..203bbfd86 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 000000000..e4643147e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..ce2b637cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 000000000..1958f31b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..42efc5761 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..435d0db51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..aafc8b226 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 000000000..55e2f9caa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..f8469acec Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..378796767 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..0365228d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..9eedb802b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..74754a1a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..8c0a7ae1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..84764c31e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..8c238855d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..de6741076 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..8578e07df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..1d7e632d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..229e9bdc6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..c7b6cfb12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..dad190950 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 000000000..ad3581f81 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 000000000..51ea417f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 000000000..dedd04889 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..562e9aaf8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..a21bf926d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..ea0f2b7f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..b93de07cf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..92798e030 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..6026a1a15 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 000000000..0a1043f6f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 000000000..60f02631b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 000000000..c3a335ec6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..c557cb377 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..b52b7a72c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..d3ac5aab5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..1eb84843a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 000000000..b612206c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 000000000..243f04228 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a new file mode 100644 index 000000000..9efb3c539 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 000000000..bad59d1bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a new file mode 100644 index 000000000..15e9e11b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a new file mode 100644 index 000000000..c30fef3bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a new file mode 100644 index 000000000..53a60d562 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a new file mode 100644 index 000000000..e841d04b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a new file mode 100644 index 000000000..c668dfff0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a new file mode 100644 index 000000000..7a737060c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a new file mode 100644 index 000000000..aa9f7fc7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a new file mode 100644 index 000000000..c01378c80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a new file mode 100644 index 000000000..49e871a1e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a new file mode 100644 index 000000000..724c339f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a new file mode 100644 index 000000000..4e3dbea68 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a new file mode 100644 index 000000000..b9e8ee3ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a new file mode 100644 index 000000000..af67121a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a new file mode 100644 index 000000000..df1fb51c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a new file mode 100644 index 000000000..398abcfe3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a new file mode 100644 index 000000000..31094646c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a new file mode 100644 index 000000000..ea78b924f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a new file mode 100644 index 000000000..89e3c740f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a new file mode 100644 index 000000000..45fe80341 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a new file mode 100644 index 000000000..228a1ad35 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a new file mode 100644 index 000000000..28bf741c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a new file mode 100644 index 000000000..0d4ee9ed3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 000000000..2eee14c06 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 000000000..8a7a3374d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a new file mode 100644 index 000000000..c5aa60241 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a new file mode 100644 index 000000000..c19278c2c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a new file mode 100644 index 000000000..cb0a32773 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 000000000..4843b0481 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 000000000..796dfb84b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 000000000..fbc7a9dc0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 000000000..faba24e9a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a new file mode 100644 index 000000000..5c928ba0f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a new file mode 100644 index 000000000..8a037ee47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a new file mode 100644 index 000000000..706490874 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a new file mode 100644 index 000000000..0bdd645e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a new file mode 100644 index 000000000..304b43b51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a new file mode 100644 index 000000000..cb66132f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a new file mode 100644 index 000000000..d445b0189 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a new file mode 100644 index 000000000..14b1ec1ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a new file mode 100644 index 000000000..e26c89056 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a new file mode 100644 index 000000000..54e931a58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a new file mode 100644 index 000000000..f011a721d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a new file mode 100644 index 000000000..ce3a0876d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a new file mode 100644 index 000000000..6bc3728d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a new file mode 100644 index 000000000..a35a24b40 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a new file mode 100644 index 000000000..d674404fb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a new file mode 100644 index 000000000..ce2fe8951 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a new file mode 100644 index 000000000..06b17d0da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a new file mode 100644 index 000000000..1060a64d2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a new file mode 100644 index 000000000..443bb25a0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a new file mode 100644 index 000000000..ac0c5f642 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a new file mode 100644 index 000000000..cf72a6d0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a new file mode 100644 index 000000000..29fde9746 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a new file mode 100644 index 000000000..dbd709f06 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a new file mode 100644 index 000000000..003b052eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a new file mode 100644 index 000000000..3be2e7849 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a new file mode 100644 index 000000000..8bc846c16 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a new file mode 100644 index 000000000..06fb1b80d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a new file mode 100644 index 000000000..16458195d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a new file mode 100644 index 000000000..a58c9c844 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a new file mode 100644 index 000000000..3c2f72008 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a new file mode 100644 index 000000000..deeb4b7c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a new file mode 100644 index 000000000..30db0a197 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a new file mode 100644 index 000000000..3fa52c596 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a new file mode 100644 index 000000000..31121fdcf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a new file mode 100644 index 000000000..3a2bb93fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a new file mode 100644 index 000000000..60ac153a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a new file mode 100644 index 000000000..29e107117 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a new file mode 100644 index 000000000..97a1b02f3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a new file mode 100644 index 000000000..50a2e38cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a new file mode 100644 index 000000000..f4cc8dcb4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a new file mode 100644 index 000000000..bec0b25ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a new file mode 100644 index 000000000..78027e1e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a new file mode 100644 index 000000000..f4a89328f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a new file mode 100644 index 000000000..ce5e291a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a new file mode 100644 index 000000000..df91aadba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap.a new file mode 100644 index 000000000..34c606fa6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a new file mode 100644 index 000000000..dc845446a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a new file mode 100644 index 000000000..bde9a7631 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a new file mode 100644 index 000000000..85ecf8a2f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a new file mode 100644 index 000000000..b18f4b754 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a new file mode 100644 index 000000000..405c24e81 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a new file mode 100644 index 000000000..27b5d931c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a new file mode 100644 index 000000000..d633b8c12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a new file mode 100644 index 000000000..64916fd74 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a new file mode 100644 index 000000000..958b3dc92 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a new file mode 100644 index 000000000..074e846f3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a new file mode 100644 index 000000000..cf7942567 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a new file mode 100644 index 000000000..49400a3ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a new file mode 100644 index 000000000..b26457f72 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a new file mode 100644 index 000000000..f7101ca6d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a new file mode 100644 index 000000000..f899180a0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a new file mode 100644 index 000000000..51763a70b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a new file mode 100644 index 000000000..0e12e1334 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a new file mode 100644 index 000000000..65e2049da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a new file mode 100644 index 000000000..166288977 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a new file mode 100644 index 000000000..7fda090ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a new file mode 100644 index 000000000..8aaa20854 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a new file mode 100644 index 000000000..61b62484b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a new file mode 100644 index 000000000..7b6420481 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a new file mode 100644 index 000000000..e1e2f262c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a new file mode 100644 index 000000000..82c6bf307 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a new file mode 100644 index 000000000..37677ab7b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a new file mode 100644 index 000000000..d01bb8d29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a new file mode 100644 index 000000000..ebe75803f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a new file mode 100644 index 000000000..6e72a4dc3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a new file mode 100644 index 000000000..f6abea763 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a new file mode 100644 index 000000000..8f325ebe3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a new file mode 100644 index 000000000..89d1b7041 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a new file mode 100644 index 000000000..42f49714f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a new file mode 100644 index 000000000..3fe875be3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a new file mode 100644 index 000000000..0d94fe271 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a new file mode 100644 index 000000000..5ca150b19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_opengl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a new file mode 100644 index 000000000..2f7bcc9ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2p.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a new file mode 100644 index 000000000..c6e0cd9ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_p2pgraph.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a new file mode 100644 index 000000000..54462ace8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pathcch.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a new file mode 100644 index 000000000..f74b21e3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a new file mode 100644 index 000000000..ffc8f0b0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_peerdist.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a new file mode 100644 index 000000000..23cd940c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a new file mode 100644 index 000000000..245f275ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_prntvpt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a new file mode 100644 index 000000000..2fadbd939 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a new file mode 100644 index 000000000..b3a875fbe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a new file mode 100644 index 000000000..49fc68bf4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_quartz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a new file mode 100644 index 000000000..4f0bdc0ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_query.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a new file mode 100644 index 000000000..fc74f80c2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_qwave.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a new file mode 100644 index 000000000..6b9f89da1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a new file mode 100644 index 000000000..6f014fe26 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rasdlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a new file mode 100644 index 000000000..520d7b71b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a new file mode 100644 index 000000000..d473f439c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a new file mode 100644 index 000000000..ee44784f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcexts.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a new file mode 100644 index 000000000..d52203d31 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcns4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a new file mode 100644 index 000000000..cc6381e6f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcproxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a new file mode 100644 index 000000000..543948561 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a new file mode 100644 index 000000000..a523d2307 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a new file mode 100644 index 000000000..fbfeeb883 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a new file mode 100644 index 000000000..b10358ec0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a new file mode 100644 index 000000000..e9a7dbfd5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_rtworkq.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..bc13dd410 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..08f54f607 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..19c21a5c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..808c7d47d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..e8b73394c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..b1c2c40d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..54d59d7d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..504848a14 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_runtimeobject.a new file mode 100644 index 000000000..57114fb6c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a new file mode 100644 index 000000000..4ec0af002 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a new file mode 100644 index 000000000..8cf2e63dc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_samsrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a new file mode 100644 index 000000000..ab8cc4774 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sas.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a new file mode 100644 index 000000000..251413982 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scarddlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a new file mode 100644 index 000000000..955ecfd41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scecli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a new file mode 100644 index 000000000..fbd750c0e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_scesrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a new file mode 100644 index 000000000..067b6f532 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_schannel.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a new file mode 100644 index 000000000..53671d1ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a new file mode 100644 index 000000000..c86e022d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_security.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a new file mode 100644 index 000000000..934408694 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sens.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a new file mode 100644 index 000000000..d7e09d952 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a new file mode 100644 index 000000000..2b29363f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sensorsutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a new file mode 100644 index 000000000..dce8dea20 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a new file mode 100644 index 000000000..857ca87b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sfc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..1b06b8963 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..11d544d00 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..b2d21eaf6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..1681ba1d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..724b88d86 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..8b5c5679a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shcore.a new file mode 100644 index 000000000..e0cb94213 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a new file mode 100644 index 000000000..7ce2c214b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shdocvw.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a new file mode 100644 index 000000000..9b36306d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a new file mode 100644 index 000000000..a254a3644 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shfolder.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a new file mode 100644 index 000000000..c3dd5fdb8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a new file mode 100644 index 000000000..d785e65eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a new file mode 100644 index 000000000..43f3b625c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slcext.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a new file mode 100644 index 000000000..8d10f0de4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_slwga.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a new file mode 100644 index 000000000..4c17ec13b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_snmpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a new file mode 100644 index 000000000..a05c7dd7d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_spoolss.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a new file mode 100644 index 000000000..6366f0d49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sporder.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a new file mode 100644 index 000000000..502075424 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_srpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a new file mode 100644 index 000000000..5e54d8897 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ssdpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a new file mode 100644 index 000000000..8375b1bd4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_sti.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a new file mode 100644 index 000000000..6934d3851 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_swdevice.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a new file mode 100644 index 000000000..99a091488 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_synchronization.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a new file mode 100644 index 000000000..c8348f27c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_t2embed.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a new file mode 100644 index 000000000..36123f3f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a new file mode 100644 index 000000000..f61e08de8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tbs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a new file mode 100644 index 000000000..879c4c241 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a new file mode 100644 index 000000000..0fcb4abfe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_thunk32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a new file mode 100644 index 000000000..c42846dc1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a new file mode 100644 index 000000000..29426250c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_traffic.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a new file mode 100644 index 000000000..17dfcbba0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_tsec.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a new file mode 100644 index 000000000..c23fa1572 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_twain_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a new file mode 100644 index 000000000..f0eb04dcb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_txfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a new file mode 100644 index 000000000..850c8c676 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ualapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a new file mode 100644 index 000000000..7fd55e2f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a new file mode 100644 index 000000000..3978c0286 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_umpdddi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a new file mode 100644 index 000000000..4be27178f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a new file mode 100644 index 000000000..433c99125 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a new file mode 100644 index 000000000..157037f11 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a new file mode 100644 index 000000000..6f7c99f52 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_usp10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a new file mode 100644 index 000000000..e7535e457 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a new file mode 100644 index 000000000..3fffa465d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vdmdbg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a new file mode 100644 index 000000000..ced80c6d2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a new file mode 100644 index 000000000..e5aa9322e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a new file mode 100644 index 000000000..203a54e49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a new file mode 100644 index 000000000..ce9faa04b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vfw32.a new file mode 100644 index 000000000..4ee873336 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a new file mode 100644 index 000000000..fedb81337 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_virtdisk.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a new file mode 100644 index 000000000..16394ae1d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_vssapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a new file mode 100644 index 000000000..1aa71796a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wcmapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a new file mode 100644 index 000000000..920e6b4ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsbp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a new file mode 100644 index 000000000..2680c98e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsclientapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a new file mode 100644 index 000000000..597419a4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdsmc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a new file mode 100644 index 000000000..d02e02f9a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdspxe.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a new file mode 100644 index 000000000..713cd9cfc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wdstptc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a new file mode 100644 index 000000000..4b78f3ca1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a new file mode 100644 index 000000000..44718580e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a new file mode 100644 index 000000000..3bf0a96ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wecapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a new file mode 100644 index 000000000..cd69a4c9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wer.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a new file mode 100644 index 000000000..79387dcee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wevtapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a new file mode 100644 index 000000000..d5ff21360 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wiaservc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a new file mode 100644 index 000000000..ae9822813 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winbio.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a new file mode 100644 index 000000000..18779a820 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a new file mode 100644 index 000000000..31fbef11e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a new file mode 100644 index 000000000..cda5fbe41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windows.ui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 000000000..7d94e04c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 000000000..f8be94441 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..735ac6523 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..4bed1b1e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 000000000..f776baaa8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..01292a5a0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..16a1296da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..5371ddab7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..2f1c4141c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..1e4e42c81 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..3e26ac748 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..58e50e5f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..56a3e3623 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..3d67aed45 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..dad567be5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..b2cb11e9e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..d5697b9d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..11be6da92 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..2718e4666 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..220a68cdd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..f66031557 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..e762f5221 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..4faeaa1f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..fe26c3d3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..8effb1970 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..d6527fd97 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..44e462bb9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..17706d845 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..55954cd19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..918697f65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..7907b3b75 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..a6d25991e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..eb3d5fa19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..1cd50fc1e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..5ba6e4e1d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..9f3412518 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..d1fdf0a34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..13808fc7a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..af43d3cff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..9a00e8232 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a new file mode 100644 index 000000000..a851e732e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..95527be34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..90fde2e47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..e2d23b9f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..0757c26ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..6a3e88e58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..77ed2712c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..974c1c1c2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..0ca1500fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..0b23b2b11 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..3c36c785c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..ebfbc923d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..bb694d4af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..24be928bb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..98eb6cda8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..d2bca079d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..c9ae77c84 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..1e51efd73 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..91a4e62a2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..8d4fd3433 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..ed77b26af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..79323d2f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..a55ddae94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..d46c94dea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..8f36637dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..2fe002262 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..d0cca93e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..3ecc222b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..696ae36bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..84bc77d7d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..c3612ca7d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..a159c319a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..460e61989 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 000000000..0a86c5b61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..c4d1ba2b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..2d4b41f15 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..6b7d9cd01 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..95bdd3c0d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..ade2b499e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 000000000..8f61e693d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..ecb273563 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..5501d11b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..da73411f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..cf630b5dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..d40773368 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..977ac4e7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..34833cbb0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..57858f286 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..21f7322af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..cec79cb62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..c7163a624 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..b6d8cc743 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..6105470f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..cd19c2fb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..00d75526d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..ef34952cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..ca2761f5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..105f5c80a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..5a140137f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..4e49d6749 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..d0ec877f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..95a9bfb30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..067a348e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..dae18e877 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..a5115c3df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..38b2821d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..91f059966 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..9f00d28f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..9fa8e24f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..59ae3527b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..02d4560d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..f81e6ceee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..15596e5ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 000000000..fb4d21015 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 000000000..9c4c74b85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 000000000..da49791a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 000000000..1362a96d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 000000000..4b46f3602 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 000000000..e5fc8cf29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 000000000..90c472603 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 000000000..05b5b8aba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..be4994ce9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..51e89caa4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..493442d3e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..b5cd1aa78 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..a8c6c09d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..0b6588461 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..3bc3b947e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..fb8c8ec5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..83b64c00b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..953406dcb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..3c758ff97 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..9ce4fd9b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..86bbbcba8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a new file mode 100644 index 000000000..595109403 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a new file mode 100644 index 000000000..8dfa306b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a new file mode 100644 index 000000000..c6073e636 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a new file mode 100644 index 000000000..c29811ac1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a new file mode 100644 index 000000000..08a1b26ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a new file mode 100644 index 000000000..f1e64913d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a new file mode 100644 index 000000000..424039b22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a new file mode 100644 index 000000000..b9c76f561 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a new file mode 100644 index 000000000..4338e8e5b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a new file mode 100644 index 000000000..e79507902 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a new file mode 100644 index 000000000..4e96e11b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a new file mode 100644 index 000000000..d4af08b87 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a new file mode 100644 index 000000000..252c2782f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a new file mode 100644 index 000000000..7bc0efef2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a new file mode 100644 index 000000000..4ea456eaf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 000000000..79b13d5d0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 000000000..23a078cf7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 000000000..9b9135579 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 000000000..89e6572f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 000000000..75f351601 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 000000000..3b79a3414 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a new file mode 100644 index 000000000..0072969aa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a new file mode 100644 index 000000000..88e4a44a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a new file mode 100644 index 000000000..33947ec83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a new file mode 100644 index 000000000..737149a46 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a new file mode 100644 index 000000000..c86f9a562 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a new file mode 100644 index 000000000..ea2bce6fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a new file mode 100644 index 000000000..44aedc1f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a new file mode 100644 index 000000000..50ea8b505 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a new file mode 100644 index 000000000..0ade38276 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a new file mode 100644 index 000000000..c0b608983 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a new file mode 100644 index 000000000..c92ecc94b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a new file mode 100644 index 000000000..55d704d5e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a new file mode 100644 index 000000000..7fd7ed3ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a new file mode 100644 index 000000000..d3e929e1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a new file mode 100644 index 000000000..1f039103f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a new file mode 100644 index 000000000..ccd98d679 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a new file mode 100644 index 000000000..7e24e2be1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a new file mode 100644 index 000000000..d6ffecd57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a new file mode 100644 index 000000000..386507369 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a new file mode 100644 index 000000000..c782f1512 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a new file mode 100644 index 000000000..f0e48b304 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a new file mode 100644 index 000000000..131affb37 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a new file mode 100644 index 000000000..f7f0abe2c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a new file mode 100644 index 000000000..321fd2fc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a new file mode 100644 index 000000000..b0f72c9a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a new file mode 100644 index 000000000..e4e04628d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp.a new file mode 100644 index 000000000..5ef765fd1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a new file mode 100644 index 000000000..2608a19b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..722280930 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..b8f9f7a78 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..91bc763bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a new file mode 100644 index 000000000..eb78e07bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a new file mode 100644 index 000000000..0929639e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a new file mode 100644 index 000000000..8f16d8437 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a new file mode 100644 index 000000000..5bcd58738 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a new file mode 100644 index 000000000..f20bd440d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a new file mode 100644 index 000000000..71c58f876 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a new file mode 100644 index 000000000..1a91cd7c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a new file mode 100644 index 000000000..a16a066ad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a new file mode 100644 index 000000000..6846f7ef6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a new file mode 100644 index 000000000..2cd8067c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a new file mode 100644 index 000000000..14873d309 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a new file mode 100644 index 000000000..f0e11a059 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a new file mode 100644 index 000000000..74c7c8ac0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a new file mode 100644 index 000000000..61958f3d4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a new file mode 100644 index 000000000..1fa5240c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a new file mode 100644 index 000000000..d74c3142e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a new file mode 100644 index 000000000..52227cbfd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a new file mode 100644 index 000000000..5c8d0016e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a new file mode 100644 index 000000000..680423855 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a new file mode 100644 index 000000000..30c5ad1ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a new file mode 100644 index 000000000..b1712ab05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a new file mode 100644 index 000000000..409934013 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a new file mode 100644 index 000000000..8e19c7f87 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a new file mode 100644 index 000000000..bc09346bb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a new file mode 100644 index 000000000..bf1e18b9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a new file mode 100644 index 000000000..b12646340 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a new file mode 100644 index 000000000..d47881198 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a new file mode 100644 index 000000000..8421f8604 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a new file mode 100644 index 000000000..710f54b09 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a new file mode 100644 index 000000000..3ce3d6bac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a new file mode 100644 index 000000000..ab91188d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a new file mode 100644 index 000000000..aa9979690 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a new file mode 100644 index 000000000..f6c44ec02 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a new file mode 100644 index 000000000..42ee6724e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a new file mode 100644 index 000000000..e482dcdb9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winfax.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a new file mode 100644 index 000000000..8d6ae883e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a new file mode 100644 index 000000000..dfcd54458 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wininet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a new file mode 100644 index 000000000..7ddc07bfa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a new file mode 100644 index 000000000..31e9f209a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winscard.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a new file mode 100644 index 000000000..c99f8301d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a new file mode 100644 index 000000000..2f5f94114 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsqlite3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a new file mode 100644 index 000000000..8faad470e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winsta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a new file mode 100644 index 000000000..066e7a88b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wintrust.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a new file mode 100644 index 000000000..7e2cd8775 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_winusb.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a new file mode 100644 index 000000000..dd0d898d4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a new file mode 100644 index 000000000..1e9ead806 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wlanui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a new file mode 100644 index 000000000..70e88d9cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a new file mode 100644 index 000000000..1acabc325 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmip.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a new file mode 100644 index 000000000..3c06a11b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wmvcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a new file mode 100644 index 000000000..d5c38d21b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wofutil.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a new file mode 100644 index 000000000..0b0c43171 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wow32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a new file mode 100644 index 000000000..55cc1be96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a new file mode 100644 index 000000000..8394bdf4e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wscapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a new file mode 100644 index 000000000..7a00a571e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsclient.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a new file mode 100644 index 000000000..51e054190 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsdapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a new file mode 100644 index 000000000..2b0490cee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsmsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a new file mode 100644 index 000000000..87bf3dee8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsnmp32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a new file mode 100644 index 000000000..97ce32f58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wsock32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a new file mode 100644 index 000000000..5f3988cda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a new file mode 100644 index 000000000..04a0a0685 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a new file mode 100644 index 000000000..52d46423b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xaudio2_8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a new file mode 100644 index 000000000..46ee0c7c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a new file mode 100644 index 000000000..93bb330bb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a new file mode 100644 index 000000000..9976a4bcc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xinputuap.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a new file mode 100644 index 000000000..b65232dc1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a new file mode 100644 index 000000000..7e0af573e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xolehlp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a new file mode 100644 index 000000000..e65dd685a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a new file mode 100644 index 000000000..3101fb6ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/lib/libwinapi_xpsprint.a differ diff --git a/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/src/lib.rs b/vendor/registry-40351f815f426200/winapi-i686-pc-windows-gnu/src/lib.rs new file mode 100644 index 000000000..3b7f827d8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/.cargo-checksum.json b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/.cargo-checksum.json new file mode 100644 index 000000000..10b185202 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/Cargo.toml b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/Cargo.toml new file mode 100644 index 000000000..7e1341b08 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/build.rs b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/build.rs new file mode 100644 index 000000000..a655b7c9e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a new file mode 100644 index 000000000..9b5c0173a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_aclui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a new file mode 100644 index 000000000..aec05b511 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_activeds.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a new file mode 100644 index 000000000..ef376d2d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a new file mode 100644 index 000000000..9296b800b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_advpack.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a new file mode 100644 index 000000000..6311be601 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_amsi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 000000000..f5fc53fcf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_api-ms-win-net-isolation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a new file mode 100644 index 000000000..6af015f70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appmgmts.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a new file mode 100644 index 000000000..9a78ee410 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_appnotify.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a new file mode 100644 index 000000000..f1e748948 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_audioeng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a new file mode 100644 index 000000000..1b810a4c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a new file mode 100644 index 000000000..7b52eea5e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avifil32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a new file mode 100644 index 000000000..70b6218f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_avrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a new file mode 100644 index 000000000..2f811091b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_basesrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a new file mode 100644 index 000000000..a27364dc7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a new file mode 100644 index 000000000..b5f9f37ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bluetoothapis.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a new file mode 100644 index 000000000..948b32cc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_bthprops.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a new file mode 100644 index 000000000..cbea8a25b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a new file mode 100644 index 000000000..ec28d7ca5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certadm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a new file mode 100644 index 000000000..042dce5bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_certpoleng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a new file mode 100644 index 000000000..a32bb2003 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cfgmgr32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a new file mode 100644 index 000000000..6102ad9da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_chakrart.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a new file mode 100644 index 000000000..e82b0651e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cldapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a new file mode 100644 index 000000000..0d2fb6f5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clfsw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a new file mode 100644 index 000000000..feedc4028 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_clusapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a new file mode 100644 index 000000000..cfc918a39 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a new file mode 100644 index 000000000..f7f87b6ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a new file mode 100644 index 000000000..983548219 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comppkgsup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a new file mode 100644 index 000000000..fd7b71886 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_compstui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a new file mode 100644 index 000000000..cf09bc49d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_comsvcs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a new file mode 100644 index 000000000..7ff290d0c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a new file mode 100644 index 000000000..e0eb5967e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_credui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a new file mode 100644 index 000000000..85a898c2e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a new file mode 100644 index 000000000..7073c94b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a new file mode 100644 index 000000000..79322ae28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a new file mode 100644 index 000000000..6d508374e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a new file mode 100644 index 000000000..d94b99a80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cryptxml.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a new file mode 100644 index 000000000..0bb61ac7d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a new file mode 100644 index 000000000..9cb80ea64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_cscdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a new file mode 100644 index 000000000..fb4876377 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a new file mode 100644 index 000000000..5d2982a04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a new file mode 100644 index 000000000..f23896dfb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d10_1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a new file mode 100644 index 000000000..07bdcf7b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a new file mode 100644 index 000000000..d77ff38df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a new file mode 100644 index 000000000..76a789fe4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a new file mode 100644 index 000000000..7202ff53b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcompiler.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a new file mode 100644 index 000000000..5632c6a5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a new file mode 100644 index 000000000..2f687f88a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_d3dcsxd.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a new file mode 100644 index 000000000..5fbc21695 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_davclnt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a new file mode 100644 index 000000000..e32cf057a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbgeng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a new file mode 100644 index 000000000..68af1dfa6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dbghelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a new file mode 100644 index 000000000..e73db18bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dciman32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a new file mode 100644 index 000000000..beeeef276 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dcomp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a new file mode 100644 index 000000000..0ef6fe93c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ddraw.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a new file mode 100644 index 000000000..8b46a2f12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a new file mode 100644 index 000000000..d7eac5962 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_devmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a new file mode 100644 index 000000000..0725743b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dflayout.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a new file mode 100644 index 000000000..28d840c1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a new file mode 100644 index 000000000..32d2a6d64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a new file mode 100644 index 000000000..39cda2520 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dhcpsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a new file mode 100644 index 000000000..14af019ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a new file mode 100644 index 000000000..7107b8f50 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dinput8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a new file mode 100644 index 000000000..44850a831 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dmprocessxmlfiltered.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a new file mode 100644 index 000000000..4c84067a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a new file mode 100644 index 000000000..8ee91a67d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a new file mode 100644 index 000000000..2b484ea7c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dnsrslvr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a new file mode 100644 index 000000000..afa99f26b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dpx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a new file mode 100644 index 000000000..aba232d52 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a new file mode 100644 index 000000000..4748b2d88 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drtprov.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a new file mode 100644 index 000000000..7f0175f8e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_drttransport.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a new file mode 100644 index 000000000..8954c2adf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsound.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a new file mode 100644 index 000000000..9a921eb9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsprop.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a new file mode 100644 index 000000000..8cf29e977 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dssec.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a new file mode 100644 index 000000000..a1ba612d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dststlog.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a new file mode 100644 index 000000000..f574c83c2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dsuiext.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a new file mode 100644 index 000000000..244f217be Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwmapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a new file mode 100644 index 000000000..58d885edb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a new file mode 100644 index 000000000..3816b8119 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a new file mode 100644 index 000000000..30f262bb8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_dxva2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a new file mode 100644 index 000000000..7fbba3aae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappcfg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a new file mode 100644 index 000000000..5f46d3d04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_eappprxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a new file mode 100644 index 000000000..4a5711f9d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_easregprov.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a new file mode 100644 index 000000000..4d6b04625 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_efswrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a new file mode 100644 index 000000000..883a09f85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_elscore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a new file mode 100644 index 000000000..2167897fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a new file mode 100644 index 000000000..4c81d1789 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_evr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a new file mode 100644 index 000000000..f57e082e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_faultrep.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a new file mode 100644 index 000000000..a8893cec6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_feclient.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a new file mode 100644 index 000000000..56caa245b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fhsvcctl.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a new file mode 100644 index 000000000..11b8dbb47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a new file mode 100644 index 000000000..7fd6358cc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fontsub.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a new file mode 100644 index 000000000..24dc14b70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyd.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a new file mode 100644 index 000000000..45576b38e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_framedyn.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a new file mode 100644 index 000000000..66e8bc280 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fwpuclnt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a new file mode 100644 index 000000000..6d0559b91 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_fxsutility.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a new file mode 100644 index 000000000..219b37dbc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a new file mode 100644 index 000000000..6210e26e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gdiplus.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a new file mode 100644 index 000000000..8798334aa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glmf32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a new file mode 100644 index 000000000..3853089ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_glu32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a new file mode 100644 index 000000000..eb249e344 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_gpedit.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a new file mode 100644 index 000000000..5677beaf1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hbaapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a new file mode 100644 index 000000000..3c741a1f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hid.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a new file mode 100644 index 000000000..e5b21ff65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hlink.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a new file mode 100644 index 000000000..d8eb49b05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a new file mode 100644 index 000000000..63e0d0ecc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_httpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a new file mode 100644 index 000000000..1500ab018 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iashlpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a new file mode 100644 index 000000000..68363f9b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a new file mode 100644 index 000000000..5088584c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icmui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a new file mode 100644 index 000000000..b80e877f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuin.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a new file mode 100644 index 000000000..095530465 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_icuuc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a new file mode 100644 index 000000000..1f9bbc4ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imagehlp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a new file mode 100644 index 000000000..e150dfdb1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imgutil.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a new file mode 100644 index 000000000..aa94bb387 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_imm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a new file mode 100644 index 000000000..4d10d4742 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_infocardapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a new file mode 100644 index 000000000..efa3184d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a new file mode 100644 index 000000000..e537a534a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_inseng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a new file mode 100644 index 000000000..9eb2b30d0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a new file mode 100644 index 000000000..b8f9a99e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iprop.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a new file mode 100644 index 000000000..afb2defed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_irprops.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a new file mode 100644 index 000000000..6338c772f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_iscsidsc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a new file mode 100644 index 000000000..0ab246cbd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_jsrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a new file mode 100644 index 000000000..daa363d55 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a new file mode 100644 index 000000000..8100ca91c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksproxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a new file mode 100644 index 000000000..dd661f68f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ksuser.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a new file mode 100644 index 000000000..c661f4f33 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ktmw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a new file mode 100644 index 000000000..8a53f99ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_loadperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a new file mode 100644 index 000000000..b48029426 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_lz32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a new file mode 100644 index 000000000..5c3940708 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_magnification.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a new file mode 100644 index 000000000..684e4d20b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a new file mode 100644 index 000000000..37dabbe16 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mciole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a new file mode 100644 index 000000000..2c32aa881 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmlocalmanagement.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a new file mode 100644 index 000000000..1b0714811 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mdmregistration.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a new file mode 100644 index 000000000..3dba86413 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a new file mode 100644 index 000000000..a74394b12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a new file mode 100644 index 000000000..66ecb3c0a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a new file mode 100644 index 000000000..948ad9cba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfplay.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a new file mode 100644 index 000000000..3e1222d05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a new file mode 100644 index 000000000..92bf2ed4a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a new file mode 100644 index 000000000..19172ea06 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mfsrcsnk.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a new file mode 100644 index 000000000..a6bc0fa92 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mgmtapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a new file mode 100644 index 000000000..53c14c3b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..ff29df6b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..fa66286f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..1bf4b6451 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..58f6877e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..8e03f00fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..942ee910a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..53db5fc16 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..6ee38d902 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..e322d6036 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..1d82ba3e0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..db27f3cb4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..0b3c0f81b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..4af2e6a03 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..2787d9861 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..2db943142 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..cce97dad6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..2baa86b29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..e4b19a2b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..edc77198a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..1ed424bee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..4c8539bf9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..a70dd0a17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..88899bb5e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..42c47ed1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..70465e325 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..6db054b2f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..9bae76055 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..2c1477dc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..3669aea3f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..2f010487e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..5e82569d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..38deb42a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..7933e694f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..99dd8b17b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..98cae3e31 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..7812f4f01 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..8493346e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..d9e045956 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..ab252344b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..68fe5a8b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..576cd0236 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..e19671209 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..8dfc82301 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..0f50d4fe1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..abbba99f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..c4e4b03a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..144278b21 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..06d3dc060 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..8638ee668 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..3ac8927bb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..f98e53b08 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..aa2709da3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..c2b513d96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..28ad4178e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..a142db391 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..e642b55bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..35ddf2f5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..6672ce64f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..4ec4511ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..b19f1c5c5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..da758877f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..62c713df0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..08ae7e9bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..e307074c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..d6f945d69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..2ee0571f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..392084e01 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..caa36ab63 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..e3c333fef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..99ea62b5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..ab0a13af4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..6d577ead5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..8927baeb2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..8b5c539ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..dcebe9c6b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..a3b907ff4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..f67d7b4d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..011f72aa2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..37d79bb47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..ca540049b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..18325564f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..7d0c64d83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..6ce5a9f44 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..ff4e9155c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..7c0b81e43 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..342c2f8d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..7e23224cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..a6f94e354 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..62ca5f70d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..ddfaba8b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..65e9a3091 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..b5e62b0ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..5ddac425c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..2517dc2e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..047cde321 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..38005fc5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..71966efd1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..102b71396 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..3d5f9d913 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..e7003e17e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..ac4bd5d80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..9a083ac85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..bce4a2b30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..6d4a41317 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..e3f0112fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..0b33c8a8c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..4396b1c46 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a new file mode 100644 index 000000000..ebf7e0825 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a new file mode 100644 index 000000000..b2999aad1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a new file mode 100644 index 000000000..31855cd9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..8ac5491a8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..e99797bdb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..6a518b4e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..c10cebcbf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..d4b95d5c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..352a38048 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..ceeaf1541 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..d56e26fe0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..baafaee3b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..949f6e750 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..9c977b6e0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..5a649b776 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..87de26636 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..9a3b5ea80 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..8487b79cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..2cd8af89c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..1c98d9958 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..ef9a25a30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..716ef4eda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..06c3727be Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..14e680b4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..811d67786 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..eead8f154 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..3710d1ea8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..612254a08 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..48f1c6730 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..d310e5a91 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a new file mode 100644 index 000000000..a8ced6abc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a new file mode 100644 index 000000000..e05b33b70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a new file mode 100644 index 000000000..349ef848f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a new file mode 100644 index 000000000..3ba6b61af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a new file mode 100644 index 000000000..1de2709e1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a new file mode 100644 index 000000000..05253736f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a new file mode 100644 index 000000000..043ca84eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a new file mode 100644 index 000000000..72eb94adc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a new file mode 100644 index 000000000..de7169cc6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a new file mode 100644 index 000000000..3ede30198 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a new file mode 100644 index 000000000..d536a7181 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a new file mode 100644 index 000000000..a2ce88ff9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a new file mode 100644 index 000000000..7a962d8a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a new file mode 100644 index 000000000..156ec1a72 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a new file mode 100644 index 000000000..123c44032 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a new file mode 100644 index 000000000..076855636 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a new file mode 100644 index 000000000..daf7ad3e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a new file mode 100644 index 000000000..ccddf3fac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a new file mode 100644 index 000000000..7cf01dce1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a new file mode 100644 index 000000000..87343675f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a new file mode 100644 index 000000000..10efc0ef2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a new file mode 100644 index 000000000..cd66704f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a new file mode 100644 index 000000000..d739a9bb3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a new file mode 100644 index 000000000..b95d43388 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a new file mode 100644 index 000000000..77167844c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a new file mode 100644 index 000000000..8cfa67224 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a new file mode 100644 index 000000000..bd1859d96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a new file mode 100644 index 000000000..9826b9390 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore.a new file mode 100644 index 000000000..d2e567dd2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a new file mode 100644 index 000000000..7b4de17c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a new file mode 100644 index 000000000..09b858912 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-advapi32-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a new file mode 100644 index 000000000..75725543a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-normaliz-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a new file mode 100644 index 000000000..df8fd9399 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-ole32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a new file mode 100644 index 000000000..b1aeac5f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shell32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a new file mode 100644 index 000000000..0608aab45 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a new file mode 100644 index 000000000..eaf612306 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-shlwapi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a new file mode 100644 index 000000000..99be014d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-user32-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a new file mode 100644 index 000000000..b313ab075 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel-api-ms-win-downlevel-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mincore_downlevel.a new file mode 100644 index 000000000..fb6659917 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a new file mode 100644 index 000000000..a127d296d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a new file mode 100644 index 000000000..9d0e79300 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a new file mode 100644 index 000000000..959ae6737 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a new file mode 100644 index 000000000..8d324ca2f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mprsnap.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a new file mode 100644 index 000000000..66b280bf2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mqrt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a new file mode 100644 index 000000000..8be378e4e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mrmsupport.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a new file mode 100644 index 000000000..abf9a53a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msacm32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a new file mode 100644 index 000000000..05382a40e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a new file mode 100644 index 000000000..c4008925f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mscms.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a new file mode 100644 index 000000000..afe449bad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msctfmonitor.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a new file mode 100644 index 000000000..5a53a36ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdelta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a new file mode 100644 index 000000000..56ee4bcfe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdmo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a new file mode 100644 index 000000000..ee83b3a27 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msdrm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a new file mode 100644 index 000000000..64f1cffe3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a new file mode 100644 index 000000000..2f704d35d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msimg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a new file mode 100644 index 000000000..43cc5150c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatcha.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a new file mode 100644 index 000000000..14b103d29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mspatchc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a new file mode 100644 index 000000000..58749ed3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msports.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a new file mode 100644 index 000000000..790a965c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msrating.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a new file mode 100644 index 000000000..7603a13ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mstask.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a new file mode 100644 index 000000000..b2d85d6d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msv1_0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a new file mode 100644 index 000000000..11c75ab3c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_msvfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a new file mode 100644 index 000000000..89a098485 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a new file mode 100644 index 000000000..4d4e2b061 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtx.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a new file mode 100644 index 000000000..2650cd8ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_mtxdm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a new file mode 100644 index 000000000..e09d66bae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a new file mode 100644 index 000000000..0def121b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-api-ms-win-net-isolation-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a new file mode 100644 index 000000000..cfd9dd287 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clfsw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a new file mode 100644 index 000000000..5970ee344 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-clusapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a new file mode 100644 index 000000000..74fba9086 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-cryptxml.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a new file mode 100644 index 000000000..8bf77341e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbgeng.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a new file mode 100644 index 000000000..d945fb634 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dbghelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a new file mode 100644 index 000000000..cbf3fd63a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-dnsperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a new file mode 100644 index 000000000..6fe9290cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a new file mode 100644 index 000000000..5bb5feaf4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-faultrep.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a new file mode 100644 index 000000000..355f44dd8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-framedynos.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a new file mode 100644 index 000000000..908098323 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-fwpuclnt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a new file mode 100644 index 000000000..9fc81e257 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-hbaapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a new file mode 100644 index 000000000..38fc2076f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-httpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a new file mode 100644 index 000000000..671cc8f22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-iscsidsc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a new file mode 100644 index 000000000..f65813edf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ktmw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a new file mode 100644 index 000000000..e67b3765b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-loadperf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a new file mode 100644 index 000000000..668f7f70e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-mprapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a new file mode 100644 index 000000000..22bf2b076 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-netsh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a new file mode 100644 index 000000000..3af56297b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntdsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a new file mode 100644 index 000000000..aa0dab891 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-ntlanman.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a new file mode 100644 index 000000000..5fcc9470a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a new file mode 100644 index 000000000..33e44cef1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a new file mode 100644 index 000000000..532dd1a90 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-snmpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a new file mode 100644 index 000000000..475f3bf03 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-tbs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a new file mode 100644 index 000000000..40bfd336b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-traffic.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a new file mode 100644 index 000000000..92cab8b60 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-virtdisk.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a new file mode 100644 index 000000000..8fb796ad6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-vssapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a new file mode 100644 index 000000000..b3ca8f095 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a new file mode 100644 index 000000000..4e2227e77 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wer.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a new file mode 100644 index 000000000..04f8e436e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wevtapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a new file mode 100644 index 000000000..1f79b3345 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wintrust.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a new file mode 100644 index 000000000..bb9e17d7a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wnvapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a new file mode 100644 index 000000000..b0189ea94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv-wsmsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nanosrv.a new file mode 100644 index 000000000..0cd62da1e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a new file mode 100644 index 000000000..ea1cf5acd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a new file mode 100644 index 000000000..1fc19b2dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_nddeapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a new file mode 100644 index 000000000..c63db8a5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ndfapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a new file mode 100644 index 000000000..ed625a45b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a new file mode 100644 index 000000000..9bd1f99a5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_netsh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a new file mode 100644 index 000000000..c6b4305f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a new file mode 100644 index 000000000..efc374939 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ninput.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a new file mode 100644 index 000000000..c09e95316 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_normaliz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a new file mode 100644 index 000000000..a8115e6f5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a new file mode 100644 index 000000000..f83d7bee9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsa.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a new file mode 100644 index 000000000..b2f0c7a05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a new file mode 100644 index 000000000..05fe28856 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsatq.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a new file mode 100644 index 000000000..6d339a717 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntdsetup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a new file mode 100644 index 000000000..ac632dbce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntfrsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a new file mode 100644 index 000000000..e96d7fa99 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntlanman.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a new file mode 100644 index 000000000..8e615be6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntmarta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a new file mode 100644 index 000000000..7eabf2e29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ntquery.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a new file mode 100644 index 000000000..a9deb72bd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbc32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a new file mode 100644 index 000000000..58e32ba6f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_odbcbcp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a new file mode 100644 index 000000000..0a15b7f19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oemlicense.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a new file mode 100644 index 000000000..9e63fccac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a new file mode 100644 index 000000000..379418321 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a new file mode 100644 index 000000000..1ba67064c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a new file mode 100644 index 000000000..a601f6424 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olecli32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a new file mode 100644 index 000000000..51e77ac86 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a new file mode 100644 index 000000000..3b9724226 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_olesvr32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a new file mode 100644 index 000000000..f2f6cec1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ondemandconnroutehelper.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 000000000..87920a19b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 000000000..edd5b98d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..8f47df2dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..53dd13b2d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..dbb682ab7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..8bfce595c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..bf188d6a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..b5c267ca3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 000000000..61b9123da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..baeb6f41a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..f6e4ba445 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 000000000..73e3cc05e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-console-l3-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..2e5d78c8b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..0cde1efd8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..d7bb8596c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..0dfe6ddd8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..624c7c4a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..8578294fb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..922e68c71 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..aace11e85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..4370369de Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 000000000..fde61e0b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..8d475ad5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..7fca348f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..5ea3df17a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..b28b72167 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..95063510d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..50a0eed24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..eae9ed9fb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..9f0a7f8c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..5d4ce9e5c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..fdccf67ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..632c71eca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..8d990887f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..ba40d51e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..f8f32b919 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..8765f8957 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..cfe9892d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..fc4f3f57a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..2e0545049 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..75c9289c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..c0adc7b33 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..dd7467729 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..94f2b88e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..7bf1cf1aa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..14aae16d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..f95a32617 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..046c4b9ec Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..5fcacf222 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..8158b7cc6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..3f235e385 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..a88281b0e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 000000000..0aa221c3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 000000000..904f87ef5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-job-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/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 000000000..e1cf8eb3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..a6ade328d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 000000000..155b2b36c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 000000000..6e3debc6a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 000000000..ef9d17e6d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 000000000..db5c54e76 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 000000000..ffca9df9e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 000000000..e87e40442 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..2def2c864 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..e390a2c91 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..7e32220f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..c03ba1463 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..1f762983b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..a5450e1ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..ec19275b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..04db6c79c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..e01b733ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..7bb9faedf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..29c100c70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..427587639 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..014095540 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..447c6861d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..e5eec8c73 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..adf5eec4f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..3231b19a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..6660b2951 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..38ab3fbdc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..286097f32 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..a15a95b09 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..c431e08fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..70d421d3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..828351374 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..311a01c52 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..888789a1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 000000000..cd52aa5b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 000000000..4cae32813 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 000000000..7cc315e9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 000000000..eeb1202f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..9abe0b82f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..7ea0422b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..0529465c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..30835b444 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..6b5192e1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..f488b0342 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..7a057aed0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..4947d659c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..9b6e6bebf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 000000000..5c8d995a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..1c5420daf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..e4e209c38 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..f32e75e30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..5004db8b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..886d7f216 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..b8fb9103a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..848084051 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..994fad528 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..cb78933c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..eb40f9d2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..5b2e934b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 000000000..6218d2d15 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-registry-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..72c270eab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..81481f017 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 000000000..b21ca1d66 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..613818cf7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..bc8502716 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 000000000..96440d17b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 000000000..ea1a271f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..d9cdc6db8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..0e793032d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..4ed0527f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 000000000..f3ea41414 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 000000000..bb61bd6db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 000000000..fefe50cc0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..a8eb122b5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..35b239c01 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..01b5f0ef9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..10c68e304 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..c418749a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..ac2422348 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..e32f5ea6b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..e8ed02e05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..48cd52ec8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..b2f7c2c4e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..e8c768f36 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..697b0f04d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 000000000..894669ec1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..107277e69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 000000000..35ad9efca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 000000000..424f12176 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..32047b93a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..3facd6d13 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..0032a54e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..cf48fa521 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..0005443ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..5ee03434b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 000000000..56512f461 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..840ad3d34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..cf72ff523 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..158c2ddc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..482c8df24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..6c3369fdf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..0c48c43b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..a619e5f5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..8eefbaf19 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..42c56f64f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..c5d853d28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..8bebbf25f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..0081ed25c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..7bd6ddf0c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..3d76d2e9e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..a0c0a797a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..f4f87ec35 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..1b194666e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..98b54d37c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..cf03890fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..c501e6ae1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..3d6883c58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..ffdf7de27 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..f53689edc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..0cb309ebd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..586b878dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 000000000..7098deaf4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..f47eea56e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 000000000..14cac2942 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..29458f64f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 000000000..0919a9c50 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-mm-time-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 000000000..6b65168f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 000000000..df4b909f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..18cc39fcb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 000000000..75f77bab7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..2e67a71dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..f5f2f1e41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..c66632351 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 000000000..9ebf89a1d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..48e50afef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..5433b74ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..dc931453c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..7b979d275 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..7f60c7092 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..da060497e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..94293b435 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..f9b23c5b4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..0f4f17735 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..30b94934f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..3878a0640 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..83b2ce9da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..ba1e9d6fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..806feca25 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 000000000..8ba257353 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 000000000..676481b3b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 000000000..5f44695a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..5f839c327 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..a675a9860 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..78191e933 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..095c6f725 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..42f56be13 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..022bfde9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 000000000..78d88c572 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 000000000..23a761873 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 000000000..1b4f5f4a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..c0727cb09 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..4dff840c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..d5b5a8c64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..b1db71514 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 000000000..863c254e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 000000000..79ea315d2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 000000000..4303612e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a new file mode 100644 index 000000000..ed3b2dbe1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a new file mode 100644 index 000000000..404271f35 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a new file mode 100644 index 000000000..19e8cc8ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a new file mode 100644 index 000000000..e6415b25b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a new file mode 100644 index 000000000..3af9a7197 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a new file mode 100644 index 000000000..9d7a14813 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a new file mode 100644 index 000000000..01bb89afa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a new file mode 100644 index 000000000..fc0c71f1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a new file mode 100644 index 000000000..c650e9d10 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a new file mode 100644 index 000000000..24ce85ae5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a new file mode 100644 index 000000000..f225936b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a new file mode 100644 index 000000000..9a565f328 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a new file mode 100644 index 000000000..223150a29 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a new file mode 100644 index 000000000..5c6d8511b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a new file mode 100644 index 000000000..1513278c8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a new file mode 100644 index 000000000..8c0346dfc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a new file mode 100644 index 000000000..742b903d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a new file mode 100644 index 000000000..7713ea748 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a new file mode 100644 index 000000000..f4d0be66c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a new file mode 100644 index 000000000..7c2fc90e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a new file mode 100644 index 000000000..b0f7ac0ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-profapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a new file mode 100644 index 000000000..07d1abc58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a new file mode 100644 index 000000000..bbbb1eaaf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a new file mode 100644 index 000000000..7a558b27f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a new file mode 100644 index 000000000..e0bd55b8f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a new file mode 100644 index 000000000..f37191215 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a new file mode 100644 index 000000000..c9e8a97e4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a new file mode 100644 index 000000000..53b72e18a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a new file mode 100644 index 000000000..1e1426fb1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a new file mode 100644 index 000000000..71812a4e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a new file mode 100644 index 000000000..2c5a0bc4f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a new file mode 100644 index 000000000..822dba5c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a new file mode 100644 index 000000000..740404c3e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a new file mode 100644 index 000000000..cde101e72 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore.a new file mode 100644 index 000000000..73de4a1a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a new file mode 100644 index 000000000..13b6ff73d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a new file mode 100644 index 000000000..7fb130920 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-apphelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a new file mode 100644 index 000000000..2ef0585ae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a new file mode 100644 index 000000000..01f2d7c4f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a new file mode 100644 index 000000000..a4a11a8d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a new file mode 100644 index 000000000..07f693af7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a new file mode 100644 index 000000000..f1525b30c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-d3dx10_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a new file mode 100644 index 000000000..4fc85dbb6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a new file mode 100644 index 000000000..0aaead0e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a new file mode 100644 index 000000000..33824c8f4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-input.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a new file mode 100644 index 000000000..c6aa4b1f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a new file mode 100644 index 000000000..ccad8d47d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a new file mode 100644 index 000000000..23b79e18c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a new file mode 100644 index 000000000..5d32d2d25 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a new file mode 100644 index 000000000..456ecfe88 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a new file mode 100644 index 000000000..4fec75c4a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a new file mode 100644 index 000000000..27f2a8f47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a new file mode 100644 index 000000000..9cdfffbb0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a new file mode 100644 index 000000000..a13c23a73 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a new file mode 100644 index 000000000..45ca5d57d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a new file mode 100644 index 000000000..c7ad535ec Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a new file mode 100644 index 000000000..dd5a81658 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a new file mode 100644 index 000000000..440f89c88 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a new file mode 100644 index 000000000..80bd73460 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a new file mode 100644 index 000000000..b4f9a916a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a new file mode 100644 index 000000000..deb433a28 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a new file mode 100644 index 000000000..24d40ed5a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-twinapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a new file mode 100644 index 000000000..57c2392a2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a new file mode 100644 index 000000000..d70e49282 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a new file mode 100644 index 000000000..b6f5f4ffa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a new file mode 100644 index 000000000..2504470f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a new file mode 100644 index 000000000..b719e9eef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a new file mode 100644 index 000000000..bc6b087b9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a new file mode 100644 index 000000000..d40324e1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecore_downlevel.a new file mode 100644 index 000000000..d9d2e7fb4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 000000000..4b60a8dbd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 000000000..37796dd79 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a new file mode 100644 index 000000000..3c8e1bd41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-appmodel-runtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a new file mode 100644 index 000000000..bd8771bd8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-atoms-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a new file mode 100644 index 000000000..f3de0ed96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-calendar-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..23886f816 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..b69e68d65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a new file mode 100644 index 000000000..7965562e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 000000000..79c95c6e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..6ebfb7dda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..75e8159fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..3b30281a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a new file mode 100644 index 000000000..96e1b51af Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..38d587fb0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..eab795a2b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a new file mode 100644 index 000000000..8ea73550c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-console-l3-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a new file mode 100644 index 000000000..e3acd5554 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..813b54b6d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..02f67a6c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..afb379d07 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a new file mode 100644 index 000000000..b1e710806 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a new file mode 100644 index 000000000..5ed0238f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-debug-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..bffab6b15 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..624dc474c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..a245ec199 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a new file mode 100644 index 000000000..dd4595fca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-enclave-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..4b637732e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a new file mode 100644 index 000000000..d0fe7e13b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..f2fce2569 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..99f64f268 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..885eb7f5e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..7f8b0772c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..e4d2df1b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..bcb9cfb40 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..36ccc1aef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..b08e2df1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..a1c8e5b73 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..b96341b93 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..ba013a7d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..fd67434d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a new file mode 100644 index 000000000..40a8d28f3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..ee9b5c634 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..81afd3135 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a new file mode 100644 index 000000000..67353c0da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..68dc69588 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a new file mode 100644 index 000000000..be482816a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-file-l2-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a new file mode 100644 index 000000000..d3694d14c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-firmware-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..77c910104 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..2dc7874fd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..7ead05528 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..e718fddda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..15adb8bcd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..752ff6372 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..e8d8ac028 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..8e7f8b1d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a new file mode 100644 index 000000000..9d442cf6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a new file mode 100644 index 000000000..d78ed971b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a new file mode 100644 index 000000000..54128f3e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-job-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/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 000000000..98bc76370 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..cdd522329 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a new file mode 100644 index 000000000..bb3e669ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a new file mode 100644 index 000000000..babbd4be4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a new file mode 100644 index 000000000..57aaed69e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a new file mode 100644 index 000000000..3e4629f1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a new file mode 100644 index 000000000..c62d4e4d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a new file mode 100644 index 000000000..48ff45e2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-kernel32-legacy-l1-1-6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..5be8cc82a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..8f9d8cc5d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a new file mode 100644 index 000000000..0dbcbdecc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a new file mode 100644 index 000000000..ba93a511f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..5beddeb83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..fe53ca1b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..6b6f3ab14 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..597a7341b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..ff3a73bc6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..73068c945 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..e184b1406 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..d482db391 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..85bb2828f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..35c5b4e67 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..057d2181f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a new file mode 100644 index 000000000..9ec4f1ed5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a new file mode 100644 index 000000000..2779da823 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-memory-l1-1-5.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..830399c8c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..e5b93eb3b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..32892823c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..a6cf11f46 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..d010b4896 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..62b4a7917 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..716f5ff42 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..e9813e3c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..df203084e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a new file mode 100644 index 000000000..709550e2b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-perfcounters-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a new file mode 100644 index 000000000..f03bf5b5b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a new file mode 100644 index 000000000..7a5433325 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-privateprofile-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a new file mode 100644 index 000000000..3a5497b61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..e2dac0623 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a new file mode 100644 index 000000000..300ebbd0f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processenvironment-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a new file mode 100644 index 000000000..c3529dbc6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processsnapshot-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..a31d61f45 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..4139db225 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..b261a17f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..6b5ac6a34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a new file mode 100644 index 000000000..3660d62b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..c022a8d23 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a new file mode 100644 index 000000000..e450b83dc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-processtopology-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..5e63038a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..f2df8d7e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..145f005d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 000000000..c213a69e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a new file mode 100644 index 000000000..8dfc0ab10 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a new file mode 100644 index 000000000..2e935e166 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-quirks-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..5d00a3e83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..4fddfeb98 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..3cc9213a7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a new file mode 100644 index 000000000..109b4ee82 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a new file mode 100644 index 000000000..b90ba3d03 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a new file mode 100644 index 000000000..de745de7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a new file mode 100644 index 000000000..4c586ad7b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-registry-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..0ba540ab8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a new file mode 100644 index 000000000..e5541c3d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-rtlsupport-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a new file mode 100644 index 000000000..0be5f13c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a new file mode 100644 index 000000000..7c1dc698b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a new file mode 100644 index 000000000..9faf458e7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-shutdown-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a new file mode 100644 index 000000000..cbdd35968 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a new file mode 100644 index 000000000..cdcb06163 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sidebyside-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 000000000..a525c4fa2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..fb526b6e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a new file mode 100644 index 000000000..1f4b85129 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a new file mode 100644 index 000000000..1f782cdd7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a new file mode 100644 index 000000000..9e05ef6df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a new file mode 100644 index 000000000..022212bcf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-string-obsolete-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a new file mode 100644 index 000000000..019e70e9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-stringansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..e0af344eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..3992b7d99 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..50be97b40 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..939e55f8d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..1fe3ad0c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..6df87048b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a new file mode 100644 index 000000000..31c58dcac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a new file mode 100644 index 000000000..eff78043d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..67abc3c62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a new file mode 100644 index 000000000..130c97425 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a new file mode 100644 index 000000000..10259ec69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-systemtopology-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..614cac530 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a new file mode 100644 index 000000000..a1ca3fe8f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-threadpool-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..244ecea2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a new file mode 100644 index 000000000..b273fc924 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a new file mode 100644 index 000000000..561916f30 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-toolhelp-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..6c0b50e38 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..8a156fdfe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a new file mode 100644 index 000000000..b96b6c886 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-util-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..2d157704f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a new file mode 100644 index 000000000..dade58d6c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-version-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..cd166998f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a new file mode 100644 index 000000000..95111af22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-versionansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..21e50b203 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..36a62c64e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..1658383d0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..1c8f1bdd5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..749a8cc9a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..7a0c18f96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..cec82e90d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..a8e03e711 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..bc51a0a9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..4de28a730 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..3b9e69d72 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a new file mode 100644 index 000000000..3b559d7b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-winrt-string-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..bb8d5f0c1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a new file mode 100644 index 000000000..4a1bb3c20 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a new file mode 100644 index 000000000..a1cd338a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-wow64-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..f52fb737a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a new file mode 100644 index 000000000..129a71daf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a new file mode 100644 index 000000000..7437b4607 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-config-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a new file mode 100644 index 000000000..523112828 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a new file mode 100644 index 000000000..b7d359a9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-devices-swdevice-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a new file mode 100644 index 000000000..6b36a729f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a new file mode 100644 index 000000000..0eb01e372 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a new file mode 100644 index 000000000..8658e4216 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a new file mode 100644 index 000000000..245d2d85c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a new file mode 100644 index 000000000..66598aefa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-dx-d3dkmt-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..ec27513b8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..d86ed7f7c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a new file mode 100644 index 000000000..cbc8cf973 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-consumer-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..dce5d5b79 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..bb5d05f26 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a new file mode 100644 index 000000000..de185eac4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..1ffddea91 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a new file mode 100644 index 000000000..90325013c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-eventing-tdh-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..95bdab594 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 000000000..6a6ef393b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 000000000..2ab5d417f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 000000000..7274d76b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 000000000..da9d062d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 000000000..9d610fe18 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 000000000..ef0805360 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 000000000..681fdd018 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 000000000..7f55f5ee3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a new file mode 100644 index 000000000..a4fbccff1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a new file mode 100644 index 000000000..96e382d1a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-misc-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a new file mode 100644 index 000000000..b62fbec1f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-mme-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a new file mode 100644 index 000000000..48785f2a6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-playsound-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a new file mode 100644 index 000000000..f5d17523c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-mm-time-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a new file mode 100644 index 000000000..b31859665 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ntuser-sysparams-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a new file mode 100644 index 000000000..3eca89434 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-oobe-notification-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a new file mode 100644 index 000000000..bce843c40 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-perf-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a new file mode 100644 index 000000000..343e40d1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a new file mode 100644 index 000000000..2f2f9fe65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-limitsmanagement-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a new file mode 100644 index 000000000..416beb740 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-power-setting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..02c3c4015 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a new file mode 100644 index 000000000..e4c8e7662 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-appcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a new file mode 100644 index 000000000..883e43b8a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..4852884c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..0c2049c39 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..ae1b07291 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a new file mode 100644 index 000000000..9a1ae24cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-base-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a new file mode 100644 index 000000000..3412dd272 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-credentials-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..1ad14296a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..f39207785 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..02dc0e4d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..1c49d625c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a new file mode 100644 index 000000000..fb8bb052e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-lsalookup-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..9a7c5a14b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..673f4d522 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..e11adfe34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..a7d7272df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a new file mode 100644 index 000000000..29b71e1da Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-security-systemfunctions-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a new file mode 100644 index 000000000..2bc4656b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a new file mode 100644 index 000000000..56625cf50 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a new file mode 100644 index 000000000..87b629605 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a new file mode 100644 index 000000000..53a32622f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a new file mode 100644 index 000000000..103d4752c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-core-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a new file mode 100644 index 000000000..db48c5feb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a new file mode 100644 index 000000000..58f7df3ef Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-management-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a new file mode 100644 index 000000000..2b0db2c5e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-service-winsvc-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a new file mode 100644 index 000000000..7f7667916 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a new file mode 100644 index 000000000..fba58aabb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a new file mode 100644 index 000000000..23e421b2c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-registry-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..214063d57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..d01e791f0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..847b7574c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..eebc1b763 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a new file mode 100644 index 000000000..918694333 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a new file mode 100644 index 000000000..8d0c8acd9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shcore-unicodeansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a new file mode 100644 index 000000000..a9927de6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a new file mode 100644 index 000000000..68f7f5cde Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-api-ms-win-shell-shdirectory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a new file mode 100644 index 000000000..e8a4dc2b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-authz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a new file mode 100644 index 000000000..ee8432fa4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a new file mode 100644 index 000000000..06a76bfec Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a new file mode 100644 index 000000000..8cc5a476f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-chakra.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a new file mode 100644 index 000000000..9d5b919a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a new file mode 100644 index 000000000..25d1f1605 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a new file mode 100644 index 000000000..79492c6d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptbase.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a new file mode 100644 index 000000000..1e3317d57 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-cryptnet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a new file mode 100644 index 000000000..2e7c373b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a new file mode 100644 index 000000000..185ed0276 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a new file mode 100644 index 000000000..ab43f596e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a new file mode 100644 index 000000000..d058b1e1e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a new file mode 100644 index 000000000..ded2380f1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a new file mode 100644 index 000000000..03cae087a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dfscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a new file mode 100644 index 000000000..c9298997f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a new file mode 100644 index 000000000..60c5b5896 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a new file mode 100644 index 000000000..628d219a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dnsapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a new file mode 100644 index 000000000..56c7261a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsparse.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a new file mode 100644 index 000000000..67c8734f3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dsrole.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a new file mode 100644 index 000000000..671f2bfc2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a new file mode 100644 index 000000000..15771d972 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a new file mode 100644 index 000000000..cd95792e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 000000000..28eb32dd1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 000000000..7f295e4d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a new file mode 100644 index 000000000..a274bf57e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-networking-wlanapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a new file mode 100644 index 000000000..c2f7ff4f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a new file mode 100644 index 000000000..77efe4b61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-shell32-shellfolders-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 000000000..7b968d583 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 000000000..c7b52d246 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 000000000..3d44de25c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 000000000..37624df32 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a new file mode 100644 index 000000000..7bae6bda3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-fltlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a new file mode 100644 index 000000000..580cbac3a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hid.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a new file mode 100644 index 000000000..f20f592d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a new file mode 100644 index 000000000..f46c4884b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a new file mode 100644 index 000000000..fa5a85c90 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a new file mode 100644 index 000000000..32864e9b6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-logoncli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a new file mode 100644 index 000000000..c7d76bb83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a new file mode 100644 index 000000000..2dc6733ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a new file mode 100644 index 000000000..89a4eb56b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a new file mode 100644 index 000000000..ae5de25fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a new file mode 100644 index 000000000..18de81d85 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a new file mode 100644 index 000000000..e1d81baf6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mpr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a new file mode 100644 index 000000000..77c0f0c39 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a new file mode 100644 index 000000000..126b7a914 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a new file mode 100644 index 000000000..63beb7820 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a new file mode 100644 index 000000000..db37a10e0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-netutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a new file mode 100644 index 000000000..4c43b2d6d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a new file mode 100644 index 000000000..d1dbb033a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a new file mode 100644 index 000000000..667c2bcee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a new file mode 100644 index 000000000..31668fe04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-profapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a new file mode 100644 index 000000000..2bc2a70db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a new file mode 100644 index 000000000..8808e748f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a new file mode 100644 index 000000000..a689c15c4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a new file mode 100644 index 000000000..625e3414c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-samcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a new file mode 100644 index 000000000..04a19c1bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-schedcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a new file mode 100644 index 000000000..fd4a96b59 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-srvcli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a new file mode 100644 index 000000000..f631e9c32 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a new file mode 100644 index 000000000..22e4d166f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a new file mode 100644 index 000000000..c143cb715 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a new file mode 100644 index 000000000..d8aaf37fe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a new file mode 100644 index 000000000..d61f5d74f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a new file mode 100644 index 000000000..86b5f1769 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a new file mode 100644 index 000000000..972de6e83 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a new file mode 100644 index 000000000..cca1b802b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a new file mode 100644 index 000000000..de73a8b63 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a new file mode 100644 index 000000000..4e054e233 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a new file mode 100644 index 000000000..d5573c434 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a new file mode 100644 index 000000000..927cf9a2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wintrust.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a new file mode 100644 index 000000000..fd517c276 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wkscli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a new file mode 100644 index 000000000..7c4faa1ad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wlanapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a new file mode 100644 index 000000000..e78cb6c4e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a new file mode 100644 index 000000000..f0b68b86c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-wpprecorderum.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a new file mode 100644 index 000000000..aa9aeb8d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a new file mode 100644 index 000000000..560f31623 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xaudio2_9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a new file mode 100644 index 000000000..cd8228c74 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap.a new file mode 100644 index 000000000..8e19e5165 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a new file mode 100644 index 000000000..d5fdc1da0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a new file mode 100644 index 000000000..1fab81127 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-apphelp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a new file mode 100644 index 000000000..09acba717 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comctl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a new file mode 100644 index 000000000..641f77b51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-comdlg32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a new file mode 100644 index 000000000..edee55c0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a new file mode 100644 index 000000000..73dc282ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3d9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a new file mode 100644 index 000000000..2785192d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-d3dx10_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a new file mode 100644 index 000000000..a8adedc14 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-difxapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a new file mode 100644 index 000000000..29a649c94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-gdi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a new file mode 100644 index 000000000..ded06ded0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-input.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a new file mode 100644 index 000000000..b6a50005b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a new file mode 100644 index 000000000..e3cffbcaf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-msi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a new file mode 100644 index 000000000..c5038ac1b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-newdev.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a new file mode 100644 index 000000000..a987556d2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a new file mode 100644 index 000000000..49f6a39d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleacc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a new file mode 100644 index 000000000..8370d6a4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a new file mode 100644 index 000000000..6bb7fe4ad Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-oledlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a new file mode 100644 index 000000000..44fbc7801 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a new file mode 100644 index 000000000..d3782543d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a new file mode 100644 index 000000000..bd9e367ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a new file mode 100644 index 000000000..5f361602a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a new file mode 100644 index 000000000..af61a3a17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a new file mode 100644 index 000000000..2d1f9c1f9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a new file mode 100644 index 000000000..fc53fd233 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a new file mode 100644 index 000000000..cc44364a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a new file mode 100644 index 000000000..246ce3ba8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a new file mode 100644 index 000000000..208fe4e2e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-twinapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a new file mode 100644 index 000000000..2486aac74 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a new file mode 100644 index 000000000..37922ca6d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a new file mode 100644 index 000000000..9ffb0e7ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a new file mode 100644 index 000000000..5e36466c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a new file mode 100644 index 000000000..78d09429d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a new file mode 100644 index 000000000..f13249d27 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a new file mode 100644 index 000000000..82aec5e7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_onecoreuap_downlevel.a new file mode 100644 index 000000000..a412d1813 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a new file mode 100644 index 000000000..ffc45dc7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opengl32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a new file mode 100644 index 000000000..c88f52ee0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_opmxbox.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a new file mode 100644 index 000000000..9daf25887 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2p.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a new file mode 100644 index 000000000..38235cd5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_p2pgraph.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a new file mode 100644 index 000000000..75520ffe0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pathcch.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a new file mode 100644 index 000000000..1cd6167d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_pdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a new file mode 100644 index 000000000..7469347b9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_peerdist.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a new file mode 100644 index 000000000..31e03e4cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_powrprof.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a new file mode 100644 index 000000000..f4f187e3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_prntvpt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a new file mode 100644 index 000000000..995c244cb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a new file mode 100644 index 000000000..faaf0c4b0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_psapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a new file mode 100644 index 000000000..062b1b2c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_quartz.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a new file mode 100644 index 000000000..24c36813d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_query.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a new file mode 100644 index 000000000..e61f5dc9f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_qwave.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a new file mode 100644 index 000000000..580468f79 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a new file mode 100644 index 000000000..c1ae17924 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rasdlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a new file mode 100644 index 000000000..9817f08e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_resutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a new file mode 100644 index 000000000..95487014c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a new file mode 100644 index 000000000..1de9056e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcexts.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a new file mode 100644 index 000000000..f65bfa0e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcns4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a new file mode 100644 index 000000000..ed10fc6c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcproxy.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a new file mode 100644 index 000000000..1c275df7f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a new file mode 100644 index 000000000..b13b6d219 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rstrtmgr.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a new file mode 100644 index 000000000..818088fb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a new file mode 100644 index 000000000..c98f447a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a new file mode 100644 index 000000000..4b5f7ee8c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_rtworkq.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..1801c6705 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..da5c0652e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..3a96659ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..5c961d18e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..5b8da42fa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..53f6fe0ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..d689c065d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..79b665b9b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_runtimeobject.a new file mode 100644 index 000000000..bf368a20f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a new file mode 100644 index 000000000..b9525b0c6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samlib.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a new file mode 100644 index 000000000..478283872 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_samsrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a new file mode 100644 index 000000000..542596572 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sas.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a new file mode 100644 index 000000000..acf33106c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scarddlg.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a new file mode 100644 index 000000000..5811d5725 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scecli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a new file mode 100644 index 000000000..909f4b99e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_scesrv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a new file mode 100644 index 000000000..aea8ed1f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_schannel.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a new file mode 100644 index 000000000..e6c8ad803 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_secur32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a new file mode 100644 index 000000000..6544213f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_security.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a new file mode 100644 index 000000000..17a72cb5f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sens.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a new file mode 100644 index 000000000..93cf942dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a new file mode 100644 index 000000000..4f86fa7c1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sensorsutils.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a new file mode 100644 index 000000000..1d657d512 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_setupapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a new file mode 100644 index 000000000..b4fc6a6cf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sfc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..a4e75b9db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..c4b902bfd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a new file mode 100644 index 000000000..1925c13d0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a new file mode 100644 index 000000000..7c1f77ba6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a new file mode 100644 index 000000000..3f53c733e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-scaling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..47c152cde Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shcore.a new file mode 100644 index 000000000..2c5f78672 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a new file mode 100644 index 000000000..5d8cad8a1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shdocvw.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a new file mode 100644 index 000000000..98cf7d259 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shell32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a new file mode 100644 index 000000000..326fefdd0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shfolder.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a new file mode 100644 index 000000000..30656c118 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_shlwapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a new file mode 100644 index 000000000..1e636724f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a new file mode 100644 index 000000000..5865ad6bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slcext.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a new file mode 100644 index 000000000..eeed243ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_slwga.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a new file mode 100644 index 000000000..38258ee3d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_snmpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a new file mode 100644 index 000000000..95ed86048 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_spoolss.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a new file mode 100644 index 000000000..3383fe395 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sporder.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a new file mode 100644 index 000000000..8de830f22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_srpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a new file mode 100644 index 000000000..7d267809e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ssdpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a new file mode 100644 index 000000000..03201e969 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_sti.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a new file mode 100644 index 000000000..793ba3a53 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_swdevice.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a new file mode 100644 index 000000000..4e3b2af68 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_synchronization.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a new file mode 100644 index 000000000..1c44954ed Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_t2embed.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a new file mode 100644 index 000000000..558700280 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a new file mode 100644 index 000000000..11a57b558 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tbs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a new file mode 100644 index 000000000..2dc5dc9b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tdh.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a new file mode 100644 index 000000000..883b23175 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tokenbinding.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a new file mode 100644 index 000000000..a1bb1674f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_traffic.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a new file mode 100644 index 000000000..a0257340f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_tsec.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a new file mode 100644 index 000000000..097b8e4d2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_txfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a new file mode 100644 index 000000000..a97b24cc7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ualapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a new file mode 100644 index 000000000..fa32a1c45 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a new file mode 100644 index 000000000..36cbb19b2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_umpdddi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a new file mode 100644 index 000000000..060ebc5f8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a new file mode 100644 index 000000000..63ce1cd93 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_user32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a new file mode 100644 index 000000000..354fdd7ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_userenv.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a new file mode 100644 index 000000000..bd0e21c96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_usp10.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a new file mode 100644 index 000000000..fc162f237 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_uxtheme.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a new file mode 100644 index 000000000..634cf670c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_version.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a new file mode 100644 index 000000000..7b1ca446b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vertdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a new file mode 100644 index 000000000..7d346d9d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avicap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a new file mode 100644 index 000000000..169484edc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-avifil32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a new file mode 100644 index 000000000..27f29f58e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32-msvfw32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vfw32.a new file mode 100644 index 000000000..4ee873336 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a new file mode 100644 index 000000000..e2da0b667 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_virtdisk.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a new file mode 100644 index 000000000..c3ee9a6a9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_vssapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a new file mode 100644 index 000000000..829682c3f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wcmapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a new file mode 100644 index 000000000..d62c5d111 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsbp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a new file mode 100644 index 000000000..24475656f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsclientapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a new file mode 100644 index 000000000..e869d4018 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdsmc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a new file mode 100644 index 000000000..67e2f2d26 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdspxe.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a new file mode 100644 index 000000000..f0e2dd98d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wdstptc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a new file mode 100644 index 000000000..dbb557b99 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a new file mode 100644 index 000000000..3db218f69 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_websocket.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a new file mode 100644 index 000000000..77817cce4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wecapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a new file mode 100644 index 000000000..24f470aaa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wer.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a new file mode 100644 index 000000000..f6b9852b9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wevtapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a new file mode 100644 index 000000000..0328e9201 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wiaservc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a new file mode 100644 index 000000000..392c61548 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winbio.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a new file mode 100644 index 000000000..d23124b34 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a new file mode 100644 index 000000000..24ee96647 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a new file mode 100644 index 000000000..594416df0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windows.ui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a new file mode 100644 index 000000000..376dc934b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a new file mode 100644 index 000000000..4fb57229e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-appmodel-runtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a new file mode 100644 index 000000000..7f9104238 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a new file mode 100644 index 000000000..8dcb2257d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a new file mode 100644 index 000000000..667c2d288 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a new file mode 100644 index 000000000..16d7f6e22 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-com-midlproxystub-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a new file mode 100644 index 000000000..e8e919bdb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a new file mode 100644 index 000000000..c197afecc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-comm-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a new file mode 100644 index 000000000..7b0609a2a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a new file mode 100644 index 000000000..cf05f2bbd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-console-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a new file mode 100644 index 000000000..76347e732 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a new file mode 100644 index 000000000..57cef7037 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-datetime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a new file mode 100644 index 000000000..f54077264 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-debug-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a new file mode 100644 index 000000000..f56e67f78 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a new file mode 100644 index 000000000..816e82ff6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-delayload-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a new file mode 100644 index 000000000..04311d4a3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-enclave-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a new file mode 100644 index 000000000..85a80d304 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a new file mode 100644 index 000000000..c4248e6bc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a new file mode 100644 index 000000000..fa7974e24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-errorhandling-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a new file mode 100644 index 000000000..f6ba05e49 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a new file mode 100644 index 000000000..330cc42e5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-featurestaging-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a new file mode 100644 index 000000000..70c994fb3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a new file mode 100644 index 000000000..5f69666ab Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a new file mode 100644 index 000000000..e51c23bfe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a new file mode 100644 index 000000000..4f5a52f24 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-fibers-l2-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a new file mode 100644 index 000000000..436bf76f3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a new file mode 100644 index 000000000..b7549f8ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a new file mode 100644 index 000000000..af7bed7d3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a new file mode 100644 index 000000000..c05ebeb81 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a new file mode 100644 index 000000000..aa87bb85c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a new file mode 100644 index 000000000..af5188d61 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a new file mode 100644 index 000000000..b030a9e96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-file-l2-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a new file mode 100644 index 000000000..6b25481df Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-handle-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a new file mode 100644 index 000000000..0cd981eb3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a new file mode 100644 index 000000000..8a8c4decf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a new file mode 100644 index 000000000..aae89c554 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-heap-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a new file mode 100644 index 000000000..25055ffd2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a new file mode 100644 index 000000000..d1e7cbf58 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-interlocked-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a new file mode 100644 index 000000000..9f25dbf96 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a new file mode 100644 index 000000000..fd60dbdf1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-io-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/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 000000000..d25acbe0d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a new file mode 100644 index 000000000..1c07faeb5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-kernel32-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a new file mode 100644 index 000000000..58ae12d9c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-largeinteger-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a new file mode 100644 index 000000000..05f0e1e41 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a new file mode 100644 index 000000000..0af2c3890 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-libraryloader-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a new file mode 100644 index 000000000..42d1bd674 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..aebd13d6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a new file mode 100644 index 000000000..ddd7680c3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a new file mode 100644 index 000000000..03396118c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a new file mode 100644 index 000000000..805324866 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a new file mode 100644 index 000000000..6bcde9268 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-localization-obsolete-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a new file mode 100644 index 000000000..080203d4c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a new file mode 100644 index 000000000..0eabec9ce Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a new file mode 100644 index 000000000..121bf61ca Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a new file mode 100644 index 000000000..f620651e2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-memory-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a new file mode 100644 index 000000000..9b112fc9a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a new file mode 100644 index 000000000..cf45466d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-ansi-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a new file mode 100644 index 000000000..04822e149 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a new file mode 100644 index 000000000..a63de1481 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a new file mode 100644 index 000000000..05741b0f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namedpipe-l1-2-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a new file mode 100644 index 000000000..f29fc1aeb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a new file mode 100644 index 000000000..14da17ea5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-namespace-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a new file mode 100644 index 000000000..2446d3479 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-normalization-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a new file mode 100644 index 000000000..1767c2f04 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-path-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a new file mode 100644 index 000000000..7bcf4de97 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processenvironment-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a new file mode 100644 index 000000000..0ef867096 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a new file mode 100644 index 000000000..8e3594c51 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a new file mode 100644 index 000000000..e885e26d8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a new file mode 100644 index 000000000..4a68e2e17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processthreads-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a new file mode 100644 index 000000000..0b44ad247 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-processtopology-obsolete-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a new file mode 100644 index 000000000..367a07ac4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-profile-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a new file mode 100644 index 000000000..ac268c6a4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a new file mode 100644 index 000000000..6cbeeffbe Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a new file mode 100644 index 000000000..371a4c7dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-psm-appnotify-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a new file mode 100644 index 000000000..5bf499972 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a new file mode 100644 index 000000000..11ddaa644 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a new file mode 100644 index 000000000..e93a81ca8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-realtime-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a new file mode 100644 index 000000000..f36978948 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-rtlsupport-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a new file mode 100644 index 000000000..42b61dfae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-slapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a new file mode 100644 index 000000000..698ddaddb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a new file mode 100644 index 000000000..0ef6bbfba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a new file mode 100644 index 000000000..070964696 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a new file mode 100644 index 000000000..b268543c7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a new file mode 100644 index 000000000..e789bba16 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-synch-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a new file mode 100644 index 000000000..80f9c9cb7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a new file mode 100644 index 000000000..2fcf88567 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a new file mode 100644 index 000000000..03d507f8f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-sysinfo-l1-2-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a new file mode 100644 index 000000000..e20a3b80c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-threadpool-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a new file mode 100644 index 000000000..a94e2d0f6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-timezone-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a new file mode 100644 index 000000000..0f9d69946 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-url-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a new file mode 100644 index 000000000..8279d7201 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-util-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a new file mode 100644 index 000000000..f34b40a2b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-version-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a new file mode 100644 index 000000000..fa6483ca0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-versionansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a new file mode 100644 index 000000000..1507037cf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowsceip-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a new file mode 100644 index 000000000..febb56731 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a new file mode 100644 index 000000000..6499d7d6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a new file mode 100644 index 000000000..fb9c0d43b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-windowserrorreporting-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a new file mode 100644 index 000000000..8f1751fbf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a new file mode 100644 index 000000000..25a56ca70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-error-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..ab32b872c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a new file mode 100644 index 000000000..0a0cfad05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-registration-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a new file mode 100644 index 000000000..469de78c2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a new file mode 100644 index 000000000..b8f36b0cf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-roparameterizediid-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a new file mode 100644 index 000000000..4acaa7d65 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-winrt-string-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a new file mode 100644 index 000000000..0cf2878ac Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-wow64-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a new file mode 100644 index 000000000..3384e1560 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-core-xstate-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a new file mode 100644 index 000000000..f4f0e8be0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-classicprovider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a new file mode 100644 index 000000000..1368f89b7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-consumer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a new file mode 100644 index 000000000..7d03ec5d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-controller-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a new file mode 100644 index 000000000..3ba774b68 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-legacy-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a new file mode 100644 index 000000000..673e82cb9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-eventing-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a new file mode 100644 index 000000000..7d08bb697 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-deviceinformation-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a new file mode 100644 index 000000000..4c85c1f46 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-expandedresources-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a new file mode 100644 index 000000000..54f72382d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a new file mode 100644 index 000000000..616a29d6e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-gamemonitor-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a new file mode 100644 index 000000000..601f05a50 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a new file mode 100644 index 000000000..ca1e9b8de Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a new file mode 100644 index 000000000..117874faa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a new file mode 100644 index 000000000..694a4092f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a new file mode 100644 index 000000000..7eef86525 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-gaming-tcui-l1-1-4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a new file mode 100644 index 000000000..6b3d0c62d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-ro-typeresolution-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a new file mode 100644 index 000000000..62581e48d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a new file mode 100644 index 000000000..be5df7e47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a new file mode 100644 index 000000000..3f7c7fbae Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-base-l1-2-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a new file mode 100644 index 000000000..70fd9fc94 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-cryptoapi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a new file mode 100644 index 000000000..3c8658c45 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-isolatedcontainer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a new file mode 100644 index 000000000..f24a52999 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-ansi-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a new file mode 100644 index 000000000..46c5f2f17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-lsalookup-l2-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a new file mode 100644 index 000000000..4d5c84bd6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a new file mode 100644 index 000000000..5124e6019 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-provider-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a new file mode 100644 index 000000000..2a4cf7835 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-ansi-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a new file mode 100644 index 000000000..e2a7cc44d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-security-sddl-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a new file mode 100644 index 000000000..a75e822db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-api-ms-win-shcore-stream-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a new file mode 100644 index 000000000..2a6a511db Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-bcrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a new file mode 100644 index 000000000..e320391c0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a new file mode 100644 index 000000000..7ac6d0b05 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-chakra.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a new file mode 100644 index 000000000..dcff55abc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-coremessaging.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a new file mode 100644 index 000000000..e6c125e8d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-crypt32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a new file mode 100644 index 000000000..711f95bf4 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a new file mode 100644 index 000000000..018719141 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a new file mode 100644 index 000000000..983d99782 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3d12.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a new file mode 100644 index 000000000..675d1569d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a new file mode 100644 index 000000000..0cfcf385f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a new file mode 100644 index 000000000..19e57e18c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a new file mode 100644 index 000000000..acf659f93 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a new file mode 100644 index 000000000..242e43805 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a new file mode 100644 index 000000000..c0dc910fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a new file mode 100644 index 000000000..660716933 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a new file mode 100644 index 000000000..3e2203442 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-core-iuri-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a new file mode 100644 index 000000000..b06b03e4b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-gaming-xinput-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a new file mode 100644 index 000000000..ea046a48c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a new file mode 100644 index 000000000..bbfb183d6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a new file mode 100644 index 000000000..6bcc88188 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a new file mode 100644 index 000000000..e8c280932 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ext-ms-win-uiacore-l1-1-3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a new file mode 100644 index 000000000..a629a8cbc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-hrtfapo.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a new file mode 100644 index 000000000..82d731bf3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-inkobjcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a new file mode 100644 index 000000000..42d054f64 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-iphlpapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a new file mode 100644 index 000000000..a484762d5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a new file mode 100644 index 000000000..02e079728 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a new file mode 100644 index 000000000..61f695b73 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a new file mode 100644 index 000000000..b56d74314 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mfsensorgroup.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a new file mode 100644 index 000000000..a2d7db18e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a new file mode 100644 index 000000000..722445a56 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a new file mode 100644 index 000000000..e26526079 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a new file mode 100644 index 000000000..230fd2afb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ncrypt.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a new file mode 100644 index 000000000..9ab94f4eb Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ntdll.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a new file mode 100644 index 000000000..39e7d2c62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a new file mode 100644 index 000000000..bc9642191 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a new file mode 100644 index 000000000..8a8eef581 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rometadata.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a new file mode 100644 index 000000000..ac77cc6d0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a new file mode 100644 index 000000000..9760833ee Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-sspicli.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a new file mode 100644 index 000000000..fdc6b996b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a new file mode 100644 index 000000000..0a4aad375 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a new file mode 100644 index 000000000..4a4442f4b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a new file mode 100644 index 000000000..16ea84ec0 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a new file mode 100644 index 000000000..3c383d000 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a new file mode 100644 index 000000000..994c633fc Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a new file mode 100644 index 000000000..81770cab6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a new file mode 100644 index 000000000..4578472e8 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xaudio2_9.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a new file mode 100644 index 000000000..3a8aa6018 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp.a new file mode 100644 index 000000000..a85aad831 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a new file mode 100644 index 000000000..68131012c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-advapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a new file mode 100644 index 000000000..2a07b48d9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-localization-l1-2-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a new file mode 100644 index 000000000..891b09e59 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a b/vendor/registry-40351f815f426200/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 000000000..bf98a4142 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-api-ms-win-core-winrt-robuffer-l1-1-0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a new file mode 100644 index 000000000..40f006238 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-cabinet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a new file mode 100644 index 000000000..96bc6aa1e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d2d1.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a new file mode 100644 index 000000000..ddf0ff9ba Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3d11.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a new file mode 100644 index 000000000..dc2ef2d48 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-d3dcompiler_47.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a new file mode 100644 index 000000000..6a6ca8944 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-deviceaccess.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a new file mode 100644 index 000000000..4319f0ae9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a new file mode 100644 index 000000000..7350198f7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dhcpcsvc6.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a new file mode 100644 index 000000000..68a3c24d7 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a new file mode 100644 index 000000000..4c41bfcde Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-dxgi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a new file mode 100644 index 000000000..df960f5e6 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-esent.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a new file mode 100644 index 000000000..4818f2931 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-kernel32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a new file mode 100644 index 000000000..df6d5327f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a new file mode 100644 index 000000000..95a95c6dd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfplat.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a new file mode 100644 index 000000000..3b64b76d1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mfreadwrite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a new file mode 100644 index 000000000..3af3528b3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mmdevapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a new file mode 100644 index 000000000..593538e1c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-msajapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a new file mode 100644 index 000000000..b220187cd Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mscoree.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a new file mode 100644 index 000000000..f3dba4ff9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-mswsock.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a new file mode 100644 index 000000000..3685c4d1d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ole32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a new file mode 100644 index 000000000..dfbadd780 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-oleaut32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a new file mode 100644 index 000000000..f6ca5724c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-propsys.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a new file mode 100644 index 000000000..8c88d3317 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-rpcrt4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a new file mode 100644 index 000000000..8bef6ebec Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-uiautomationcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a new file mode 100644 index 000000000..d4590326b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-urlmon.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a new file mode 100644 index 000000000..ce2f0d2c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-webservices.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a new file mode 100644 index 000000000..5b1679cd9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.data.pdf.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a new file mode 100644 index 000000000..30c12b708 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windows.networking.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a new file mode 100644 index 000000000..bfb543e5d Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a new file mode 100644 index 000000000..c557407ff Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a new file mode 100644 index 000000000..0c21219c9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xaudio2_8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a new file mode 100644 index 000000000..abf088d47 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xinput1_4.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a new file mode 100644 index 000000000..1f95da652 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel-xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowsapp_downlevel.a new file mode 100644 index 000000000..83a2d27f7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a new file mode 100644 index 000000000..bf44edd12 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_windowscodecs.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a new file mode 100644 index 000000000..1ad799c8f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winfax.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a new file mode 100644 index 000000000..afea448f2 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winhttp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a new file mode 100644 index 000000000..360fbca43 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wininet.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a new file mode 100644 index 000000000..20a0aedda Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winmm.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a new file mode 100644 index 000000000..4ddddbcf3 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winscard.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a new file mode 100644 index 000000000..a8302fdd9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winspool.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a new file mode 100644 index 000000000..d681e08ea Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsqlite3.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a new file mode 100644 index 000000000..a7cdc5144 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winsta.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a new file mode 100644 index 000000000..b5d435a2c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wintrust.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a new file mode 100644 index 000000000..5dfdad4b1 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_winusb.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a new file mode 100644 index 000000000..a7e75b551 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a new file mode 100644 index 000000000..7018a298e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wlanui.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a new file mode 100644 index 000000000..20dc6d78a Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wldap32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a new file mode 100644 index 000000000..1243b415b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmip.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a new file mode 100644 index 000000000..41a5a9c70 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wmvcore.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a new file mode 100644 index 000000000..8770cee59 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wnvapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a new file mode 100644 index 000000000..d4a89ff38 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wofutil.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a new file mode 100644 index 000000000..d61898aaa Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_ws2_32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a new file mode 100644 index 000000000..6e4f3dc08 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wscapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a new file mode 100644 index 000000000..4a01997bf Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsclient.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a new file mode 100644 index 000000000..24c1c707c Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsdapi.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a new file mode 100644 index 000000000..783acfa0b Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsmsvc.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a new file mode 100644 index 000000000..e9bffd126 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsnmp32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a new file mode 100644 index 000000000..8d1283045 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wsock32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a new file mode 100644 index 000000000..07dabb997 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_wtsapi32.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a new file mode 100644 index 000000000..ab285476f Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a new file mode 100644 index 000000000..36dcc81e9 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xaudio2_8.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a new file mode 100644 index 000000000..8fcf22fd5 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a new file mode 100644 index 000000000..8409ae455 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinput9_1_0.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a new file mode 100644 index 000000000..8f778e317 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xinputuap.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a new file mode 100644 index 000000000..4da29d07e Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xmllite.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a new file mode 100644 index 000000000..524c5fe17 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xolehlp.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a new file mode 100644 index 000000000..07d7d9b62 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsdocumenttargetprint.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a new file mode 100644 index 000000000..22cf10158 Binary files /dev/null and b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/lib/libwinapi_xpsprint.a differ diff --git a/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/src/lib.rs b/vendor/registry-40351f815f426200/winapi-x86_64-pc-windows-gnu/src/lib.rs new file mode 100644 index 000000000..3b7f827d8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/.cargo-checksum.json b/vendor/registry-40351f815f426200/winapi/.cargo-checksum.json new file mode 100644 index 000000000..961ebdc3a --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/.cargo-checksum.json @@ -0,0 +1 @@ +{"files":{"Cargo.toml":"1b6f08bb48c88a117c42755ee64c7a4772f8506c46d056f5750fb756df36653a","LICENSE-APACHE":"b40930bbcf80744c86c46a12bc9da056641d722716c378f5659b9e555ef833e1","LICENSE-MIT":"ce7bc3499fee93d5022ef430d5e4201e79a6d9154f3974e42f41349f0569e09b","README.md":"e15c8581746742647e66415bd50156be53c258925a53112fdd412755064b990c","build.rs":"39e89b910bf0b9aa46bed762697e29f2384b1a800017e6582446f12c926041e1","src/km/d3dkmthk.rs":"5fcafcbcf558bb9d7a1dde128dcb34f6b69bc6e8f8f5ff2017044bb64ad3a7c4","src/km/mod.rs":"d93c57482cc3a011f87b8d95d8da8fc52a1c5c053b9a143d781c276871cd1dd1","src/lib.rs":"c9dd767b72d5975a938b0c837c8939fa77054a97b9d96faa39113cfc7c0fe34f","src/macros.rs":"461674a3c07505914743d059e9720d42f2d58ace491b4093902ea212ecf426c5","src/shared/basetsd.rs":"de639d77c388a7f52e268cdc11b06b80d7d37f6419ee57634236b1d856c5f2f5","src/shared/bcrypt.rs":"fdf4f601cf9ed10d1968e719d55164920520aaef0ba3ed98e4323bb10f53a15e","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":"c649d821aa1894713ed5289be94b9d71f8ee19a14fdab0c7fc5af937d1df59e9","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":"d1367f30e92948b0612f7e96494e1e49f0467faad656677b89065949d9343911","src/shared/in6addr.rs":"a854ce17d724cfc78fbe4235ae76aeedabfd5c879ab9eab4b78895da1c4f3c6c","src/shared/inaddr.rs":"8cb93acdb7cdf5e9a34504bccbf5ad2fe000810d3866c3c6d0a778d033cf9ff3","src/shared/intsafe.rs":"030ad79543efe5bae6c6dfaff77077458a4bc876582a201f3155129a684cb1d1","src/shared/ks.rs":"90b4f80d97a1c914bbecb7ae11eb11ad45959f80540014bf70518e5688a514a0","src/shared/ksmedia.rs":"402a4c2ea6982ccb9db97d30efa70645f8d2bdb1a27ad9786f99300c59852f5c","src/shared/ktmtypes.rs":"6434171e5657c236ea20603113a8fe19ad465da8d92ef152831604cfe8d14aa9","src/shared/lmcons.rs":"a730be5fd0ef2d682986547cbeada8d6343fc9e72c063cd900b747f22cc08d34","src/shared/minwindef.rs":"08960523fa4c5c883536d88c458b2f01c3a3e611587d9eabe0fa3bf0f3cd6672","src/shared/mmreg.rs":"b9364cfe8c392fb1b791e62907df3c77426fa8c96ac78df2e991bcce667c718f","src/shared/mod.rs":"612146162a0ddb99dd1ab48db3f3aade7ac494bcb575286376a5cf5d9a2b77fe","src/shared/mstcpip.rs":"b500e6c96dab2ffc9ab0b11be1159d768cc737252e446b65674130792a42abbe","src/shared/mswsockdef.rs":"275c695b2d98535af9250cf343ee414bbf71e186dddf80b68767d96342c31f1d","src/shared/netioapi.rs":"eaec4aa81a22dc7bb889661b843679a008c5a2c194a207940fb130b98ea5887b","src/shared/ntddscsi.rs":"b61d548dae4ed529ce76c8f7dcdc91888dc8304d6df8346e36b0818c6c7a856e","src/shared/ntddser.rs":"0c34546f7d3fdb2d3db72703b0c9f1a138ed1ef60f332f32efdceb3ed0632e85","src/shared/ntdef.rs":"c7b37accffd34a36db0504e8782250c5e366ccc8e5c7e2e2eb33715d5704061b","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/transportsettingcommon.rs":"0791e5ddad518fa316f30bde5139a87343189a8c582e33b376e87923b6edf42b","src/shared/tvout.rs":"0a5b43d53916c9dd3a6e1637eb230068d91bf5de517b38eaefd1fb759470e551","src/shared/usb.rs":"31a0327300cbfdaf99fdc5ee9b34e82229070e15c1487066d5e09c99ed9ea6dd","src/shared/usbiodef.rs":"ae2550d17e23ac8265a9cb983423ccc7740a1a41404a9b7ac62082ed53c626df","src/shared/usbspec.rs":"e787df4b0f7bb8b92fff4354689a1b3ed332d54f777c79560b7bba3db04273c1","src/shared/windef.rs":"3b0fa697ec4a57f9016c0bfb01df1768636c1eb6c8c4bfd5a9f16ba7d6bfee68","src/shared/windowsx.rs":"72e7f99f70a1a30f34f00bff8147e7837d2be8a9b93f005fecf1bddcd20f7988","src/shared/winerror.rs":"15b45be96becf021440856db1a5da11ffa5b26afe299344facd674f30cf2a5aa","src/shared/winusbio.rs":"871b050e4dec58e371542ab6c8277a5c6f57b9364bee08b1f3b7b0d9117b9cda","src/shared/wmistr.rs":"0a5431b57488503975d0c6c3aebbf2f56bffae2462b4c89e22220b100a52f70d","src/shared/wnnc.rs":"7e893b55d96fe43280cb39a6568773ff2c747cbfce13e201619d8ffaa3936cb1","src/shared/ws2def.rs":"62293f8c9211e01a9596b82dc186f9caf706f2d7ebd50a19b2bbdeaee965fb8a","src/shared/ws2ipdef.rs":"5c94ea40f541ae972c3c5fc665678bffa85bcc7b654250669779fbc2b90d2b48","src/shared/wtypes.rs":"d7788392196e15d52a5c8331e85272dde9f1c6857dc0a06b41ae5ac21502de60","src/shared/wtypesbase.rs":"d4d98d3777d6a581827fb8b96d5d57b531e80df49ec013ecf962a0aa8809b6f7","src/um/accctrl.rs":"679b937a10fa0017ef9fb7cd34996431f5fe0fa679d7abcfd6f4bbab80c8982b","src/um/aclapi.rs":"7867f7668606c0f258ccb238f49f560d42fd54da2a757d52fa42bb4c051aa730","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/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":"8245717248f77bba1f9b8018d878331f71779775369478592f3a6dbab3354aec","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":"5e7bc7a34a602c67c6819472d2986117000a81bce60e168874932d9ba8733f96","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":"8e1f0c28ffc77cc5044792a2f7598f1d0961381e5e7ebc0227547fd98becf68e","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":"f6539f6601198085e0056ad3244ae3cb740a276388b3ebb2d75139ff2c77a3f4","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/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/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/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":"77e329ced9753253289b4faa70981590514aadd7ff408d7174102e1cbf84ed69","src/um/imm.rs":"1272b7f59ea87c4923cbf7aa5f35c1454db56f4d5a5cd97dbe6a3f407e50ff7d","src/um/interlockedapi.rs":"e6f8149b979099dc50816487d893f1943f1004cd9a6b1ee56eb564c7783c5cf6","src/um/ioapiset.rs":"871a1d24183a5e54ce29b86921cbe493d26a5c815f4c498c9068bb1eb92a67de","src/um/jobapi.rs":"4d5e4e86461b66be148fc2e4760fd01a9a54042a1c95ed5f3b89e000f4ceaef5","src/um/jobapi2.rs":"dadff8f24ab1d6847c0c234a8ff013906c3f7fa8523f2c5173d19bd13a7b1b55","src/um/knownfolders.rs":"5e5d204d5dcf3ec3098e6d3f1f1d660a63f43b691773cca946899b8b19bc196a","src/um/ktmw32.rs":"70ca3f285930c526fbaf5820e8b33d4132c6ecccaa4c4acf1dea506b6c8f5cb4","src/um/libloaderapi.rs":"cf640966ffe68af913b06acfeddedae01c47d334dbb51a5c1ff91f7ec94efb98","src/um/lmaccess.rs":"cf88ff16fbaacbfdaa896269f0fc97c0c1ac2a855b864eec96770418e74494e8","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":"eb3447cea90b7209082cfef31bd99f17ff6bf85a2c510c3e32aa05348958487a","src/um/mmeapi.rs":"88a4119036d9386c96af4018c11ef95f247ea0eaeb54f6626b2dbd7ea5862b1a","src/um/mmsystem.rs":"ffefe67a61f7f89bfe7331eb85abc8bdb4b72f95ffe7a26b25db7f5b746c5aad","src/um/mod.rs":"d5bb0cc45adbe157953a3d07dc9d80839da02b51612fbf6c0eb06df57bad663a","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":"2a48848cd262dcf318fad55dc4738dacf8c870553af1c699f06bbfedad7ef4e4","src/um/ncrypt.rs":"87bf4e6422462efa5b201fef64e6938b900ceacac699c724c8b22581dc419243","src/um/ntlsa.rs":"b19d8e5af3d7efdb8958d2370bde7d07220437b7fc2ea85d6b98cba9bb363134","src/um/ntsecapi.rs":"e9626865a9dbfb45503f6c211f2af4763476ece0951a31065081ee610eef275f","src/um/oaidl.rs":"8019e5eeb2800c1ccd7f98041192d5235aab9ccbba16aa7cf2272fec10f419d3","src/um/objbase.rs":"05c2cec2b50a1381569fa5fed7a7224e3c996ba6d6de281a94c698541f53ef9d","src/um/objidl.rs":"b4975ca093d1e9c60293bc425741b6128abe39a5ecbde0d7e54a7c6bd38f6dde","src/um/objidlbase.rs":"0868d95ab7554e0e99445f32e4ba19ef41703aae7d1f88b5ccfb65fc69cd246e","src/um/ocidl.rs":"bff12022b3564a323932e9807c225409fa701bda37b1037a94ecb99aa4c38dd0","src/um/ole2.rs":"1ae2519d7b3bec95faa463e78bcc696c3648582e1586c0874781500479385200","src/um/oleauto.rs":"8753b9021e80b229d9445fa059484b55c63392ce63a0673a12eda00934eda666","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":"92667ff546104d1f6c77cb884cdf96df0a1df93ae4b2dd1a4f6d11690c715405","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":"968e68c57cecb20e7721f69f3c1bdf657445626feb338e3f32f63f29277f14fc","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/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":"1f4f0f8a1f8a8739c481f8d2bcee3c7b032c8309f6fe9a673fd993737187890d","src/um/shobjidl_core.rs":"6112b8907680e12753914d1799b8a9e0137d16e9029fef808d00c62b738ae1c2","src/um/shtypes.rs":"56ecaf1a140ced304f72ffad40cc039c9441cf23a6769c316cf1b208ab969911","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":"35d262e7bf54fa9e21aeb472b31bea3a13df4d238a2391777c90a4e348247b6f","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":"e19aabb5212c6f357a102bda20f9aaaa91b19081bdf55f8c5dcd27500806b9a6","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":"bb32ef2031b88eb6e4835c8ae7ed1495d21be0587397afaacca166face40bed1","src/um/wbemdisp.rs":"f6d45ad8a9ec8d9a5c86c74d3163e7fb2d180a09ea96782a6c6a69797128c61a","src/um/wbemprov.rs":"13e29281c2d6a930068754cefdf699ba9d59826b8b3d39c0726fa2e9d680a3a3","src/um/wbemtran.rs":"e5abd15d360926810b06f9b2486223ad7416fbf0884f3a701faab29dbd250023","src/um/wct.rs":"0db574400292a398f026385517d7c5c17e9a2a5dae75898438cdd98ea8ef50a2","src/um/werapi.rs":"27be0a45fdc78a49f2103646fa358425a2b409c30a773e83b91cd0571bd2fa5d","src/um/winbase.rs":"f96f3212dd0fa8d370ea552316730427a0b831e6ca5de030da56998b8372495c","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":"14f1eb7584db72ce4a2fcc53f9b3cb5a54e0e74b95333b96cc16106376c90adc","src/um/winhttp.rs":"a28b7d5b45e215faeca04f7fc25ffc0369e1cbcde12b61980276307e1c67a245","src/um/wininet.rs":"501cd35f233de092c45fef2c0003fd864670122dd7b63702d7fe6c1d7b3dc7f9","src/um/winineti.rs":"b6288aa923100568c09e4350ac9340dcf582629f52e91eb6b195ffbca1619549","src/um/winioctl.rs":"7980851d6704eb340c7d924e9db9ac516ab277019dd212cb0528bde35d5dda1f","src/um/winnetwk.rs":"b0153509998e107790099ce1a160e38bd095b2b6bac9ddf7d1b2490db609f3b6","src/um/winnls.rs":"d55d3470239da9551b61a58abd47e71ab7cd55a13223baffba33fde6a44c677b","src/um/winnt.rs":"63fc14a989610151bab322048ed0d0bf9173f9cc9cec68bc346454f11bd3ef06","src/um/winreg.rs":"64e327128f0e62e8f45a55e39b915d3bcc7645c0222632f6226ff505e4bd7e20","src/um/winsafer.rs":"4680859e90029ad4447ac226f667f3290d99c7a0bff8e17c595f2bdca2d63fd3","src/um/winscard.rs":"3e55793eb45ac8770adb94227b0a9431fb3545bbe1b46e40234ad51d9432152c","src/um/winsmcrd.rs":"622c977577ec7a1820b94bba1d1b34686a406c7516d03683c6e89177a5d580a6","src/um/winsock2.rs":"5aa19899f0139771ea9ffdddad4e5f2cfabfc6a58f90b398bf0d89a82f99bbce","src/um/winspool.rs":"69f443b90a6dff35b09e701f7190b67aded9389ccab44960239a15d50cfd7012","src/um/winsvc.rs":"204ec6b8270c0f7c3d409638cc76acd97929d65678d4a8101e17f786acfa0689","src/um/winusb.rs":"8c7ac644694d02166f531e1b2d1f6363347703a8f3a75fc30df4e30f8886c8a8","src/um/winuser.rs":"e212625eebf02225c5cf5087fbe917f19fa786533268844a46d963425cb0eab6","src/um/winver.rs":"aa2b3097709177507db69887e905cca198371edf4338c6a4264442bf09b85c13","src/um/wow64apiset.rs":"91c7ea2cc1cf67ebac303e8b8ca288f97f7dce331b35a9e05d24598a18f760f4","src/um/wpdmtpextensions.rs":"22967a6b3843ac8e5385adb277e1c3b3205ede2d905e43e0497416c604213555","src/um/ws2spi.rs":"e0af920a2d480d90ce5e90fb8383f3997ee07bb8e4cc396c042c080456fb096a","src/um/ws2tcpip.rs":"11ef57db8079c80808d66c690a9939445bd7b426a3eabcbfb024056110cebe94","src/um/xinput.rs":"69f27b977eceeaa310aed92fa96183e4d831ed00007839ec3366022fe928f229","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":"e4537a6edda2871c8767e78279bb43eff5afdba5ba162d26ae07ac0df21de0dd","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":"f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770"} \ No newline at end of file diff --git a/vendor/registry-40351f815f426200/winapi/Cargo.toml b/vendor/registry-40351f815f426200/winapi/Cargo.toml new file mode 100644 index 000000000..0404dada7 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/Cargo.toml @@ -0,0 +1,402 @@ +# 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.7" +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/*/x86_64-pc-windows-msvc/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"] + +[features] +accctrl = [] +aclapi = [] +activation = [] +appmgmt = [] +audioclient = [] +audiosessiontypes = [] +avrt = [] +basetsd = [] +bcrypt = [] +bits = [] +bits10_1 = [] +bits1_5 = [] +bits2_0 = [] +bits2_5 = [] +bits3_0 = [] +bits4_0 = [] +bits5_0 = [] +bitscfg = [] +bitsmsg = [] +bugcodes = [] +cderr = [] +cfg = [] +cfgmgr32 = [] +cguid = [] +combaseapi = [] +coml2api = [] +commapi = [] +commctrl = [] +commdlg = [] +commoncontrols = [] +consoleapi = [] +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 = [] +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 = [] +enclaveapi = [] +endpointvolume = [] +errhandlingapi = [] +everything = [] +evntcons = [] +evntprov = [] +evntrace = [] +excpt = [] +exdisp = [] +fibersapi = [] +fileapi = [] +gl-gl = [] +guiddef = [] +handleapi = [] +heapapi = [] +hidclass = [] +hidpi = [] +hidsdi = [] +hidusage = [] +highlevelmonitorconfigurationapi = [] +hstring = [] +http = [] +ifdef = [] +imm = [] +impl-debug = [] +impl-default = [] +in6addr = [] +inaddr = [] +inspectable = [] +interlockedapi = [] +intsafe = [] +ioapiset = [] +jobapi = [] +jobapi2 = [] +knownfolders = [] +ks = [] +ksmedia = [] +ktmtypes = [] +ktmw32 = [] +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 = [] +msaatext = [] +mscat = [] +mschapp = [] +mssip = [] +mstcpip = [] +mswsock = [] +mswsockdef = [] +namedpipeapi = [] +namespaceapi = [] +nb30 = [] +ncrypt = [] +netioapi = [] +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 = [] +propkeydef = [] +propsys = [] +prsht = [] +psapi = [] +qos = [] +realtimeapiset = [] +reason = [] +restartmanager = [] +restrictederrorinfo = [] +rmxfguid = [] +roapi = [] +robuffer = [] +roerrorapi = [] +rpc = [] +rpcdce = [] +rpcndr = [] +sapi = [] +sapi51 = [] +sapi53 = [] +sapiddk = [] +sapiddk51 = [] +schannel = [] +sddl = [] +securityappcontainer = [] +securitybaseapi = [] +servprov = [] +setupapi = [] +shellapi = [] +shellscalingapi = [] +shlobj = [] +shobjidl = [] +shobjidl_core = [] +shtypes = [] +spapidef = [] +spellcheck = [] +sporder = [] +sql = [] +sqlext = [] +sqltypes = [] +sqlucode = [] +sspi = [] +std = [] +stralign = [] +stringapiset = [] +strmif = [] +subauth = [] +synchapi = [] +sysinfoapi = [] +systemtopologyapi = [] +taskschd = [] +textstor = [] +threadpoolapiset = [] +threadpoollegacyapiset = [] +timeapi = [] +timezoneapi = [] +tlhelp32 = [] +transportsettingcommon = [] +tvout = [] +unknwnbase = [] +urlhist = [] +urlmon = [] +usb = [] +usbiodef = [] +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 = [] +windowsceip = [] +windowsx = [] +winefs = [] +winerror = [] +winevt = [] +wingdi = [] +winhttp = [] +wininet = [] +winineti = [] +winioctl = [] +winnetwk = [] +winnls = [] +winnt = [] +winreg = [] +winsafer = [] +winscard = [] +winsmcrd = [] +winsock2 = [] +winspool = [] +winstring = [] +winsvc = [] +winusb = [] +winusbio = [] +winuser = [] +winver = [] +wmistr = [] +wnnc = [] +wow64apiset = [] +wpdmtpextensions = [] +ws2def = [] +ws2ipdef = [] +ws2spi = [] +ws2tcpip = [] +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" +[badges.appveyor] +branch = "0.3" +repository = "retep998/winapi-rs" +service = "github" + +[badges.travis-ci] +branch = "0.3" +repository = "retep998/winapi-rs" diff --git a/vendor/registry-40351f815f426200/winapi/LICENSE-APACHE b/vendor/registry-40351f815f426200/winapi/LICENSE-APACHE new file mode 100644 index 000000000..8dada3eda --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/LICENSE-MIT b/vendor/registry-40351f815f426200/winapi/LICENSE-MIT new file mode 100644 index 000000000..6f1b4c850 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/README.md b/vendor/registry-40351f815f426200/winapi/README.md new file mode 100644 index 000000000..0d8d39c61 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/README.md @@ -0,0 +1,89 @@ +# winapi-rs +[![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/*/x86_64-pc-windows-msvc/winapi/) + +Official IRC channel: #winapi on [Mozilla IRC](https://wiki.mozilla.org/IRC) + +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](http://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](http://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/*/x86_64-pc-windows-msvc/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/vendor/registry-40351f815f426200/winapi/build.rs b/vendor/registry-40351f815f426200/winapi/build.rs new file mode 100644 index 000000000..036687d25 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/build.rs @@ -0,0 +1,488 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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"]), + ("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", "minwindef"], &[]), + ("in6addr", &["minwindef"], &[]), + ("inaddr", &["minwindef"], &[]), + ("intsafe", &[], &[]), + ("ks", &[], &[]), + ("ksmedia", &[], &[]), + ("ktmtypes", &["guiddef", "minwindef", "winnt"], &[]), + ("lmcons", &["minwindef", "winnt"], &[]), + ("minwindef", &["basetsd", "ntdef"], &[]), + ("mmreg", &["guiddef", "minwindef"], &[]), + ("mstcpip", &["basetsd", "guiddef", "in6addr", "inaddr", "minwindef", "winnt", "ws2def"], &["ntdll"]), + ("mswsockdef", &["minwindef", "winnt", "ws2def"], &[]), + ("netioapi", &["basetsd", "guiddef", "ifdef", "minwindef", "ntdef"], &["iphlpapi"]), + ("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"]), + ("transportsettingcommon", &["guiddef"], &[]), + ("tvout", &["guiddef", "minwindef"], &[]), + ("usb", &["minwindef", "usbspec", "winnt"], &[]), + ("usbiodef", &["guiddef", "minwindef", "winioctl", "winnt"], &[]), + ("usbspec", &["basetsd", "guiddef", "minwindef", "winnt"], &[]), + ("windef", &["minwindef", "winnt"], &[]), + ("windowsx", &["minwindef"], &[]), + ("winerror", &["minwindef", "wtypesbase"], &[]), + ("winusbio", &["minwindef", "usb"], &[]), + ("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 + // um + ("accctrl", &["guiddef", "minwindef", "winbase", "winnt"], &[]), + ("aclapi", &["accctrl", "guiddef", "minwindef", "winnt"], &["advapi32"]), + ("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"], &[]), + ("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"], &[]), + ("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"]), + ("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"]), + ("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"], &["winhttp"]), + ("imm", &["minwindef", "windef"], &["imm32"]), + ("interlockedapi", &["minwindef", "winnt"], &["kernel32"]), + ("ioapiset", &["basetsd", "minwinbase", "minwindef", "winnt"], &["kernel32"]), + ("jobapi", &["minwindef", "winnt"], &["kernel32"]), + ("jobapi2", &["basetsd", "minwinbase", "minwindef", "ntdef", "winnt"], &["kernel32"]), + ("knownfolders", &[], &[]), + ("ktmw32", &["guiddef", "minwinbase", "minwindef", "winnt"], &["ktmw32"]), + ("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"], &[]), + ("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", &["minwindef", "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", &[], &[]), + ("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", "objidl", "propkeydef", "propsys", "shobjidl_core", "shtypes", "unknwnbase", "windef", "winnt"], &[]), + ("shobjidl_core", &["commctrl", "guiddef", "minwindef", "objidl", "unknwnbase", "windef", "winnt"], &[]), + ("shtypes", &["guiddef", "minwindef", "winnt"], &[]), + ("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", "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"]), + ("winusb", &["minwinbase", "minwindef", "usb", "usbspec", "winnt", "winusbio"], &["winusb"]), + ("winuser", &["basetsd", "guiddef", "limits", "minwinbase", "minwindef", "vadefs", "windef", "wingdi", "winnt"], &["user32"]), + ("winver", &["minwindef", "winnt"], &["kernel32", "version"]), + ("wow64apiset", &["minwindef", "winnt"], &["kernel32"]), + ("wpdmtpextensions", &[], &[]), + ("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"]), + ("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" => { + 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/vendor/registry-40351f815f426200/winapi/src/km/d3dkmthk.rs b/vendor/registry-40351f815f426200/winapi/src/km/d3dkmthk.rs new file mode 100644 index 000000000..9ac551cee --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/km/mod.rs b/vendor/registry-40351f815f426200/winapi/src/km/mod.rs new file mode 100644 index 000000000..480f1950f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/lib.rs b/vendor/registry-40351f815f426200/winapi/src/lib.rs new file mode 100644 index 000000000..5dc8fb485 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/lib.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. +#![cfg(windows)] +#![deny(unused, unused_qualifications)] +#![warn(unused_attributes)] +#![allow(bad_style, overflowing_literals, unused_macros)] +#![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::const_static_lifetime, 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))] + +#[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 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/vendor/registry-40351f815f426200/winapi/src/macros.rs b/vendor/registry-40351f815f426200/winapi/src/macros.rs new file mode 100644 index 000000000..b209b48a8 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/macros.rs @@ -0,0 +1,424 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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_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: $crate::shared::wtypes::PROPERTYKEY + = $crate::shared::wtypes::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! 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_arch = "x86")] + 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/vendor/registry-40351f815f426200/winapi/src/shared/basetsd.rs b/vendor/registry-40351f815f426200/winapi/src/shared/basetsd.rs new file mode 100644 index 000000000..1870fd2d6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +pub type UHALF_PTR = c_ushort; +#[cfg(target_pointer_width = "64")] +pub type UHALF_PTR = c_uint; +#[cfg(target_arch = "x86")] +pub type PUHALF_PTR = *mut c_ushort; +#[cfg(target_pointer_width = "64")] +pub type PUHALF_PTR = *mut c_uint; +#[cfg(target_arch = "x86")] +pub type HALF_PTR = c_short; +#[cfg(target_pointer_width = "64")] +pub type HALF_PTR = c_int; +#[cfg(target_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/shared/bcrypt.rs b/vendor/registry-40351f815f426200/winapi/src/shared/bcrypt.rs new file mode 100644 index 000000000..4fa88ef8f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/bugcodes.rs b/vendor/registry-40351f815f426200/winapi/src/shared/bugcodes.rs new file mode 100644 index 000000000..3e2bd4954 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/cderr.rs b/vendor/registry-40351f815f426200/winapi/src/shared/cderr.rs new file mode 100644 index 000000000..07ea187ec --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/cfg.rs b/vendor/registry-40351f815f426200/winapi/src/shared/cfg.rs new file mode 100644 index 000000000..4abe3838b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/d3d9.rs b/vendor/registry-40351f815f426200/winapi/src/shared/d3d9.rs new file mode 100644 index 000000000..437c81111 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/d3d9caps.rs b/vendor/registry-40351f815f426200/winapi/src/shared/d3d9caps.rs new file mode 100644 index 000000000..e806e08b7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/d3d9types.rs b/vendor/registry-40351f815f426200/winapi/src/shared/d3d9types.rs new file mode 100644 index 000000000..e794d2731 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/d3dkmdt.rs b/vendor/registry-40351f815f426200/winapi/src/shared/d3dkmdt.rs new file mode 100644 index 000000000..89d574f12 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/d3dukmdt.rs b/vendor/registry-40351f815f426200/winapi/src/shared/d3dukmdt.rs new file mode 100644 index 000000000..16a34d1a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/d3dukmdt.rs @@ -0,0 +1,416 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, +}} +BITFIELD!{D3DDDICB_LOCK2FLAGS Value: UINT [ + Reserved set_Reserved[0..32], +]} +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/vendor/registry-40351f815f426200/winapi/src/shared/dcomptypes.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dcomptypes.rs new file mode 100644 index 000000000..4d45d3c90 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/devguid.rs b/vendor/registry-40351f815f426200/winapi/src/shared/devguid.rs new file mode 100644 index 000000000..f163037b8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/devpkey.rs b/vendor/registry-40351f815f426200/winapi/src/shared/devpkey.rs new file mode 100644 index 000000000..db6855796 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/devpropdef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/devpropdef.rs new file mode 100644 index 000000000..1e9388a44 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dinputd.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dinputd.rs new file mode 100644 index 000000000..ceb9ffd99 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi.rs new file mode 100644 index 000000000..0e878586e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_2.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_2.rs new file mode 100644 index 000000000..941f15e98 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_3.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_3.rs new file mode 100644 index 000000000..caf346a61 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_4.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_4.rs new file mode 100644 index 000000000..53269e88d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_5.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_5.rs new file mode 100644 index 000000000..a0500a247 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_6.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgi1_6.rs new file mode 100644 index 000000000..30af20519 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgiformat.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgiformat.rs new file mode 100644 index 000000000..84cd23fa2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/dxgitype.rs b/vendor/registry-40351f815f426200/winapi/src/shared/dxgitype.rs new file mode 100644 index 000000000..d09dccde5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/evntprov.rs b/vendor/registry-40351f815f426200/winapi/src/shared/evntprov.rs new file mode 100644 index 000000000..455ff5d29 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/evntrace.rs b/vendor/registry-40351f815f426200/winapi/src/shared/evntrace.rs new file mode 100644 index 000000000..23a93eec3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/guiddef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/guiddef.rs new file mode 100644 index 000000000..dcd39dcc4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/hidclass.rs b/vendor/registry-40351f815f426200/winapi/src/shared/hidclass.rs new file mode 100644 index 000000000..c65c14faf --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/hidpi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/hidpi.rs new file mode 100644 index 000000000..ea0229253 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/hidsdi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/hidsdi.rs new file mode 100644 index 000000000..ebdd3ed4f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/hidusage.rs b/vendor/registry-40351f815f426200/winapi/src/shared/hidusage.rs new file mode 100644 index 000000000..a483bf27d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ifdef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ifdef.rs new file mode 100644 index 000000000..e64527a3f --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/ifdef.rs @@ -0,0 +1,22 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, ULONG64}; +use shared::minwindef::ULONG; +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_LUID = NET_LUID_LH; +pub type PNET_LUID = *mut NET_LUID; +pub type NET_IFINDEX = ULONG; +pub type PNET_IFINDEX = *mut ULONG; +pub type NET_IFTYPE = UINT16; +pub type PNET_IFTYPE = *mut UINT16; diff --git a/vendor/registry-40351f815f426200/winapi/src/shared/in6addr.rs b/vendor/registry-40351f815f426200/winapi/src/shared/in6addr.rs new file mode 100644 index 000000000..6ed9382e6 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/in6addr.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. +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/vendor/registry-40351f815f426200/winapi/src/shared/inaddr.rs b/vendor/registry-40351f815f426200/winapi/src/shared/inaddr.rs new file mode 100644 index 000000000..c56e1ea8b --- /dev/null +++ b/vendor/registry-40351f815f426200/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 +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/vendor/registry-40351f815f426200/winapi/src/shared/intsafe.rs b/vendor/registry-40351f815f426200/winapi/src/shared/intsafe.rs new file mode 100644 index 000000000..916dc0e1a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ks.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ks.rs new file mode 100644 index 000000000..3a2ab103c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ksmedia.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ksmedia.rs new file mode 100644 index 000000000..01d390d3c --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/ksmedia.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 +// Licensed under the MIT License +//! Mappings for the contents of ksmedia.h +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} diff --git a/vendor/registry-40351f815f426200/winapi/src/shared/ktmtypes.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ktmtypes.rs new file mode 100644 index 000000000..77394e2d5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/lmcons.rs b/vendor/registry-40351f815f426200/winapi/src/shared/lmcons.rs new file mode 100644 index 000000000..ca2819b4f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/minwindef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/minwindef.rs new file mode 100644 index 000000000..6c2e38d2c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/mmreg.rs b/vendor/registry-40351f815f426200/winapi/src/shared/mmreg.rs new file mode 100644 index 000000000..06ad900f2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/mod.rs b/vendor/registry-40351f815f426200/winapi/src/shared/mod.rs new file mode 100644 index 000000000..cc14a5cec --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/mod.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. +//! Headers shared between user mode and kernel mode +#[cfg(feature = "basetsd")] pub mod basetsd; +#[cfg(feature = "bcrypt")] pub mod bcrypt; +#[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 = "in6addr")] pub mod in6addr; +#[cfg(feature = "inaddr")] pub mod inaddr; +#[cfg(feature = "intsafe")] pub mod intsafe; +#[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 = "mstcpip")] pub mod mstcpip; +#[cfg(feature = "mswsockdef")] pub mod mswsockdef; +#[cfg(feature = "netioapi")] pub mod netioapi; +#[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 = "transportsettingcommon")] pub mod transportsettingcommon; +#[cfg(feature = "tvout")] pub mod tvout; +#[cfg(feature = "usb")] pub mod usb; +#[cfg(feature = "usbiodef")] pub mod usbiodef; +#[cfg(feature = "usbspec")] pub mod usbspec; +#[cfg(feature = "windef")] pub mod windef; +#[cfg(feature = "windowsx")] pub mod windowsx; +#[cfg(feature = "winerror")] pub mod winerror; +#[cfg(feature = "winusbio")] pub mod winusbio; +#[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/vendor/registry-40351f815f426200/winapi/src/shared/mstcpip.rs b/vendor/registry-40351f815f426200/winapi/src/shared/mstcpip.rs new file mode 100644 index 000000000..fe2072544 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/mswsockdef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/mswsockdef.rs new file mode 100644 index 000000000..b62cf299d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/netioapi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/netioapi.rs new file mode 100644 index 000000000..e8788e50b --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/netioapi.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 shared::basetsd::SIZE_T; +use shared::guiddef::GUID; +use shared::ifdef::{NET_IFINDEX, NET_LUID, PNET_IFINDEX, PNET_LUID}; +use shared::minwindef::DWORD; +use shared::ntdef::{CHAR, PSTR, PWSTR, WCHAR}; +pub type NETIO_STATUS = DWORD; +pub type NETIOAPI_API = NETIO_STATUS; +extern "system" { + 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; +} diff --git a/vendor/registry-40351f815f426200/winapi/src/shared/ntddscsi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ntddscsi.rs new file mode 100644 index 000000000..ac47ec4e1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ntddser.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ntddser.rs new file mode 100644 index 000000000..d37b7f6ae --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ntdef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ntdef.rs new file mode 100644 index 000000000..2a4e1209a --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/ntdef.rs @@ -0,0 +1,1073 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, + QuadPart QuadPart_mut: LONGLONG, +}} +STRUCT!{struct LARGE_INTEGER_s { + LowPart: ULONG, + HighPart: LONG, +}} +pub type PLARGE_INTEGER = *mut LARGE_INTEGER; +UNION!{union ULARGE_INTEGER { + [u64; 1], + s s_mut: ULARGE_INTEGER_s, + QuadPart QuadPart_mut: ULONGLONG, +}} +STRUCT!{struct ULARGE_INTEGER_s { + 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/vendor/registry-40351f815f426200/winapi/src/shared/ntstatus.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ntstatus.rs new file mode 100644 index 000000000..c369c22fc --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/qos.rs b/vendor/registry-40351f815f426200/winapi/src/shared/qos.rs new file mode 100644 index 000000000..5117bd26a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/rpc.rs b/vendor/registry-40351f815f426200/winapi/src/shared/rpc.rs new file mode 100644 index 000000000..5af7e095d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/rpcdce.rs b/vendor/registry-40351f815f426200/winapi/src/shared/rpcdce.rs new file mode 100644 index 000000000..ab2879d92 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/rpcndr.rs b/vendor/registry-40351f815f426200/winapi/src/shared/rpcndr.rs new file mode 100644 index 000000000..b65a3da05 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/sddl.rs b/vendor/registry-40351f815f426200/winapi/src/shared/sddl.rs new file mode 100644 index 000000000..cf64387a4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/sspi.rs b/vendor/registry-40351f815f426200/winapi/src/shared/sspi.rs new file mode 100644 index 000000000..3b7c2d68a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/stralign.rs b/vendor/registry-40351f815f426200/winapi/src/shared/stralign.rs new file mode 100644 index 000000000..2e2a703fe --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/transportsettingcommon.rs b/vendor/registry-40351f815f426200/winapi/src/shared/transportsettingcommon.rs new file mode 100644 index 000000000..2f5f6fb6c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/tvout.rs b/vendor/registry-40351f815f426200/winapi/src/shared/tvout.rs new file mode 100644 index 000000000..f691bdf32 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/usb.rs b/vendor/registry-40351f815f426200/winapi/src/shared/usb.rs new file mode 100644 index 000000000..7caae833c --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/shared/usbiodef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/usbiodef.rs new file mode 100644 index 000000000..e9028c640 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/usbiodef.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 +//! 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; +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/vendor/registry-40351f815f426200/winapi/src/shared/usbspec.rs b/vendor/registry-40351f815f426200/winapi/src/shared/usbspec.rs new file mode 100644 index 000000000..5fae43efd --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/windef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/windef.rs new file mode 100644 index 000000000..d2e5fe01c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/windowsx.rs b/vendor/registry-40351f815f426200/winapi/src/shared/windowsx.rs new file mode 100644 index 000000000..4147aa353 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/winerror.rs b/vendor/registry-40351f815f426200/winapi/src/shared/winerror.rs new file mode 100644 index 000000000..378a31a4b --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/winerror.rs @@ -0,0 +1,6149 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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_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/vendor/registry-40351f815f426200/winapi/src/shared/winusbio.rs b/vendor/registry-40351f815f426200/winapi/src/shared/winusbio.rs new file mode 100644 index 000000000..800694333 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/wmistr.rs b/vendor/registry-40351f815f426200/winapi/src/shared/wmistr.rs new file mode 100644 index 000000000..35374e92b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/wnnc.rs b/vendor/registry-40351f815f426200/winapi/src/shared/wnnc.rs new file mode 100644 index 000000000..305137c58 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ws2def.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ws2def.rs new file mode 100644 index 000000000..484f6d4a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/ws2ipdef.rs b/vendor/registry-40351f815f426200/winapi/src/shared/ws2ipdef.rs new file mode 100644 index 000000000..b48518ecc --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/shared/ws2ipdef.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. +//! 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}; +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; +STRUCT!{struct IP_MREQ { + imr_multiaddr: IN_ADDR, + imr_interface: IN_ADDR, +}} +pub type PIP_MREQ = *mut IP_MREQ; +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/vendor/registry-40351f815f426200/winapi/src/shared/wtypes.rs b/vendor/registry-40351f815f426200/winapi/src/shared/wtypes.rs new file mode 100644 index 000000000..8b5c88811 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/shared/wtypesbase.rs b/vendor/registry-40351f815f426200/winapi/src/shared/wtypesbase.rs new file mode 100644 index 000000000..e8ca7ee08 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/accctrl.rs b/vendor/registry-40351f815f426200/winapi/src/um/accctrl.rs new file mode 100644 index 000000000..829ce5793 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/aclapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/aclapi.rs new file mode 100644 index 000000000..5c2c5f121 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/appmgmt.rs b/vendor/registry-40351f815f426200/winapi/src/um/appmgmt.rs new file mode 100644 index 000000000..1d7b910d4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/audioclient.rs b/vendor/registry-40351f815f426200/winapi/src/um/audioclient.rs new file mode 100644 index 000000000..5f7b83e46 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/audiosessiontypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/audiosessiontypes.rs new file mode 100644 index 000000000..3c64f4244 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/avrt.rs b/vendor/registry-40351f815f426200/winapi/src/um/avrt.rs new file mode 100644 index 000000000..62b0e9c88 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits.rs new file mode 100644 index 000000000..aef603fe0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits10_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits10_1.rs new file mode 100644 index 000000000..327161a8d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits1_5.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits1_5.rs new file mode 100644 index 000000000..b2890e7db --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits2_0.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits2_0.rs new file mode 100644 index 000000000..15e582708 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits2_5.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits2_5.rs new file mode 100644 index 000000000..50a5b4d17 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits3_0.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits3_0.rs new file mode 100644 index 000000000..478dce642 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits4_0.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits4_0.rs new file mode 100644 index 000000000..2cd763a68 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bits5_0.rs b/vendor/registry-40351f815f426200/winapi/src/um/bits5_0.rs new file mode 100644 index 000000000..97166eb83 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bitscfg.rs b/vendor/registry-40351f815f426200/winapi/src/um/bitscfg.rs new file mode 100644 index 000000000..3d9f46a2d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/bitsmsg.rs b/vendor/registry-40351f815f426200/winapi/src/um/bitsmsg.rs new file mode 100644 index 000000000..b7029f730 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/cfgmgr32.rs b/vendor/registry-40351f815f426200/winapi/src/um/cfgmgr32.rs new file mode 100644 index 000000000..2c4c7f39f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/cguid.rs b/vendor/registry-40351f815f426200/winapi/src/um/cguid.rs new file mode 100644 index 000000000..be7f92958 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/combaseapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/combaseapi.rs new file mode 100644 index 000000000..823c026ac --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/coml2api.rs b/vendor/registry-40351f815f426200/winapi/src/um/coml2api.rs new file mode 100644 index 000000000..449be87e3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/commapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/commapi.rs new file mode 100644 index 000000000..433bb78fa --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/commctrl.rs b/vendor/registry-40351f815f426200/winapi/src/um/commctrl.rs new file mode 100644 index 000000000..9b32d3259 --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +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: LPSTR, + 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/vendor/registry-40351f815f426200/winapi/src/um/commdlg.rs b/vendor/registry-40351f815f426200/winapi/src/um/commdlg.rs new file mode 100644 index 000000000..c9326a6fc --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/commoncontrols.rs b/vendor/registry-40351f815f426200/winapi/src/um/commoncontrols.rs new file mode 100644 index 000000000..d659e046a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/consoleapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/consoleapi.rs new file mode 100644 index 000000000..3f5496b95 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/corsym.rs b/vendor/registry-40351f815f426200/winapi/src/um/corsym.rs new file mode 100644 index 000000000..2e7c0f983 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1.rs new file mode 100644 index 000000000..0632e6891 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1_1.rs new file mode 100644 index 000000000..8217e30ab --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1_2.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1_2.rs new file mode 100644 index 000000000..31b051390 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1_3.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1_3.rs new file mode 100644 index 000000000..64b7bd394 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1effectauthor.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1effectauthor.rs new file mode 100644 index 000000000..c8322791c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects.rs new file mode 100644 index 000000000..c2d1f58a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects_1.rs new file mode 100644 index 000000000..ba97f0149 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects_2.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1effects_2.rs new file mode 100644 index 000000000..40eea83a2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2d1svg.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2d1svg.rs new file mode 100644 index 000000000..33e133ebe --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d2dbasetypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/d2dbasetypes.rs new file mode 100644 index 000000000..754a05572 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d.rs new file mode 100644 index 000000000..e4b0250b6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10.rs new file mode 100644 index 000000000..887b7a344 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10_1.rs new file mode 100644 index 000000000..3765ce309 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10_1shader.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10_1shader.rs new file mode 100644 index 000000000..69d9583ce --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10effect.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10effect.rs new file mode 100644 index 000000000..de93acec4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10misc.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10misc.rs new file mode 100644 index 000000000..5303f2eb3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10sdklayers.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10sdklayers.rs new file mode 100644 index 000000000..d71c483e4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d10shader.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d10shader.rs new file mode 100644 index 000000000..952fd6dc2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11.rs new file mode 100644 index 000000000..d6e306a2b --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/d3d11.rs @@ -0,0 +1,3420 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, + 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 { + DD3D11_PROCESSIDTYPE_UNKNOWN = 0, + DD3D11_PROCESSIDTYPE_DWM = 1, + DD3D11_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/vendor/registry-40351f815f426200/winapi/src/um/d3d11_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11_1.rs new file mode 100644 index 000000000..7b0b46ec2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11_2.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11_2.rs new file mode 100644 index 000000000..28b655a05 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11_3.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11_3.rs new file mode 100644 index 000000000..5ae721380 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11_4.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11_4.rs new file mode 100644 index 000000000..5d0da98b5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11on12.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11on12.rs new file mode 100644 index 000000000..bf106a38b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11sdklayers.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11sdklayers.rs new file mode 100644 index 000000000..e70b6686e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11shader.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11shader.rs new file mode 100644 index 000000000..ebe06b424 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d11tokenizedprogramformat.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d11tokenizedprogramformat.rs new file mode 100644 index 000000000..e81926214 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d12.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d12.rs new file mode 100644 index 000000000..56048d939 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d12sdklayers.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d12sdklayers.rs new file mode 100644 index 000000000..bb9535ccf --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3d12shader.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3d12shader.rs new file mode 100644 index 000000000..f07bf83a6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dcommon.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dcommon.rs new file mode 100644 index 000000000..b4f67dd12 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dcompiler.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dcompiler.rs new file mode 100644 index 000000000..944ae25f0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dcsx.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dcsx.rs new file mode 100644 index 000000000..c12640061 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dx10core.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dx10core.rs new file mode 100644 index 000000000..c5fb44923 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dx10math.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dx10math.rs new file mode 100644 index 000000000..9c6179fdd --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/d3dx10mesh.rs b/vendor/registry-40351f815f426200/winapi/src/um/d3dx10mesh.rs new file mode 100644 index 000000000..319df62d8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/datetimeapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/datetimeapi.rs new file mode 100644 index 000000000..e8102a108 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/davclnt.rs b/vendor/registry-40351f815f426200/winapi/src/um/davclnt.rs new file mode 100644 index 000000000..9bfc5a371 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dbghelp.rs b/vendor/registry-40351f815f426200/winapi/src/um/dbghelp.rs new file mode 100644 index 000000000..384c9a463 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/dbghelp.rs @@ -0,0 +1,667 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, 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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +STRUCT!{struct ADDRESS { + Offset: DWORD, + Segment: WORD, + Mode: ADDRESS_MODE, +}} +#[cfg(target_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +FN!{stdcall PREAD_PROCESS_MEMORY_ROUTINE( + hProcess: HANDLE, + qwBaseAddress: DWORD, + lpBuffer: PVOID, + nSize: DWORD, + lpNumberOfBytesRead: PDWORD, +) -> BOOL} +#[cfg(target_arch = "x86")] +FN!{stdcall PFUNCTION_TABLE_ACCESS_ROUTINE( + ahProcess: HANDLE, + AddrBase: DWORD, +) -> PVOID} +#[cfg(target_arch = "x86")] +FN!{stdcall PGET_MODULE_BASE_ROUTINE( + hProcess: HANDLE, + Address: DWORD, +) -> DWORD} +#[cfg(target_arch = "x86")] +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; +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_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: LPSTACKFRAME64, + 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 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 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(any(target_arch = "x86", target_arch = "arm"))] + pub fn MapDebugInformation( + FileHandle: HANDLE, + FileName: PCSTR, + SymbolPath: PCSTR, + ImageBase: ULONG, + ) -> PIMAGE_DEBUG_INFORMATION; + #[cfg(any(target_arch = "x86", target_arch = "arm"))] + pub fn UnmapDebugInformation( + DebugInfo: PIMAGE_DEBUG_INFORMATION, + ) -> BOOL; +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/dbt.rs b/vendor/registry-40351f815f426200/winapi/src/um/dbt.rs new file mode 100644 index 000000000..e95a58ce9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dcommon.rs b/vendor/registry-40351f815f426200/winapi/src/um/dcommon.rs new file mode 100644 index 000000000..e0260cbd9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dcomp.rs b/vendor/registry-40351f815f426200/winapi/src/um/dcomp.rs new file mode 100644 index 000000000..17048650a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dcompanimation.rs b/vendor/registry-40351f815f426200/winapi/src/um/dcompanimation.rs new file mode 100644 index 000000000..ca54c405e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dde.rs b/vendor/registry-40351f815f426200/winapi/src/um/dde.rs new file mode 100644 index 000000000..b3ce4a9da --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ddraw.rs b/vendor/registry-40351f815f426200/winapi/src/um/ddraw.rs new file mode 100644 index 000000000..fd0d9e89b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ddrawi.rs b/vendor/registry-40351f815f426200/winapi/src/um/ddrawi.rs new file mode 100644 index 000000000..18e651863 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ddrawint.rs b/vendor/registry-40351f815f426200/winapi/src/um/ddrawint.rs new file mode 100644 index 000000000..2f9b7431b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/debugapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/debugapi.rs new file mode 100644 index 000000000..442b50db4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/devicetopology.rs b/vendor/registry-40351f815f426200/winapi/src/um/devicetopology.rs new file mode 100644 index 000000000..6f74ffba1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dinput.rs b/vendor/registry-40351f815f426200/winapi/src/um/dinput.rs new file mode 100644 index 000000000..5b5b1c5e5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dispex.rs b/vendor/registry-40351f815f426200/winapi/src/um/dispex.rs new file mode 100644 index 000000000..a846b461f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dmksctl.rs b/vendor/registry-40351f815f426200/winapi/src/um/dmksctl.rs new file mode 100644 index 000000000..252ab7387 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dmusicc.rs b/vendor/registry-40351f815f426200/winapi/src/um/dmusicc.rs new file mode 100644 index 000000000..ee87b6fde --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/docobj.rs b/vendor/registry-40351f815f426200/winapi/src/um/docobj.rs new file mode 100644 index 000000000..e14ddb9e3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/documenttarget.rs b/vendor/registry-40351f815f426200/winapi/src/um/documenttarget.rs new file mode 100644 index 000000000..b4cc1ae0c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dpa_dsa.rs b/vendor/registry-40351f815f426200/winapi/src/um/dpa_dsa.rs new file mode 100644 index 000000000..21a3f4b3b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dpapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/dpapi.rs new file mode 100644 index 000000000..42f5824f5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dsgetdc.rs b/vendor/registry-40351f815f426200/winapi/src/um/dsgetdc.rs new file mode 100644 index 000000000..860a652ec --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dsound.rs b/vendor/registry-40351f815f426200/winapi/src/um/dsound.rs new file mode 100644 index 000000000..9c23bbf53 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dsrole.rs b/vendor/registry-40351f815f426200/winapi/src/um/dsrole.rs new file mode 100644 index 000000000..b644d7994 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dvp.rs b/vendor/registry-40351f815f426200/winapi/src/um/dvp.rs new file mode 100644 index 000000000..5760732e0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dwmapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/dwmapi.rs new file mode 100644 index 000000000..475473f9a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dwrite.rs b/vendor/registry-40351f815f426200/winapi/src/um/dwrite.rs new file mode 100644 index 000000000..b21cd6f8d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dwrite_1.rs b/vendor/registry-40351f815f426200/winapi/src/um/dwrite_1.rs new file mode 100644 index 000000000..b762bbdcb --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dwrite_2.rs b/vendor/registry-40351f815f426200/winapi/src/um/dwrite_2.rs new file mode 100644 index 000000000..e9810bba0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dwrite_3.rs b/vendor/registry-40351f815f426200/winapi/src/um/dwrite_3.rs new file mode 100644 index 000000000..f6645c347 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dxdiag.rs b/vendor/registry-40351f815f426200/winapi/src/um/dxdiag.rs new file mode 100644 index 000000000..6f46c7ac7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dxfile.rs b/vendor/registry-40351f815f426200/winapi/src/um/dxfile.rs new file mode 100644 index 000000000..67ba32c4b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dxgidebug.rs b/vendor/registry-40351f815f426200/winapi/src/um/dxgidebug.rs new file mode 100644 index 000000000..3478da300 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dxva2api.rs b/vendor/registry-40351f815f426200/winapi/src/um/dxva2api.rs new file mode 100644 index 000000000..db07c40e9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/dxvahd.rs b/vendor/registry-40351f815f426200/winapi/src/um/dxvahd.rs new file mode 100644 index 000000000..755dfdc23 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/enclaveapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/enclaveapi.rs new file mode 100644 index 000000000..b2da8e145 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/endpointvolume.rs b/vendor/registry-40351f815f426200/winapi/src/um/endpointvolume.rs new file mode 100644 index 000000000..384e47b6c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/errhandlingapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/errhandlingapi.rs new file mode 100644 index 000000000..66d7618de --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/evntcons.rs b/vendor/registry-40351f815f426200/winapi/src/um/evntcons.rs new file mode 100644 index 000000000..48d4d700d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/exdisp.rs b/vendor/registry-40351f815f426200/winapi/src/um/exdisp.rs new file mode 100644 index 000000000..3d44fd385 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/fibersapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/fibersapi.rs new file mode 100644 index 000000000..c2e3b08ff --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/fileapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/fileapi.rs new file mode 100644 index 000000000..ed183a5fb --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/gl/gl.rs b/vendor/registry-40351f815f426200/winapi/src/um/gl/gl.rs new file mode 100644 index 000000000..d7c1b586e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/gl/mod.rs b/vendor/registry-40351f815f426200/winapi/src/um/gl/mod.rs new file mode 100644 index 000000000..6ce6d067f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/handleapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/handleapi.rs new file mode 100644 index 000000000..1d7e43d77 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/heapapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/heapapi.rs new file mode 100644 index 000000000..83073b31e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/highlevelmonitorconfigurationapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/highlevelmonitorconfigurationapi.rs new file mode 100644 index 000000000..f187aeb26 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/http.rs b/vendor/registry-40351f815f426200/winapi/src/um/http.rs new file mode 100644 index 000000000..38608d1df --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/http.rs @@ -0,0 +1,1072 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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; +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: HANDLE, + 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; +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/imm.rs b/vendor/registry-40351f815f426200/winapi/src/um/imm.rs new file mode 100644 index 000000000..ddf4c3f2c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/interlockedapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/interlockedapi.rs new file mode 100644 index 000000000..17f656db9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ioapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/ioapiset.rs new file mode 100644 index 000000000..b9b710964 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/jobapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/jobapi.rs new file mode 100644 index 000000000..cbe45c1dc --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/jobapi2.rs b/vendor/registry-40351f815f426200/winapi/src/um/jobapi2.rs new file mode 100644 index 000000000..98eb1e9d1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/knownfolders.rs b/vendor/registry-40351f815f426200/winapi/src/um/knownfolders.rs new file mode 100644 index 000000000..a761ce297 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ktmw32.rs b/vendor/registry-40351f815f426200/winapi/src/um/ktmw32.rs new file mode 100644 index 000000000..c1b882247 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/libloaderapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/libloaderapi.rs new file mode 100644 index 000000000..05e3017d2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmaccess.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmaccess.rs new file mode 100644 index 000000000..3c6c430cb --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/lmaccess.rs @@ -0,0 +1,1214 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, + 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/vendor/registry-40351f815f426200/winapi/src/um/lmalert.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmalert.rs new file mode 100644 index 000000000..e406d807c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmapibuf.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmapibuf.rs new file mode 100644 index 000000000..620a1319b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmat.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmat.rs new file mode 100644 index 000000000..46742eb1b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmdfs.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmdfs.rs new file mode 100644 index 000000000..a0be98b26 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmerrlog.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmerrlog.rs new file mode 100644 index 000000000..8a07f731c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmjoin.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmjoin.rs new file mode 100644 index 000000000..72c72c0ee --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmmsg.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmmsg.rs new file mode 100644 index 000000000..9970fe94e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmremutl.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmremutl.rs new file mode 100644 index 000000000..27275203b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmrepl.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmrepl.rs new file mode 100644 index 000000000..81a665be5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmserver.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmserver.rs new file mode 100644 index 000000000..621c4be9a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmshare.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmshare.rs new file mode 100644 index 000000000..3024ac3aa --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmstats.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmstats.rs new file mode 100644 index 000000000..c0bfc3746 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmsvc.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmsvc.rs new file mode 100644 index 000000000..2d9ee5e2e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmuse.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmuse.rs new file mode 100644 index 000000000..66423121f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lmwksta.rs b/vendor/registry-40351f815f426200/winapi/src/um/lmwksta.rs new file mode 100644 index 000000000..9b086bf60 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lowlevelmonitorconfigurationapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/lowlevelmonitorconfigurationapi.rs new file mode 100644 index 000000000..fe73214b5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/lsalookup.rs b/vendor/registry-40351f815f426200/winapi/src/um/lsalookup.rs new file mode 100644 index 000000000..95a6b62b7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/memoryapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/memoryapi.rs new file mode 100644 index 000000000..5bf5bd01c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/minschannel.rs b/vendor/registry-40351f815f426200/winapi/src/um/minschannel.rs new file mode 100644 index 000000000..ba3ca4f29 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/minwinbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/minwinbase.rs new file mode 100644 index 000000000..b414af1ba --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mmdeviceapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/mmdeviceapi.rs new file mode 100644 index 000000000..7965bf105 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/mmdeviceapi.rs @@ -0,0 +1,218 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/mmeapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/mmeapi.rs new file mode 100644 index 000000000..cc5153b3b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mmsystem.rs b/vendor/registry-40351f815f426200/winapi/src/um/mmsystem.rs new file mode 100644 index 000000000..657ba5f4e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mod.rs b/vendor/registry-40351f815f426200/winapi/src/um/mod.rs new file mode 100644 index 000000000..af20c7c69 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/mod.rs @@ -0,0 +1,281 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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 = "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 = "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 = "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 = "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 = "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 = "jobapi")] pub mod jobapi; +#[cfg(feature = "jobapi2")] pub mod jobapi2; +#[cfg(feature = "knownfolders")] pub mod knownfolders; +#[cfg(feature = "ktmw32")] pub mod ktmw32; +#[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 = "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 = "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 = "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 = "winusb")] pub mod winusb; +#[cfg(feature = "winuser")] pub mod winuser; +#[cfg(feature = "winver")] pub mod winver; +#[cfg(feature = "wow64apiset")] pub mod wow64apiset; +#[cfg(feature = "wpdmtpextensions")] pub mod wpdmtpextensions; +#[cfg(feature = "ws2spi")] pub mod ws2spi; +#[cfg(feature = "ws2tcpip")] pub mod ws2tcpip; +#[cfg(feature = "xinput")] pub mod xinput; diff --git a/vendor/registry-40351f815f426200/winapi/src/um/msaatext.rs b/vendor/registry-40351f815f426200/winapi/src/um/msaatext.rs new file mode 100644 index 000000000..238ca2c13 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mscat.rs b/vendor/registry-40351f815f426200/winapi/src/um/mscat.rs new file mode 100644 index 000000000..fca635fcb --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mschapp.rs b/vendor/registry-40351f815f426200/winapi/src/um/mschapp.rs new file mode 100644 index 000000000..103b54c9f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mssip.rs b/vendor/registry-40351f815f426200/winapi/src/um/mssip.rs new file mode 100644 index 000000000..f8cd6e407 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/mswsock.rs b/vendor/registry-40351f815f426200/winapi/src/um/mswsock.rs new file mode 100644 index 000000000..cbbe19135 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/namedpipeapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/namedpipeapi.rs new file mode 100644 index 000000000..7c7447f1e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/namespaceapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/namespaceapi.rs new file mode 100644 index 000000000..cfdb80572 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/nb30.rs b/vendor/registry-40351f815f426200/winapi/src/um/nb30.rs new file mode 100644 index 000000000..81dfddfb7 --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/um/ncrypt.rs b/vendor/registry-40351f815f426200/winapi/src/um/ncrypt.rs new file mode 100644 index 000000000..5f5431e21 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ntlsa.rs b/vendor/registry-40351f815f426200/winapi/src/um/ntlsa.rs new file mode 100644 index 000000000..901c0acf1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +#[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_arch = "x86_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/vendor/registry-40351f815f426200/winapi/src/um/ntsecapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/ntsecapi.rs new file mode 100644 index 000000000..cf30ea929 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/oaidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/oaidl.rs new file mode 100644 index 000000000..a3f6decd7 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/oaidl.rs @@ -0,0 +1,879 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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_arch = "x86")] +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(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/vendor/registry-40351f815f426200/winapi/src/um/objbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/objbase.rs new file mode 100644 index 000000000..7cafface2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/objidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/objidl.rs new file mode 100644 index 000000000..f3f0b27aa --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/objidl.rs @@ -0,0 +1,507 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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::{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, +}} +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/vendor/registry-40351f815f426200/winapi/src/um/objidlbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/objidlbase.rs new file mode 100644 index 000000000..9984480ea --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ocidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/ocidl.rs new file mode 100644 index 000000000..07ec0d4ba --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/ole2.rs b/vendor/registry-40351f815f426200/winapi/src/um/ole2.rs new file mode 100644 index 000000000..66c168964 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/oleauto.rs b/vendor/registry-40351f815f426200/winapi/src/um/oleauto.rs new file mode 100644 index 000000000..7d4edba46 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/oleauto.rs @@ -0,0 +1,836 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, 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 OaBuildVersion() -> ULONG; + pub fn OaEnablePerUserTLibRegistration(); +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/olectl.rs b/vendor/registry-40351f815f426200/winapi/src/um/olectl.rs new file mode 100644 index 000000000..4a9ccdf9d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/oleidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/oleidl.rs new file mode 100644 index 000000000..39b8c309e --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/opmapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/opmapi.rs new file mode 100644 index 000000000..a8e5de87a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/pdh.rs b/vendor/registry-40351f815f426200/winapi/src/um/pdh.rs new file mode 100644 index 000000000..9ef4ee74a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/perflib.rs b/vendor/registry-40351f815f426200/winapi/src/um/perflib.rs new file mode 100644 index 000000000..aea3bde94 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/physicalmonitorenumerationapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/physicalmonitorenumerationapi.rs new file mode 100644 index 000000000..b61ff7e00 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/playsoundapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/playsoundapi.rs new file mode 100644 index 000000000..9b0d0d50a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/portabledevice.rs b/vendor/registry-40351f815f426200/winapi/src/um/portabledevice.rs new file mode 100644 index 000000000..c191423f1 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/portabledevice.rs @@ -0,0 +1,162 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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; +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/vendor/registry-40351f815f426200/winapi/src/um/portabledeviceapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/portabledeviceapi.rs new file mode 100644 index 000000000..a694e7e2d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/portabledevicetypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/portabledevicetypes.rs new file mode 100644 index 000000000..f6c13d3ec --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/powerbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/powerbase.rs new file mode 100644 index 000000000..f856fddf8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/powersetting.rs b/vendor/registry-40351f815f426200/winapi/src/um/powersetting.rs new file mode 100644 index 000000000..88b0c6fa6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/powrprof.rs b/vendor/registry-40351f815f426200/winapi/src/um/powrprof.rs new file mode 100644 index 000000000..d2d365f87 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/processenv.rs b/vendor/registry-40351f815f426200/winapi/src/um/processenv.rs new file mode 100644 index 000000000..8ecb5e0e9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/processsnapshot.rs b/vendor/registry-40351f815f426200/winapi/src/um/processsnapshot.rs new file mode 100644 index 000000000..c49aac6a9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/processthreadsapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/processthreadsapi.rs new file mode 100644 index 000000000..9629ee865 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/processtopologyapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/processtopologyapi.rs new file mode 100644 index 000000000..694f0762a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/profileapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/profileapi.rs new file mode 100644 index 000000000..908457592 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/propidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/propidl.rs new file mode 100644 index 000000000..233c0f28b --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/propidl.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::WORD; +use shared::wtypes::VARTYPE; +STRUCT!{struct PROPVARIANT { + vt: VARTYPE, + wReserved1: WORD, + wReserved2: WORD, + wReserved3: WORD, + data: [u8; 16], +}} +pub type REFPROPVARIANT = *const PROPVARIANT; diff --git a/vendor/registry-40351f815f426200/winapi/src/um/propkeydef.rs b/vendor/registry-40351f815f426200/winapi/src/um/propkeydef.rs new file mode 100644 index 000000000..bc0924c76 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/propsys.rs b/vendor/registry-40351f815f426200/winapi/src/um/propsys.rs new file mode 100644 index 000000000..9a4f6a0ff --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/prsht.rs b/vendor/registry-40351f815f426200/winapi/src/um/prsht.rs new file mode 100644 index 000000000..25cb9262d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/psapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/psapi.rs new file mode 100644 index 000000000..eb1adb803 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/realtimeapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/realtimeapiset.rs new file mode 100644 index 000000000..5f63dbe19 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/reason.rs b/vendor/registry-40351f815f426200/winapi/src/um/reason.rs new file mode 100644 index 000000000..609c295a5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/restartmanager.rs b/vendor/registry-40351f815f426200/winapi/src/um/restartmanager.rs new file mode 100644 index 000000000..3f4af64f5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/restrictederrorinfo.rs b/vendor/registry-40351f815f426200/winapi/src/um/restrictederrorinfo.rs new file mode 100644 index 000000000..9c5db989b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/rmxfguid.rs b/vendor/registry-40351f815f426200/winapi/src/um/rmxfguid.rs new file mode 100644 index 000000000..97c3814c1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/sapi.rs new file mode 100644 index 000000000..2a2cf375a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sapi51.rs b/vendor/registry-40351f815f426200/winapi/src/um/sapi51.rs new file mode 100644 index 000000000..db1d46438 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sapi53.rs b/vendor/registry-40351f815f426200/winapi/src/um/sapi53.rs new file mode 100644 index 000000000..7121191d8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sapiddk.rs b/vendor/registry-40351f815f426200/winapi/src/um/sapiddk.rs new file mode 100644 index 000000000..8ff59b523 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sapiddk51.rs b/vendor/registry-40351f815f426200/winapi/src/um/sapiddk51.rs new file mode 100644 index 000000000..0607cebfb --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/schannel.rs b/vendor/registry-40351f815f426200/winapi/src/um/schannel.rs new file mode 100644 index 000000000..5ec1ac008 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/securityappcontainer.rs b/vendor/registry-40351f815f426200/winapi/src/um/securityappcontainer.rs new file mode 100644 index 000000000..02d862938 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/securitybaseapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/securitybaseapi.rs new file mode 100644 index 000000000..81bfd18ff --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/servprov.rs b/vendor/registry-40351f815f426200/winapi/src/um/servprov.rs new file mode 100644 index 000000000..aeb382dbc --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/setupapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/setupapi.rs new file mode 100644 index 000000000..d716fc56c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/shellapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/shellapi.rs new file mode 100644 index 000000000..2c961c4c5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/shellscalingapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/shellscalingapi.rs new file mode 100644 index 000000000..4db4ff6fe --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/shlobj.rs b/vendor/registry-40351f815f426200/winapi/src/um/shlobj.rs new file mode 100644 index 000000000..f652c6c2d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/shobjidl.rs b/vendor/registry-40351f815f426200/winapi/src/um/shobjidl.rs new file mode 100644 index 000000000..7db441224 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/shobjidl.rs @@ -0,0 +1,373 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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 shared::minwindef::{BOOL, DWORD, UINT}; +use shared::windef::HWND; +use um::objidl::IBindCtx; +use um::propkeydef::REFPROPERTYKEY; +use um::propsys::{GETPROPERTYSTOREFLAGS, IPropertyDescriptionList, IPropertyStore}; +use um::shobjidl_core::{IModalWindow, IModalWindowVtbl, IShellItem, IShellItemFilter, SFGAOF}; +use um::shtypes::COMDLG_FILTERSPEC; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, WCHAR}; +pub type IFileOperationProgressSink = IUnknown; // TODO +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, +}} +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/vendor/registry-40351f815f426200/winapi/src/um/shobjidl_core.rs b/vendor/registry-40351f815f426200/winapi/src/um/shobjidl_core.rs new file mode 100644 index 000000000..ef17f2295 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/shobjidl_core.rs @@ -0,0 +1,306 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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::{HICON, HWND, RECT}; +use um::commctrl::HIMAGELIST; +use um::objidl::IBindCtx; +use um::unknwnbase::{IUnknown, IUnknownVtbl}; +use um::winnt::{HRESULT, LPCWSTR, LPWSTR, ULONGLONG, WCHAR}; +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, +}} +//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, +}} +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;} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/shtypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/shtypes.rs new file mode 100644 index 000000000..470d79e21 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/spapidef.rs b/vendor/registry-40351f815f426200/winapi/src/um/spapidef.rs new file mode 100644 index 000000000..259f4699f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/spellcheck.rs b/vendor/registry-40351f815f426200/winapi/src/um/spellcheck.rs new file mode 100644 index 000000000..9254ed52d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sporder.rs b/vendor/registry-40351f815f426200/winapi/src/um/sporder.rs new file mode 100644 index 000000000..84630e3e0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sql.rs b/vendor/registry-40351f815f426200/winapi/src/um/sql.rs new file mode 100644 index 000000000..d42a163ed --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sqlext.rs b/vendor/registry-40351f815f426200/winapi/src/um/sqlext.rs new file mode 100644 index 000000000..8de50f1b8 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sqltypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/sqltypes.rs new file mode 100644 index 000000000..5c9b3020d --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +pub type SQLLEN = SQLINTEGER; +#[cfg(target_arch = "x86")] +pub type SQLULEN = SQLUINTEGER; +#[cfg(target_arch = "x86")] +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_arch = "x86")] +//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/vendor/registry-40351f815f426200/winapi/src/um/sqlucode.rs b/vendor/registry-40351f815f426200/winapi/src/um/sqlucode.rs new file mode 100644 index 000000000..b5ed4bfab --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sspi.rs b/vendor/registry-40351f815f426200/winapi/src/um/sspi.rs new file mode 100644 index 000000000..edc0dbc6d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/stringapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/stringapiset.rs new file mode 100644 index 000000000..61560ed14 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/strmif.rs b/vendor/registry-40351f815f426200/winapi/src/um/strmif.rs new file mode 100644 index 000000000..db08afd9a --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/subauth.rs b/vendor/registry-40351f815f426200/winapi/src/um/subauth.rs new file mode 100644 index 000000000..b5d539b25 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/synchapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/synchapi.rs new file mode 100644 index 000000000..205579e66 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/sysinfoapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/sysinfoapi.rs new file mode 100644 index 000000000..03bdb47d1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/systemtopologyapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/systemtopologyapi.rs new file mode 100644 index 000000000..8591fac8d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/taskschd.rs b/vendor/registry-40351f815f426200/winapi/src/um/taskschd.rs new file mode 100644 index 000000000..d73786cd3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/textstor.rs b/vendor/registry-40351f815f426200/winapi/src/um/textstor.rs new file mode 100644 index 000000000..7e2d60218 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/threadpoolapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/threadpoolapiset.rs new file mode 100644 index 000000000..13a1e7a40 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/threadpoollegacyapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/threadpoollegacyapiset.rs new file mode 100644 index 000000000..dc306c4e4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/timeapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/timeapi.rs new file mode 100644 index 000000000..dae647067 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/timezoneapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/timezoneapi.rs new file mode 100644 index 000000000..b7d99f778 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/tlhelp32.rs b/vendor/registry-40351f815f426200/winapi/src/um/tlhelp32.rs new file mode 100644 index 000000000..f910b9f49 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/unknwnbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/unknwnbase.rs new file mode 100644 index 000000000..4162fc109 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/urlhist.rs b/vendor/registry-40351f815f426200/winapi/src/um/urlhist.rs new file mode 100644 index 000000000..f35e55029 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/urlmon.rs b/vendor/registry-40351f815f426200/winapi/src/um/urlmon.rs new file mode 100644 index 000000000..bdcbada51 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/userenv.rs b/vendor/registry-40351f815f426200/winapi/src/um/userenv.rs new file mode 100644 index 000000000..ea0af96ff --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/usp10.rs b/vendor/registry-40351f815f426200/winapi/src/um/usp10.rs new file mode 100644 index 000000000..b2f24be06 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/utilapiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/utilapiset.rs new file mode 100644 index 000000000..0ef86e359 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/uxtheme.rs b/vendor/registry-40351f815f426200/winapi/src/um/uxtheme.rs new file mode 100644 index 000000000..0e046a356 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/vsbackup.rs b/vendor/registry-40351f815f426200/winapi/src/um/vsbackup.rs new file mode 100644 index 000000000..0a7f2602c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/vss.rs b/vendor/registry-40351f815f426200/winapi/src/um/vss.rs new file mode 100644 index 000000000..7038f0376 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/vsserror.rs b/vendor/registry-40351f815f426200/winapi/src/um/vsserror.rs new file mode 100644 index 000000000..1a295509d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/vswriter.rs b/vendor/registry-40351f815f426200/winapi/src/um/vswriter.rs new file mode 100644 index 000000000..43d6000ec --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wbemads.rs b/vendor/registry-40351f815f426200/winapi/src/um/wbemads.rs new file mode 100644 index 000000000..5ba09e6eb --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wbemcli.rs b/vendor/registry-40351f815f426200/winapi/src/um/wbemcli.rs new file mode 100644 index 000000000..f519b0fa6 --- /dev/null +++ b/vendor/registry-40351f815f426200/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} +// class DECLSPEC_UUID("4590f811-1d3a-11d0-891f-00aa004b2e24") +// 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/vendor/registry-40351f815f426200/winapi/src/um/wbemdisp.rs b/vendor/registry-40351f815f426200/winapi/src/um/wbemdisp.rs new file mode 100644 index 000000000..8e3ec7736 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wbemprov.rs b/vendor/registry-40351f815f426200/winapi/src/um/wbemprov.rs new file mode 100644 index 000000000..4ba60eedc --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wbemtran.rs b/vendor/registry-40351f815f426200/winapi/src/um/wbemtran.rs new file mode 100644 index 000000000..6f9d4a6ed --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wct.rs b/vendor/registry-40351f815f426200/winapi/src/um/wct.rs new file mode 100644 index 000000000..0c3fae910 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/werapi.rs b/vendor/registry-40351f815f426200/winapi/src/um/werapi.rs new file mode 100644 index 000000000..6eae64e90 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/werapi.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. +//! Function prototypes for Windows Error Reporting (WER) +use shared::minwindef::{BOOL, DWORD, PDWORD}; +use um::winnt::{HANDLE, HRESULT, PCWSTR, PVOID}; +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/vendor/registry-40351f815f426200/winapi/src/um/winbase.rs b/vendor/registry-40351f815f426200/winapi/src/um/winbase.rs new file mode 100644 index 000000000..22db22a9b --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winbase.rs @@ -0,0 +1,2825 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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::{ + LPPROC_THREAD_ATTRIBUTE_LIST, LPSTARTUPINFOA, 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 fn CreateProcessWithLogonW(); + // pub fn CreateProcessWithTokenW(); + // pub fn IsTokenUntrusted(); + 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/vendor/registry-40351f815f426200/winapi/src/um/wincodec.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincodec.rs new file mode 100644 index 000000000..dbe8a4456 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wincodecsdk.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincodecsdk.rs new file mode 100644 index 000000000..f71bf72aa --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wincon.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincon.rs new file mode 100644 index 000000000..9eb3a2290 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wincontypes.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincontypes.rs new file mode 100644 index 000000000..ab37d0201 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wincred.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincred.rs new file mode 100644 index 000000000..660837e73 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wincrypt.rs b/vendor/registry-40351f815f426200/winapi/src/um/wincrypt.rs new file mode 100644 index 000000000..abc2a9923 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/windowsceip.rs b/vendor/registry-40351f815f426200/winapi/src/um/windowsceip.rs new file mode 100644 index 000000000..87a59d33c --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winefs.rs b/vendor/registry-40351f815f426200/winapi/src/um/winefs.rs new file mode 100644 index 000000000..f4766431b --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winevt.rs b/vendor/registry-40351f815f426200/winapi/src/um/winevt.rs new file mode 100644 index 000000000..dce3d27ec --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wingdi.rs b/vendor/registry-40351f815f426200/winapi/src/um/wingdi.rs new file mode 100644 index 000000000..4404bee08 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winhttp.rs b/vendor/registry-40351f815f426200/winapi/src/um/winhttp.rs new file mode 100644 index 000000000..f39c78f51 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wininet.rs b/vendor/registry-40351f815f426200/winapi/src/um/wininet.rs new file mode 100644 index 000000000..9a83d6a5d --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winineti.rs b/vendor/registry-40351f815f426200/winapi/src/um/winineti.rs new file mode 100644 index 000000000..c0076c0d0 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winioctl.rs b/vendor/registry-40351f815f426200/winapi/src/um/winioctl.rs new file mode 100644 index 000000000..4b57b1ed2 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winioctl.rs @@ -0,0 +1,1076 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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); diff --git a/vendor/registry-40351f815f426200/winapi/src/um/winnetwk.rs b/vendor/registry-40351f815f426200/winapi/src/um/winnetwk.rs new file mode 100644 index 000000000..5680da124 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winnls.rs b/vendor/registry-40351f815f426200/winapi/src/um/winnls.rs new file mode 100644 index 000000000..fd68a2354 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winnt.rs b/vendor/registry-40351f815f426200/winapi/src/um/winnt.rs new file mode 100644 index 000000000..ecf7bea04 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winnt.rs @@ -0,0 +1,8622 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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_arch = "x86")] +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_arch = "x86")] +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; +STRUCT!{struct LARGE_INTEGER_u { + LowPart: DWORD, + HighPart: LONG, +}} +UNION!{union LARGE_INTEGER { + [u64; 1], + QuadPart QuadPart_mut: LONGLONG, + u u_mut: LARGE_INTEGER_u, +}} +pub type PLARGE_INTEGER = *mut LARGE_INTEGER; +STRUCT!{struct ULARGE_INTEGER_u { + LowPart: DWORD, + HighPart: LONG, +}} +UNION!{union ULARGE_INTEGER { + [u64; 1], + QuadPart QuadPart_mut: ULONGLONG, + u u_mut: ULARGE_INTEGER_u, +}} +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_arch = "x86")] +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_arch = "x86_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(target_arch = "x86_64")] +STRUCT!{struct XSTATE_CONTEXT { + Mask: DWORD64, + Length: DWORD, + Reserved1: DWORD, + Area: PXSAVE_AREA, + Buffer: PVOID, +}} +#[cfg(any(target_arch = "x86", target_arch = "x86_64"))] +IFDEF!{ +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) +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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_arch = "x86")] +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, +}} +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_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/um/winreg.rs b/vendor/registry-40351f815f426200/winapi/src/um/winreg.rs new file mode 100644 index 000000000..3097ef04c --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winreg.rs @@ -0,0 +1,490 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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::winnt::{ACCESS_MASK, HANDLE, LONG, LPCSTR, LPCWSTR, LPSTR, LPWSTR, PVOID}; +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 isize as HKEY; +pub const HKEY_CURRENT_USER: HKEY = 0x80000001i32 as isize as HKEY; +pub const HKEY_LOCAL_MACHINE: HKEY = 0x80000002i32 as isize as HKEY; +pub const HKEY_USERS: HKEY = 0x80000003i32 as isize as HKEY; +pub const HKEY_PERFORMANCE_DATA: HKEY = 0x80000004i32 as isize as HKEY; +pub const HKEY_PERFORMANCE_TEXT: HKEY = 0x80000050i32 as isize as HKEY; +pub const HKEY_PERFORMANCE_NLSTEXT: HKEY = 0x80000060i32 as isize as HKEY; +pub const HKEY_CURRENT_CONFIG: HKEY = 0x80000005i32 as isize as HKEY; +pub const HKEY_DYN_DATA: HKEY = 0x80000006i32 as isize as HKEY; +pub const HKEY_CURRENT_USER_LOCAL_SETTINGS: HKEY = 0x80000007i32 as isize 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(); + // pub fn RegEnumKeyW(); + 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(); + // pub fn RegLoadKeyA(); + // pub fn RegLoadKeyW(); + pub fn RegNotifyChangeKeyValue( + hKey: HKEY, + bWatchSubtree: BOOL, + dwNotifyFilter: DWORD, + hEvent: HANDLE, + fAsynchronous: BOOL, + ) -> LSTATUS; + // pub fn RegOpenKeyA(); + // pub fn RegOpenKeyW(); + 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(); + // pub fn RegQueryValueW(); + 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(); + // pub fn RegReplaceKeyW(); + // pub fn RegRestoreKeyA(); + // pub fn RegRestoreKeyW(); + // pub fn RegRenameKey(); + // pub fn RegSaveKeyA(); + // pub fn RegSaveKeyW(); + // pub fn RegSetKeySecurity(); + // pub fn RegSetValueA(); + // pub fn RegSetValueW(); + 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(); + // pub fn RegUnLoadKeyW(); + 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(); + pub fn RegLoadMUIStringW( + hKey: HKEY, + pszValue: LPCWSTR, + pszOutBuf: LPWSTR, + cbOutBuf: DWORD, + pcbData: LPDWORD, + Flags: DWORD, + pszDirectory: LPCWSTR, + ) -> LSTATUS; + // pub fn RegLoadAppKeyA(); + // pub fn RegLoadAppKeyW(); + // pub fn InitiateSystemShutdownA(); + // pub fn InitiateSystemShutdownW(); + pub fn AbortSystemShutdownA( + lpMachineName: LPSTR, + ) -> BOOL; + pub fn AbortSystemShutdownW( + lpMachineName: LPWSTR, + ) -> BOOL; +} +// REASON_* +// MAX_SHUTDOWN_TIMEOUT +extern "system" { + // pub fn InitiateSystemShutdownExA(); + // pub fn InitiateSystemShutdownExW(); +} +// SHUTDOWN_* +extern "system" { + // pub fn InitiateShutdownA(); + // pub fn InitiateShutdownW(); + // pub fn CheckForHiberboot(); + // pub fn RegSaveKeyExA(); + // pub fn RegSaveKeyExW(); +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/winsafer.rs b/vendor/registry-40351f815f426200/winapi/src/um/winsafer.rs new file mode 100644 index 000000000..9607b6772 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winscard.rs b/vendor/registry-40351f815f426200/winapi/src/um/winscard.rs new file mode 100644 index 000000000..5adaec774 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winsmcrd.rs b/vendor/registry-40351f815f426200/winapi/src/um/winsmcrd.rs new file mode 100644 index 000000000..227bf7b40 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winsock2.rs b/vendor/registry-40351f815f426200/winapi/src/um/winsock2.rs new file mode 100644 index 000000000..a8327e3bb --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +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_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/um/winspool.rs b/vendor/registry-40351f815f426200/winapi/src/um/winspool.rs new file mode 100644 index 000000000..a4e3302a1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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: LPDEVMODEA, +}} +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/vendor/registry-40351f815f426200/winapi/src/um/winsvc.rs b/vendor/registry-40351f815f426200/winapi/src/um/winsvc.rs new file mode 100644 index 000000000..702164ccd --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winsvc.rs @@ -0,0 +1,665 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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} +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; +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/vendor/registry-40351f815f426200/winapi/src/um/winusb.rs b/vendor/registry-40351f815f426200/winapi/src/um/winusb.rs new file mode 100644 index 000000000..c72e36833 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/winuser.rs b/vendor/registry-40351f815f426200/winapi/src/um/winuser.rs new file mode 100644 index 000000000..53890d138 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/winuser.rs @@ -0,0 +1,7006 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, +}; +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; +STRUCT!{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; +STRUCT!{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; +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; + 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; +} +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_arch = "x86")] +pub use self::GetWindowLongA as GetWindowLongPtrA; +#[cfg(target_arch = "x86")] +pub use self::GetWindowLongW as GetWindowLongPtrW; +#[cfg(target_arch = "x86")] +pub use self::SetWindowLongA as SetWindowLongPtrA; +#[cfg(target_arch = "x86")] +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_arch = "x86")] +pub use self::GetClassLongA as GetClassLongPtrA; +#[cfg(target_arch = "x86")] +pub use self::GetClassLongW as GetClassLongPtrW; +#[cfg(target_arch = "x86")] +pub use self::SetClassLongA as SetClassLongPtrA; +#[cfg(target_arch = "x86")] +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; +} +/********* +* CUTOFF * +*********/ +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; +// Edit Control Styles +// +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; +// Edit Control Notification Codes +// +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; +// Edit control EM_SETMARGIN parameters +pub const EC_LEFTMARGIN: WORD = 0x0001; +pub const EC_RIGHTMARGIN: WORD = 0x0002; +pub const EC_USEFONTINFO: WORD = 0xffff; +// wParam of EM_GET/SETIMESTATUS +pub const EMSIS_COMPOSITIONSTRING: WORD = 0x0001; +// lParam for EMSIS_COMPOSITIONSTRING +pub const EIMES_GETCOMPSTRATONCE: WORD = 0x0001; +pub const EIMES_CANCELCOMPSTRINFOCUS: WORD = 0x0002; +pub const EIMES_COMPLETECOMPSTRKILLFOCUS: WORD = 0x0004; +// Edit Control Messages +// +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; +// EDITWORDBREAKPROC code values +// +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; +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; + 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; +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 CCHILDREN_SCROLLBAR: usize = 5; +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 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 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; +} +pub const ENUM_CURRENT_SETTINGS: DWORD = 0xFFFFFFFF; +pub const ENUM_REGISTRY_SETTINGS: DWORD = 0xFFFFFFFE; +pub const MDITILE_VERTICAL: UINT = 0x0000; +pub const MDITILE_HORIZONTAL: UINT = 0x0001; +pub const MDITILE_SKIPDISABLED: UINT = 0x0002; +pub const MDITILE_ZORDER: UINT = 0x0004; +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; +} +FN!{stdcall MSGBOXCALLBACK( + LPHELPINFO, +) -> ()} +FN!{stdcall WINEVENTPROC( + HWINEVENTHOOK, + DWORD, + HWND, + LONG, + LONG, + DWORD, + DWORD, +) -> ()} +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; +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 SIZEL; +pub type LPSIZEL = *mut SIZEL; +//8855 (Win 7 SDK) +STRUCT!{struct ICONINFO { + fIcon: BOOL, + xHotspot: DWORD, + yHotspot: DWORD, + hbmMask: HBITMAP, + hbmColor: HBITMAP, +}} +pub type PICONINFO = *mut ICONINFO; +//9066 +//10069 +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; +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; +} +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; + 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; +} +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; + 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 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; +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; + pub fn CopyIcon( + hIcon: HICON, + ) -> HICON; + pub fn GetIconInfo( + hIcon: HICON, + piconinfo: PICONINFO, + ) -> BOOL; +} +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; +//11264 +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; +//12141 +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; +//12869 +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; +//12900 +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; +//12971 +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, + ); + 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_arch = "x86_64")] +pub const CONSOLE_APPLICATION_16BIT: LONG = 0x0000; +#[cfg(target_arch = "x86")] +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; +extern "system" { +//14098 + 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 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; + 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; +} +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; +// if WINVER >= 0x0601 +// GetSystemMetrics(SM_DIGITIZER) flag values +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; +// end if WINVER >= 0x0601 +// System Menu Command Values +// +STRUCT!{struct ANIMATIONINFO { + cbSize: UINT, + iMinAnimate: c_int, +}} +pub type LPANIMATIONINFO = *mut ANIMATIONINFO; +pub const SPIF_UPDATEINIFILE: UINT = 0x0001; +pub const SPIF_SENDWININICHANGE: UINT = 0x0002; +pub const SPIF_SENDCHANGE: UINT = SPIF_SENDWININICHANGE; +extern "system" { + pub fn LoadIconA( + hInstance: HINSTANCE, + lpIconName: LPCSTR, + ) -> HICON; + pub fn LoadIconW( + hInstance: HINSTANCE, + lpIconName: LPCWSTR, + ) -> HICON; + pub fn IsImmersiveProcess( + hProcess: HANDLE, + ) -> BOOL; +} +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; +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/winver.rs b/vendor/registry-40351f815f426200/winapi/src/um/winver.rs new file mode 100644 index 000000000..5d25c678f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/wow64apiset.rs b/vendor/registry-40351f815f426200/winapi/src/um/wow64apiset.rs new file mode 100644 index 000000000..b8ce4aaff --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/wow64apiset.rs @@ -0,0 +1,27 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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, 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; +} diff --git a/vendor/registry-40351f815f426200/winapi/src/um/wpdmtpextensions.rs b/vendor/registry-40351f815f426200/winapi/src/um/wpdmtpextensions.rs new file mode 100644 index 000000000..f760e9936 --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/wpdmtpextensions.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!{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/vendor/registry-40351f815f426200/winapi/src/um/ws2spi.rs b/vendor/registry-40351f815f426200/winapi/src/um/ws2spi.rs new file mode 100644 index 000000000..2b9136ea3 --- /dev/null +++ b/vendor/registry-40351f815f426200/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(any(target_arch = "x86", target_arch = "arm"))] + 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/vendor/registry-40351f815f426200/winapi/src/um/ws2tcpip.rs b/vendor/registry-40351f815f426200/winapi/src/um/ws2tcpip.rs new file mode 100644 index 000000000..4867c74a2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/um/xinput.rs b/vendor/registry-40351f815f426200/winapi/src/um/xinput.rs new file mode 100644 index 000000000..e583c1e1f --- /dev/null +++ b/vendor/registry-40351f815f426200/winapi/src/um/xinput.rs @@ -0,0 +1,165 @@ +// Licensed under the Apache License, Version 2.0 +// or the MIT 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_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_DRUM_KIT: BYTE = 0x08; +pub const XINPUT_CAPS_VOICE_SUPPORTED: WORD = 0x0004; +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/vendor/registry-40351f815f426200/winapi/src/vc/excpt.rs b/vendor/registry-40351f815f426200/winapi/src/vc/excpt.rs new file mode 100644 index 000000000..a4f4d91e4 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/vc/limits.rs b/vendor/registry-40351f815f426200/winapi/src/vc/limits.rs new file mode 100644 index 000000000..31509adee --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/vc/mod.rs b/vendor/registry-40351f815f426200/winapi/src/vc/mod.rs new file mode 100644 index 000000000..0c0606bd9 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/vc/vadefs.rs b/vendor/registry-40351f815f426200/winapi/src/vc/vadefs.rs new file mode 100644 index 000000000..d44cc04db --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/vc/vcruntime.rs b/vendor/registry-40351f815f426200/winapi/src/vc/vcruntime.rs new file mode 100644 index 000000000..63c671b36 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/activation.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/activation.rs new file mode 100644 index 000000000..dca597bd1 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/hstring.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/hstring.rs new file mode 100644 index 000000000..98314e361 --- /dev/null +++ b/vendor/registry-40351f815f426200/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_arch = "x86")] +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/vendor/registry-40351f815f426200/winapi/src/winrt/inspectable.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/inspectable.rs new file mode 100644 index 000000000..fb1e43315 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/mod.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/mod.rs new file mode 100644 index 000000000..47e38676f --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/roapi.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/roapi.rs new file mode 100644 index 000000000..47b988062 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/robuffer.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/robuffer.rs new file mode 100644 index 000000000..b0192fbe2 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/roerrorapi.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/roerrorapi.rs new file mode 100644 index 000000000..aa9f683a5 --- /dev/null +++ b/vendor/registry-40351f815f426200/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/vendor/registry-40351f815f426200/winapi/src/winrt/winstring.rs b/vendor/registry-40351f815f426200/winapi/src/winrt/winstring.rs new file mode 100644 index 000000000..ecbfcdf2a --- /dev/null +++ b/vendor/registry-40351f815f426200/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, + ); +}