[INFO] cloning repository https://github.com/audibleblink/getsystem.rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/audibleblink/getsystem.rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faudibleblink%2Fgetsystem.rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faudibleblink%2Fgetsystem.rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] f956566fa735f01b0fcfcb8be9592b4b08ff673c [INFO] checking audibleblink/getsystem.rs against master#30f74ff0dc4d66debc8b50724c446f817e5f75f4 for pr-121848-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faudibleblink%2Fgetsystem.rs" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/audibleblink/getsystem.rs on toolchain 30f74ff0dc4d66debc8b50724c446f817e5f75f4 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+30f74ff0dc4d66debc8b50724c446f817e5f75f4" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/audibleblink/getsystem.rs [INFO] finished tweaking git repo https://github.com/audibleblink/getsystem.rs [INFO] tweaked toml for git repo https://github.com/audibleblink/getsystem.rs written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/audibleblink/getsystem.rs already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+30f74ff0dc4d66debc8b50724c446f817e5f75f4" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: dependencies.bindings.name [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [ERROR] error running command: no output for 300 seconds [ERROR] this task or one of its parent failed! [ERROR] no output for 300 seconds [ERROR] note: run with `RUST_BACKTRACE=1` to display a backtrace. [INFO] checking audibleblink/getsystem.rs against try#72eda894eb3548c7ba774079ce0afab42958d4ee for pr-121848-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Faudibleblink%2Fgetsystem.rs" "/workspace/builds/worker-2-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/audibleblink/getsystem.rs on toolchain 72eda894eb3548c7ba774079ce0afab42958d4ee [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+72eda894eb3548c7ba774079ce0afab42958d4ee" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/audibleblink/getsystem.rs [INFO] finished tweaking git repo https://github.com/audibleblink/getsystem.rs [INFO] tweaked toml for git repo https://github.com/audibleblink/getsystem.rs written to /workspace/builds/worker-2-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/audibleblink/getsystem.rs already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+72eda894eb3548c7ba774079ce0afab42958d4ee" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: dependencies.bindings.name [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded windows_macros v0.19.0 [INFO] [stderr] Downloaded windows_quote v0.19.0 [INFO] [stderr] Downloaded windows_gen v0.19.0 [INFO] [stderr] Downloaded windows v0.19.0 [INFO] [stderr] Downloaded windows_reader v0.19.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+72eda894eb3548c7ba774079ce0afab42958d4ee" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 8d72e86cc18f70acb3b4175c5c6fd37d8ed62ca48d6317048b8523f83b90e214 [INFO] running `Command { std: "docker" "start" "-a" "8d72e86cc18f70acb3b4175c5c6fd37d8ed62ca48d6317048b8523f83b90e214", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8d72e86cc18f70acb3b4175c5c6fd37d8ed62ca48d6317048b8523f83b90e214", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8d72e86cc18f70acb3b4175c5c6fd37d8ed62ca48d6317048b8523f83b90e214", kill_on_drop: false }` [INFO] [stdout] 8d72e86cc18f70acb3b4175c5c6fd37d8ed62ca48d6317048b8523f83b90e214 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+72eda894eb3548c7ba774079ce0afab42958d4ee" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 083208aee043e2373a0873f95c8ee3e2957dcd8ce9f5d858f1bdd54f0301d0d4 [INFO] running `Command { std: "docker" "start" "-a" "083208aee043e2373a0873f95c8ee3e2957dcd8ce9f5d858f1bdd54f0301d0d4", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: dependencies.bindings.name [INFO] [stderr] Compiling proc-macro2 v1.0.28 [INFO] [stderr] Compiling unicode-xid v0.2.2 [INFO] [stderr] Compiling syn v1.0.75 [INFO] [stderr] Compiling windows_quote v0.19.0 [INFO] [stderr] Compiling windows_reader v0.19.0 [INFO] [stderr] Compiling const-sha1 v0.2.0 [INFO] [stderr] Checking windows_gen v0.19.0 [INFO] [stderr] Compiling quote v1.0.9 [INFO] [stderr] Compiling windows_macros v0.19.0 [INFO] [stderr] Compiling windows v0.19.0 [INFO] [stderr] Compiling bindings v0.1.0 (/opt/rustwide/workdir/bindings) [INFO] [stdout] warning: unused return value of `Box::::from_raw` that must be used [INFO] [stdout] --> /opt/rustwide/target/debug/build/bindings-bffa331bfe7fcd4a/out/windows.rs:1:4800 [INFO] [stdout] | [INFO] [stdout] 1 | ... { if ! value . 0 . is_null ( ) { unsafe { :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: Into... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box` [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 1 | # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Windows { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Win32 { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Foundation { # [ repr ( transparent ) ] # [ derive ( :: std :: default :: Default , :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct BOOL ( pub i32 ) ; unsafe impl :: windows :: Abi for BOOL { type Abi = Self ; type DefaultType = Self ; } impl BOOL { # [ inline ] pub fn as_bool ( self ) -> bool { ! ( self . 0 == 0 ) } # [ inline ] pub fn ok ( self ) -> :: windows :: Result < ( ) > { if self . as_bool ( ) { Ok ( ( ) ) } else { Err ( :: windows :: HRESULT :: from_thread ( ) . into ( ) ) } } # [ inline ] # [ track_caller ] pub fn unwrap ( self ) { self . ok ( ) . unwrap ( ) ; } # [ inline ] # [ track_caller ] pub fn expect ( self , msg : & str ) { self . ok ( ) . expect ( msg ) ; } } impl :: std :: convert :: From < BOOL > for bool { fn from ( value : BOOL ) -> Self { value . as_bool ( ) } } impl :: std :: convert :: From < & BOOL > for bool { fn from ( value : & BOOL ) -> Self { value . as_bool ( ) } } impl :: std :: convert :: From < bool > for BOOL { fn from ( value : bool ) -> Self { if value { BOOL ( 1 ) } else { BOOL ( 0 ) } } } impl :: std :: convert :: From < & bool > for BOOL { fn from ( value : & bool ) -> Self { ( * value ) . into ( ) } } impl :: std :: cmp :: PartialEq < bool > for BOOL { fn eq ( & self , other : & bool ) -> bool { self . as_bool ( ) == * other } } impl :: std :: cmp :: PartialEq < BOOL > for bool { fn eq ( & self , other : & BOOL ) -> bool { * self == other . as_bool ( ) } } impl std :: ops :: Not for BOOL { type Output = Self ; fn not ( self ) -> Self :: Output { if self . as_bool ( ) { BOOL ( 0 ) } else { BOOL ( 1 ) } } } impl < 'a > :: windows :: IntoParam < 'a , BOOL > for bool { fn into_param ( self ) -> :: windows :: Param < 'a , BOOL > { :: windows :: Param :: Owned ( self . into ( ) ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( transparent ) ] pub struct HANDLE ( pub isize ) ; impl HANDLE { } impl :: std :: default :: Default for HANDLE { fn default ( ) -> Self { Self ( 0 ) } } impl HANDLE { pub const NULL : Self = Self ( 0 ) ; pub fn is_null ( & self ) -> bool { self . 0 == 0 } } impl :: std :: fmt :: Debug for HANDLE { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "HANDLE" ) . field ( "Value" , & self .0 ) . finish ( ) } } impl :: std :: cmp :: PartialEq for HANDLE { fn eq ( & self , other : & Self ) -> bool { self .0 == other .0 } } impl :: std :: cmp :: Eq for HANDLE { } unsafe impl :: windows :: Abi for HANDLE { type Abi = Self ; type DefaultType = Self ; } impl HANDLE { pub const INVALID : Self = Self ( - 1 ) ; pub fn is_invalid ( & self ) -> bool { self . 0 == - 1 } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( transparent ) ] pub struct HWND ( pub isize ) ; impl HWND { } impl :: std :: default :: Default for HWND { fn default ( ) -> Self { Self ( 0 ) } } impl HWND { pub const NULL : Self = Self ( 0 ) ; pub fn is_null ( & self ) -> bool { self . 0 == 0 } } impl :: std :: fmt :: Debug for HWND { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "HWND" ) . field ( "Value" , & self .0 ) . finish ( ) } } impl :: std :: cmp :: PartialEq for HWND { fn eq ( & self , other : & Self ) -> bool { self .0 == other .0 } } impl :: std :: cmp :: Eq for HWND { } unsafe impl :: windows :: Abi for HWND { type Abi = Self ; type DefaultType = Self ; } # [ repr ( transparent ) ] # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct PSTR ( pub * mut u8 ) ; impl PSTR { pub const NULL : Self = Self ( :: std :: ptr :: null_mut ( ) ) ; pub fn is_null ( & self ) -> bool { self . 0 . is_null ( ) } } impl :: std :: default :: Default for PSTR { fn default ( ) -> Self { Self ( :: std :: ptr :: null_mut ( ) ) } } impl :: std :: cmp :: PartialEq for PSTR { fn eq ( & self , other : & Self ) -> bool { self . 0 == other . 0 } } unsafe impl :: windows :: Abi for PSTR { type Abi = Self ; type DefaultType = Self ; fn drop_param ( param : & mut :: windows :: Param < '_ , Self > ) { if let :: windows :: Param :: Boxed ( value ) = param { if ! value . 0 . is_null ( ) { unsafe { let _ = :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: IntoParam < 'a , PSTR > for & 'a str { fn into_param ( self ) -> :: windows :: Param < 'a , PSTR > { :: windows :: Param :: Boxed ( PSTR ( :: std :: boxed :: Box :: < [ u8 ] > :: into_raw ( self . bytes ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u8 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } impl < 'a > :: windows :: IntoParam < 'a , PSTR > for String { fn into_param ( self ) -> :: windows :: Param < 'a , PSTR > { :: windows :: Param :: Boxed ( PSTR ( :: std :: boxed :: Box :: < [ u8 ] > :: into_raw ( self . bytes ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u8 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } # [ repr ( transparent ) ] # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct PWSTR ( pub * mut u16 ) ; impl PWSTR { pub const NULL : Self = Self ( :: std :: ptr :: null_mut ( ) ) ; pub fn is_null ( & self ) -> bool { self . 0 . is_null ( ) } } impl :: std :: default :: Default for PWSTR { fn default ( ) -> Self { Self ( :: std :: ptr :: null_mut ( ) ) } } impl :: std :: cmp :: PartialEq for PWSTR { fn eq ( & self , other : & Self ) -> bool { self . 0 == other . 0 } } unsafe impl :: windows :: Abi for PWSTR { type Abi = Self ; type DefaultType = Self ; fn drop_param ( param : & mut :: windows :: Param < '_ , Self > ) { if let :: windows :: Param :: Boxed ( value ) = param { if ! value . 0 . is_null ( ) { unsafe { :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: IntoParam < 'a , PWSTR > for & 'a str { fn into_param ( self ) -> :: windows :: Param < 'a , PWSTR > { :: windows :: Param :: Boxed ( PWSTR ( :: std :: boxed :: Box :: < [ u16 ] > :: into_raw ( self . encode_utf16 ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u16 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } impl < 'a > :: windows :: IntoParam < 'a , PWSTR > for String { fn into_param ( self ) -> :: windows :: Param < 'a , PWSTR > { :: windows :: Param :: Boxed ( PWSTR ( :: std :: boxed :: Box :: < [ u16 ] > :: into_raw ( self . encode_utf16 ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u16 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Security { pub unsafe fn AdjustTokenPrivileges < 'a , > ( tokenhandle : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , disableallprivileges : impl :: windows :: IntoParam < 'a , super::Foundation:: BOOL > , newstate : * mut TOKEN_PRIVILEGES , bufferlength : u32 , previousstate : * mut TOKEN_PRIVILEGES , returnlength : * mut u32 , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn AdjustTokenPrivileges ( tokenhandle : super::Foundation:: HANDLE , disableallprivileges : super::Foundation:: BOOL , newstate : * mut TOKEN_PRIVILEGES , bufferlength : u32 , previousstate : * mut TOKEN_PRIVILEGES , returnlength : * mut u32 ) -> super::Foundation:: BOOL ; } AdjustTokenPrivileges ( tokenhandle . into_param ( ) . abi ( ) , disableallprivileges . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( newstate ) , :: std :: mem :: transmute ( bufferlength ) , :: std :: mem :: transmute ( previousstate ) , :: std :: mem :: transmute ( returnlength ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn DuplicateTokenEx < 'a , > ( hexistingtoken : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , dwdesiredaccess : TOKEN_ACCESS_MASK , lptokenattributes : * mut SECURITY_ATTRIBUTES , impersonationlevel : SECURITY_IMPERSONATION_LEVEL , tokentype : TOKEN_TYPE , phnewtoken : * mut super::Foundation:: HANDLE , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn DuplicateTokenEx ( hexistingtoken : super::Foundation:: HANDLE , dwdesiredaccess : TOKEN_ACCESS_MASK , lptokenattributes : * mut SECURITY_ATTRIBUTES , impersonationlevel : SECURITY_IMPERSONATION_LEVEL , tokentype : TOKEN_TYPE , phnewtoken : * mut super::Foundation:: HANDLE ) -> super::Foundation:: BOOL ; } DuplicateTokenEx ( hexistingtoken . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwdesiredaccess ) , :: std :: mem :: transmute ( lptokenattributes ) , :: std :: mem :: transmute ( impersonationlevel ) , :: std :: mem :: transmute ( tokentype ) , :: std :: mem :: transmute ( phnewtoken ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn ImpersonateLoggedOnUser < 'a , > ( htoken : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn ImpersonateLoggedOnUser ( htoken : super::Foundation:: HANDLE ) -> super::Foundation:: BOOL ; } ImpersonateLoggedOnUser ( htoken . into_param ( ) . abi ( ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct LUID_AND_ATTRIBUTES { pub Luid : super::System::SystemServices:: LUID , pub Attributes : TOKEN_PRIVILEGES_ATTRIBUTES } impl LUID_AND_ATTRIBUTES { } impl :: std :: default :: Default for LUID_AND_ATTRIBUTES { fn default ( ) -> Self { Self { Luid : :: std :: default :: Default :: default ( ) , Attributes : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for LUID_AND_ATTRIBUTES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "LUID_AND_ATTRIBUTES" ) . field ( "Luid" , & self . Luid ) . field ( "Attributes" , & self . Attributes ) . finish ( ) } } impl :: std :: cmp :: PartialEq for LUID_AND_ATTRIBUTES { fn eq ( & self , other : & Self ) -> bool { self . Luid == other . Luid && self . Attributes == other . Attributes } } impl :: std :: cmp :: Eq for LUID_AND_ATTRIBUTES { } unsafe impl :: windows :: Abi for LUID_AND_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct SECURITY_ATTRIBUTES { pub nLength : u32 , pub lpSecurityDescriptor : * mut :: std :: ffi :: c_void , pub bInheritHandle : super::Foundation:: BOOL } impl SECURITY_ATTRIBUTES { } impl :: std :: default :: Default for SECURITY_ATTRIBUTES { fn default ( ) -> Self { Self { nLength : 0 , lpSecurityDescriptor : :: std :: ptr :: null_mut ( ) , bInheritHandle : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for SECURITY_ATTRIBUTES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "SECURITY_ATTRIBUTES" ) . field ( "nLength" , & self . nLength ) . field ( "lpSecurityDescriptor" , & self . lpSecurityDescriptor ) . field ( "bInheritHandle" , & self . bInheritHandle ) . finish ( ) } } impl :: std :: cmp :: PartialEq for SECURITY_ATTRIBUTES { fn eq ( & self , other : & Self ) -> bool { self . nLength == other . nLength && self . lpSecurityDescriptor == other . lpSecurityDescriptor && self . bInheritHandle == other . bInheritHandle } } impl :: std :: cmp :: Eq for SECURITY_ATTRIBUTES { } unsafe impl :: windows :: Abi for SECURITY_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct SECURITY_IMPERSONATION_LEVEL ( pub i32 ) ; pub const SecurityAnonymous : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 0i32 ) ; pub const SecurityIdentification : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 1i32 ) ; pub const SecurityImpersonation : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 2i32 ) ; pub const SecurityDelegation : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 3i32 ) ; impl :: std :: convert :: From < i32 > for SECURITY_IMPERSONATION_LEVEL { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for SECURITY_IMPERSONATION_LEVEL { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_ACCESS_MASK ( pub u32 ) ; pub const TOKEN_DELETE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 65536u32 ) ; pub const TOKEN_READ_CONTROL : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 131072u32 ) ; pub const TOKEN_WRITE_DAC : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 262144u32 ) ; pub const TOKEN_WRITE_OWNER : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 524288u32 ) ; pub const TOKEN_ACCESS_SYSTEM_SECURITY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 16777216u32 ) ; pub const TOKEN_ASSIGN_PRIMARY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 1u32 ) ; pub const TOKEN_DUPLICATE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 2u32 ) ; pub const TOKEN_IMPERSONATE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 4u32 ) ; pub const TOKEN_QUERY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 8u32 ) ; pub const TOKEN_QUERY_SOURCE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 16u32 ) ; pub const TOKEN_ADJUST_PRIVILEGES : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 32u32 ) ; pub const TOKEN_ADJUST_GROUPS : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 64u32 ) ; pub const TOKEN_ADJUST_DEFAULT : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 128u32 ) ; pub const TOKEN_ADJUST_SESSIONID : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 256u32 ) ; pub const TOKEN_ALL_ACCESS : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 983295u32 ) ; impl :: std :: convert :: From < u32 > for TOKEN_ACCESS_MASK { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_ACCESS_MASK { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for TOKEN_ACCESS_MASK { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for TOKEN_ACCESS_MASK { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for TOKEN_ACCESS_MASK { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for TOKEN_ACCESS_MASK { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct TOKEN_PRIVILEGES { pub PrivilegeCount : u32 , pub Privileges : [ LUID_AND_ATTRIBUTES ;1 ] } impl TOKEN_PRIVILEGES { } impl :: std :: default :: Default for TOKEN_PRIVILEGES { fn default ( ) -> Self { Self { PrivilegeCount : 0 , Privileges : [ :: std :: default :: Default :: default ( ) ;1 ] } } } impl :: std :: fmt :: Debug for TOKEN_PRIVILEGES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "TOKEN_PRIVILEGES" ) . field ( "PrivilegeCount" , & self . PrivilegeCount ) . field ( "Privileges" , & self . Privileges ) . finish ( ) } } impl :: std :: cmp :: PartialEq for TOKEN_PRIVILEGES { fn eq ( & self , other : & Self ) -> bool { self . PrivilegeCount == other . PrivilegeCount && self . Privileges == other . Privileges } } impl :: std :: cmp :: Eq for TOKEN_PRIVILEGES { } unsafe impl :: windows :: Abi for TOKEN_PRIVILEGES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_PRIVILEGES_ATTRIBUTES ( pub u32 ) ; pub const SE_PRIVILEGE_ENABLED : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 2u32 ) ; pub const SE_PRIVILEGE_ENABLED_BY_DEFAULT : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 1u32 ) ; pub const SE_PRIVILEGE_REMOVED : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 4u32 ) ; pub const SE_PRIVILEGE_USED_FOR_ACCESS : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 2147483648u32 ) ; impl :: std :: convert :: From < u32 > for TOKEN_PRIVILEGES_ATTRIBUTES { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_PRIVILEGES_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for TOKEN_PRIVILEGES_ATTRIBUTES { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for TOKEN_PRIVILEGES_ATTRIBUTES { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for TOKEN_PRIVILEGES_ATTRIBUTES { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for TOKEN_PRIVILEGES_ATTRIBUTES { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_TYPE ( pub i32 ) ; pub const TokenPrimary : TOKEN_TYPE = TOKEN_TYPE ( 1i32 ) ; pub const TokenImpersonation : TOKEN_TYPE = TOKEN_TYPE ( 2i32 ) ; impl :: std :: convert :: From < i32 > for TOKEN_TYPE { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_TYPE { type Abi = Self ; type DefaultType = Self ; } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod System { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod SystemServices { # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct LUID { pub LowPart : u32 , pub HighPart : i32 } impl LUID { } impl :: std :: default :: Default for LUID { fn default ( ) -> Self { Self { LowPart : 0 , HighPart : 0 } } } impl :: std :: fmt :: Debug for LUID { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "LUID" ) . field ( "LowPart" , & self . LowPart ) . field ( "HighPart" , & self . HighPart ) . finish ( ) } } impl :: std :: cmp :: PartialEq for LUID { fn eq ( & self , other : & Self ) -> bool { self . LowPart == other . LowPart && self . HighPart == other . HighPart } } impl :: std :: cmp :: Eq for LUID { } unsafe impl :: windows :: Abi for LUID { type Abi = Self ; type DefaultType = Self ; } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Threading { # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct CREATE_PROCESS_LOGON_FLAGS ( pub u32 ) ; pub const LOGON_WITH_PROFILE : CREATE_PROCESS_LOGON_FLAGS = CREATE_PROCESS_LOGON_FLAGS ( 1u32 ) ; pub const LOGON_NETCREDENTIALS_ONLY : CREATE_PROCESS_LOGON_FLAGS = CREATE_PROCESS_LOGON_FLAGS ( 2u32 ) ; impl :: std :: convert :: From < u32 > for CREATE_PROCESS_LOGON_FLAGS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for CREATE_PROCESS_LOGON_FLAGS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for CREATE_PROCESS_LOGON_FLAGS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for CREATE_PROCESS_LOGON_FLAGS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for CREATE_PROCESS_LOGON_FLAGS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for CREATE_PROCESS_LOGON_FLAGS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } pub unsafe fn CreateProcessWithTokenW < 'a , > ( htoken : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HANDLE > , dwlogonflags : CREATE_PROCESS_LOGON_FLAGS , lpapplicationname : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , lpcommandline : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , dwcreationflags : u32 , lpenvironment : * mut :: std :: ffi :: c_void , lpcurrentdirectory : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , lpstartupinfo : * mut STARTUPINFOW , lpprocessinformation : * mut PROCESS_INFORMATION , ) -> super::super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn CreateProcessWithTokenW ( htoken : super::super::Foundation:: HANDLE , dwlogonflags : CREATE_PROCESS_LOGON_FLAGS , lpapplicationname : super::super::Foundation:: PWSTR , lpcommandline : super::super::Foundation:: PWSTR , dwcreationflags : u32 , lpenvironment : * mut :: std :: ffi :: c_void , lpcurrentdirectory : super::super::Foundation:: PWSTR , lpstartupinfo : * mut STARTUPINFOW , lpprocessinformation : * mut PROCESS_INFORMATION ) -> super::super::Foundation:: BOOL ; } CreateProcessWithTokenW ( htoken . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwlogonflags ) , lpapplicationname . into_param ( ) . abi ( ) , lpcommandline . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwcreationflags ) , :: std :: mem :: transmute ( lpenvironment ) , lpcurrentdirectory . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( lpstartupinfo ) , :: std :: mem :: transmute ( lpprocessinformation ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentProcess < > ( ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentProcess ( ) -> super::super::Foundation:: HANDLE ; } GetCurrentProcess ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentProcessId < > ( ) -> u32 { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentProcessId ( ) -> u32 ; } GetCurrentProcessId ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentThread < > ( ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentThread ( ) -> super::super::Foundation:: HANDLE ; } GetCurrentThread ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn OpenProcess < 'a , > ( dwdesiredaccess : PROCESS_ACCESS_RIGHTS , binherithandle : impl :: windows :: IntoParam < 'a , super::super::Foundation:: BOOL > , dwprocessid : u32 , ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn OpenProcess ( dwdesiredaccess : PROCESS_ACCESS_RIGHTS , binherithandle : super::super::Foundation:: BOOL , dwprocessid : u32 ) -> super::super::Foundation:: HANDLE ; } OpenProcess ( :: std :: mem :: transmute ( dwdesiredaccess ) , binherithandle . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwprocessid ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn OpenProcessToken < 'a , > ( processhandle : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HANDLE > , desiredaccess : super::super::Security:: TOKEN_ACCESS_MASK , tokenhandle : * mut super::super::Foundation:: HANDLE , ) -> super::super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn OpenProcessToken ( processhandle : super::super::Foundation:: HANDLE , desiredaccess : super::super::Security:: TOKEN_ACCESS_MASK , tokenhandle : * mut super::super::Foundation:: HANDLE ) -> super::super::Foundation:: BOOL ; } OpenProcessToken ( processhandle . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( desiredaccess ) , :: std :: mem :: transmute ( tokenhandle ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct PROCESS_ACCESS_RIGHTS ( pub u32 ) ; pub const PROCESS_TERMINATE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1u32 ) ; pub const PROCESS_CREATE_THREAD : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2u32 ) ; pub const PROCESS_SET_SESSIONID : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 4u32 ) ; pub const PROCESS_VM_OPERATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 8u32 ) ; pub const PROCESS_VM_READ : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 16u32 ) ; pub const PROCESS_VM_WRITE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 32u32 ) ; pub const PROCESS_DUP_HANDLE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 64u32 ) ; pub const PROCESS_CREATE_PROCESS : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 128u32 ) ; pub const PROCESS_SET_QUOTA : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 256u32 ) ; pub const PROCESS_SET_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 512u32 ) ; pub const PROCESS_QUERY_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1024u32 ) ; pub const PROCESS_SUSPEND_RESUME : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2048u32 ) ; pub const PROCESS_QUERY_LIMITED_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 4096u32 ) ; pub const PROCESS_SET_LIMITED_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 8192u32 ) ; pub const PROCESS_ALL_ACCESS : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2097151u32 ) ; pub const PROCESS_DELETE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 65536u32 ) ; pub const PROCESS_READ_CONTROL : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 131072u32 ) ; pub const PROCESS_WRITE_DAC : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 262144u32 ) ; pub const PROCESS_WRITE_OWNER : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 524288u32 ) ; pub const PROCESS_SYNCHRONIZE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1048576u32 ) ; pub const PROCESS_STANDARD_RIGHTS_REQUIRED : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 983040u32 ) ; impl :: std :: convert :: From < u32 > for PROCESS_ACCESS_RIGHTS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for PROCESS_ACCESS_RIGHTS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for PROCESS_ACCESS_RIGHTS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for PROCESS_ACCESS_RIGHTS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for PROCESS_ACCESS_RIGHTS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for PROCESS_ACCESS_RIGHTS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct PROCESS_INFORMATION { pub hProcess : super::super::Foundation:: HANDLE , pub hThread : super::super::Foundation:: HANDLE , pub dwProcessId : u32 , pub dwThreadId : u32 } impl PROCESS_INFORMATION { } impl :: std :: default :: Default for PROCESS_INFORMATION { fn default ( ) -> Self { Self { hProcess : :: std :: default :: Default :: default ( ) , hThread : :: std :: default :: Default :: default ( ) , dwProcessId : 0 , dwThreadId : 0 } } } impl :: std :: fmt :: Debug for PROCESS_INFORMATION { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "PROCESS_INFORMATION" ) . field ( "hProcess" , & self . hProcess ) . field ( "hThread" , & self . hThread ) . field ( "dwProcessId" , & self . dwProcessId ) . field ( "dwThreadId" , & self . dwThreadId ) . finish ( ) } } impl :: std :: cmp :: PartialEq for PROCESS_INFORMATION { fn eq ( & self , other : & Self ) -> bool { self . hProcess == other . hProcess && self . hThread == other . hThread && self . dwProcessId == other . dwProcessId && self . dwThreadId == other . dwThreadId } } impl :: std :: cmp :: Eq for PROCESS_INFORMATION { } unsafe impl :: windows :: Abi for PROCESS_INFORMATION { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct STARTUPINFOW { pub cb : u32 , pub lpReserved : super::super::Foundation:: PWSTR , pub lpDesktop : super::super::Foundation:: PWSTR , pub lpTitle : super::super::Foundation:: PWSTR , pub dwX : u32 , pub dwY : u32 , pub dwXSize : u32 , pub dwYSize : u32 , pub dwXCountChars : u32 , pub dwYCountChars : u32 , pub dwFillAttribute : u32 , pub dwFlags : STARTUPINFOW_FLAGS , pub wShowWindow : u16 , pub cbReserved2 : u16 , pub lpReserved2 : * mut u8 , pub hStdInput : super::super::Foundation:: HANDLE , pub hStdOutput : super::super::Foundation:: HANDLE , pub hStdError : super::super::Foundation:: HANDLE } impl STARTUPINFOW { } impl :: std :: default :: Default for STARTUPINFOW { fn default ( ) -> Self { Self { cb : 0 , lpReserved : :: std :: default :: Default :: default ( ) , lpDesktop : :: std :: default :: Default :: default ( ) , lpTitle : :: std :: default :: Default :: default ( ) , dwX : 0 , dwY : 0 , dwXSize : 0 , dwYSize : 0 , dwXCountChars : 0 , dwYCountChars : 0 , dwFillAttribute : 0 , dwFlags : :: std :: default :: Default :: default ( ) , wShowWindow : 0 , cbReserved2 : 0 , lpReserved2 : :: std :: ptr :: null_mut ( ) , hStdInput : :: std :: default :: Default :: default ( ) , hStdOutput : :: std :: default :: Default :: default ( ) , hStdError : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for STARTUPINFOW { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "STARTUPINFOW" ) . field ( "cb" , & self . cb ) . field ( "lpReserved" , & self . lpReserved ) . field ( "lpDesktop" , & self . lpDesktop ) . field ( "lpTitle" , & self . lpTitle ) . field ( "dwX" , & self . dwX ) . field ( "dwY" , & self . dwY ) . field ( "dwXSize" , & self . dwXSize ) . field ( "dwYSize" , & self . dwYSize ) . field ( "dwXCountChars" , & self . dwXCountChars ) . field ( "dwYCountChars" , & self . dwYCountChars ) . field ( "dwFillAttribute" , & self . dwFillAttribute ) . field ( "dwFlags" , & self . dwFlags ) . field ( "wShowWindow" , & self . wShowWindow ) . field ( "cbReserved2" , & self . cbReserved2 ) . field ( "lpReserved2" , & self . lpReserved2 ) . field ( "hStdInput" , & self . hStdInput ) . field ( "hStdOutput" , & self . hStdOutput ) . field ( "hStdError" , & self . hStdError ) . finish ( ) } } impl :: std :: cmp :: PartialEq for STARTUPINFOW { fn eq ( & self , other : & Self ) -> bool { self . cb == other . cb && self . lpReserved == other . lpReserved && self . lpDesktop == other . lpDesktop && self . lpTitle == other . lpTitle && self . dwX == other . dwX && self . dwY == other . dwY && self . dwXSize == other . dwXSize && self . dwYSize == other . dwYSize && self . dwXCountChars == other . dwXCountChars && self . dwYCountChars == other . dwYCountChars && self . dwFillAttribute == other . dwFillAttribute && self . dwFlags == other . dwFlags && self . wShowWindow == other . wShowWindow && self . cbReserved2 == other . cbReserved2 && self . lpReserved2 == other . lpReserved2 && self . hStdInput == other . hStdInput && self . hStdOutput == other . hStdOutput && self . hStdError == other . hStdError } } impl :: std :: cmp :: Eq for STARTUPINFOW { } unsafe impl :: windows :: Abi for STARTUPINFOW { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct STARTUPINFOW_FLAGS ( pub u32 ) ; pub const STARTF_FORCEONFEEDBACK : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 64u32 ) ; pub const STARTF_FORCEOFFFEEDBACK : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 128u32 ) ; pub const STARTF_PREVENTPINNING : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 8192u32 ) ; pub const STARTF_RUNFULLSCREEN : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 32u32 ) ; pub const STARTF_TITLEISAPPID : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 4096u32 ) ; pub const STARTF_TITLEISLINKNAME : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 2048u32 ) ; pub const STARTF_UNTRUSTEDSOURCE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 32768u32 ) ; pub const STARTF_USECOUNTCHARS : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 8u32 ) ; pub const STARTF_USEFILLATTRIBUTE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 16u32 ) ; pub const STARTF_USEHOTKEY : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 512u32 ) ; pub const STARTF_USEPOSITION : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 4u32 ) ; pub const STARTF_USESHOWWINDOW : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 1u32 ) ; pub const STARTF_USESIZE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 2u32 ) ; pub const STARTF_USESTDHANDLES : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 256u32 ) ; impl :: std :: convert :: From < u32 > for STARTUPINFOW_FLAGS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for STARTUPINFOW_FLAGS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for STARTUPINFOW_FLAGS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for STARTUPINFOW_FLAGS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for STARTUPINFOW_FLAGS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for STARTUPINFOW_FLAGS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod UI { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod WindowsAndMessaging { # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct MESSAGEBOX_RESULT ( pub i32 ) ; pub const IDOK : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 1i32 ) ; pub const IDCANCEL : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 2i32 ) ; pub const IDABORT : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 3i32 ) ; pub const IDRETRY : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 4i32 ) ; pub const IDIGNORE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 5i32 ) ; pub const IDYES : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 6i32 ) ; pub const IDNO : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 7i32 ) ; pub const IDCLOSE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 8i32 ) ; pub const IDHELP : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 9i32 ) ; pub const IDTRYAGAIN : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 10i32 ) ; pub const IDCONTINUE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 11i32 ) ; pub const IDASYNC : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 32001i32 ) ; pub const IDTIMEOUT : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 32000i32 ) ; impl :: std :: convert :: From < i32 > for MESSAGEBOX_RESULT { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for MESSAGEBOX_RESULT { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct MESSAGEBOX_STYLE ( pub u32 ) ; pub const MB_ABORTRETRYIGNORE : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 2u32 ) ; pub const MB_CANCELTRYCONTINUE : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 6u32 ) ; pub const MB_HELP : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16384u32 ) ; pub const MB_OK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_OKCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 1u32 ) ; pub const MB_RETRYCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 5u32 ) ; pub const MB_YESNO : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 4u32 ) ; pub const MB_YESNOCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 3u32 ) ; pub const MB_ICONHAND : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_ICONQUESTION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 32u32 ) ; pub const MB_ICONEXCLAMATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 48u32 ) ; pub const MB_ICONASTERISK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 64u32 ) ; pub const MB_USERICON : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 128u32 ) ; pub const MB_ICONWARNING : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 48u32 ) ; pub const MB_ICONERROR : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_ICONINFORMATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 64u32 ) ; pub const MB_ICONSTOP : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_DEFBUTTON1 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_DEFBUTTON2 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 256u32 ) ; pub const MB_DEFBUTTON3 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 512u32 ) ; pub const MB_DEFBUTTON4 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 768u32 ) ; pub const MB_APPLMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_SYSTEMMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 4096u32 ) ; pub const MB_TASKMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 8192u32 ) ; pub const MB_NOFOCUS : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 32768u32 ) ; pub const MB_SETFOREGROUND : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 65536u32 ) ; pub const MB_DEFAULT_DESKTOP_ONLY : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 131072u32 ) ; pub const MB_TOPMOST : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 262144u32 ) ; pub const MB_RIGHT : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 524288u32 ) ; pub const MB_RTLREADING : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 1048576u32 ) ; pub const MB_SERVICE_NOTIFICATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 2097152u32 ) ; pub const MB_SERVICE_NOTIFICATION_NT3X : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 262144u32 ) ; pub const MB_TYPEMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 15u32 ) ; pub const MB_ICONMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 240u32 ) ; pub const MB_DEFMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 3840u32 ) ; pub const MB_MODEMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 12288u32 ) ; pub const MB_MISCMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 49152u32 ) ; impl :: std :: convert :: From < u32 > for MESSAGEBOX_STYLE { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for MESSAGEBOX_STYLE { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for MESSAGEBOX_STYLE { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for MESSAGEBOX_STYLE { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for MESSAGEBOX_STYLE { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for MESSAGEBOX_STYLE { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } pub unsafe fn MessageBoxA < 'a , > ( hwnd : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HWND > , lptext : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PSTR > , lpcaption : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PSTR > , utype : MESSAGEBOX_STYLE , ) -> MESSAGEBOX_RESULT { # [ cfg ( windows ) ] { # [ link ( name ="USER32" ) ] extern "system" { fn MessageBoxA ( hwnd : super::super::Foundation:: HWND , lptext : super::super::Foundation:: PSTR , lpcaption : super::super::Foundation:: PSTR , utype : MESSAGEBOX_STYLE ) -> MESSAGEBOX_RESULT ; } MessageBoxA ( hwnd . into_param ( ) . abi ( ) , lptext . into_param ( ) . abi ( ) , lpcaption . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( utype ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } } } } } [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `Box::::from_raw` that must be used [INFO] [stdout] --> /opt/rustwide/target/debug/build/bindings-bffa331bfe7fcd4a/out/windows.rs:1:6372 [INFO] [stdout] | [INFO] [stdout] 1 | ... { if ! value . 0 . is_null ( ) { unsafe { :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: Into... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: call `drop(Box::from_raw(ptr))` if you intend to drop the `Box` [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 1 | # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Windows { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Win32 { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Foundation { # [ repr ( transparent ) ] # [ derive ( :: std :: default :: Default , :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct BOOL ( pub i32 ) ; unsafe impl :: windows :: Abi for BOOL { type Abi = Self ; type DefaultType = Self ; } impl BOOL { # [ inline ] pub fn as_bool ( self ) -> bool { ! ( self . 0 == 0 ) } # [ inline ] pub fn ok ( self ) -> :: windows :: Result < ( ) > { if self . as_bool ( ) { Ok ( ( ) ) } else { Err ( :: windows :: HRESULT :: from_thread ( ) . into ( ) ) } } # [ inline ] # [ track_caller ] pub fn unwrap ( self ) { self . ok ( ) . unwrap ( ) ; } # [ inline ] # [ track_caller ] pub fn expect ( self , msg : & str ) { self . ok ( ) . expect ( msg ) ; } } impl :: std :: convert :: From < BOOL > for bool { fn from ( value : BOOL ) -> Self { value . as_bool ( ) } } impl :: std :: convert :: From < & BOOL > for bool { fn from ( value : & BOOL ) -> Self { value . as_bool ( ) } } impl :: std :: convert :: From < bool > for BOOL { fn from ( value : bool ) -> Self { if value { BOOL ( 1 ) } else { BOOL ( 0 ) } } } impl :: std :: convert :: From < & bool > for BOOL { fn from ( value : & bool ) -> Self { ( * value ) . into ( ) } } impl :: std :: cmp :: PartialEq < bool > for BOOL { fn eq ( & self , other : & bool ) -> bool { self . as_bool ( ) == * other } } impl :: std :: cmp :: PartialEq < BOOL > for bool { fn eq ( & self , other : & BOOL ) -> bool { * self == other . as_bool ( ) } } impl std :: ops :: Not for BOOL { type Output = Self ; fn not ( self ) -> Self :: Output { if self . as_bool ( ) { BOOL ( 0 ) } else { BOOL ( 1 ) } } } impl < 'a > :: windows :: IntoParam < 'a , BOOL > for bool { fn into_param ( self ) -> :: windows :: Param < 'a , BOOL > { :: windows :: Param :: Owned ( self . into ( ) ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( transparent ) ] pub struct HANDLE ( pub isize ) ; impl HANDLE { } impl :: std :: default :: Default for HANDLE { fn default ( ) -> Self { Self ( 0 ) } } impl HANDLE { pub const NULL : Self = Self ( 0 ) ; pub fn is_null ( & self ) -> bool { self . 0 == 0 } } impl :: std :: fmt :: Debug for HANDLE { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "HANDLE" ) . field ( "Value" , & self .0 ) . finish ( ) } } impl :: std :: cmp :: PartialEq for HANDLE { fn eq ( & self , other : & Self ) -> bool { self .0 == other .0 } } impl :: std :: cmp :: Eq for HANDLE { } unsafe impl :: windows :: Abi for HANDLE { type Abi = Self ; type DefaultType = Self ; } impl HANDLE { pub const INVALID : Self = Self ( - 1 ) ; pub fn is_invalid ( & self ) -> bool { self . 0 == - 1 } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( transparent ) ] pub struct HWND ( pub isize ) ; impl HWND { } impl :: std :: default :: Default for HWND { fn default ( ) -> Self { Self ( 0 ) } } impl HWND { pub const NULL : Self = Self ( 0 ) ; pub fn is_null ( & self ) -> bool { self . 0 == 0 } } impl :: std :: fmt :: Debug for HWND { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "HWND" ) . field ( "Value" , & self .0 ) . finish ( ) } } impl :: std :: cmp :: PartialEq for HWND { fn eq ( & self , other : & Self ) -> bool { self .0 == other .0 } } impl :: std :: cmp :: Eq for HWND { } unsafe impl :: windows :: Abi for HWND { type Abi = Self ; type DefaultType = Self ; } # [ repr ( transparent ) ] # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct PSTR ( pub * mut u8 ) ; impl PSTR { pub const NULL : Self = Self ( :: std :: ptr :: null_mut ( ) ) ; pub fn is_null ( & self ) -> bool { self . 0 . is_null ( ) } } impl :: std :: default :: Default for PSTR { fn default ( ) -> Self { Self ( :: std :: ptr :: null_mut ( ) ) } } impl :: std :: cmp :: PartialEq for PSTR { fn eq ( & self , other : & Self ) -> bool { self . 0 == other . 0 } } unsafe impl :: windows :: Abi for PSTR { type Abi = Self ; type DefaultType = Self ; fn drop_param ( param : & mut :: windows :: Param < '_ , Self > ) { if let :: windows :: Param :: Boxed ( value ) = param { if ! value . 0 . is_null ( ) { unsafe { :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: IntoParam < 'a , PSTR > for & 'a str { fn into_param ( self ) -> :: windows :: Param < 'a , PSTR > { :: windows :: Param :: Boxed ( PSTR ( :: std :: boxed :: Box :: < [ u8 ] > :: into_raw ( self . bytes ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u8 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } impl < 'a > :: windows :: IntoParam < 'a , PSTR > for String { fn into_param ( self ) -> :: windows :: Param < 'a , PSTR > { :: windows :: Param :: Boxed ( PSTR ( :: std :: boxed :: Box :: < [ u8 ] > :: into_raw ( self . bytes ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u8 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } # [ repr ( transparent ) ] # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy , :: std :: cmp :: Eq , :: std :: fmt :: Debug ) ] pub struct PWSTR ( pub * mut u16 ) ; impl PWSTR { pub const NULL : Self = Self ( :: std :: ptr :: null_mut ( ) ) ; pub fn is_null ( & self ) -> bool { self . 0 . is_null ( ) } } impl :: std :: default :: Default for PWSTR { fn default ( ) -> Self { Self ( :: std :: ptr :: null_mut ( ) ) } } impl :: std :: cmp :: PartialEq for PWSTR { fn eq ( & self , other : & Self ) -> bool { self . 0 == other . 0 } } unsafe impl :: windows :: Abi for PWSTR { type Abi = Self ; type DefaultType = Self ; fn drop_param ( param : & mut :: windows :: Param < '_ , Self > ) { if let :: windows :: Param :: Boxed ( value ) = param { if ! value . 0 . is_null ( ) { unsafe { let _ = :: std :: boxed :: Box :: from_raw ( value . 0 ) ; } } } } } impl < 'a > :: windows :: IntoParam < 'a , PWSTR > for & 'a str { fn into_param ( self ) -> :: windows :: Param < 'a , PWSTR > { :: windows :: Param :: Boxed ( PWSTR ( :: std :: boxed :: Box :: < [ u16 ] > :: into_raw ( self . encode_utf16 ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u16 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } impl < 'a > :: windows :: IntoParam < 'a , PWSTR > for String { fn into_param ( self ) -> :: windows :: Param < 'a , PWSTR > { :: windows :: Param :: Boxed ( PWSTR ( :: std :: boxed :: Box :: < [ u16 ] > :: into_raw ( self . encode_utf16 ( ) . chain ( :: std :: iter :: once ( 0 ) ) . collect :: < std :: vec :: Vec < u16 >> ( ) . into_boxed_slice ( ) ) as _ ) ) } } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Security { pub unsafe fn AdjustTokenPrivileges < 'a , > ( tokenhandle : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , disableallprivileges : impl :: windows :: IntoParam < 'a , super::Foundation:: BOOL > , newstate : * mut TOKEN_PRIVILEGES , bufferlength : u32 , previousstate : * mut TOKEN_PRIVILEGES , returnlength : * mut u32 , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn AdjustTokenPrivileges ( tokenhandle : super::Foundation:: HANDLE , disableallprivileges : super::Foundation:: BOOL , newstate : * mut TOKEN_PRIVILEGES , bufferlength : u32 , previousstate : * mut TOKEN_PRIVILEGES , returnlength : * mut u32 ) -> super::Foundation:: BOOL ; } AdjustTokenPrivileges ( tokenhandle . into_param ( ) . abi ( ) , disableallprivileges . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( newstate ) , :: std :: mem :: transmute ( bufferlength ) , :: std :: mem :: transmute ( previousstate ) , :: std :: mem :: transmute ( returnlength ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn DuplicateTokenEx < 'a , > ( hexistingtoken : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , dwdesiredaccess : TOKEN_ACCESS_MASK , lptokenattributes : * mut SECURITY_ATTRIBUTES , impersonationlevel : SECURITY_IMPERSONATION_LEVEL , tokentype : TOKEN_TYPE , phnewtoken : * mut super::Foundation:: HANDLE , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn DuplicateTokenEx ( hexistingtoken : super::Foundation:: HANDLE , dwdesiredaccess : TOKEN_ACCESS_MASK , lptokenattributes : * mut SECURITY_ATTRIBUTES , impersonationlevel : SECURITY_IMPERSONATION_LEVEL , tokentype : TOKEN_TYPE , phnewtoken : * mut super::Foundation:: HANDLE ) -> super::Foundation:: BOOL ; } DuplicateTokenEx ( hexistingtoken . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwdesiredaccess ) , :: std :: mem :: transmute ( lptokenattributes ) , :: std :: mem :: transmute ( impersonationlevel ) , :: std :: mem :: transmute ( tokentype ) , :: std :: mem :: transmute ( phnewtoken ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn ImpersonateLoggedOnUser < 'a , > ( htoken : impl :: windows :: IntoParam < 'a , super::Foundation:: HANDLE > , ) -> super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn ImpersonateLoggedOnUser ( htoken : super::Foundation:: HANDLE ) -> super::Foundation:: BOOL ; } ImpersonateLoggedOnUser ( htoken . into_param ( ) . abi ( ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct LUID_AND_ATTRIBUTES { pub Luid : super::System::SystemServices:: LUID , pub Attributes : TOKEN_PRIVILEGES_ATTRIBUTES } impl LUID_AND_ATTRIBUTES { } impl :: std :: default :: Default for LUID_AND_ATTRIBUTES { fn default ( ) -> Self { Self { Luid : :: std :: default :: Default :: default ( ) , Attributes : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for LUID_AND_ATTRIBUTES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "LUID_AND_ATTRIBUTES" ) . field ( "Luid" , & self . Luid ) . field ( "Attributes" , & self . Attributes ) . finish ( ) } } impl :: std :: cmp :: PartialEq for LUID_AND_ATTRIBUTES { fn eq ( & self , other : & Self ) -> bool { self . Luid == other . Luid && self . Attributes == other . Attributes } } impl :: std :: cmp :: Eq for LUID_AND_ATTRIBUTES { } unsafe impl :: windows :: Abi for LUID_AND_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct SECURITY_ATTRIBUTES { pub nLength : u32 , pub lpSecurityDescriptor : * mut :: std :: ffi :: c_void , pub bInheritHandle : super::Foundation:: BOOL } impl SECURITY_ATTRIBUTES { } impl :: std :: default :: Default for SECURITY_ATTRIBUTES { fn default ( ) -> Self { Self { nLength : 0 , lpSecurityDescriptor : :: std :: ptr :: null_mut ( ) , bInheritHandle : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for SECURITY_ATTRIBUTES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "SECURITY_ATTRIBUTES" ) . field ( "nLength" , & self . nLength ) . field ( "lpSecurityDescriptor" , & self . lpSecurityDescriptor ) . field ( "bInheritHandle" , & self . bInheritHandle ) . finish ( ) } } impl :: std :: cmp :: PartialEq for SECURITY_ATTRIBUTES { fn eq ( & self , other : & Self ) -> bool { self . nLength == other . nLength && self . lpSecurityDescriptor == other . lpSecurityDescriptor && self . bInheritHandle == other . bInheritHandle } } impl :: std :: cmp :: Eq for SECURITY_ATTRIBUTES { } unsafe impl :: windows :: Abi for SECURITY_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct SECURITY_IMPERSONATION_LEVEL ( pub i32 ) ; pub const SecurityAnonymous : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 0i32 ) ; pub const SecurityIdentification : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 1i32 ) ; pub const SecurityImpersonation : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 2i32 ) ; pub const SecurityDelegation : SECURITY_IMPERSONATION_LEVEL = SECURITY_IMPERSONATION_LEVEL ( 3i32 ) ; impl :: std :: convert :: From < i32 > for SECURITY_IMPERSONATION_LEVEL { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for SECURITY_IMPERSONATION_LEVEL { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_ACCESS_MASK ( pub u32 ) ; pub const TOKEN_DELETE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 65536u32 ) ; pub const TOKEN_READ_CONTROL : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 131072u32 ) ; pub const TOKEN_WRITE_DAC : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 262144u32 ) ; pub const TOKEN_WRITE_OWNER : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 524288u32 ) ; pub const TOKEN_ACCESS_SYSTEM_SECURITY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 16777216u32 ) ; pub const TOKEN_ASSIGN_PRIMARY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 1u32 ) ; pub const TOKEN_DUPLICATE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 2u32 ) ; pub const TOKEN_IMPERSONATE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 4u32 ) ; pub const TOKEN_QUERY : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 8u32 ) ; pub const TOKEN_QUERY_SOURCE : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 16u32 ) ; pub const TOKEN_ADJUST_PRIVILEGES : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 32u32 ) ; pub const TOKEN_ADJUST_GROUPS : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 64u32 ) ; pub const TOKEN_ADJUST_DEFAULT : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 128u32 ) ; pub const TOKEN_ADJUST_SESSIONID : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 256u32 ) ; pub const TOKEN_ALL_ACCESS : TOKEN_ACCESS_MASK = TOKEN_ACCESS_MASK ( 983295u32 ) ; impl :: std :: convert :: From < u32 > for TOKEN_ACCESS_MASK { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_ACCESS_MASK { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for TOKEN_ACCESS_MASK { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for TOKEN_ACCESS_MASK { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for TOKEN_ACCESS_MASK { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for TOKEN_ACCESS_MASK { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct TOKEN_PRIVILEGES { pub PrivilegeCount : u32 , pub Privileges : [ LUID_AND_ATTRIBUTES ;1 ] } impl TOKEN_PRIVILEGES { } impl :: std :: default :: Default for TOKEN_PRIVILEGES { fn default ( ) -> Self { Self { PrivilegeCount : 0 , Privileges : [ :: std :: default :: Default :: default ( ) ;1 ] } } } impl :: std :: fmt :: Debug for TOKEN_PRIVILEGES { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "TOKEN_PRIVILEGES" ) . field ( "PrivilegeCount" , & self . PrivilegeCount ) . field ( "Privileges" , & self . Privileges ) . finish ( ) } } impl :: std :: cmp :: PartialEq for TOKEN_PRIVILEGES { fn eq ( & self , other : & Self ) -> bool { self . PrivilegeCount == other . PrivilegeCount && self . Privileges == other . Privileges } } impl :: std :: cmp :: Eq for TOKEN_PRIVILEGES { } unsafe impl :: windows :: Abi for TOKEN_PRIVILEGES { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_PRIVILEGES_ATTRIBUTES ( pub u32 ) ; pub const SE_PRIVILEGE_ENABLED : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 2u32 ) ; pub const SE_PRIVILEGE_ENABLED_BY_DEFAULT : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 1u32 ) ; pub const SE_PRIVILEGE_REMOVED : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 4u32 ) ; pub const SE_PRIVILEGE_USED_FOR_ACCESS : TOKEN_PRIVILEGES_ATTRIBUTES = TOKEN_PRIVILEGES_ATTRIBUTES ( 2147483648u32 ) ; impl :: std :: convert :: From < u32 > for TOKEN_PRIVILEGES_ATTRIBUTES { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_PRIVILEGES_ATTRIBUTES { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for TOKEN_PRIVILEGES_ATTRIBUTES { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for TOKEN_PRIVILEGES_ATTRIBUTES { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for TOKEN_PRIVILEGES_ATTRIBUTES { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for TOKEN_PRIVILEGES_ATTRIBUTES { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct TOKEN_TYPE ( pub i32 ) ; pub const TokenPrimary : TOKEN_TYPE = TOKEN_TYPE ( 1i32 ) ; pub const TokenImpersonation : TOKEN_TYPE = TOKEN_TYPE ( 2i32 ) ; impl :: std :: convert :: From < i32 > for TOKEN_TYPE { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for TOKEN_TYPE { type Abi = Self ; type DefaultType = Self ; } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod System { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod SystemServices { # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct LUID { pub LowPart : u32 , pub HighPart : i32 } impl LUID { } impl :: std :: default :: Default for LUID { fn default ( ) -> Self { Self { LowPart : 0 , HighPart : 0 } } } impl :: std :: fmt :: Debug for LUID { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "LUID" ) . field ( "LowPart" , & self . LowPart ) . field ( "HighPart" , & self . HighPart ) . finish ( ) } } impl :: std :: cmp :: PartialEq for LUID { fn eq ( & self , other : & Self ) -> bool { self . LowPart == other . LowPart && self . HighPart == other . HighPart } } impl :: std :: cmp :: Eq for LUID { } unsafe impl :: windows :: Abi for LUID { type Abi = Self ; type DefaultType = Self ; } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod Threading { # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct CREATE_PROCESS_LOGON_FLAGS ( pub u32 ) ; pub const LOGON_WITH_PROFILE : CREATE_PROCESS_LOGON_FLAGS = CREATE_PROCESS_LOGON_FLAGS ( 1u32 ) ; pub const LOGON_NETCREDENTIALS_ONLY : CREATE_PROCESS_LOGON_FLAGS = CREATE_PROCESS_LOGON_FLAGS ( 2u32 ) ; impl :: std :: convert :: From < u32 > for CREATE_PROCESS_LOGON_FLAGS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for CREATE_PROCESS_LOGON_FLAGS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for CREATE_PROCESS_LOGON_FLAGS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for CREATE_PROCESS_LOGON_FLAGS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for CREATE_PROCESS_LOGON_FLAGS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for CREATE_PROCESS_LOGON_FLAGS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } pub unsafe fn CreateProcessWithTokenW < 'a , > ( htoken : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HANDLE > , dwlogonflags : CREATE_PROCESS_LOGON_FLAGS , lpapplicationname : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , lpcommandline : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , dwcreationflags : u32 , lpenvironment : * mut :: std :: ffi :: c_void , lpcurrentdirectory : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PWSTR > , lpstartupinfo : * mut STARTUPINFOW , lpprocessinformation : * mut PROCESS_INFORMATION , ) -> super::super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn CreateProcessWithTokenW ( htoken : super::super::Foundation:: HANDLE , dwlogonflags : CREATE_PROCESS_LOGON_FLAGS , lpapplicationname : super::super::Foundation:: PWSTR , lpcommandline : super::super::Foundation:: PWSTR , dwcreationflags : u32 , lpenvironment : * mut :: std :: ffi :: c_void , lpcurrentdirectory : super::super::Foundation:: PWSTR , lpstartupinfo : * mut STARTUPINFOW , lpprocessinformation : * mut PROCESS_INFORMATION ) -> super::super::Foundation:: BOOL ; } CreateProcessWithTokenW ( htoken . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwlogonflags ) , lpapplicationname . into_param ( ) . abi ( ) , lpcommandline . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwcreationflags ) , :: std :: mem :: transmute ( lpenvironment ) , lpcurrentdirectory . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( lpstartupinfo ) , :: std :: mem :: transmute ( lpprocessinformation ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentProcess < > ( ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentProcess ( ) -> super::super::Foundation:: HANDLE ; } GetCurrentProcess ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentProcessId < > ( ) -> u32 { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentProcessId ( ) -> u32 ; } GetCurrentProcessId ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn GetCurrentThread < > ( ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn GetCurrentThread ( ) -> super::super::Foundation:: HANDLE ; } GetCurrentThread ( ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn OpenProcess < 'a , > ( dwdesiredaccess : PROCESS_ACCESS_RIGHTS , binherithandle : impl :: windows :: IntoParam < 'a , super::super::Foundation:: BOOL > , dwprocessid : u32 , ) -> super::super::Foundation:: HANDLE { # [ cfg ( windows ) ] { # [ link ( name ="KERNEL32" ) ] extern "system" { fn OpenProcess ( dwdesiredaccess : PROCESS_ACCESS_RIGHTS , binherithandle : super::super::Foundation:: BOOL , dwprocessid : u32 ) -> super::super::Foundation:: HANDLE ; } OpenProcess ( :: std :: mem :: transmute ( dwdesiredaccess ) , binherithandle . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( dwprocessid ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } pub unsafe fn OpenProcessToken < 'a , > ( processhandle : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HANDLE > , desiredaccess : super::super::Security:: TOKEN_ACCESS_MASK , tokenhandle : * mut super::super::Foundation:: HANDLE , ) -> super::super::Foundation:: BOOL { # [ cfg ( windows ) ] { # [ link ( name ="ADVAPI32" ) ] extern "system" { fn OpenProcessToken ( processhandle : super::super::Foundation:: HANDLE , desiredaccess : super::super::Security:: TOKEN_ACCESS_MASK , tokenhandle : * mut super::super::Foundation:: HANDLE ) -> super::super::Foundation:: BOOL ; } OpenProcessToken ( processhandle . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( desiredaccess ) , :: std :: mem :: transmute ( tokenhandle ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct PROCESS_ACCESS_RIGHTS ( pub u32 ) ; pub const PROCESS_TERMINATE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1u32 ) ; pub const PROCESS_CREATE_THREAD : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2u32 ) ; pub const PROCESS_SET_SESSIONID : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 4u32 ) ; pub const PROCESS_VM_OPERATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 8u32 ) ; pub const PROCESS_VM_READ : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 16u32 ) ; pub const PROCESS_VM_WRITE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 32u32 ) ; pub const PROCESS_DUP_HANDLE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 64u32 ) ; pub const PROCESS_CREATE_PROCESS : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 128u32 ) ; pub const PROCESS_SET_QUOTA : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 256u32 ) ; pub const PROCESS_SET_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 512u32 ) ; pub const PROCESS_QUERY_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1024u32 ) ; pub const PROCESS_SUSPEND_RESUME : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2048u32 ) ; pub const PROCESS_QUERY_LIMITED_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 4096u32 ) ; pub const PROCESS_SET_LIMITED_INFORMATION : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 8192u32 ) ; pub const PROCESS_ALL_ACCESS : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 2097151u32 ) ; pub const PROCESS_DELETE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 65536u32 ) ; pub const PROCESS_READ_CONTROL : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 131072u32 ) ; pub const PROCESS_WRITE_DAC : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 262144u32 ) ; pub const PROCESS_WRITE_OWNER : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 524288u32 ) ; pub const PROCESS_SYNCHRONIZE : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 1048576u32 ) ; pub const PROCESS_STANDARD_RIGHTS_REQUIRED : PROCESS_ACCESS_RIGHTS = PROCESS_ACCESS_RIGHTS ( 983040u32 ) ; impl :: std :: convert :: From < u32 > for PROCESS_ACCESS_RIGHTS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for PROCESS_ACCESS_RIGHTS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for PROCESS_ACCESS_RIGHTS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for PROCESS_ACCESS_RIGHTS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for PROCESS_ACCESS_RIGHTS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for PROCESS_ACCESS_RIGHTS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct PROCESS_INFORMATION { pub hProcess : super::super::Foundation:: HANDLE , pub hThread : super::super::Foundation:: HANDLE , pub dwProcessId : u32 , pub dwThreadId : u32 } impl PROCESS_INFORMATION { } impl :: std :: default :: Default for PROCESS_INFORMATION { fn default ( ) -> Self { Self { hProcess : :: std :: default :: Default :: default ( ) , hThread : :: std :: default :: Default :: default ( ) , dwProcessId : 0 , dwThreadId : 0 } } } impl :: std :: fmt :: Debug for PROCESS_INFORMATION { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "PROCESS_INFORMATION" ) . field ( "hProcess" , & self . hProcess ) . field ( "hThread" , & self . hThread ) . field ( "dwProcessId" , & self . dwProcessId ) . field ( "dwThreadId" , & self . dwThreadId ) . finish ( ) } } impl :: std :: cmp :: PartialEq for PROCESS_INFORMATION { fn eq ( & self , other : & Self ) -> bool { self . hProcess == other . hProcess && self . hThread == other . hThread && self . dwProcessId == other . dwProcessId && self . dwThreadId == other . dwThreadId } } impl :: std :: cmp :: Eq for PROCESS_INFORMATION { } unsafe impl :: windows :: Abi for PROCESS_INFORMATION { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: clone :: Clone , :: std :: marker :: Copy ) ] # [ repr ( C ) ] pub struct STARTUPINFOW { pub cb : u32 , pub lpReserved : super::super::Foundation:: PWSTR , pub lpDesktop : super::super::Foundation:: PWSTR , pub lpTitle : super::super::Foundation:: PWSTR , pub dwX : u32 , pub dwY : u32 , pub dwXSize : u32 , pub dwYSize : u32 , pub dwXCountChars : u32 , pub dwYCountChars : u32 , pub dwFillAttribute : u32 , pub dwFlags : STARTUPINFOW_FLAGS , pub wShowWindow : u16 , pub cbReserved2 : u16 , pub lpReserved2 : * mut u8 , pub hStdInput : super::super::Foundation:: HANDLE , pub hStdOutput : super::super::Foundation:: HANDLE , pub hStdError : super::super::Foundation:: HANDLE } impl STARTUPINFOW { } impl :: std :: default :: Default for STARTUPINFOW { fn default ( ) -> Self { Self { cb : 0 , lpReserved : :: std :: default :: Default :: default ( ) , lpDesktop : :: std :: default :: Default :: default ( ) , lpTitle : :: std :: default :: Default :: default ( ) , dwX : 0 , dwY : 0 , dwXSize : 0 , dwYSize : 0 , dwXCountChars : 0 , dwYCountChars : 0 , dwFillAttribute : 0 , dwFlags : :: std :: default :: Default :: default ( ) , wShowWindow : 0 , cbReserved2 : 0 , lpReserved2 : :: std :: ptr :: null_mut ( ) , hStdInput : :: std :: default :: Default :: default ( ) , hStdOutput : :: std :: default :: Default :: default ( ) , hStdError : :: std :: default :: Default :: default ( ) } } } impl :: std :: fmt :: Debug for STARTUPINFOW { fn fmt ( & self , fmt : & mut :: std :: fmt :: Formatter < '_ > ) -> :: std :: fmt :: Result { fmt . debug_struct ( "STARTUPINFOW" ) . field ( "cb" , & self . cb ) . field ( "lpReserved" , & self . lpReserved ) . field ( "lpDesktop" , & self . lpDesktop ) . field ( "lpTitle" , & self . lpTitle ) . field ( "dwX" , & self . dwX ) . field ( "dwY" , & self . dwY ) . field ( "dwXSize" , & self . dwXSize ) . field ( "dwYSize" , & self . dwYSize ) . field ( "dwXCountChars" , & self . dwXCountChars ) . field ( "dwYCountChars" , & self . dwYCountChars ) . field ( "dwFillAttribute" , & self . dwFillAttribute ) . field ( "dwFlags" , & self . dwFlags ) . field ( "wShowWindow" , & self . wShowWindow ) . field ( "cbReserved2" , & self . cbReserved2 ) . field ( "lpReserved2" , & self . lpReserved2 ) . field ( "hStdInput" , & self . hStdInput ) . field ( "hStdOutput" , & self . hStdOutput ) . field ( "hStdError" , & self . hStdError ) . finish ( ) } } impl :: std :: cmp :: PartialEq for STARTUPINFOW { fn eq ( & self , other : & Self ) -> bool { self . cb == other . cb && self . lpReserved == other . lpReserved && self . lpDesktop == other . lpDesktop && self . lpTitle == other . lpTitle && self . dwX == other . dwX && self . dwY == other . dwY && self . dwXSize == other . dwXSize && self . dwYSize == other . dwYSize && self . dwXCountChars == other . dwXCountChars && self . dwYCountChars == other . dwYCountChars && self . dwFillAttribute == other . dwFillAttribute && self . dwFlags == other . dwFlags && self . wShowWindow == other . wShowWindow && self . cbReserved2 == other . cbReserved2 && self . lpReserved2 == other . lpReserved2 && self . hStdInput == other . hStdInput && self . hStdOutput == other . hStdOutput && self . hStdError == other . hStdError } } impl :: std :: cmp :: Eq for STARTUPINFOW { } unsafe impl :: windows :: Abi for STARTUPINFOW { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct STARTUPINFOW_FLAGS ( pub u32 ) ; pub const STARTF_FORCEONFEEDBACK : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 64u32 ) ; pub const STARTF_FORCEOFFFEEDBACK : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 128u32 ) ; pub const STARTF_PREVENTPINNING : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 8192u32 ) ; pub const STARTF_RUNFULLSCREEN : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 32u32 ) ; pub const STARTF_TITLEISAPPID : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 4096u32 ) ; pub const STARTF_TITLEISLINKNAME : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 2048u32 ) ; pub const STARTF_UNTRUSTEDSOURCE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 32768u32 ) ; pub const STARTF_USECOUNTCHARS : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 8u32 ) ; pub const STARTF_USEFILLATTRIBUTE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 16u32 ) ; pub const STARTF_USEHOTKEY : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 512u32 ) ; pub const STARTF_USEPOSITION : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 4u32 ) ; pub const STARTF_USESHOWWINDOW : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 1u32 ) ; pub const STARTF_USESIZE : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 2u32 ) ; pub const STARTF_USESTDHANDLES : STARTUPINFOW_FLAGS = STARTUPINFOW_FLAGS ( 256u32 ) ; impl :: std :: convert :: From < u32 > for STARTUPINFOW_FLAGS { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for STARTUPINFOW_FLAGS { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for STARTUPINFOW_FLAGS { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for STARTUPINFOW_FLAGS { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for STARTUPINFOW_FLAGS { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for STARTUPINFOW_FLAGS { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } } } # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod UI { # [ allow ( unused_variables , non_upper_case_globals , non_snake_case , unused_unsafe , non_camel_case_types , dead_code , clippy :: all ) ] pub mod WindowsAndMessaging { # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct MESSAGEBOX_RESULT ( pub i32 ) ; pub const IDOK : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 1i32 ) ; pub const IDCANCEL : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 2i32 ) ; pub const IDABORT : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 3i32 ) ; pub const IDRETRY : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 4i32 ) ; pub const IDIGNORE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 5i32 ) ; pub const IDYES : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 6i32 ) ; pub const IDNO : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 7i32 ) ; pub const IDCLOSE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 8i32 ) ; pub const IDHELP : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 9i32 ) ; pub const IDTRYAGAIN : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 10i32 ) ; pub const IDCONTINUE : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 11i32 ) ; pub const IDASYNC : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 32001i32 ) ; pub const IDTIMEOUT : MESSAGEBOX_RESULT = MESSAGEBOX_RESULT ( 32000i32 ) ; impl :: std :: convert :: From < i32 > for MESSAGEBOX_RESULT { fn from ( value : i32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for MESSAGEBOX_RESULT { type Abi = Self ; type DefaultType = Self ; } # [ derive ( :: std :: cmp :: PartialEq , :: std :: cmp :: Eq , :: std :: marker :: Copy , :: std :: clone :: Clone , :: std :: default :: Default , :: std :: fmt :: Debug ) ] # [ repr ( transparent ) ] pub struct MESSAGEBOX_STYLE ( pub u32 ) ; pub const MB_ABORTRETRYIGNORE : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 2u32 ) ; pub const MB_CANCELTRYCONTINUE : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 6u32 ) ; pub const MB_HELP : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16384u32 ) ; pub const MB_OK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_OKCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 1u32 ) ; pub const MB_RETRYCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 5u32 ) ; pub const MB_YESNO : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 4u32 ) ; pub const MB_YESNOCANCEL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 3u32 ) ; pub const MB_ICONHAND : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_ICONQUESTION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 32u32 ) ; pub const MB_ICONEXCLAMATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 48u32 ) ; pub const MB_ICONASTERISK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 64u32 ) ; pub const MB_USERICON : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 128u32 ) ; pub const MB_ICONWARNING : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 48u32 ) ; pub const MB_ICONERROR : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_ICONINFORMATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 64u32 ) ; pub const MB_ICONSTOP : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 16u32 ) ; pub const MB_DEFBUTTON1 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_DEFBUTTON2 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 256u32 ) ; pub const MB_DEFBUTTON3 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 512u32 ) ; pub const MB_DEFBUTTON4 : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 768u32 ) ; pub const MB_APPLMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 0u32 ) ; pub const MB_SYSTEMMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 4096u32 ) ; pub const MB_TASKMODAL : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 8192u32 ) ; pub const MB_NOFOCUS : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 32768u32 ) ; pub const MB_SETFOREGROUND : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 65536u32 ) ; pub const MB_DEFAULT_DESKTOP_ONLY : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 131072u32 ) ; pub const MB_TOPMOST : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 262144u32 ) ; pub const MB_RIGHT : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 524288u32 ) ; pub const MB_RTLREADING : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 1048576u32 ) ; pub const MB_SERVICE_NOTIFICATION : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 2097152u32 ) ; pub const MB_SERVICE_NOTIFICATION_NT3X : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 262144u32 ) ; pub const MB_TYPEMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 15u32 ) ; pub const MB_ICONMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 240u32 ) ; pub const MB_DEFMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 3840u32 ) ; pub const MB_MODEMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 12288u32 ) ; pub const MB_MISCMASK : MESSAGEBOX_STYLE = MESSAGEBOX_STYLE ( 49152u32 ) ; impl :: std :: convert :: From < u32 > for MESSAGEBOX_STYLE { fn from ( value : u32 ) -> Self { Self ( value ) } } unsafe impl :: windows :: Abi for MESSAGEBOX_STYLE { type Abi = Self ; type DefaultType = Self ; } impl :: std :: ops :: BitOr for MESSAGEBOX_STYLE { type Output = Self ; fn bitor ( self , rhs : Self ) -> Self { Self ( self . 0 | rhs . 0 ) } } impl :: std :: ops :: BitAnd for MESSAGEBOX_STYLE { type Output = Self ; fn bitand ( self , rhs : Self ) -> Self { Self ( self . 0 & rhs . 0 ) } } impl :: std :: ops :: BitOrAssign for MESSAGEBOX_STYLE { fn bitor_assign ( & mut self , rhs : Self ) { self . 0 . bitor_assign ( rhs . 0 ) } } impl :: std :: ops :: BitAndAssign for MESSAGEBOX_STYLE { fn bitand_assign ( & mut self , rhs : Self ) { self . 0 . bitand_assign ( rhs . 0 ) } } pub unsafe fn MessageBoxA < 'a , > ( hwnd : impl :: windows :: IntoParam < 'a , super::super::Foundation:: HWND > , lptext : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PSTR > , lpcaption : impl :: windows :: IntoParam < 'a , super::super::Foundation:: PSTR > , utype : MESSAGEBOX_STYLE , ) -> MESSAGEBOX_RESULT { # [ cfg ( windows ) ] { # [ link ( name ="USER32" ) ] extern "system" { fn MessageBoxA ( hwnd : super::super::Foundation:: HWND , lptext : super::super::Foundation:: PSTR , lpcaption : super::super::Foundation:: PSTR , utype : MESSAGEBOX_STYLE ) -> MESSAGEBOX_RESULT ; } MessageBoxA ( hwnd . into_param ( ) . abi ( ) , lptext . into_param ( ) . abi ( ) , lpcaption . into_param ( ) . abi ( ) , :: std :: mem :: transmute ( utype ) ) } # [ cfg ( not ( windows ) ) ] unimplemented ! ( "Unsupported target OS" ) ; } } } } } [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 2 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking getsystem v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `AdjustTokenPrivileges`, `DuplicateTokenEx` [INFO] [stdout] --> src/main.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | DuplicateTokenEx, ImpersonateLoggedOnUser, AdjustTokenPrivileges, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CreateProcessWithTokenW`, `GetCurrentProcessId`, `GetCurrentProcess`, `GetCurrentThread` [INFO] [stdout] --> src/main.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | CreateProcessWithTokenW, OpenProcess, OpenProcessToken, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 7 | GetCurrentProcess, GetCurrentProcessId, GetCurrentThread, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AdjustTokenPrivileges`, `DuplicateTokenEx` [INFO] [stdout] --> src/main.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | DuplicateTokenEx, ImpersonateLoggedOnUser, AdjustTokenPrivileges, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CreateProcessWithTokenW`, `GetCurrentProcessId`, `GetCurrentProcess`, `GetCurrentThread` [INFO] [stdout] --> src/main.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | CreateProcessWithTokenW, OpenProcess, OpenProcessToken, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 7 | GetCurrentProcess, GetCurrentProcessId, GetCurrentThread, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ok` [INFO] [stdout] --> src/main.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let ok = OpenProcessToken( [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_ok` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ok` [INFO] [stdout] --> src/main.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let ok = OpenProcessToken( [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_ok` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `tokenH` should have a snake case name [INFO] [stdout] --> src/main.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | let tokenH = get_token_from_pid(1156); [INFO] [stdout] | ^^^^^^ help: convert the identifier to snake case: `token_h` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `tokenH` should have a snake case name [INFO] [stdout] --> src/main.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | let tokenH = get_token_from_pid(1156); [INFO] [stdout] | ^^^^^^ help: convert the identifier to snake case: `token_h` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `hProc` should have a snake case name [INFO] [stdout] --> src/main.rs:25:10 [INFO] [stdout] | [INFO] [stdout] 25 | let hProc = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid); [INFO] [stdout] | ^^^^^ help: convert the identifier to snake case: `h_proc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `hProc` should have a snake case name [INFO] [stdout] --> src/main.rs:25:10 [INFO] [stdout] | [INFO] [stdout] 25 | let hProc = OpenProcess(PROCESS_QUERY_INFORMATION, false, pid); [INFO] [stdout] | ^^^^^ help: convert the identifier to snake case: `h_proc` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `newHToken` should have a snake case name [INFO] [stdout] --> src/main.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | let newHToken: HANDLE = HANDLE(0); [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `new_htoken` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `newHToken` should have a snake case name [INFO] [stdout] --> src/main.rs:27:10 [INFO] [stdout] | [INFO] [stdout] 27 | let newHToken: HANDLE = HANDLE(0); [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `new_htoken` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 6 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 6 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.56s [INFO] running `Command { std: "docker" "inspect" "083208aee043e2373a0873f95c8ee3e2957dcd8ce9f5d858f1bdd54f0301d0d4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "083208aee043e2373a0873f95c8ee3e2957dcd8ce9f5d858f1bdd54f0301d0d4", kill_on_drop: false }` [INFO] [stdout] 083208aee043e2373a0873f95c8ee3e2957dcd8ce9f5d858f1bdd54f0301d0d4