| 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.59.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 |
|
| 19 |
windows_targets::link!("ole32.dll" "system" fn CoCreateInstance(rclsid : *const GUID, punkouter : * mut core::ffi::c_void, dwclscontext : CLSCTX, riid : *const GUID, ppv : *mut *mut core::ffi::c_void) -> HRESULT); |
| 20 |
windows_targets::link!("ole32.dll" "system" fn CoInitializeEx(pvreserved : *const core::ffi::c_void, dwcoinit : u32) -> HRESULT); |
| 21 |
windows_targets::link!("kernel32.dll" "system" fn FreeLibrary(hlibmodule : HMODULE) -> BOOL); |
| 22 |
windows_targets::link!("kernel32.dll" "system" fn GetMachineTypeAttributes(machine : u16, machinetypeattributes : *mut MACHINE_ATTRIBUTES) -> HRESULT); |
| 23 |
windows_targets::link!("kernel32.dll" "system" fn GetProcAddress(hmodule : HMODULE, lpprocname : PCSTR) -> FARPROC); |
| 24 |
windows_targets::link!("kernel32.dll" "system" fn LoadLibraryA(lplibfilename : PCSTR) -> HMODULE); |
| 25 |
windows_targets::link!("kernel32.dll" "system" fn OpenSemaphoreA(dwdesiredaccess : u32, binherithandle : BOOL, lpname : PCSTR) -> HANDLE); |
| 26 |
windows_targets::link!("kernel32.dll" "system" fn PeekNamedPipe(hnamedpipe : HANDLE, lpbuffer : *mut core::ffi::c_void, nbuffersize : u32, lpbytesread : *mut u32, lptotalbytesavail : *mut u32, lpbytesleftthismessage : *mut u32) -> BOOL); |
| 27 |
windows_targets::link!("advapi32.dll" "system" fn RegCloseKey(hkey : HKEY) -> WIN32_ERROR); |
| 28 |
windows_targets::link!("advapi32.dll" "system" fn RegEnumKeyExW(hkey : HKEY, dwindex : u32, lpname : PWSTR, lpcchname : *mut u32, lpreserved : *const u32, lpclass : PWSTR, lpcchclass : *mut u32, lpftlastwritetime : *mut FILETIME) -> WIN32_ERROR); |
| 29 |
windows_targets::link!("advapi32.dll" "system" fn RegOpenKeyExW(hkey : HKEY, lpsubkey : PCWSTR, uloptions : u32, samdesired : REG_SAM_FLAGS, phkresult : *mut HKEY) -> WIN32_ERROR); |
| 30 |
windows_targets::link!("advapi32.dll" "system" fn RegQueryValueExW(hkey : HKEY, lpvaluename : PCWSTR, lpreserved : *const u32, lptype : *mut REG_VALUE_TYPE, lpdata : *mut u8, lpcbdata : *mut u32) -> WIN32_ERROR); |
| 31 |
windows_targets::link!("kernel32.dll" "system" fn ReleaseSemaphore(hsemaphore : HANDLE, lreleasecount : i32, lppreviouscount : *mut i32) -> BOOL); |
| 32 |
windows_targets::link!("oleaut32.dll" "system" fn SysFreeString(bstrstring : BSTR)); |
| 33 |
windows_targets::link!("oleaut32.dll" "system" fn SysStringLen(pbstr : BSTR) -> u32); |
| 34 |
windows_targets::link!("kernel32.dll" "system" fn WaitForSingleObject(hhandle : HANDLE, dwmilliseconds : u32) -> WAIT_EVENT); |
| 35 |
pub type ADVANCED_FEATURE_FLAGS = u16; |
| 36 |
pub type BOOL = i32; |
| 37 |
pub type BSTR = *const u16; |
| 38 |
pub type CLSCTX = u32; |
| 39 |
pub const CLSCTX_ALL: CLSCTX = 23u32; |
| 40 |
pub type COINIT = i32; |
| 41 |
pub const COINIT_MULTITHREADED: COINIT = 0i32; |
| 42 |
pub const ERROR_NO_MORE_ITEMS: WIN32_ERROR = 259u32; |
| 43 |
pub const ERROR_SUCCESS: WIN32_ERROR = 0u32; |
| 44 |
pub const FALSE: BOOL = 0i32; |
| 45 |
pub type FARPROC = Option<unsafe extern "system" fn() -> isize>; |
| 46 |
#[repr(C)] |
| 47 |
#[derive(Clone, Copy)] |
| 48 |
pub struct FILETIME { |
| 49 |
pub dwLowDateTime: u32, |
| 50 |
pub dwHighDateTime: u32, |
| 51 |
} |
| 52 |
pub const FILE_ATTRIBUTE_TEMPORARY: FILE_FLAGS_AND_ATTRIBUTES = 256u32; |
| 53 |
pub type FILE_FLAGS_AND_ATTRIBUTES = u32; |
| 54 |
#[repr(C)] |
| 55 |
#[derive(Clone, Copy)] |
| 56 |
pub struct GUID { |
| 57 |
pub data1: u32, |
| 58 |
pub data2: u16, |
| 59 |
pub data3: u16, |
| 60 |
pub data4: [u8; 8], |
| 61 |
} |
| 62 |
impl GUID { |
| 63 |
pub const fn from_u128(uuid: u128) -> Self { |
| 64 |
Self { |
| 65 |
data1: (uuid >> 96) as u32, |
| 66 |
data2: (uuid >> 80 & 0xffff) as u16, |
| 67 |
data3: (uuid >> 64 & 0xffff) as u16, |
| 68 |
data4: (uuid as u64).to_be_bytes(), |
| 69 |
} |
| 70 |
} |
| 71 |
} |
| 72 |
pub type HANDLE = *mut core::ffi::c_void; |
| 73 |
pub type HINSTANCE = *mut core::ffi::c_void; |
| 74 |
pub type HKEY = *mut core::ffi::c_void; |
| 75 |
pub const HKEY_LOCAL_MACHINE: HKEY = -2147483646i32 as _; |
| 76 |
pub type HMODULE = *mut core::ffi::c_void; |
| 77 |
pub type HRESULT = i32; |
| 78 |
pub type IMAGE_FILE_MACHINE = u16; |
| 79 |
pub const IMAGE_FILE_MACHINE_AMD64: IMAGE_FILE_MACHINE = 34404u16; |
| 80 |
pub const IID_IUnknown: GUID = GUID::from_u128(0x00000000_0000_0000_c000_000000000046); |
| 81 |
#[repr(C)] |
| 82 |
pub struct IUnknown_Vtbl { |
| 83 |
pub QueryInterface: unsafe extern "system" fn( |
| 84 |
this: *mut core::ffi::c_void, |
| 85 |
iid: *const GUID, |
| 86 |
interface: *mut *mut core::ffi::c_void, |
| 87 |
) -> HRESULT, |
| 88 |
pub AddRef: unsafe extern "system" fn(this: *mut core::ffi::c_void) -> u32, |
| 89 |
pub Release: unsafe extern "system" fn(this: *mut core::ffi::c_void) -> u32, |
| 90 |
} |
| 91 |
pub const KEY_READ: REG_SAM_FLAGS = 131097u32; |
| 92 |
pub const KEY_WOW64_32KEY: REG_SAM_FLAGS = 512u32; |
| 93 |
pub type MACHINE_ATTRIBUTES = i32; |
| 94 |
pub type PCSTR = *const u8; |
| 95 |
pub type PCWSTR = *const u16; |
| 96 |
pub type PWSTR = *mut u16; |
| 97 |
pub type REG_SAM_FLAGS = u32; |
| 98 |
pub const REG_SZ: REG_VALUE_TYPE = 1u32; |
| 99 |
pub type REG_VALUE_TYPE = u32; |
| 100 |
#[repr(C)] |
| 101 |
#[derive(Clone, Copy)] |
| 102 |
pub struct SAFEARRAY { |
| 103 |
pub cDims: u16, |
| 104 |
pub fFeatures: ADVANCED_FEATURE_FLAGS, |
| 105 |
pub cbElements: u32, |
| 106 |
pub cLocks: u32, |
| 107 |
pub pvData: *mut core::ffi::c_void, |
| 108 |
pub rgsabound: [SAFEARRAYBOUND; 1], |
| 109 |
} |
| 110 |
#[repr(C)] |
| 111 |
#[derive(Clone, Copy)] |
| 112 |
pub struct SAFEARRAYBOUND { |
| 113 |
pub cElements: u32, |
| 114 |
pub lLbound: i32, |
| 115 |
} |
| 116 |
pub const SEMAPHORE_MODIFY_STATE: SYNCHRONIZATION_ACCESS_RIGHTS = 2u32; |
| 117 |
pub type SYNCHRONIZATION_ACCESS_RIGHTS = u32; |
| 118 |
pub const S_FALSE: HRESULT = 0x1_u32 as _; |
| 119 |
pub const S_OK: HRESULT = 0x0_u32 as _; |
| 120 |
pub type THREAD_ACCESS_RIGHTS = u32; |
| 121 |
pub const THREAD_SYNCHRONIZE: THREAD_ACCESS_RIGHTS = 1048576u32; |
| 122 |
pub const UserEnabled: MACHINE_ATTRIBUTES = 1i32; |
| 123 |
pub const WAIT_ABANDONED: WAIT_EVENT = 128u32; |
| 124 |
pub type WAIT_EVENT = u32; |
| 125 |
pub const WAIT_FAILED: WAIT_EVENT = 4294967295u32; |
| 126 |
pub const WAIT_OBJECT_0: WAIT_EVENT = 0u32; |
| 127 |
pub const WAIT_TIMEOUT: WAIT_EVENT = 258u32; |
| 128 |
pub type WIN32_ERROR = u32; |
| 129 |
|
| 130 |
#[link(name = "advapi32")] |
| 131 |
#[link(name = "ole32")] |
| 132 |
#[link(name = "oleaut32")] |
| 133 |
extern "C" {} |
| 134 |
use super::windows_targets; |