| 1 |
// This file is autogenerated. |
| 2 |
// |
| 3 |
// To add bindings, edit windows_sys.lst then run: |
| 4 |
// |
| 5 |
// ``` |
| 6 |
// cd generate-windows-sys/ |
| 7 |
// cargo run |
| 8 |
// ``` |
| 9 |
// Bindings generated by `windows-bindgen` 0.55.0 |
| 10 |
|
| 11 |
#![allow( |
| 12 |
non_snake_case, |
| 13 |
non_upper_case_globals, |
| 14 |
non_camel_case_types, |
| 15 |
dead_code, |
| 16 |
clippy::all |
| 17 |
)] |
| 18 |
#[link(name = "advapi32")] |
| 19 |
extern "system" { |
| 20 |
pub fn RegCloseKey(hkey: HKEY) -> WIN32_ERROR; |
| 21 |
} |
| 22 |
#[link(name = "advapi32")] |
| 23 |
extern "system" { |
| 24 |
pub fn RegEnumKeyExW( |
| 25 |
hkey: HKEY, |
| 26 |
dwindex: u32, |
| 27 |
lpname: PWSTR, |
| 28 |
lpcchname: *mut u32, |
| 29 |
lpreserved: *const u32, |
| 30 |
lpclass: PWSTR, |
| 31 |
lpcchclass: *mut u32, |
| 32 |
lpftlastwritetime: *mut FILETIME, |
| 33 |
) -> WIN32_ERROR; |
| 34 |
} |
| 35 |
#[link(name = "advapi32")] |
| 36 |
extern "system" { |
| 37 |
pub fn RegOpenKeyExW( |
| 38 |
hkey: HKEY, |
| 39 |
lpsubkey: PCWSTR, |
| 40 |
uloptions: u32, |
| 41 |
samdesired: REG_SAM_FLAGS, |
| 42 |
phkresult: *mut HKEY, |
| 43 |
) -> WIN32_ERROR; |
| 44 |
} |
| 45 |
#[link(name = "advapi32")] |
| 46 |
extern "system" { |
| 47 |
pub fn RegQueryValueExW( |
| 48 |
hkey: HKEY, |
| 49 |
lpvaluename: PCWSTR, |
| 50 |
lpreserved: *const u32, |
| 51 |
lptype: *mut REG_VALUE_TYPE, |
| 52 |
lpdata: *mut u8, |
| 53 |
lpcbdata: *mut u32, |
| 54 |
) -> WIN32_ERROR; |
| 55 |
} |
| 56 |
#[link(name = "kernel32")] |
| 57 |
extern "system" { |
| 58 |
pub fn FreeLibrary(hlibmodule: HMODULE) -> BOOL; |
| 59 |
} |
| 60 |
#[link(name = "kernel32")] |
| 61 |
extern "system" { |
| 62 |
pub fn GetMachineTypeAttributes( |
| 63 |
machine: u16, |
| 64 |
machinetypeattributes: *mut MACHINE_ATTRIBUTES, |
| 65 |
) -> HRESULT; |
| 66 |
} |
| 67 |
#[link(name = "kernel32")] |
| 68 |
extern "system" { |
| 69 |
pub fn GetProcAddress(hmodule: HMODULE, lpprocname: PCSTR) -> FARPROC; |
| 70 |
} |
| 71 |
#[link(name = "kernel32")] |
| 72 |
extern "system" { |
| 73 |
pub fn LoadLibraryA(lplibfilename: PCSTR) -> HMODULE; |
| 74 |
} |
| 75 |
#[link(name = "kernel32")] |
| 76 |
extern "system" { |
| 77 |
pub fn OpenSemaphoreA(dwdesiredaccess: u32, binherithandle: BOOL, lpname: PCSTR) -> HANDLE; |
| 78 |
} |
| 79 |
#[link(name = "kernel32")] |
| 80 |
extern "system" { |
| 81 |
pub fn PeekNamedPipe( |
| 82 |
hnamedpipe: HANDLE, |
| 83 |
lpbuffer: *mut core::ffi::c_void, |
| 84 |
nbuffersize: u32, |
| 85 |
lpbytesread: *mut u32, |
| 86 |
lptotalbytesavail: *mut u32, |
| 87 |
lpbytesleftthismessage: *mut u32, |
| 88 |
) -> BOOL; |
| 89 |
} |
| 90 |
#[link(name = "kernel32")] |
| 91 |
extern "system" { |
| 92 |
pub fn ReleaseSemaphore( |
| 93 |
hsemaphore: HANDLE, |
| 94 |
lreleasecount: i32, |
| 95 |
lppreviouscount: *mut i32, |
| 96 |
) -> BOOL; |
| 97 |
} |
| 98 |
#[link(name = "kernel32")] |
| 99 |
extern "system" { |
| 100 |
pub fn WaitForSingleObject(hhandle: HANDLE, dwmilliseconds: u32) -> WAIT_EVENT; |
| 101 |
} |
| 102 |
#[link(name = "ole32")] |
| 103 |
extern "system" { |
| 104 |
pub fn CoCreateInstance( |
| 105 |
rclsid: *const GUID, |
| 106 |
punkouter: *mut core::ffi::c_void, |
| 107 |
dwclscontext: CLSCTX, |
| 108 |
riid: *const GUID, |
| 109 |
ppv: *mut *mut core::ffi::c_void, |
| 110 |
) -> HRESULT; |
| 111 |
} |
| 112 |
#[link(name = "ole32")] |
| 113 |
extern "system" { |
| 114 |
pub fn CoInitializeEx(pvreserved: *const core::ffi::c_void, dwcoinit: u32) -> HRESULT; |
| 115 |
} |
| 116 |
#[link(name = "oleaut32")] |
| 117 |
extern "system" { |
| 118 |
pub fn SysFreeString(bstrstring: BSTR); |
| 119 |
} |
| 120 |
#[link(name = "oleaut32")] |
| 121 |
extern "system" { |
| 122 |
pub fn SysStringLen(pbstr: BSTR) -> u32; |
| 123 |
} |
| 124 |
pub type ADVANCED_FEATURE_FLAGS = u16; |
| 125 |
pub type BOOL = i32; |
| 126 |
pub type BSTR = *const u16; |
| 127 |
pub type CLSCTX = u32; |
| 128 |
pub const CLSCTX_ALL: CLSCTX = 23u32; |
| 129 |
pub type COINIT = i32; |
| 130 |
pub const COINIT_MULTITHREADED: COINIT = 0i32; |
| 131 |
pub const ERROR_NO_MORE_ITEMS: WIN32_ERROR = 259u32; |
| 132 |
pub const ERROR_SUCCESS: WIN32_ERROR = 0u32; |
| 133 |
pub const FALSE: BOOL = 0i32; |
| 134 |
pub type FARPROC = Option<unsafe extern "system" fn() -> isize>; |
| 135 |
#[repr(C)] |
| 136 |
pub struct FILETIME { |
| 137 |
pub dwLowDateTime: u32, |
| 138 |
pub dwHighDateTime: u32, |
| 139 |
} |
| 140 |
impl Copy for FILETIME {} |
| 141 |
impl Clone for FILETIME { |
| 142 |
fn clone(&self) -> Self { |
| 143 |
*self |
| 144 |
} |
| 145 |
} |
| 146 |
pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32; |
| 147 |
pub type FILE_FLAGS_AND_ATTRIBUTES = u32; |
| 148 |
#[repr(C)] |
| 149 |
pub struct GUID { |
| 150 |
pub data1: u32, |
| 151 |
pub data2: u16, |
| 152 |
pub data3: u16, |
| 153 |
pub data4: [u8; 8], |
| 154 |
} |
| 155 |
impl Copy for GUID {} |
| 156 |
impl Clone for GUID { |
| 157 |
fn clone(&self) -> Self { |
| 158 |
*self |
| 159 |
} |
| 160 |
} |
| 161 |
impl GUID { |
| 162 |
pub const fn from_u128(uuid: u128) -> Self { |
| 163 |
Self { |
| 164 |
data1: (uuid >> 96) as u32, |
| 165 |
data2: (uuid >> 80 & 0xffff) as u16, |
| 166 |
data3: (uuid >> 64 & 0xffff) as u16, |
| 167 |
data4: (uuid as u64).to_be_bytes(), |
| 168 |
} |
| 169 |
} |
| 170 |
} |
| 171 |
pub type HANDLE = *mut core::ffi::c_void; |
| 172 |
pub type HKEY = *mut core::ffi::c_void; |
| 173 |
pub const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _; |
| 174 |
pub type HMODULE = *mut core::ffi::c_void; |
| 175 |
pub type HRESULT = i32; |
| 176 |
pub type IMAGE_FILE_MACHINE = u16; |
| 177 |
pub const IMAGE_FILE_MACHINE_AMD64: IMAGE_FILE_MACHINE = 34404u16; |
| 178 |
pub const KEY_READ: REG_SAM_FLAGS = 131097u32; |
| 179 |
pub const KEY_WOW64_32KEY: REG_SAM_FLAGS = 512u32; |
| 180 |
pub type MACHINE_ATTRIBUTES = i32; |
| 181 |
pub type PCSTR = *const u8; |
| 182 |
pub type PCWSTR = *const u16; |
| 183 |
pub type PWSTR = *mut u16; |
| 184 |
pub type REG_SAM_FLAGS = u32; |
| 185 |
pub const REG_SZ: REG_VALUE_TYPE = 1u32; |
| 186 |
pub type REG_VALUE_TYPE = u32; |
| 187 |
#[repr(C)] |
| 188 |
pub struct SAFEARRAY { |
| 189 |
pub cDims: u16, |
| 190 |
pub fFeatures: ADVANCED_FEATURE_FLAGS, |
| 191 |
pub cbElements: u32, |
| 192 |
pub cLocks: u32, |
| 193 |
pub pvData: *mut core::ffi::c_void, |
| 194 |
pub rgsabound: [SAFEARRAYBOUND; 1], |
| 195 |
} |
| 196 |
impl Copy for SAFEARRAY {} |
| 197 |
impl Clone for SAFEARRAY { |
| 198 |
fn clone(&self) -> Self { |
| 199 |
*self |
| 200 |
} |
| 201 |
} |
| 202 |
#[repr(C)] |
| 203 |
pub struct SAFEARRAYBOUND { |
| 204 |
pub cElements: u32, |
| 205 |
pub lLbound: i32, |
| 206 |
} |
| 207 |
impl Copy for SAFEARRAYBOUND {} |
| 208 |
impl Clone for SAFEARRAYBOUND { |
| 209 |
fn clone(&self) -> Self { |
| 210 |
*self |
| 211 |
} |
| 212 |
} |
| 213 |
pub const SEMAPHORE_MODIFY_STATE: SYNCHRONIZATION_ACCESS_RIGHTS = 2u32; |
| 214 |
pub type SYNCHRONIZATION_ACCESS_RIGHTS = u32; |
| 215 |
pub const S_FALSE: HRESULT = 0x1_u32 as _; |
| 216 |
pub const S_OK: HRESULT = 0x0_u32 as _; |
| 217 |
pub type THREAD_ACCESS_RIGHTS = u32; |
| 218 |
pub const THREAD_SYNCHRONIZE: THREAD_ACCESS_RIGHTS = 1048576u32; |
| 219 |
pub const UserEnabled: MACHINE_ATTRIBUTES = 1i32; |
| 220 |
pub const WAIT_ABANDONED: WAIT_EVENT = 128u32; |
| 221 |
pub type WAIT_EVENT = u32; |
| 222 |
pub const WAIT_FAILED: WAIT_EVENT = 4294967295u32; |
| 223 |
pub const WAIT_OBJECT_0: WAIT_EVENT = 0u32; |
| 224 |
pub const WAIT_TIMEOUT: WAIT_EVENT = 258u32; |
| 225 |
pub type WIN32_ERROR = u32; |