├── .gitignore ├── Cargo.toml ├── LICENSE ├── README.md └── src ├── lib.rs └── um ├── accctrl.rs ├── aclapi.rs ├── adhoc.rs ├── appmgmt.rs ├── audioclient.rs ├── audiosessiontypes.rs ├── avrt.rs ├── bits.rs ├── bits10_1.rs ├── bits1_5.rs ├── bits2_0.rs ├── bits2_5.rs ├── bits3_0.rs ├── bits4_0.rs ├── bits5_0.rs ├── bitscfg.rs ├── bitsmsg.rs ├── bluetoothapis.rs ├── bluetoothleapis.rs ├── bthledef.rs ├── cfgmgr32.rs ├── cguid.rs ├── combaseapi.rs ├── coml2api.rs ├── commapi.rs ├── commctrl.rs ├── commdlg.rs ├── commoncontrols.rs ├── consoleapi.rs ├── corsym.rs ├── d2d1.rs ├── d2d1_1.rs ├── d2d1_2.rs ├── d2d1_3.rs ├── d2d1effectauthor.rs ├── d2d1effects.rs ├── d2d1effects_1.rs ├── d2d1effects_2.rs ├── d2d1svg.rs ├── d2dbasetypes.rs ├── d3d.rs ├── d3d10.rs ├── d3d10_1.rs ├── d3d10_1shader.rs ├── d3d10effect.rs ├── d3d10misc.rs ├── d3d10sdklayers.rs ├── d3d10shader.rs ├── d3d11.rs ├── d3d11_1.rs ├── d3d11_2.rs ├── d3d11_3.rs ├── d3d11_4.rs ├── d3d11on12.rs ├── d3d11sdklayers.rs ├── d3d11shader.rs ├── d3d11tokenizedprogramformat.rs ├── d3d12.rs ├── d3d12sdklayers.rs ├── d3d12shader.rs ├── d3dcommon.rs ├── d3dcompiler.rs ├── d3dcsx.rs ├── d3dx10core.rs ├── d3dx10math.rs ├── d3dx10mesh.rs ├── datetimeapi.rs ├── davclnt.rs ├── dbghelp.rs ├── dbt.rs ├── dcommon.rs ├── dcomp.rs ├── dcompanimation.rs ├── dde.rs ├── ddraw.rs ├── ddrawi.rs ├── ddrawint.rs ├── debugapi.rs ├── devicetopology.rs ├── dinput.rs ├── dispex.rs ├── dmksctl.rs ├── dmusicc.rs ├── docobj.rs ├── documenttarget.rs ├── dot1x.rs ├── dpa_dsa.rs ├── dpapi.rs ├── dsgetdc.rs ├── dsound.rs ├── dsrole.rs ├── dvp.rs ├── dwmapi.rs ├── dwrite.rs ├── dwrite_1.rs ├── dwrite_2.rs ├── dwrite_3.rs ├── dxdiag.rs ├── dxfile.rs ├── dxgidebug.rs ├── dxva2api.rs ├── dxvahd.rs ├── eaptypes.rs ├── enclaveapi.rs ├── endpointvolume.rs ├── errhandlingapi.rs ├── evntcons.rs ├── exdisp.rs ├── fibersapi.rs ├── fileapi.rs ├── functiondiscoverykeys_devpkey.rs ├── handleapi.rs ├── heapapi.rs ├── highlevelmonitorconfigurationapi.rs ├── http.rs ├── imm.rs ├── interlockedapi.rs ├── ioapiset.rs ├── ipexport.rs ├── iphlpapi.rs ├── iptypes.rs ├── jobapi.rs ├── jobapi2.rs ├── ktmw32.rs ├── l2cmn.rs ├── libloaderapi.rs ├── lmaccess.rs ├── lmalert.rs ├── lmapibuf.rs ├── lmat.rs ├── lmdfs.rs ├── lmerrlog.rs ├── lmjoin.rs ├── lmmsg.rs ├── lmremutl.rs ├── lmrepl.rs ├── lmserver.rs ├── lmshare.rs ├── lmstats.rs ├── lmsvc.rs ├── lmuse.rs ├── lmwksta.rs ├── lowlevelmonitorconfigurationapi.rs ├── lsalookup.rs ├── memoryapi.rs ├── minschannel.rs ├── minwinbase.rs ├── mmdeviceapi.rs ├── mmeapi.rs ├── mmsystem.rs ├── mod.rs ├── msaatext.rs ├── mscat.rs ├── mschapp.rs ├── mssip.rs ├── mswsock.rs ├── namedpipeapi.rs ├── namespaceapi.rs ├── nb30.rs ├── ncrypt.rs ├── ntlsa.rs ├── ntsecapi.rs ├── oaidl.rs ├── objbase.rs ├── objidl.rs ├── objidlbase.rs ├── ocidl.rs ├── ole2.rs ├── oleauto.rs ├── olectl.rs ├── oleidl.rs ├── opmapi.rs ├── pdh.rs ├── perflib.rs ├── physicalmonitorenumerationapi.rs ├── playsoundapi.rs ├── portabledevice.rs ├── portabledeviceapi.rs ├── portabledevicetypes.rs ├── powerbase.rs ├── powersetting.rs ├── powrprof.rs ├── processenv.rs ├── processsnapshot.rs ├── processthreadsapi.rs ├── processtopologyapi.rs ├── profileapi.rs ├── propidl.rs ├── propkey.rs ├── propkeydef.rs ├── propsys.rs ├── prsht.rs ├── psapi.rs ├── realtimeapiset.rs ├── reason.rs ├── restartmanager.rs ├── restrictederrorinfo.rs ├── rmxfguid.rs ├── rtinfo.rs ├── sapi.rs ├── sapi51.rs ├── sapi53.rs ├── sapiddk.rs ├── sapiddk51.rs ├── schannel.rs ├── securityappcontainer.rs ├── securitybaseapi.rs ├── servprov.rs ├── setupapi.rs ├── shellapi.rs ├── shellscalingapi.rs ├── shlobj.rs ├── shobjidl.rs ├── shobjidl_core.rs ├── shtypes.rs ├── softpub.rs ├── spapidef.rs ├── spellcheck.rs ├── sporder.rs ├── sql.rs ├── sqlext.rs ├── sqltypes.rs ├── sqlucode.rs ├── sspi.rs ├── stringapiset.rs ├── strmif.rs ├── subauth.rs ├── synchapi.rs ├── sysinfoapi.rs ├── systemtopologyapi.rs ├── taskschd.rs ├── textstor.rs ├── threadpoolapiset.rs ├── threadpoollegacyapiset.rs ├── timeapi.rs ├── timezoneapi.rs ├── tlhelp32.rs ├── unknwnbase.rs ├── urlhist.rs ├── urlmon.rs ├── userenv.rs ├── usp10.rs ├── utilapiset.rs ├── uxtheme.rs ├── vsbackup.rs ├── vss.rs ├── vsserror.rs ├── vswriter.rs ├── wbemads.rs ├── wbemcli.rs ├── wbemdisp.rs ├── wbemprov.rs ├── wbemtran.rs ├── wct.rs ├── werapi.rs ├── winbase.rs ├── wincodec.rs ├── wincodecsdk.rs ├── wincon.rs ├── wincontypes.rs ├── wincred.rs ├── wincrypt.rs ├── windowsceip.rs ├── winefs.rs ├── winevt.rs ├── wingdi.rs ├── winhttp.rs ├── wininet.rs ├── winineti.rs ├── winioctl.rs ├── winnetwk.rs ├── winnls.rs ├── winnt.rs ├── winreg.rs ├── winsafer.rs ├── winscard.rs ├── winsmcrd.rs ├── winsock2.rs ├── winspool.rs ├── winsvc.rs ├── wintrust.rs ├── winusb.rs ├── winuser.rs ├── winver.rs ├── wlanapi.rs ├── wlanihv.rs ├── wlanihvtypes.rs ├── wlclient.rs ├── wow64apiset.rs ├── wpdmtpextensions.rs ├── ws2bth.rs ├── ws2spi.rs ├── ws2tcpip.rs ├── wtsapi32.rs └── xinput.rs /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dynamic-winapi" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | winapi = { version = "0.3", features = ["errhandlingapi", "heapapi", "memoryapi", "psapi", "winbase"] } 10 | obfstr = "0.3" 11 | 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 postrequest 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # dynamic-winapi 2 | 3 | Provide raw FFI bindings to the Windows API by dynamically loading DLLs and resolving the functions with [GetProcAddress](https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getprocaddress). 4 | 5 | This project is not a replacement for the [winapi-rs](https://github.com/retep998/winapi-rs) crate and you will more than likely require it if you use this project. 6 | 7 | ## Example 8 | 9 | Cargo.toml 10 | ```toml 11 | [dependencies] 12 | base64 = "0.13" 13 | dynamic-winapi = { git = "https://github.com/postrequest/dynamic-winapi", branch = "main" } 14 | winapi = { version = "0.3", features = [] } 15 | ``` 16 | main.rs: 17 | ```Rust 18 | use dynamic_winapi::um::{ 19 | processthreadsapi::{CreateRemoteThreadEx, OpenProcess}, 20 | memoryapi::{VirtualAllocEx, VirtualProtectEx, WriteProcessMemory}, 21 | }; 22 | use winapi::ctypes::c_void; 23 | use winapi::um::winnt::{ 24 | MEM_COMMIT, PAGE_EXECUTE_READ, PAGE_READWRITE, PROCESS_ALL_ACCESS, 25 | }; 26 | 27 | fn main() { 28 | // insert target PID 29 | let pid = 5100; 30 | // insert base64 encoded shellcode 31 | let shellcode_b64 = ""; 32 | let mut shellcode = base64::decode(shellcode_b64).unwrap(); 33 | let shellcode_ptr: *mut c_void = shellcode.as_mut_ptr() as *mut c_void; 34 | 35 | // get process handle 36 | let handle = unsafe {OpenProcess().unwrap()( 37 | PROCESS_ALL_ACCESS, 38 | 0x01, 39 | pid 40 | )}; 41 | 42 | // alloc payload 43 | let addr_shellcode = unsafe {VirtualAllocEx().unwrap()( 44 | handle, 45 | 0 as _, 46 | shellcode.len(), 47 | MEM_COMMIT, 48 | PAGE_READWRITE 49 | )}; 50 | let mut ret_len: usize = 0; 51 | let _ = unsafe {WriteProcessMemory().unwrap()( 52 | handle, 53 | addr_shellcode, 54 | shellcode_ptr, 55 | shellcode.len(), 56 | &mut ret_len 57 | )}; 58 | 59 | // protect and execute 60 | let mut old_protect: u32 = 0; 61 | let _ = unsafe {VirtualProtectEx().unwrap()( 62 | handle, 63 | addr_shellcode, 64 | shellcode.len(), 65 | PAGE_EXECUTE_READ, 66 | &mut old_protect 67 | )}; 68 | let _ = unsafe {CreateRemoteThreadEx().unwrap()( 69 | handle, 70 | 0 as _, 71 | 0, 72 | std::mem::transmute(addr_shellcode), 73 | 0 as _, 74 | 0, 75 | 0 as _, 76 | 0 as _ 77 | )}; 78 | } 79 | ``` 80 | 81 | ## Feedback 82 | 83 | Feel free to file an issue or make a request for APIs [here](https://github.com/postrequest/dynamic-winapi/issues/new). 84 | 85 | ## Acknowledgments 86 | [@retep998](https://github.com/retep998) for [winapi-rs](https://github.com/retep998/winapi-rs). This project would not have been possible without this, so if you use `dynamic-winapi` or [winapi-rs](https://github.com/retep998/winapi-rs), please consider supporting [@retep998](https://github.com/retep998) [here](https://patreon.com/retep998). 87 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | use std::ffi::OsStr; 2 | use std::os::windows::ffi::OsStrExt; 3 | use winapi::{ 4 | shared::minwindef::{FARPROC, HMODULE}, 5 | um::libloaderapi::{GetProcAddress, LoadLibraryW}, 6 | }; 7 | 8 | pub mod um; 9 | 10 | pub fn get_dll(dll_name: &str) -> HMODULE { 11 | let handle = unsafe { LoadLibraryW(get_wide(dll_name).as_ptr()) }; 12 | if handle.is_null() { 13 | return 0 as _ 14 | } 15 | handle 16 | } 17 | 18 | pub fn get_fn(dll: HMODULE, fn_name: &str) -> FARPROC { 19 | let func = unsafe { GetProcAddress(dll, fn_name.as_ptr() as _) }; 20 | if func.is_null() { 21 | return 0 as _ 22 | } 23 | func 24 | } 25 | 26 | pub fn get_k32_fn(fn_name: &str) -> FARPROC { 27 | let k32_handle = get_dll(obfstr::obfstr!("kernel32.dll")); 28 | get_fn(k32_handle, fn_name) 29 | } 30 | 31 | pub fn get_advapi32_fn(fn_name: &str) -> FARPROC { 32 | let dll_handle = get_dll(obfstr::obfstr!("advapi32.dll")); 33 | get_fn(dll_handle, fn_name) 34 | } 35 | 36 | pub fn get_wide(s: &str) -> Vec { 37 | OsStr::new(s).encode_wide().chain(std::iter::once(0)).collect() 38 | } 39 | -------------------------------------------------------------------------------- /src/um/audiosessiontypes.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::DWORD; 7 | ENUM!{enum AUDCLNT_SHAREMODE { 8 | AUDCLNT_SHAREMODE_SHARED, 9 | AUDCLNT_SHAREMODE_EXCLUSIVE, 10 | }} 11 | ENUM!{enum AUDIO_STREAM_CATEGORY { 12 | AudioCategory_Other = 0, 13 | AudioCategory_ForegroundOnlyMedia = 1, 14 | AudioCategory_BackgroundCapableMedia = 2, 15 | AudioCategory_Communications = 3, 16 | AudioCategory_Alerts = 4, 17 | AudioCategory_SoundEffects = 5, 18 | AudioCategory_GameEffects = 6, 19 | AudioCategory_GameMedia = 7, 20 | AudioCategory_GameChat = 8, 21 | AudioCategory_Speech = 9, 22 | AudioCategory_Movie = 10, 23 | AudioCategory_Media = 11, 24 | }} 25 | pub const AUDCLNT_STREAMFLAGS_CROSSPROCESS: DWORD = 0x00010000; 26 | pub const AUDCLNT_STREAMFLAGS_LOOPBACK: DWORD = 0x00020000; 27 | pub const AUDCLNT_STREAMFLAGS_EVENTCALLBACK: DWORD = 0x00040000; 28 | pub const AUDCLNT_STREAMFLAGS_NOPERSIST: DWORD = 0x00080000; 29 | pub const AUDCLNT_STREAMFLAGS_RATEADJUST: DWORD = 0x00100000; 30 | pub const AUDCLNT_SESSIONFLAGS_EXPIREWHENUNOWNED: DWORD = 0x10000000; 31 | pub const AUDCLNT_SESSIONFLAGS_DISPLAY_HIDE: DWORD = 0x20000000; 32 | pub const AUDCLNT_SESSIONFLAGS_DISPLAY_HIDEWHENEXPIRED: DWORD = 0x40000000; 33 | ENUM!{enum AudioSessionState { 34 | AudioSessionStateInactive = 0, 35 | AudioSessionStateActive = 1, 36 | AudioSessionStateExpired = 2, 37 | }} 38 | -------------------------------------------------------------------------------- /src/um/avrt.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_longlong; 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::{BOOL, LPDWORD, PULONG}; 9 | use um::winnt::{HANDLE, LPCSTR, LPCWSTR, PHANDLE, PLARGE_INTEGER}; 10 | ENUM!{enum AVRT_PRIORITY { 11 | AVRT_PRIORITY_VERYLOW = -2i32 as u32, 12 | AVRT_PRIORITY_LOW, 13 | AVRT_PRIORITY_NORMAL = 0, 14 | AVRT_PRIORITY_HIGH, 15 | AVRT_PRIORITY_CRITICAL, 16 | }} 17 | pub const THREAD_ORDER_GROUP_INFINITE_TIMEOUT: c_longlong = -1; 18 | extern "system" { 19 | pub fn AvSetMmThreadCharacteristicsA( 20 | TaskName: LPCSTR, 21 | TaskIndex: LPDWORD, 22 | ) -> HANDLE; 23 | pub fn AvSetMmThreadCharacteristicsW( 24 | TaskName: LPCWSTR, 25 | TaskIndex: LPDWORD, 26 | ) -> HANDLE; 27 | pub fn AvSetMmMaxThreadCharacteristicsA( 28 | FirstTask: LPCSTR, 29 | SecondTask: LPCSTR, 30 | TaskIndex: LPDWORD, 31 | ) -> HANDLE; 32 | pub fn AvSetMmMaxThreadCharacteristicsW( 33 | FirstTask: LPCWSTR, 34 | SecondTask: LPCWSTR, 35 | TaskIndex: LPDWORD, 36 | ) -> HANDLE; 37 | pub fn AvRevertMmThreadCharacteristics( 38 | avrt_handle: HANDLE, 39 | ) -> BOOL; 40 | pub fn AvSetMmThreadPriority( 41 | AvrtHandle: HANDLE, 42 | Priority: AVRT_PRIORITY, 43 | ) -> BOOL; 44 | pub fn AvRtCreateThreadOrderingGroup( 45 | Context: PHANDLE, 46 | Period: PLARGE_INTEGER, 47 | ThreadOrderingGuid: *mut GUID, 48 | Timeout: PLARGE_INTEGER, 49 | ) -> BOOL; 50 | pub fn AvRtCreateThreadOrderingGroupExA( 51 | Context: PHANDLE, 52 | Period: PLARGE_INTEGER, 53 | ThreadOrderingGuid: *mut GUID, 54 | Timeout: PLARGE_INTEGER, 55 | TaskName: LPCSTR, 56 | )-> BOOL; 57 | pub fn AvRtCreateThreadOrderingGroupExW( 58 | Context: PHANDLE, 59 | Period: PLARGE_INTEGER, 60 | ThreadOrderingGuid: *mut GUID, 61 | Timeout: PLARGE_INTEGER, 62 | TaskName: LPCWSTR, 63 | ) -> BOOL; 64 | pub fn AvRtJoinThreadOrderingGroup( 65 | Context: PHANDLE, 66 | ThreadOrderingGuid: *mut GUID, 67 | Before: BOOL, 68 | ) -> BOOL; 69 | pub fn AvRtWaitOnThreadOrderingGroup( 70 | Context: HANDLE, 71 | ) -> BOOL; 72 | pub fn AvRtLeaveThreadOrderingGroup( 73 | Context: HANDLE, 74 | ) -> BOOL; 75 | pub fn AvRtDeleteThreadOrderingGroup( 76 | Context: HANDLE, 77 | ) -> BOOL; 78 | pub fn AvQuerySystemResponsiveness( 79 | AvrtHandle: HANDLE, 80 | SystemResponsivenessValue: PULONG, 81 | ) -> BOOL; 82 | } 83 | -------------------------------------------------------------------------------- /src/um/bits10_1.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::UINT64; 7 | use shared::minwindef::DWORD; 8 | use um::bits::{IBackgroundCopyFile, IBackgroundCopyJob}; 9 | use um::bits2_0::BG_FILE_RANGE; 10 | use um::bits3_0::{IBackgroundCopyCallback2, IBackgroundCopyCallback2Vtbl}; 11 | use um::bits5_0::{IBackgroundCopyFile5, IBackgroundCopyFile5Vtbl}; 12 | use um::winnt::HRESULT; 13 | RIDL!{#[uuid(0x98c97bd2, 0xe32b, 0x4ad8, 0xa5, 0x28, 0x95, 0xfd, 0x8b, 0x16, 0xbd, 0x42)] 14 | interface IBackgroundCopyCallback3(IBackgroundCopyCallback3Vtbl): 15 | IBackgroundCopyCallback2(IBackgroundCopyCallback2Vtbl) { 16 | fn FileRangesTransferred( 17 | job: *mut IBackgroundCopyJob, 18 | file: *mut IBackgroundCopyFile, 19 | rangeCount: DWORD, 20 | ranges: *const BG_FILE_RANGE, 21 | ) -> HRESULT, 22 | }} 23 | RIDL!{#[uuid(0xcf6784f7, 0xd677, 0x49fd, 0x93, 0x68, 0xcb, 0x47, 0xae, 0xe9, 0xd1, 0xad)] 24 | interface IBackgroundCopyFile6(IBackgroundCopyFile6Vtbl): 25 | IBackgroundCopyFile5(IBackgroundCopyFile5Vtbl) { 26 | fn UpdateDownloadPosition( 27 | offset: UINT64, 28 | ) -> HRESULT, 29 | fn RequestFileRanges( 30 | rangeCount: DWORD, 31 | ranges: *const BG_FILE_RANGE, 32 | ) -> HRESULT, 33 | fn GetFilledFileRanges( 34 | rangeCount: *mut DWORD, 35 | ranges: *mut *mut BG_FILE_RANGE, 36 | ) -> HRESULT, 37 | }} 38 | -------------------------------------------------------------------------------- /src/um/bits1_5.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::UINT64; 7 | use shared::rpcndr::byte; 8 | use um::bits::{IBackgroundCopyJob, IBackgroundCopyJobVtbl}; 9 | use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; 10 | STRUCT!{struct BG_JOB_REPLY_PROGRESS { 11 | BytesTotal: UINT64, 12 | BytesTransferred: UINT64, 13 | }} 14 | ENUM!{enum BG_AUTH_TARGET { 15 | BG_AUTH_TARGET_SERVER = 1, 16 | BG_AUTH_TARGET_PROXY = BG_AUTH_TARGET_SERVER + 1, 17 | }} 18 | ENUM!{enum BG_AUTH_SCHEME { 19 | BG_AUTH_SCHEME_BASIC = 1, 20 | BG_AUTH_SCHEME_DIGEST = BG_AUTH_SCHEME_BASIC + 1, 21 | BG_AUTH_SCHEME_NTLM = BG_AUTH_SCHEME_DIGEST + 1, 22 | BG_AUTH_SCHEME_NEGOTIATE = BG_AUTH_SCHEME_NTLM + 1, 23 | BG_AUTH_SCHEME_PASSPORT = BG_AUTH_SCHEME_NEGOTIATE + 1, 24 | }} 25 | STRUCT!{struct BG_BASIC_CREDENTIALS { 26 | UserName: LPWSTR, 27 | Password: LPWSTR, 28 | }} 29 | UNION!{union BG_AUTH_CREDENTIALS_UNION { 30 | [usize; 2], 31 | Basic Basic_mut: BG_BASIC_CREDENTIALS, 32 | }} 33 | STRUCT!{struct BG_AUTH_CREDENTIALS { 34 | Target: BG_AUTH_TARGET, 35 | Scheme: BG_AUTH_SCHEME, 36 | Credentials: BG_AUTH_CREDENTIALS_UNION, 37 | }} 38 | pub type PBG_AUTH_CREDENTIALS = *mut BG_AUTH_CREDENTIALS; 39 | RIDL!{#[uuid(0x54b50739, 0x686f, 0x45eb, 0x9d, 0xff, 0xd6, 0xa9, 0xa0, 0xfa, 0xa9, 0xaf)] 40 | interface IBackgroundCopyJob2(IBackgroundCopyJob2Vtbl): 41 | IBackgroundCopyJob(IBackgroundCopyJobVtbl) { 42 | fn SetNotifyCmdLine( 43 | Program: LPCWSTR, 44 | Parameters: LPCWSTR, 45 | ) -> HRESULT, 46 | fn GetNotifyCmdLine( 47 | pProgram: *mut LPWSTR, 48 | pParameters: *mut LPWSTR, 49 | ) -> HRESULT, 50 | fn GetReplyProgress( 51 | pProgress: *mut BG_JOB_REPLY_PROGRESS, 52 | ) -> HRESULT, 53 | fn GetReplyData( 54 | ppBuffer: *mut *mut byte, 55 | pLength: *mut UINT64, 56 | ) -> HRESULT, 57 | fn SetReplyFileName( 58 | ReplyFileName: LPCWSTR, 59 | ) -> HRESULT, 60 | fn GetReplyFileName( 61 | pReplyFileName: *mut LPWSTR, 62 | ) -> HRESULT, 63 | fn SetCredentials( 64 | credentials: *mut BG_AUTH_CREDENTIALS, 65 | ) -> HRESULT, 66 | fn RemoveCredentials( 67 | Target: BG_AUTH_TARGET, 68 | Scheme: BG_AUTH_SCHEME, 69 | ) -> HRESULT, 70 | }} 71 | -------------------------------------------------------------------------------- /src/um/bits2_0.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::UINT64; 7 | use shared::minwindef::DWORD; 8 | use um::bits::{IBackgroundCopyFile, IBackgroundCopyFileVtbl}; 9 | use um::bits1_5::{IBackgroundCopyJob2, IBackgroundCopyJob2Vtbl}; 10 | use um::winnt::{HRESULT, LPCWSTR}; 11 | pub const BG_LENGTH_TO_EOF: UINT64 = -1i64 as u64; 12 | STRUCT!{struct BG_FILE_RANGE { 13 | InitialOffset: UINT64, 14 | Length: UINT64, 15 | }} 16 | pub const BG_COPY_FILE_OWNER: DWORD = 1; 17 | pub const BG_COPY_FILE_GROUP: DWORD = 2; 18 | pub const BG_COPY_FILE_DACL: DWORD = 4; 19 | pub const BG_COPY_FILE_SACL: DWORD = 8; 20 | pub const BG_COPY_FILE_ALL: DWORD = 15; 21 | RIDL!{#[uuid(0x443c8934, 0x90ff, 0x48ed, 0xbc, 0xde, 0x26, 0xf5, 0xc7, 0x45, 0x00, 0x42)] 22 | interface IBackgroundCopyJob3(IBackgroundCopyJob3Vtbl): 23 | IBackgroundCopyJob2(IBackgroundCopyJob2Vtbl) { 24 | fn ReplaceRemotePrefix( 25 | OldPrefix: LPCWSTR, 26 | NewPrefix: LPCWSTR, 27 | ) -> HRESULT, 28 | fn AddFileWithRanges( 29 | RemoteUrl: LPCWSTR, 30 | LocalName: LPCWSTR, 31 | RangeCount: DWORD, 32 | Ranges: *mut BG_FILE_RANGE, 33 | ) -> HRESULT, 34 | fn SetFileACLFlags( 35 | Flags: DWORD, 36 | ) -> HRESULT, 37 | fn GetFileACLFlags( 38 | Flags: *mut DWORD, 39 | ) -> HRESULT, 40 | }} 41 | RIDL!{#[uuid(0x83e81b93, 0x0873, 0x474d, 0x8a, 0x8c, 0xf2, 0x01, 0x8b, 0x1a, 0x93, 0x9c)] 42 | interface IBackgroundCopyFile2(IBackgroundCopyFile2Vtbl): 43 | IBackgroundCopyFile(IBackgroundCopyFileVtbl) { 44 | fn GetFileRanges( 45 | RangeCount: *mut DWORD, 46 | Ranges: *mut *mut BG_FILE_RANGE, 47 | ) -> HRESULT, 48 | fn SetRemoteName( 49 | Val: LPCWSTR, 50 | ) -> HRESULT, 51 | }} 52 | -------------------------------------------------------------------------------- /src/um/bits2_5.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::ULONG; 7 | use shared::rpcndr::byte; 8 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 9 | use um::winnt::{HRESULT, LPCWSTR, LPWSTR}; 10 | ENUM!{enum BG_CERT_STORE_LOCATION { 11 | BG_CERT_STORE_LOCATION_CURRENT_USER = 0, 12 | BG_CERT_STORE_LOCATION_LOCAL_MACHINE = BG_CERT_STORE_LOCATION_CURRENT_USER + 1, 13 | BG_CERT_STORE_LOCATION_CURRENT_SERVICE = BG_CERT_STORE_LOCATION_LOCAL_MACHINE + 1, 14 | BG_CERT_STORE_LOCATION_SERVICES = BG_CERT_STORE_LOCATION_CURRENT_SERVICE + 1, 15 | BG_CERT_STORE_LOCATION_USERS = BG_CERT_STORE_LOCATION_SERVICES + 1, 16 | BG_CERT_STORE_LOCATION_CURRENT_USER_GROUP_POLICY = BG_CERT_STORE_LOCATION_USERS + 1, 17 | BG_CERT_STORE_LOCATION_LOCAL_MACHINE_GROUP_POLICY 18 | = BG_CERT_STORE_LOCATION_CURRENT_USER_GROUP_POLICY + 1, 19 | BG_CERT_STORE_LOCATION_LOCAL_MACHINE_ENTERPRISE 20 | = BG_CERT_STORE_LOCATION_LOCAL_MACHINE_GROUP_POLICY + 1, 21 | }} 22 | RIDL!{#[uuid(0xf1bd1079, 0x9f01, 0x4bdc, 0x80, 0x36, 0xf0, 0x9b, 0x70, 0x09, 0x50, 0x66)] 23 | interface IBackgroundCopyJobHttpOptions(IBackgroundCopyJobHttpOptionsVtbl): 24 | IUnknown(IUnknownVtbl) { 25 | fn SetClientCertificateByID( 26 | StoreLocation: BG_CERT_STORE_LOCATION, 27 | StoreName: LPCWSTR, 28 | pCertHashBlob: *mut byte, 29 | ) -> HRESULT, 30 | fn SetClientCertificateByName( 31 | StoreLocation: BG_CERT_STORE_LOCATION, 32 | StoreName: LPCWSTR, 33 | SubjectName: LPCWSTR, 34 | ) -> HRESULT, 35 | fn RemoveClientCertificate() -> HRESULT, 36 | fn GetClientCertificate( 37 | pStoreLocation: *mut BG_CERT_STORE_LOCATION, 38 | pStoreName: *mut LPWSTR, 39 | ppCertHashBlob: *mut *mut byte, 40 | pSubjectName: *mut LPWSTR, 41 | ) -> HRESULT, 42 | fn SetCustomHeaders( 43 | RequestHeaders: LPCWSTR, 44 | ) -> HRESULT, 45 | fn GetCustomHeaders( 46 | pRequestHeaders: *mut LPWSTR, 47 | ) -> HRESULT, 48 | fn SetSecurityFlags( 49 | Flags: ULONG, 50 | ) -> HRESULT, 51 | fn GetSecurityFlags( 52 | pFlags: *mut ULONG, 53 | ) -> HRESULT, 54 | }} 55 | pub const BG_SSL_ENABLE_CRL_CHECK: ULONG = 0x0001; 56 | pub const BG_SSL_IGNORE_CERT_CN_INVALID: ULONG = 0x0002; 57 | pub const BG_SSL_IGNORE_CERT_DATE_INVALID: ULONG = 0x0004; 58 | pub const BG_SSL_IGNORE_UNKNOWN_CA: ULONG = 0x0008; 59 | pub const BG_SSL_IGNORE_CERT_WRONG_USAGE: ULONG = 0x0010; 60 | pub const BG_HTTP_REDIRECT_POLICY_MASK: ULONG = 0x0700; 61 | pub const BG_HTTP_REDIRECT_POLICY_ALLOW_SILENT: ULONG = 0x0000; 62 | pub const BG_HTTP_REDIRECT_POLICY_ALLOW_REPORT: ULONG = 0x0100; 63 | pub const BG_HTTP_REDIRECT_POLICY_DISALLOW: ULONG = 0x0200; 64 | pub const BG_HTTP_REDIRECT_POLICY_ALLOW_HTTPS_TO_HTTP: ULONG = 0x0800; 65 | -------------------------------------------------------------------------------- /src/um/bits4_0.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::PUINT64; 7 | use shared::minwindef::DWORD; 8 | use um::bits3_0::{IBackgroundCopyFile3, IBackgroundCopyFile3Vtbl}; 9 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 10 | use um::winnt::{HRESULT, LPWSTR}; 11 | RIDL!{#[uuid(0x9a2584c3, 0xf7d2, 0x457a, 0x9a, 0x5e, 0x22, 0xb6, 0x7b, 0xff, 0xc7, 0xd2)] 12 | interface IBitsTokenOptions(IBitsTokenOptionsVtbl): IUnknown(IUnknownVtbl) { 13 | fn SetHelperTokenFlags( 14 | UsageFlags: DWORD, 15 | ) -> HRESULT, 16 | fn GetHelperTokenFlags( 17 | pFlags: *mut DWORD, 18 | ) -> HRESULT, 19 | fn SetHelperToken() -> HRESULT, 20 | fn ClearHelperToken() -> HRESULT, 21 | fn GetHelperTokenSid( 22 | pSid: *mut LPWSTR, 23 | ) -> HRESULT, 24 | }} 25 | RIDL!{#[uuid(0xef7e0655, 0x7888, 0x4960, 0xb0, 0xe5, 0x73, 0x08, 0x46, 0xe0, 0x34, 0x92)] 26 | interface IBackgroundCopyFile4(IBackgroundCopyFile4Vtbl): 27 | IBackgroundCopyFile3(IBackgroundCopyFile3Vtbl) { 28 | fn GetPeerDownloadStats( 29 | pFromOrigin: PUINT64, 30 | pFromPeers: PUINT64, 31 | ) -> HRESULT, 32 | }} 33 | -------------------------------------------------------------------------------- /src/um/bitscfg.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::{c_uchar, c_ulong}; 7 | use shared::guiddef::REFIID; 8 | use shared::wtypes::BSTR; 9 | use um::oaidl::{IDispatch, IDispatchVtbl}; 10 | use um::unknwnbase::IUnknown; 11 | use um::winnt::HRESULT; 12 | RIDL!{#[uuid(0x29cfbbf7, 0x09e4, 0x4b97, 0xb0, 0xbc, 0xf2, 0x28, 0x7e, 0x3d, 0x8e, 0xb3)] 13 | interface IBITSExtensionSetup(IBITSExtensionSetupVtbl): IDispatch(IDispatchVtbl) { 14 | fn EnableBITSUploads() -> HRESULT, 15 | fn DisableBITSUploads() -> HRESULT, 16 | fn GetCleanupTaskName( 17 | pTaskName: *mut BSTR, 18 | ) -> HRESULT, 19 | fn GetCleanupTask( 20 | riid: REFIID, 21 | ppUnk: *mut *mut IUnknown, 22 | ) -> HRESULT, 23 | }} 24 | RIDL!{#[uuid(0xd5d2d542, 0x5503, 0x4e64, 0x8b, 0x48, 0x72, 0xef, 0x91, 0xa3, 0x2e, 0xe1)] 25 | interface IBITSExtensionSetupFactory(IBITSExtensionSetupFactoryVtbl): IDispatch(IDispatchVtbl) { 26 | fn GetObject( 27 | Path: BSTR, 28 | ppExtensionSetup: *mut *mut IBITSExtensionSetup, 29 | ) -> HRESULT, 30 | }} 31 | extern "system" { 32 | pub fn BSTR_UserSize( 33 | pFlags: *mut c_ulong, 34 | Offset: c_ulong, 35 | pBstr: *mut BSTR, 36 | ) -> c_ulong; 37 | pub fn BSTR_UserMarshal( 38 | pFlags: *mut c_ulong, 39 | pBuffer: *mut c_uchar, 40 | pBstr: *mut BSTR, 41 | ) -> *mut c_uchar; 42 | pub fn BSTR_UserUnmarshal( 43 | pFlags: *mut c_ulong, 44 | pBuffer: *mut c_uchar, 45 | pBstr: *mut BSTR, 46 | ) -> *mut c_uchar; 47 | pub fn BSTR_UserFree( 48 | pFlags: *mut c_ulong, 49 | pBstr: *mut BSTR, 50 | ); 51 | pub fn BSTR_UserSize64( 52 | pFlags: *mut c_ulong, 53 | Offset: c_ulong, 54 | pBstr: *mut BSTR, 55 | ) -> c_ulong; 56 | pub fn BSTR_UserMarshal64( 57 | pFlags: *mut c_ulong, 58 | pBuffer: *mut c_uchar, 59 | pBstr: *mut BSTR, 60 | ) -> *mut c_uchar; 61 | pub fn BSTR_UserUnmarshal64( 62 | pFlags: *mut c_ulong, 63 | pBuffer: *mut c_uchar, 64 | pBstr: *mut BSTR, 65 | ) -> *mut c_uchar; 66 | pub fn BSTR_UserFree64( 67 | pFlags: *mut c_ulong, 68 | pBstr: *mut BSTR, 69 | ); 70 | } 71 | -------------------------------------------------------------------------------- /src/um/coml2api.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! Structured storage, property sets, and related APIs. 7 | use shared::minwindef::DWORD; 8 | pub const STGM_READ: DWORD = 0x00000000; 9 | pub const STGM_WRITE: DWORD = 0x00000001; 10 | pub const STGM_READWRITE: DWORD = 0x00000002; 11 | -------------------------------------------------------------------------------- /src/um/commapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_char; 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD}; 8 | use um::minwinbase::LPOVERLAPPED; 9 | use um::winbase::{LPCOMMCONFIG, LPCOMMPROP, LPCOMMTIMEOUTS, LPCOMSTAT, LPDCB}; 10 | use um::winnt::HANDLE; 11 | extern "system" { 12 | pub fn ClearCommBreak( 13 | hFile: HANDLE, 14 | ) -> BOOL; 15 | pub fn ClearCommError( 16 | hFile: HANDLE, 17 | lpErrors: LPDWORD, 18 | lpStat: LPCOMSTAT, 19 | ) -> BOOL; 20 | pub fn SetupComm( 21 | hFile: HANDLE, 22 | dwInQueue: DWORD, 23 | dwOutQueue: DWORD, 24 | ) -> BOOL; 25 | pub fn EscapeCommFunction( 26 | hFile: HANDLE, 27 | dwFunc: DWORD, 28 | ) -> BOOL; 29 | pub fn GetCommConfig( 30 | hCommDev: HANDLE, 31 | lpCC: LPCOMMCONFIG, 32 | lpdwSize: LPDWORD, 33 | ) -> BOOL; 34 | pub fn GetCommMask( 35 | hFile: HANDLE, 36 | lpEvtMask: LPDWORD, 37 | ) -> BOOL; 38 | pub fn GetCommModemStatus( 39 | hFile: HANDLE, 40 | lpModemStat: LPDWORD, 41 | ) -> BOOL; 42 | pub fn GetCommProperties( 43 | hFile: HANDLE, 44 | lpCommProp: LPCOMMPROP, 45 | ) -> BOOL; 46 | pub fn GetCommState( 47 | hFile: HANDLE, 48 | lpDCB: LPDCB, 49 | ) -> BOOL; 50 | pub fn GetCommTimeouts( 51 | hFile: HANDLE, 52 | lpCommTimeouts: LPCOMMTIMEOUTS, 53 | ) -> BOOL; 54 | pub fn PurgeComm( 55 | hFile: HANDLE, 56 | dwFlags: DWORD, 57 | ) -> BOOL; 58 | pub fn SetCommBreak( 59 | hFile: HANDLE, 60 | ) -> BOOL; 61 | pub fn SetCommConfig( 62 | hCommDev: HANDLE, 63 | lpCC: LPCOMMCONFIG, 64 | dwSize: DWORD, 65 | ) -> BOOL; 66 | pub fn SetCommMask( 67 | hFile: HANDLE, 68 | dwEvtMask: DWORD, 69 | ) -> BOOL; 70 | pub fn SetCommState( 71 | hFile: HANDLE, 72 | lpDCB: LPDCB, 73 | ) -> BOOL; 74 | pub fn SetCommTimeouts( 75 | hFile: HANDLE, 76 | lpCommTimeouts: LPCOMMTIMEOUTS, 77 | ) -> BOOL; 78 | pub fn TransmitCommChar( 79 | hFile: HANDLE, 80 | cChar: c_char, 81 | ) -> BOOL; 82 | pub fn WaitCommEvent( 83 | hFile: HANDLE, 84 | lpEvtMask: LPDWORD, 85 | lpOverlapped: LPOVERLAPPED, 86 | ) -> BOOL; 87 | } 88 | -------------------------------------------------------------------------------- /src/um/consoleapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! ApiSet Contract for api-ms-win-core-console-l1 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, UINT}; 8 | use um::wincon::{PCONSOLE_READCONSOLE_CONTROL, PHANDLER_ROUTINE}; 9 | use um::wincontypes::{COORD, HPCON, PINPUT_RECORD}; 10 | use um::winnt::{HANDLE, HRESULT, VOID}; 11 | extern "system" { 12 | pub fn AllocConsole() -> BOOL; 13 | pub fn GetConsoleCP() -> UINT; 14 | pub fn GetConsoleMode( 15 | hConsoleHandle: HANDLE, 16 | lpMode: LPDWORD, 17 | ) -> BOOL; 18 | pub fn GetConsoleOutputCP() -> UINT; 19 | pub fn GetNumberOfConsoleInputEvents( 20 | hConsoleInput: HANDLE, 21 | lpNumberOfEvents: LPDWORD, 22 | ) -> BOOL; 23 | pub fn PeekConsoleInputA( 24 | hConsoleInput: HANDLE, 25 | lpBuffer: PINPUT_RECORD, 26 | nLength: DWORD, 27 | lpNumberOfEventsRead: LPDWORD, 28 | ) -> BOOL; 29 | pub fn ReadConsoleA( 30 | hConsoleInput: HANDLE, 31 | lpBuffer: LPVOID, 32 | nNumberOfCharsToRead: DWORD, 33 | lpNumberOfCharsRead: LPDWORD, 34 | pInputControl: PCONSOLE_READCONSOLE_CONTROL, 35 | ) -> BOOL; 36 | pub fn ReadConsoleW( 37 | hConsoleInput: HANDLE, 38 | lpBuffer: LPVOID, 39 | nNumberOfCharsToRead: DWORD, 40 | lpNumberOfCharsRead: LPDWORD, 41 | pInputControl: PCONSOLE_READCONSOLE_CONTROL, 42 | ) -> BOOL; 43 | pub fn ReadConsoleInputA( 44 | hConsoleInput: HANDLE, 45 | lpBuffer: PINPUT_RECORD, 46 | nLength: DWORD, 47 | lpNumberOfEventsRead: LPDWORD, 48 | ) -> BOOL; 49 | pub fn ReadConsoleInputW( 50 | hConsoleInput: HANDLE, 51 | lpBuffer: PINPUT_RECORD, 52 | nLength: DWORD, 53 | lpNumberOfEventsRead: LPDWORD, 54 | ) -> BOOL; 55 | pub fn SetConsoleCtrlHandler( 56 | HandlerRoutine: PHANDLER_ROUTINE, 57 | Add: BOOL, 58 | ) -> BOOL; 59 | pub fn SetConsoleMode( 60 | hConsoleHandle: HANDLE, 61 | dwMode: DWORD, 62 | ) -> BOOL; 63 | pub fn WriteConsoleA( 64 | hConsoleOutput: HANDLE, 65 | lpBuffer: *const VOID, 66 | nNumberOfCharsToWrite: DWORD, 67 | lpNumberOfCharsWritten: LPDWORD, 68 | lpReserved: LPVOID, 69 | ) -> BOOL; 70 | pub fn WriteConsoleW( 71 | hConsoleOutput: HANDLE, 72 | lpBuffer: *const VOID, 73 | nNumberOfCharsToWrite: DWORD, 74 | lpNumberOfCharsWritten: LPDWORD, 75 | lpReserved: LPVOID, 76 | ) -> BOOL; 77 | pub fn CreatePseudoConsole( 78 | size: COORD, 79 | hInput: HANDLE, 80 | hOutput: HANDLE, 81 | dwFlags: DWORD, 82 | phPC: *mut HPCON, 83 | ) -> HRESULT; 84 | pub fn ResizePseudoConsole( 85 | hPC: HPCON, 86 | size: COORD, 87 | ) -> HRESULT; 88 | pub fn ClosePseudoConsole( 89 | hPC: HPCON, 90 | ); 91 | } 92 | -------------------------------------------------------------------------------- /src/um/d2d1_2.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the contents of d2d1_2.h 7 | use shared::dxgi::IDXGIDevice; 8 | use shared::minwindef::FLOAT; 9 | use um::d2d1::{ID2D1Brush, ID2D1Geometry, ID2D1StrokeStyle}; 10 | use um::d2d1::{ID2D1Resource, ID2D1ResourceVtbl}; 11 | use um::d2d1_1::{D2D1_DEVICE_CONTEXT_OPTIONS, D2D1_PRIMITIVE_BLEND}; 12 | use um::d2d1_1::{ID2D1DeviceContext, ID2D1DeviceContextVtbl}; 13 | use um::d2d1_1::{ID2D1Device, ID2D1DeviceVtbl}; 14 | use um::d2d1_1::{ID2D1Factory1, ID2D1Factory1Vtbl}; 15 | use um::d2d1_1::{ID2D1CommandSink, ID2D1CommandSinkVtbl}; 16 | use um::winnt::HRESULT; 17 | ENUM!{enum D2D1_RENDERING_PRIORITY { 18 | D2D1_RENDERING_PRIORITY_NORMAL = 0, 19 | D2D1_RENDERING_PRIORITY_LOW = 1, 20 | D2D1_RENDERING_PRIORITY_FORCE_DWORD = 0xffffffff, 21 | }} 22 | RIDL!{#[uuid(0xa16907d7, 0xbc02, 0x4801, 0x99, 0xe8, 0x8c, 0xf7, 0xf4, 0x85, 0xf7, 0x74)] 23 | interface ID2D1GeometryRealization(ID2D1GeometryRealizationVtbl): 24 | ID2D1Resource(ID2D1ResourceVtbl) {}} 25 | RIDL!{#[uuid(0xd37f57e4, 0x6908, 0x459f, 0xa1, 0x99, 0xe7, 0x2f, 0x24, 0xf7, 0x99, 0x87)] 26 | interface ID2D1DeviceContext1(ID2D1DeviceContext1Vtbl): 27 | ID2D1DeviceContext(ID2D1DeviceContextVtbl) { 28 | fn CreateFilledGeometryRealization( 29 | geometry: *mut ID2D1Geometry, 30 | flatteningTolerance: FLOAT, 31 | geometryRealization: *mut *mut ID2D1GeometryRealization, 32 | ) -> HRESULT, 33 | fn CreateStrokedGeometryRealization( 34 | geometry: *mut ID2D1Geometry, 35 | flatteningTolerance: FLOAT, 36 | strokeWidth: FLOAT, 37 | strokeStyle: *mut ID2D1StrokeStyle, 38 | geometryRealization: *mut *mut ID2D1GeometryRealization, 39 | ) -> HRESULT, 40 | fn DrawGeometryRealization( 41 | geometryRealization: *mut ID2D1GeometryRealization, 42 | brush: *mut ID2D1Brush, 43 | ) -> (), 44 | }} 45 | RIDL!{#[uuid(0xd21768e1, 0x23a4, 0x4823, 0xa1, 0x4b, 0x7c, 0x3e, 0xba, 0x85, 0xd6, 0x58)] 46 | interface ID2D1Device1(ID2D1Device1Vtbl): ID2D1Device(ID2D1DeviceVtbl) { 47 | fn GetRenderingPriority() -> D2D1_RENDERING_PRIORITY, 48 | fn SetRenderingPriority( 49 | renderingPriority: D2D1_RENDERING_PRIORITY, 50 | ) -> (), 51 | fn CreateDeviceContext( 52 | options: D2D1_DEVICE_CONTEXT_OPTIONS, 53 | deviceContext1: *mut *mut ID2D1DeviceContext1, 54 | ) -> HRESULT, 55 | }} 56 | RIDL!{#[uuid(0x94f81a73, 0x9212, 0x4376, 0x9c, 0x58, 0xb1, 0x6a, 0x3a, 0x0d, 0x39, 0x92)] 57 | interface ID2D1Factory2(ID2D1Factory2Vtbl): ID2D1Factory1(ID2D1Factory1Vtbl) { 58 | fn CreateDevice( 59 | dxgiDevice: *mut IDXGIDevice, 60 | d2dDevice1: *mut *mut ID2D1Device1, 61 | ) -> HRESULT, 62 | }} 63 | RIDL!{#[uuid(0x9eb767fd, 0x4269, 0x4467, 0xb8, 0xc2, 0xeb, 0x30, 0xcb, 0x30, 0x57, 0x43)] 64 | interface ID2D1CommandSink1(ID2D1CommandSink1Vtbl): ID2D1CommandSink(ID2D1CommandSinkVtbl) { 65 | fn SetPrimitiveBlend1( 66 | primitiveBlend: D2D1_PRIMITIVE_BLEND, 67 | ) -> HRESULT, 68 | }} 69 | -------------------------------------------------------------------------------- /src/um/d2d1effects_1.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | // Mappings for the contents of d2d1effects_1.h 7 | DEFINE_GUID!{CLSID_D2D1YCbCr, 8 | 0x99503cc1, 0x66c7, 0x45c9, 0xa8, 0x75, 0x8a, 0xd8, 0xa7, 0x91, 0x44, 0x01} 9 | ENUM!{enum D2D1_YCBCR_PROP { 10 | D2D1_YCBCR_PROP_CHROMA_SUBSAMPLING = 0, 11 | D2D1_YCBCR_PROP_TRANSFORM_MATRIX = 1, 12 | D2D1_YCBCR_PROP_INTERPOLATION_MODE = 2, 13 | D2D1_YCBCR_PROP_FORCE_DWORD = 0xffffffff, 14 | }} 15 | ENUM!{enum D2D1_YCBCR_CHROMA_SUBSAMPLING { 16 | D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO = 0, 17 | D2D1_YCBCR_CHROMA_SUBSAMPLING_420 = 1, 18 | D2D1_YCBCR_CHROMA_SUBSAMPLING_422 = 2, 19 | D2D1_YCBCR_CHROMA_SUBSAMPLING_444 = 3, 20 | D2D1_YCBCR_CHROMA_SUBSAMPLING_440 = 4, 21 | D2D1_YCBCR_CHROMA_SUBSAMPLING_FORCE_DWORD = 0xffffffff, 22 | }} 23 | ENUM!{enum D2D1_YCBCR_INTERPOLATION_MODE { 24 | D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, 25 | D2D1_YCBCR_INTERPOLATION_MODE_LINEAR = 1, 26 | D2D1_YCBCR_INTERPOLATION_MODE_CUBIC = 2, 27 | D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, 28 | D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPIC = 4, 29 | D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, 30 | D2D1_YCBCR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, 31 | }} 32 | -------------------------------------------------------------------------------- /src/um/d2d1effects_2.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the contents of d2d1effects_2.h 7 | DEFINE_GUID!{CLSID_D2D1Contrast, 8 | 0xb648a78a, 0x0ed5, 0x4f80, 0xa9, 0x4a, 0x8e, 0x82, 0x5a, 0xca, 0x6b, 0x77} 9 | DEFINE_GUID!{CLSID_D2D1RgbToHue, 10 | 0x23f3e5ec, 0x91e8, 0x4d3d, 0xad, 0x0a, 0xaf, 0xad, 0xc1, 0x00, 0x4a, 0xa1} 11 | DEFINE_GUID!{CLSID_D2D1HueToRgb, 12 | 0x7b78a6bd, 0x0141, 0x4def, 0x8a, 0x52, 0x63, 0x56, 0xee, 0x0c, 0xbd, 0xd5} 13 | DEFINE_GUID!{CLSID_D2D1ChromaKey, 14 | 0x74c01f5b, 0x2a0d, 0x408c, 0x88, 0xe2, 0xc7, 0xa3, 0xc7, 0x19, 0x77, 0x42} 15 | DEFINE_GUID!{CLSID_D2D1Emboss, 16 | 0xb1c5eb2b, 0x0348, 0x43f0, 0x81, 0x07, 0x49, 0x57, 0xca, 0xcb, 0xa2, 0xae} 17 | DEFINE_GUID!{CLSID_D2D1Exposure, 18 | 0xb56c8cfa, 0xf634, 0x41ee, 0xbe, 0xe0, 0xff, 0xa6, 0x17, 0x10, 0x60, 0x04} 19 | DEFINE_GUID!{CLSID_D2D1Grayscale, 20 | 0x36dde0eb, 0x3725, 0x42e0, 0x83, 0x6d, 0x52, 0xfb, 0x20, 0xae, 0xe6, 0x44} 21 | DEFINE_GUID!{CLSID_D2D1Invert, 22 | 0xe0c3784d, 0xcb39, 0x4e84, 0xb6, 0xfd, 0x6b, 0x72, 0xf0, 0x81, 0x02, 0x63} 23 | DEFINE_GUID!{CLSID_D2D1Posterize, 24 | 0x2188945e, 0x33a3, 0x4366, 0xb7, 0xbc, 0x08, 0x6b, 0xd0, 0x2d, 0x08, 0x84} 25 | DEFINE_GUID!{CLSID_D2D1Sepia, 26 | 0x3a1af410, 0x5f1d, 0x4dbe, 0x84, 0xdf, 0x91, 0x5d, 0xa7, 0x9b, 0x71, 0x53} 27 | DEFINE_GUID!{CLSID_D2D1Sharpen, 28 | 0xc9b887cb, 0xc5ff, 0x4dc5, 0x97, 0x79, 0x27, 0x3d, 0xcf, 0x41, 0x7c, 0x7d} 29 | DEFINE_GUID!{CLSID_D2D1Straighten, 30 | 0x4da47b12, 0x79a3, 0x4fb0, 0x82, 0x37, 0xbb, 0xc3, 0xb2, 0xa4, 0xde, 0x08} 31 | DEFINE_GUID!{CLSID_D2D1TemperatureTint, 32 | 0x89176087, 0x8af9, 0x4a08, 0xae, 0xb1, 0x89, 0x5f, 0x38, 0xdb, 0x17, 0x66} 33 | DEFINE_GUID!{CLSID_D2D1Vignette, 34 | 0xc00c40be, 0x5e67, 0x4ca3, 0x95, 0xb4, 0xf4, 0xb0, 0x2c, 0x11, 0x51, 0x35} 35 | DEFINE_GUID!{CLSID_D2D1EdgeDetection, 36 | 0xeff583ca, 0xcb07, 0x4aa9, 0xac, 0x5d, 0x2c, 0xc4, 0x4c, 0x76, 0x46, 0x0f} 37 | DEFINE_GUID!{CLSID_D2D1HighlightsShadows, 38 | 0xcadc8384, 0x323f, 0x4c7e, 0xa3, 0x61, 0x2e, 0x2b, 0x24, 0xdf, 0x6e, 0xe4} 39 | DEFINE_GUID!{CLSID_D2D1LookupTable3D, 40 | 0x349e0eda, 0x0088, 0x4a79, 0x9c, 0xa3, 0xc7, 0xe3, 0x00, 0x20, 0x20, 0x20} 41 | -------------------------------------------------------------------------------- /src/um/d2dbasetypes.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the contents of d2dbasetypes.h 7 | use shared::d3d9types::D3DCOLORVALUE; 8 | // FIXME: Remove in next major version 9 | pub use um::dcommon::{ 10 | D2D1_MATRIX_3X2_F, D2D1_POINT_2F, D2D1_POINT_2L, D2D1_POINT_2U, D2D1_RECT_F, D2D1_RECT_L, 11 | D2D1_RECT_U, D2D1_SIZE_F, D2D1_SIZE_U, D2D_MATRIX_3X2_F, D2D_MATRIX_4X3_F, D2D_MATRIX_4X4_F, 12 | D2D_MATRIX_5X4_F, D2D_POINT_2F, D2D_POINT_2L, D2D_POINT_2U, D2D_RECT_F, D2D_RECT_L, D2D_RECT_U, 13 | D2D_SIZE_F, D2D_SIZE_U, D2D_VECTOR_2F, D2D_VECTOR_3F, D2D_VECTOR_4F, 14 | }; 15 | pub type D2D_COLOR_F = D3DCOLORVALUE; 16 | -------------------------------------------------------------------------------- /src/um/d3d.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_IDirect3D, 7 | 0x3bba0080, 0x2421, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 8 | DEFINE_GUID!{IID_IDirect3D2, 9 | 0x6aae1ec1, 0x662a, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 10 | DEFINE_GUID!{IID_IDirect3D3, 11 | 0xbb223240, 0xe72b, 0x11d0, 0xa9, 0xb4, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e} 12 | DEFINE_GUID!{IID_IDirect3D7, 13 | 0xf5049e77, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 14 | DEFINE_GUID!{IID_IDirect3DRampDevice, 15 | 0xf2086b20, 0x259f, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 16 | DEFINE_GUID!{IID_IDirect3DRGBDevice, 17 | 0xa4665c60, 0x2673, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 18 | DEFINE_GUID!{IID_IDirect3DHALDevice, 19 | 0x84e63de0, 0x46aa, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} 20 | DEFINE_GUID!{IID_IDirect3DMMXDevice, 21 | 0x881949a1, 0xd6f3, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 22 | DEFINE_GUID!{IID_IDirect3DRefDevice, 23 | 0x50936643, 0x13e9, 0x11d1, 0x89, 0xaa, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 24 | DEFINE_GUID!{IID_IDirect3DNullDevice, 25 | 0x8767df22, 0xbacc, 0x11d1, 0x89, 0x69, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 26 | DEFINE_GUID!{IID_IDirect3DTnLHalDevice, 27 | 0xf5049e78, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 28 | DEFINE_GUID!{IID_IDirect3DDevice, 29 | 0x64108800, 0x957d, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 30 | DEFINE_GUID!{IID_IDirect3DDevice2, 31 | 0x93281501, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 32 | DEFINE_GUID!{IID_IDirect3DDevice3, 33 | 0xb0ab3b60, 0x33d7, 0x11d1, 0xa9, 0x81, 0x00, 0xc0, 0x4f, 0xd7, 0xb1, 0x74} 34 | DEFINE_GUID!{IID_IDirect3DDevice7, 35 | 0xf5049e79, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 36 | DEFINE_GUID!{IID_IDirect3DTexture, 37 | 0x2cdcd9e0, 0x25a0, 0x11cf, 0xa3, 0x1a, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 38 | DEFINE_GUID!{IID_IDirect3DTexture2, 39 | 0x93281502, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 40 | DEFINE_GUID!{IID_IDirect3DLight, 41 | 0x4417c142, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} 42 | DEFINE_GUID!{IID_IDirect3DMaterial, 43 | 0x4417c144, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} 44 | DEFINE_GUID!{IID_IDirect3DIndexBuffer8, 45 | 0x0e689c9a, 0x053d, 0x44a0, 0x9d, 0x92, 0xdb, 0x0e, 0x3d, 0x75, 0x0f, 0x86} 46 | DEFINE_GUID!{IID_IDirect3DMaterial2, 47 | 0x93281503, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 48 | DEFINE_GUID!{IID_IDirect3DMaterial3, 49 | 0xca9c46f4, 0xd3c5, 0x11d1, 0xb7, 0x5a, 0x00, 0x60, 0x08, 0x52, 0xb3, 0x12} 50 | DEFINE_GUID!{IID_IDirect3DExecuteBuffer, 51 | 0x4417c145, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} 52 | DEFINE_GUID!{IID_IDirect3DViewport, 53 | 0x4417c146, 0x33ad, 0x11cf, 0x81, 0x6f, 0x00, 0x00, 0xc0, 0x20, 0x15, 0x6e} 54 | DEFINE_GUID!{IID_IDirect3DViewport2, 55 | 0x93281500, 0x8cf8, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 56 | DEFINE_GUID!{IID_IDirect3DViewport3, 57 | 0xb0ab3b61, 0x33d7, 0x11d1, 0xa9, 0x81, 0x00, 0xc0, 0x4f, 0xd7, 0xb1, 0x74} 58 | DEFINE_GUID!{IID_IDirect3DVertexBuffer, 59 | 0x7a503555, 0x4a83, 0x11d1, 0xa5, 0xdb, 0x00, 0xa0, 0xc9, 0x03, 0x67, 0xf8} 60 | DEFINE_GUID!{IID_IDirect3DVertexBuffer7, 61 | 0xf5049e7d, 0x4861, 0x11d2, 0xa4, 0x07, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 62 | -------------------------------------------------------------------------------- /src/um/d3d10.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use um::d3dcommon::{D3D_PRIMITIVE, D3D_PRIMITIVE_TOPOLOGY, D3D_SRV_DIMENSION}; 7 | pub type D3D10_PRIMITIVE_TOPOLOGY = D3D_PRIMITIVE_TOPOLOGY; 8 | pub type D3D10_PRIMITIVE = D3D_PRIMITIVE; 9 | pub type D3D10_SRV_DIMENSION = D3D_SRV_DIMENSION; 10 | DEFINE_GUID!{IID_ID3D10DeviceChild, 11 | 0x9b7e4c00, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 12 | DEFINE_GUID!{IID_ID3D10DepthStencilState, 13 | 0x2b4b1cc8, 0xa4ad, 0x41f8, 0x83, 0x22, 0xca, 0x86, 0xfc, 0x3e, 0xc6, 0x75} 14 | DEFINE_GUID!{IID_ID3D10BlendState, 15 | 0xedad8d19, 0x8a35, 0x4d6d, 0x85, 0x66, 0x2e, 0xa2, 0x76, 0xcd, 0xe1, 0x61} 16 | DEFINE_GUID!{IID_ID3D10RasterizerState, 17 | 0xa2a07292, 0x89af, 0x4345, 0xbe, 0x2e, 0xc5, 0x3d, 0x9f, 0xbb, 0x6e, 0x9f} 18 | DEFINE_GUID!{IID_ID3D10Resource, 19 | 0x9b7e4c01, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 20 | DEFINE_GUID!{IID_ID3D10Buffer, 21 | 0x9b7e4c02, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 22 | DEFINE_GUID!{IID_ID3D10Texture1D, 23 | 0x9b7e4c03, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 24 | DEFINE_GUID!{IID_ID3D10Texture2D, 25 | 0x9b7e4c04, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 26 | DEFINE_GUID!{IID_ID3D10Texture3D, 27 | 0x9b7e4c05, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 28 | DEFINE_GUID!{IID_ID3D10View, 29 | 0xc902b03f, 0x60a7, 0x49ba, 0x99, 0x36, 0x2a, 0x3a, 0xb3, 0x7a, 0x7e, 0x33} 30 | DEFINE_GUID!{IID_ID3D10ShaderResourceView, 31 | 0x9b7e4c07, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 32 | DEFINE_GUID!{IID_ID3D10RenderTargetView, 33 | 0x9b7e4c08, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 34 | DEFINE_GUID!{IID_ID3D10DepthStencilView, 35 | 0x9b7e4c09, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 36 | DEFINE_GUID!{IID_ID3D10VertexShader, 37 | 0x9b7e4c0a, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 38 | DEFINE_GUID!{IID_ID3D10GeometryShader, 39 | 0x6316be88, 0x54cd, 0x4040, 0xab, 0x44, 0x20, 0x46, 0x1b, 0xc8, 0x1f, 0x68} 40 | DEFINE_GUID!{IID_ID3D10PixelShader, 41 | 0x4968b601, 0x9d00, 0x4cde, 0x83, 0x46, 0x8e, 0x7f, 0x67, 0x58, 0x19, 0xb6} 42 | DEFINE_GUID!{IID_ID3D10InputLayout, 43 | 0x9b7e4c0b, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 44 | DEFINE_GUID!{IID_ID3D10SamplerState, 45 | 0x9b7e4c0c, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 46 | DEFINE_GUID!{IID_ID3D10Asynchronous, 47 | 0x9b7e4c0d, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 48 | DEFINE_GUID!{IID_ID3D10Query, 49 | 0x9b7e4c0e, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 50 | DEFINE_GUID!{IID_ID3D10Predicate, 51 | 0x9b7e4c10, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 52 | DEFINE_GUID!{IID_ID3D10Counter, 53 | 0x9b7e4c11, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 54 | DEFINE_GUID!{IID_ID3D10Device, 55 | 0x9b7e4c0f, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 56 | DEFINE_GUID!{IID_ID3D10Multithread, 57 | 0x9b7e4e00, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 58 | -------------------------------------------------------------------------------- /src/um/d3d10_1.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3D10BlendState1, 7 | 0xedad8d99, 0x8a35, 0x4d6d, 0x85, 0x66, 0x2e, 0xa2, 0x76, 0xcd, 0xe1, 0x61} 8 | DEFINE_GUID!{IID_ID3D10ShaderResourceView1, 9 | 0x9b7e4c87, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 10 | DEFINE_GUID!{IID_ID3D10Device1, 11 | 0x9b7e4c8f, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 12 | -------------------------------------------------------------------------------- /src/um/d3d10_1shader.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3D10ShaderReflection1, 7 | 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47} 8 | -------------------------------------------------------------------------------- /src/um/d3d10effect.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3D10StateBlock, 7 | 0x0803425a, 0x57f5, 0x4dd6, 0x94, 0x65, 0xa8, 0x75, 0x70, 0x83, 0x4a, 0x08} 8 | DEFINE_GUID!{IID_ID3D10EffectType, 9 | 0x4e9e1ddc, 0xcd9d, 0x4772, 0xa8, 0x37, 0x00, 0x18, 0x0b, 0x9b, 0x88, 0xfd} 10 | DEFINE_GUID!{IID_ID3D10EffectVariable, 11 | 0xae897105, 0x00e6, 0x45bf, 0xbb, 0x8e, 0x28, 0x1d, 0xd6, 0xdb, 0x8e, 0x1b} 12 | DEFINE_GUID!{IID_ID3D10EffectScalarVariable, 13 | 0x00e48f7b, 0xd2c8, 0x49e8, 0xa8, 0x6c, 0x02, 0x2d, 0xee, 0x53, 0x43, 0x1f} 14 | DEFINE_GUID!{IID_ID3D10EffectVectorVariable, 15 | 0x62b98c44, 0x1f82, 0x4c67, 0xbc, 0xd0, 0x72, 0xcf, 0x8f, 0x21, 0x7e, 0x81} 16 | DEFINE_GUID!{IID_ID3D10EffectMatrixVariable, 17 | 0x50666c24, 0xb82f, 0x4eed, 0xa1, 0x72, 0x5b, 0x6e, 0x7e, 0x85, 0x22, 0xe0} 18 | DEFINE_GUID!{IID_ID3D10EffectStringVariable, 19 | 0x71417501, 0x8df9, 0x4e0a, 0xa7, 0x8a, 0x25, 0x5f, 0x97, 0x56, 0xba, 0xff} 20 | DEFINE_GUID!{IID_ID3D10EffectShaderResourceVariable, 21 | 0xc0a7157b, 0xd872, 0x4b1d, 0x80, 0x73, 0xef, 0xc2, 0xac, 0xd4, 0xb1, 0xfc} 22 | DEFINE_GUID!{IID_ID3D10EffectRenderTargetViewVariable, 23 | 0x28ca0cc3, 0xc2c9, 0x40bb, 0xb5, 0x7f, 0x67, 0xb7, 0x37, 0x12, 0x2b, 0x17} 24 | DEFINE_GUID!{IID_ID3D10EffectDepthStencilViewVariable, 25 | 0x3e02c918, 0xcc79, 0x4985, 0xb6, 0x22, 0x2d, 0x92, 0xad, 0x70, 0x16, 0x23} 26 | DEFINE_GUID!{IID_ID3D10EffectConstantBuffer, 27 | 0x56648f4d, 0xcc8b, 0x4444, 0xa5, 0xad, 0xb5, 0xa3, 0xd7, 0x6e, 0x91, 0xb3} 28 | DEFINE_GUID!{IID_ID3D10EffectShaderVariable, 29 | 0x80849279, 0xc799, 0x4797, 0x8c, 0x33, 0x04, 0x07, 0xa0, 0x7d, 0x9e, 0x06} 30 | DEFINE_GUID!{IID_ID3D10EffectBlendVariable, 31 | 0x1fcd2294, 0xdf6d, 0x4eae, 0x86, 0xb3, 0x0e, 0x91, 0x60, 0xcf, 0xb0, 0x7b} 32 | DEFINE_GUID!{IID_ID3D10EffectDepthStencilVariable, 33 | 0xaf482368, 0x330a, 0x46a5, 0x9a, 0x5c, 0x01, 0xc7, 0x1a, 0xf2, 0x4c, 0x8d} 34 | DEFINE_GUID!{IID_ID3D10EffectRasterizerVariable, 35 | 0x21af9f0e, 0x4d94, 0x4ea9, 0x97, 0x85, 0x2c, 0xb7, 0x6b, 0x8c, 0x0b, 0x34} 36 | DEFINE_GUID!{IID_ID3D10EffectSamplerVariable, 37 | 0x6530d5c7, 0x07e9, 0x4271, 0xa4, 0x18, 0xe7, 0xce, 0x4b, 0xd1, 0xe4, 0x80} 38 | DEFINE_GUID!{IID_ID3D10EffectPass, 39 | 0x5cfbeb89, 0x1a06, 0x46e0, 0xb2, 0x82, 0xe3, 0xf9, 0xbf, 0xa3, 0x6a, 0x54} 40 | DEFINE_GUID!{IID_ID3D10EffectTechnique, 41 | 0xdb122ce8, 0xd1c9, 0x4292, 0xb2, 0x37, 0x24, 0xed, 0x3d, 0xe8, 0xb1, 0x75} 42 | DEFINE_GUID!{IID_ID3D10Effect, 43 | 0x51b0ca8b, 0xec0b, 0x4519, 0x87, 0x0d, 0x8e, 0xe1, 0xcb, 0x50, 0x17, 0xc7} 44 | DEFINE_GUID!{IID_ID3D10EffectPool, 45 | 0x9537ab04, 0x3250, 0x412e, 0x82, 0x13, 0xfc, 0xd2, 0xf8, 0x67, 0x79, 0x33} 46 | -------------------------------------------------------------------------------- /src/um/d3d10misc.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{GUID_DeviceType, 7 | 0xd722fb4d, 0x7a68, 0x437a, 0xb2, 0x0c, 0x58, 0x04, 0xee, 0x24, 0x94, 0xa6} 8 | -------------------------------------------------------------------------------- /src/um/d3d10sdklayers.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{DXGI_DEBUG_D3D10, 7 | 0x243b4c52, 0x3606, 0x4d3a, 0x99, 0xd7, 0xa7, 0xe7, 0xb3, 0x3e, 0xd7, 0x06} 8 | DEFINE_GUID!{IID_ID3D10Debug, 9 | 0x9b7e4e01, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 10 | DEFINE_GUID!{IID_ID3D10SwitchToRef, 11 | 0x9b7e4e02, 0x342c, 0x4106, 0xa1, 0x9f, 0x4f, 0x27, 0x04, 0xf6, 0x89, 0xf0} 12 | DEFINE_GUID!{IID_ID3D10InfoQueue, 13 | 0x1b940b17, 0x2642, 0x4d1f, 0xab, 0x1f, 0xb9, 0x9b, 0xad, 0x0c, 0x39, 0x5f} 14 | -------------------------------------------------------------------------------- /src/um/d3d11_3.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3D11Texture2D1, 7 | 0x51218251, 0x1e33, 0x4617, 0x9c, 0xcb, 0x4d, 0x3a, 0x43, 0x67, 0xe7, 0xbb} 8 | DEFINE_GUID!{IID_ID3D11Texture3D1, 9 | 0x0c711683, 0x2853, 0x4846, 0x9b, 0xb0, 0xf3, 0xe6, 0x06, 0x39, 0xe4, 0x6a} 10 | DEFINE_GUID!{IID_ID3D11RasterizerState2, 11 | 0x6fbd02fb, 0x209f, 0x46c4, 0xb0, 0x59, 0x2e, 0xd1, 0x55, 0x86, 0xa6, 0xac} 12 | DEFINE_GUID!{IID_ID3D11ShaderResourceView1, 13 | 0x91308b87, 0x9040, 0x411d, 0x8c, 0x67, 0xc3, 0x92, 0x53, 0xce, 0x38, 0x02} 14 | DEFINE_GUID!{IID_ID3D11RenderTargetView1, 15 | 0xffbe2e23, 0xf011, 0x418a, 0xac, 0x56, 0x5c, 0xee, 0xd7, 0xc5, 0xb9, 0x4b} 16 | DEFINE_GUID!{IID_ID3D11UnorderedAccessView1, 17 | 0x7b3b6153, 0xa886, 0x4544, 0xab, 0x37, 0x65, 0x37, 0xc8, 0x50, 0x04, 0x03} 18 | DEFINE_GUID!{IID_ID3D11Query1, 19 | 0x631b4766, 0x36dc, 0x461d, 0x8d, 0xb6, 0xc4, 0x7e, 0x13, 0xe6, 0x09, 0x16} 20 | DEFINE_GUID!{IID_ID3D11DeviceContext3, 21 | 0xb4e3c01d, 0xe79e, 0x4637, 0x91, 0xb2, 0x51, 0x0e, 0x9f, 0x4c, 0x9b, 0x8f} 22 | DEFINE_GUID!{IID_ID3D11Device3, 23 | 0xa05c8c37, 0xd2c6, 0x4732, 0xb3, 0xa0, 0x9c, 0xe0, 0xb0, 0xdc, 0x9a, 0xe6} 24 | -------------------------------------------------------------------------------- /src/um/d3d11_4.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3D11Device4, 7 | 0x8992ab71, 0x02e6, 0x4b8d, 0xba, 0x48, 0xb0, 0x56, 0xdc, 0xda, 0x42, 0xc4} 8 | -------------------------------------------------------------------------------- /src/um/d3d11on12.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the content of d3d11on12.h 7 | use ctypes::c_void; 8 | use shared::guiddef::IID; 9 | use shared::minwindef::UINT; 10 | use um::d3d11::{ID3D11Device, ID3D11DeviceContext, ID3D11Resource}; 11 | use um::d3d12::D3D12_RESOURCE_STATES; 12 | use um::d3dcommon::D3D_FEATURE_LEVEL; 13 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 14 | use um::winnt::HRESULT; 15 | FN!{stdcall PFN_D3D11ON12_CREATE_DEVICE( 16 | *mut IUnknown, 17 | UINT, 18 | *const D3D_FEATURE_LEVEL, 19 | UINT, 20 | *mut *mut IUnknown, 21 | UINT, 22 | UINT, 23 | *mut *mut ID3D11Device, 24 | *mut *mut ID3D11DeviceContext, 25 | *mut D3D_FEATURE_LEVEL, 26 | ) -> HRESULT} 27 | extern "system" { 28 | pub fn D3D11On12CreateDevice( 29 | pDevice: *mut IUnknown, 30 | Flags: UINT, 31 | pFeatureLevels: *const D3D_FEATURE_LEVEL, 32 | FeatureLevels: UINT, 33 | ppCommandQueues: *mut *mut IUnknown, 34 | NumQueues: UINT, 35 | NodeMask: UINT, 36 | ppDevice: *mut *mut ID3D11Device, 37 | ppImmediateContext: *mut *mut ID3D11DeviceContext, 38 | pChosenFeatureLevel: *mut D3D_FEATURE_LEVEL, 39 | ) -> HRESULT; 40 | } 41 | STRUCT!{struct D3D11_RESOURCE_FLAGS { 42 | BindFlags: UINT, 43 | MiscFlags: UINT, 44 | CPUAccessFlags: UINT, 45 | StructureByteStride: UINT, 46 | }} 47 | RIDL!{#[uuid(0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04)] 48 | interface ID3D11On12Device(ID3D11On12DeviceVtbl): IUnknown(IUnknownVtbl) { 49 | fn CreateWrappedResource( 50 | pResource12: *mut IUnknown, 51 | pFlags11: *const D3D11_RESOURCE_FLAGS, 52 | InState: D3D12_RESOURCE_STATES, 53 | OutState: D3D12_RESOURCE_STATES, 54 | riid: *const IID, 55 | ppResource11: *mut *mut c_void, 56 | ) -> HRESULT, 57 | fn ReleaseWrappedResources( 58 | ppResources: *mut *mut ID3D11Resource, 59 | NumResources: UINT, 60 | ) -> (), 61 | fn AcquireWrappedResources( 62 | ppResources: *mut *mut ID3D11Resource, 63 | NumResources: UINT, 64 | ) -> (), 65 | }} 66 | DEFINE_GUID!{IID_ID3D11On12Device, 67 | 0x85611e73, 0x70a9, 0x490e, 0x96, 0x14, 0xa9, 0xe3, 0x02, 0x77, 0x79, 0x04} 68 | -------------------------------------------------------------------------------- /src/um/d3dcsx.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3DX11Scan, 7 | 0x5089b68f, 0xe71d, 0x4d38, 0xbe, 0x8e, 0xf3, 0x63, 0xb9, 0x5a, 0x94, 0x05} 8 | DEFINE_GUID!{IID_ID3DX11SegmentedScan, 9 | 0xa915128c, 0xd954, 0x4c79, 0xbf, 0xe1, 0x64, 0xdb, 0x92, 0x31, 0x94, 0xd6} 10 | DEFINE_GUID!{IID_ID3DX11FFT, 11 | 0xb3f7a938, 0x4c93, 0x4310, 0xa6, 0x75, 0xb3, 0x0d, 0x6d, 0xe5, 0x05, 0x53} 12 | -------------------------------------------------------------------------------- /src/um/d3dx10core.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3DX10Sprite, 7 | 0xba0b762d, 0x8d28, 0x43ec, 0xb9, 0xdc, 0x2f, 0x84, 0x44, 0x3b, 0x06, 0x14} 8 | DEFINE_GUID!{IID_ID3DX10ThreadPump, 9 | 0xc93fecfa, 0x6967, 0x478a, 0xab, 0xbc, 0x40, 0x2d, 0x90, 0x62, 0x1f, 0xcb} 10 | DEFINE_GUID!{IID_ID3DX10Font, 11 | 0xd79dbb70, 0x5f21, 0x4d36, 0xbb, 0xc2, 0xff, 0x52, 0x5c, 0x21, 0x3c, 0xdc} 12 | -------------------------------------------------------------------------------- /src/um/d3dx10math.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3DXMatrixStack, 7 | 0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85} 8 | -------------------------------------------------------------------------------- /src/um/d3dx10mesh.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ID3DX10BaseMesh, 7 | 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30} 8 | DEFINE_GUID!{IID_ID3DX10MeshBuffer, 9 | 0x04b0d117, 0x1041, 0x46b1, 0xaa, 0x8a, 0x39, 0x52, 0x84, 0x8b, 0xa2, 0x2e} 10 | DEFINE_GUID!{IID_ID3DX10Mesh, 11 | 0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95} 12 | DEFINE_GUID!{IID_ID3DX10PMesh, 13 | 0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96} 14 | DEFINE_GUID!{IID_ID3DX10SPMesh, 15 | 0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x02, 0x90, 0xb8, 0x3c, 0xc5} 16 | DEFINE_GUID!{IID_ID3DX10PatchMesh, 17 | 0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39} 18 | DEFINE_GUID!{IID_ID3DX10SkinInfo, 19 | 0x420bd604, 0x1c76, 0x4a34, 0xa4, 0x66, 0xe4, 0x5d, 0x06, 0x58, 0xa3, 0x2c} 20 | -------------------------------------------------------------------------------- /src/um/datetimeapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_int; 7 | use shared::minwindef::DWORD; 8 | use um::minwinbase::SYSTEMTIME; 9 | use um::winnt::{LCID, LPCSTR, LPCWSTR, LPSTR, LPWSTR}; 10 | extern "system" { 11 | pub fn GetDateFormatA( 12 | Locale: LCID, 13 | dwFlags: DWORD, 14 | lpDate: *const SYSTEMTIME, 15 | lpFormat: LPCSTR, 16 | lpDateStr: LPSTR, 17 | cchDate: c_int, 18 | ) -> c_int; 19 | pub fn GetDateFormatW( 20 | Locale: LCID, 21 | dwFlags: DWORD, 22 | lpDate: *const SYSTEMTIME, 23 | lpFormat: LPCWSTR, 24 | lpDateStr: LPWSTR, 25 | cchDate: c_int, 26 | ) -> c_int; 27 | pub fn GetTimeFormatA( 28 | Locale: LCID, 29 | dwFlags: DWORD, 30 | lpTime: *const SYSTEMTIME, 31 | lpFormat: LPCSTR, 32 | lpTimeStr: LPSTR, 33 | cchTime: c_int, 34 | ) -> c_int; 35 | pub fn GetTimeFormatW( 36 | Locale: LCID, 37 | dwFlags: DWORD, 38 | lpTime: *const SYSTEMTIME, 39 | lpFormat: LPCWSTR, 40 | lpTimeStr: LPWSTR, 41 | cchTime: c_int, 42 | ) -> c_int; 43 | pub fn GetTimeFormatEx( 44 | lpLocaleName: LPCWSTR, 45 | dwFlags: DWORD, 46 | lpTime: *const SYSTEMTIME, 47 | lpFormat: LPCWSTR, 48 | lpTimeStr: LPWSTR, 49 | cchTime: c_int, 50 | ) -> c_int; 51 | pub fn GetDateFormatEx( 52 | lpLocaleName: LPCWSTR, 53 | dwFlags: DWORD, 54 | lpDate: *const SYSTEMTIME, 55 | lpFormat: LPCWSTR, 56 | lpDateStr: LPWSTR, 57 | cchDate: c_int, 58 | lpCalendar: LPCWSTR, 59 | ) -> c_int; 60 | } 61 | -------------------------------------------------------------------------------- /src/um/davclnt.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! This module defines the DAV specific functions that are exposed to the user 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD, PBYTE, PULONG, ULONG}; 8 | use um::winnt::{HANDLE, LPCWSTR, LPWSTR, PVOID, PWSTR}; 9 | pub type OPAQUE_HANDLE = DWORD; 10 | STRUCT!{struct DAV_CALLBACK_AUTH_BLOB { 11 | pBuffer: PVOID, 12 | ulSize: ULONG, 13 | ulType: ULONG, 14 | }} 15 | pub type PDAV_CALLBACK_AUTH_BLOB = *mut DAV_CALLBACK_AUTH_BLOB; 16 | STRUCT!{struct DAV_CALLBACK_AUTH_UNP { 17 | pszUserName: LPWSTR, 18 | ulUserNameLength: ULONG, 19 | pszPassword: LPWSTR, 20 | ulPasswordLength: ULONG, 21 | }} 22 | pub type PDAV_CALLBACK_AUTH_UNP = *mut DAV_CALLBACK_AUTH_UNP; 23 | STRUCT!{struct DAV_CALLBACK_CRED { 24 | AuthBlob: DAV_CALLBACK_AUTH_BLOB, 25 | UNPBlob: DAV_CALLBACK_AUTH_UNP, 26 | bAuthBlobValid: BOOL, 27 | bSave: BOOL, 28 | }} 29 | pub type PDAV_CALLBACK_CRED = *mut DAV_CALLBACK_CRED; 30 | pub const DAV_AUTHN_SCHEME_BASIC: DWORD = 0x00000001; 31 | pub const DAV_AUTHN_SCHEME_NTLM: DWORD = 0x00000002; 32 | pub const DAV_AUTHN_SCHEME_PASSPORT: DWORD = 0x00000004; 33 | pub const DAV_AUTHN_SCHEME_DIGEST: DWORD = 0x00000008; 34 | pub const DAV_AUTHN_SCHEME_NEGOTIATE: DWORD = 0x00000010; 35 | pub const DAV_AUTHN_SCHEME_CERT: DWORD = 0x00010000; 36 | pub const DAV_AUTHN_SCHEME_FBA: DWORD = 0x00100000; 37 | ENUM!{enum AUTHNEXTSTEP { 38 | DefaultBehavior, 39 | RetryRequest, 40 | CancelRequest, 41 | }} 42 | FN!{stdcall PFNDAVAUTHCALLBACK_FREECRED( 43 | pbuffer: PVOID, 44 | ) -> DWORD} 45 | FN!{stdcall PFNDAVAUTHCALLBACK( 46 | lpwzServerName: LPWSTR, 47 | lpwzRemoteName: LPWSTR, 48 | dwAuthScheme: DWORD, 49 | dwFlags: DWORD, 50 | pCallbackCred: PDAV_CALLBACK_CRED, 51 | NextStep: *mut AUTHNEXTSTEP, 52 | pFreeCred: *mut PFNDAVAUTHCALLBACK_FREECRED, 53 | ) -> DWORD} 54 | extern "system" { 55 | pub fn DavAddConnection( 56 | ConnectionHandle: *mut HANDLE, 57 | RemoteName: LPCWSTR, 58 | UserName: LPCWSTR, 59 | Password: LPCWSTR, 60 | ClientCert: PBYTE, 61 | CertSize: DWORD, 62 | ) -> DWORD; 63 | pub fn DavDeleteConnection( 64 | ConnectionHandle: HANDLE, 65 | ) -> DWORD; 66 | pub fn DavGetUNCFromHTTPPath( 67 | HttpPath: LPCWSTR, 68 | UncPath: LPWSTR, 69 | lpSize: LPDWORD, 70 | ) -> DWORD; 71 | pub fn DavGetHTTPFromUNCPath( 72 | UncPath: LPCWSTR, 73 | HttpPath: LPWSTR, 74 | lpSize: LPDWORD, 75 | ) -> DWORD; 76 | pub fn DavGetTheLockOwnerOfTheFile( 77 | FileName: LPCWSTR, 78 | LockOwnerName: PWSTR, 79 | LockOwnerNameLengthInBytes: PULONG, 80 | ) -> DWORD; 81 | pub fn DavGetExtendedError( 82 | hFile: HANDLE, 83 | ExtError: *mut DWORD, 84 | ExtErrorString: LPWSTR, 85 | cChSize: *mut DWORD, 86 | ) -> DWORD; 87 | pub fn DavFlushFile( 88 | hFile: HANDLE, 89 | ) -> DWORD; 90 | pub fn DavInvalidateCache( 91 | URLName: LPWSTR, 92 | ) -> DWORD; 93 | pub fn DavCancelConnectionsToServer( 94 | URLName: LPWSTR, 95 | fForce: BOOL, 96 | ) -> DWORD; 97 | pub fn DavRegisterAuthCallback( 98 | CallBack: PFNDAVAUTHCALLBACK, 99 | Version: ULONG, 100 | ) -> OPAQUE_HANDLE; 101 | pub fn DavUnregisterAuthCallback( 102 | hCallback: OPAQUE_HANDLE, 103 | ); 104 | } 105 | -------------------------------------------------------------------------------- /src/um/dcommon.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the contents of dcommon.h 7 | use ctypes::c_void; 8 | use shared::basetsd::UINT32; 9 | use shared::dxgiformat::DXGI_FORMAT; 10 | use shared::minwindef::FLOAT; 11 | use shared::windef::{POINT, RECT}; 12 | ENUM!{enum DWRITE_MEASURING_MODE { 13 | DWRITE_MEASURING_MODE_NATURAL = 0, 14 | DWRITE_MEASURING_MODE_GDI_CLASSIC = 1, 15 | DWRITE_MEASURING_MODE_GDI_NATURAL = 2, 16 | }} 17 | ENUM!{enum DWRITE_GLYPH_IMAGE_FORMATS { 18 | DWRITE_GLYPH_IMAGE_FORMATS_NONE = 0x00000000, 19 | DWRITE_GLYPH_IMAGE_FORMATS_TRUETYPE = 0x00000001, 20 | DWRITE_GLYPH_IMAGE_FORMATS_CFF = 0x00000002, 21 | DWRITE_GLYPH_IMAGE_FORMATS_COLR = 0x00000004, 22 | DWRITE_GLYPH_IMAGE_FORMATS_SVG = 0x00000008, 23 | DWRITE_GLYPH_IMAGE_FORMATS_PNG = 0x00000010, 24 | DWRITE_GLYPH_IMAGE_FORMATS_JPEG = 0x00000020, 25 | DWRITE_GLYPH_IMAGE_FORMATS_TIFF = 0x00000040, 26 | DWRITE_GLYPH_IMAGE_FORMATS_PREMULTIPLIED_B8G8R8A8 = 0x00000080, 27 | }} 28 | STRUCT!{struct DWRITE_GLYPH_IMAGE_DATA { 29 | imageData: *const c_void, 30 | imageDataSize: UINT32, 31 | uniqueDataId: UINT32, 32 | pixelsPerEm: UINT32, 33 | pixelSize: D2D1_SIZE_U, 34 | horizontalLeftOrigin: D2D1_POINT_2L, 35 | horizontalRightOrigin: D2D1_POINT_2L, 36 | verticalTopOrigin: D2D1_POINT_2L, 37 | verticalBottomOrigin: D2D1_POINT_2L, 38 | }} 39 | ENUM!{enum D2D1_ALPHA_MODE { 40 | D2D1_ALPHA_MODE_UNKNOWN = 0, 41 | D2D1_ALPHA_MODE_PREMULTIPLIED = 1, 42 | D2D1_ALPHA_MODE_STRAIGHT = 2, 43 | D2D1_ALPHA_MODE_IGNORE = 3, 44 | }} 45 | STRUCT!{struct D2D1_PIXEL_FORMAT { 46 | format: DXGI_FORMAT, 47 | alphaMode: D2D1_ALPHA_MODE, 48 | }} 49 | STRUCT!{struct D2D_POINT_2U { 50 | x: UINT32, 51 | y: UINT32, 52 | }} 53 | STRUCT!{struct D2D_POINT_2F { 54 | x: FLOAT, 55 | y: FLOAT, 56 | }} 57 | pub type D2D_POINT_2L = POINT; 58 | STRUCT!{struct D2D_VECTOR_2F { 59 | x: FLOAT, 60 | y: FLOAT, 61 | }} 62 | STRUCT!{struct D2D_VECTOR_3F { 63 | x: FLOAT, 64 | y: FLOAT, 65 | z: FLOAT, 66 | }} 67 | STRUCT!{struct D2D_VECTOR_4F { 68 | x: FLOAT, 69 | y: FLOAT, 70 | z: FLOAT, 71 | w: FLOAT, 72 | }} 73 | STRUCT!{struct D2D_RECT_F { 74 | left: FLOAT, 75 | top: FLOAT, 76 | right: FLOAT, 77 | bottom: FLOAT, 78 | }} 79 | STRUCT!{struct D2D_RECT_U { 80 | left: UINT32, 81 | top: UINT32, 82 | right: UINT32, 83 | bottom: UINT32, 84 | }} 85 | pub type D2D_RECT_L = RECT; 86 | STRUCT!{struct D2D_SIZE_F { 87 | width: FLOAT, 88 | height: FLOAT, 89 | }} 90 | STRUCT!{struct D2D_SIZE_U { 91 | width: UINT32, 92 | height: UINT32, 93 | }} 94 | STRUCT!{struct D2D_MATRIX_3X2_F { 95 | matrix: [[FLOAT; 2]; 3], 96 | }} 97 | STRUCT!{struct D2D_MATRIX_4X3_F { 98 | matrix: [[FLOAT; 3]; 4], 99 | }} 100 | STRUCT!{struct D2D_MATRIX_4X4_F { 101 | matrix: [[FLOAT; 4]; 4], 102 | }} 103 | STRUCT!{struct D2D_MATRIX_5X4_F { 104 | matrix: [[FLOAT; 4]; 5], 105 | }} 106 | pub type D2D1_POINT_2F = D2D_POINT_2F; 107 | pub type D2D1_POINT_2U = D2D_POINT_2U; 108 | pub type D2D1_POINT_2L = D2D_POINT_2L; 109 | pub type D2D1_RECT_F = D2D_RECT_F; 110 | pub type D2D1_RECT_U = D2D_RECT_U; 111 | pub type D2D1_RECT_L = D2D_RECT_L; 112 | pub type D2D1_SIZE_F = D2D_SIZE_F; 113 | pub type D2D1_SIZE_U = D2D_SIZE_U; 114 | pub type D2D1_MATRIX_3X2_F = D2D_MATRIX_3X2_F; 115 | -------------------------------------------------------------------------------- /src/um/dcompanimation.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Mappings for the contents of dcompanimation.h 7 | use ctypes::{c_double, c_float}; 8 | use shared::ntdef::{HRESULT, LARGE_INTEGER}; 9 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 10 | RIDL!{#[uuid(0xcbfd91d9, 0x51b2, 0x45e4, 0xb3, 0xde, 0xd1, 0x9c, 0xcf, 0xb8, 0x63, 0xc5)] 11 | interface IDCompositionAnimation(IDCompositionAnimationVtbl): IUnknown(IUnknownVtbl) { 12 | fn Reset() -> HRESULT, 13 | fn SetAbsoluteBeginTime( 14 | beginTime: LARGE_INTEGER, 15 | ) -> HRESULT, 16 | fn AddCubic( 17 | beginOffset: c_double, 18 | constantCoefficient: c_float, 19 | linearCoefficient: c_float, 20 | quadraticCoefficient: c_float, 21 | cubicCoefficient: c_float, 22 | )-> HRESULT, 23 | fn AddSinusoidal( 24 | beginOffset: c_double, 25 | bias: c_float, 26 | amplitude: c_float, 27 | frequency: c_float, 28 | phase: c_float, 29 | )-> HRESULT, 30 | fn AddRepeat( 31 | beginOffset: c_double, 32 | durationToRepeat: c_double, 33 | )-> HRESULT, 34 | fn End( 35 | endOffset: c_double, 36 | endValue: c_float, 37 | ) -> HRESULT, 38 | }} 39 | -------------------------------------------------------------------------------- /src/um/dde.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::{PUINT_PTR, UINT_PTR}; 7 | use shared::minwindef::{BOOL, LPARAM, UINT}; 8 | extern "system" { 9 | pub fn PackDDElParam( 10 | msg: UINT, 11 | uiLo: UINT_PTR, 12 | uiHi: UINT_PTR, 13 | ) -> LPARAM; 14 | pub fn UnpackDDElParam( 15 | msg: UINT, 16 | lParam: LPARAM, 17 | puiLo: PUINT_PTR, 18 | puiHi: PUINT_PTR, 19 | ) -> BOOL; 20 | } 21 | -------------------------------------------------------------------------------- /src/um/ddraw.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{CLSID_DirectDraw, 7 | 0xd7b70ee0, 0x4340, 0x11cf, 0xb0, 0x63, 0x00, 0x20, 0xaf, 0xc2, 0xcd, 0x35} 8 | DEFINE_GUID!{CLSID_DirectDraw7, 9 | 0x3c305196, 0x50db, 0x11d3, 0x9c, 0xfe, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} 10 | DEFINE_GUID!{CLSID_DirectDrawClipper, 11 | 0x593817a0, 0x7db3, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 12 | DEFINE_GUID!{IID_IDirectDraw, 13 | 0x6c14db80, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} 14 | DEFINE_GUID!{IID_IDirectDraw2, 15 | 0xb3a6f3e0, 0x2b43, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 16 | DEFINE_GUID!{IID_IDirectDraw4, 17 | 0x9c59509a, 0x39bd, 0x11d1, 0x8c, 0x4a, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} 18 | DEFINE_GUID!{IID_IDirectDraw7, 19 | 0x15e65ec0, 0x3b9c, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} 20 | DEFINE_GUID!{IID_IDirectDrawSurface, 21 | 0x6c14db81, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} 22 | DEFINE_GUID!{IID_IDirectDrawSurface2, 23 | 0x57805885, 0x6eec, 0x11cf, 0x94, 0x41, 0xa8, 0x23, 0x03, 0xc1, 0x0e, 0x27} 24 | DEFINE_GUID!{IID_IDirectDrawSurface3, 25 | 0xda044e00, 0x69b2, 0x11d0, 0xa1, 0xd5, 0x00, 0xaa, 0x00, 0xb8, 0xdf, 0xbb} 26 | DEFINE_GUID!{IID_IDirectDrawSurface4, 27 | 0x0b2b8630, 0xad35, 0x11d0, 0x8e, 0xa6, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} 28 | DEFINE_GUID!{IID_IDirectDrawSurface7, 29 | 0x06675a80, 0x3b9b, 0x11d2, 0xb9, 0x2f, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} 30 | DEFINE_GUID!{IID_IDirectDrawPalette, 31 | 0x6c14db84, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} 32 | DEFINE_GUID!{IID_IDirectDrawClipper, 33 | 0x6c14db85, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} 34 | DEFINE_GUID!{IID_IDirectDrawColorControl, 35 | 0x4b9f0ee0, 0x0d7e, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 36 | DEFINE_GUID!{IID_IDirectDrawGammaControl, 37 | 0x69c11c3e, 0xb46b, 0x11d1, 0xad, 0x7a, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e} 38 | -------------------------------------------------------------------------------- /src/um/ddrawi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{GUID_OptSurfaceKmodeInfo, 7 | 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 8 | DEFINE_GUID!{GUID_OptSurfaceUmodeInfo, 9 | 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 10 | DEFINE_GUID!{GUID_UserModeDriverInfo, 11 | 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 12 | DEFINE_GUID!{GUID_UserModeDriverPassword, 13 | 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 14 | -------------------------------------------------------------------------------- /src/um/ddrawint.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{GUID_MiscellaneousCallbacks, 7 | 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 8 | DEFINE_GUID!{GUID_Miscellaneous2Callbacks, 9 | 0x406b2f00, 0x3e5a, 0x11d1, 0xb6, 0x40, 0x00, 0xaa, 0x00, 0xa1, 0xf9, 0x6a} 10 | DEFINE_GUID!{GUID_VideoPortCallbacks, 11 | 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 12 | DEFINE_GUID!{GUID_ColorControlCallbacks, 13 | 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 14 | DEFINE_GUID!{GUID_MotionCompCallbacks, 15 | 0xb1122b40, 0x5da5, 0x11d1, 0x8f, 0xcf, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e} 16 | DEFINE_GUID!{GUID_VideoPortCaps, 17 | 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 18 | DEFINE_GUID!{GUID_D3DExtendedCaps, 19 | 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x00, 0xa0, 0xc9, 0x05, 0x41, 0x29} 20 | DEFINE_GUID!{GUID_D3DCallbacks2, 21 | 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a} 22 | DEFINE_GUID!{GUID_D3DCallbacks3, 23 | 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e} 24 | DEFINE_GUID!{GUID_NonLocalVidMemCaps, 25 | 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37} 26 | DEFINE_GUID!{GUID_KernelCallbacks, 27 | 0x80863800, 0x6b06, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 28 | DEFINE_GUID!{GUID_KernelCaps, 29 | 0xffaa7540, 0x7aa8, 0x11d0, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 30 | DEFINE_GUID!{GUID_ZPixelFormats, 31 | 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x00, 0xaa, 0x00, 0xbb, 0xb8, 0xae} 32 | DEFINE_GUID!{GUID_DDMoreCaps, 33 | 0x880baf30, 0xb030, 0x11d0, 0x8e, 0xa7, 0x00, 0x60, 0x97, 0x97, 0xea, 0x5b} 34 | DEFINE_GUID!{GUID_D3DParseUnknownCommandCallback, 35 | 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x00, 0xa0, 0xc9, 0x06, 0x29, 0xa8} 36 | DEFINE_GUID!{GUID_NTCallbacks, 37 | 0x6fe9ecde, 0xdf89, 0x11d1, 0x9d, 0xb0, 0x00, 0x60, 0x08, 0x27, 0x71, 0xba} 38 | DEFINE_GUID!{GUID_DDMoreSurfaceCaps, 39 | 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x00, 0xc0, 0x4f, 0xd9, 0x30, 0xc5} 40 | DEFINE_GUID!{GUID_DDStereoMode, 41 | 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x00, 0xa0, 0xc9, 0x83, 0xea, 0xf6} 42 | -------------------------------------------------------------------------------- /src/um/debugapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, DWORD, PBOOL}; 7 | use um::minwinbase::LPDEBUG_EVENT; 8 | use um::winnt::{HANDLE, LPCSTR, LPCWSTR}; 9 | extern "system" { 10 | pub fn IsDebuggerPresent() -> BOOL; 11 | pub fn DebugBreak(); 12 | pub fn OutputDebugStringA( 13 | lpOutputString: LPCSTR, 14 | ); 15 | pub fn OutputDebugStringW( 16 | lpOutputString: LPCWSTR, 17 | ); 18 | pub fn ContinueDebugEvent( 19 | dwProcessId: DWORD, 20 | dwThreadId: DWORD, 21 | dwContinueStatus: DWORD, 22 | ) -> BOOL; 23 | pub fn WaitForDebugEvent( 24 | lpDebugEvent: LPDEBUG_EVENT, 25 | dwMilliseconds: DWORD, 26 | ) -> BOOL; 27 | pub fn DebugActiveProcess( 28 | dwProcessId: DWORD, 29 | ) -> BOOL; 30 | pub fn DebugActiveProcessStop( 31 | dwProcessId: DWORD, 32 | ) -> BOOL; 33 | pub fn CheckRemoteDebuggerPresent( 34 | hProcess: HANDLE, 35 | pbDebuggerPresent: PBOOL, 36 | ) -> BOOL; 37 | pub fn WaitForDebugEventEx( 38 | lpDebugEvent: LPDEBUG_EVENT, 39 | dwMilliseconds: DWORD, 40 | ) -> BOOL; 41 | } 42 | -------------------------------------------------------------------------------- /src/um/dmksctl.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_IKsControl, 7 | 0x28f54685, 0x06fd, 0x11d2, 0xb2, 0x7a, 0x00, 0xa0, 0xc9, 0x22, 0x31, 0x96} 8 | DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_MIDI, 9 | 0x1d262760, 0xe957, 0x11cf, 0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00} 10 | DEFINE_GUID!{KSDATAFORMAT_SUBTYPE_DIRECTMUSIC, 11 | 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1} 12 | -------------------------------------------------------------------------------- /src/um/documenttarget.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | // TODO:It is a minimal implementation. 7 | use ctypes::c_void; 8 | use shared::basetsd::UINT32; 9 | use shared::guiddef::{GUID, REFGUID, REFIID}; 10 | use shared::ntdef::HRESULT; 11 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 12 | RIDL!{#[uuid(0x1b8efec4, 0x3019, 0x4c27, 0x96, 0x4e, 0x36, 0x72, 0x02, 0x15, 0x69, 0x06)] 13 | interface IPrintDocumentPackageTarget(IPrintDocumentPackageTargetVtbl): IUnknown(IUnknownVtbl) { 14 | fn GetPackageTargetTypes( 15 | targetCount: *mut UINT32, 16 | targetTypes: *mut *mut GUID, 17 | ) -> HRESULT, 18 | fn GetPackageTarget( 19 | guidTargetType: REFGUID, 20 | riid: REFIID, 21 | ppvTarget: *mut *mut c_void, 22 | ) -> HRESULT, 23 | fn Cancel() -> HRESULT, 24 | }} 25 | -------------------------------------------------------------------------------- /src/um/dsrole.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Contains public interfaces to query the network roles of workstations, servers, and DCs 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::{DWORD, PBYTE, ULONG}; 9 | use um::winnt::{LPCWSTR, LPWSTR, PVOID}; 10 | ENUM!{enum DSROLE_MACHINE_ROLE { 11 | DsRole_RoleStandaloneWorkstation, 12 | DsRole_RoleMemberWorkstation, 13 | DsRole_RoleStandaloneServer, 14 | DsRole_RoleMemberServer, 15 | DsRole_RoleBackupDomainController, 16 | DsRole_RolePrimaryDomainController, 17 | }} 18 | ENUM!{enum DSROLE_SERVER_STATE { 19 | DsRoleServerUnknown = 0, 20 | DsRoleServerPrimary, 21 | DsRoleServerBackup, 22 | }} 23 | pub type PDSROLE_SERVER_STATE = *mut DSROLE_SERVER_STATE; 24 | ENUM!{enum DSROLE_PRIMARY_DOMAIN_INFO_LEVEL { 25 | DsRolePrimaryDomainInfoBasic = 1, 26 | DsRoleUpgradeStatus, 27 | DsRoleOperationState, 28 | }} 29 | pub const DSROLE_PRIMARY_DS_RUNNING: ULONG = 0x00000001; 30 | pub const DSROLE_PRIMARY_DS_MIXED_MODE: ULONG = 0x00000002; 31 | pub const DSROLE_UPGRADE_IN_PROGRESS: ULONG = 0x00000004; 32 | pub const DSROLE_PRIMARY_DS_READONLY: ULONG = 0x00000008; 33 | pub const DSROLE_PRIMARY_DOMAIN_GUID_PRESENT: ULONG = 0x01000000; 34 | STRUCT!{struct DSROLE_PRIMARY_DOMAIN_INFO_BASIC { 35 | MachineRole: DSROLE_MACHINE_ROLE, 36 | Flags: ULONG, 37 | DomainNameFlat: LPWSTR, 38 | DomainNameDns: LPWSTR, 39 | DomainForestName: LPWSTR, 40 | DomainGuid: GUID, 41 | }} 42 | pub type PDSROLE_PRIMARY_DOMAIN_INFO_BASIC = *mut DSROLE_PRIMARY_DOMAIN_INFO_BASIC; 43 | STRUCT!{struct DSROLE_UPGRADE_STATUS_INFO { 44 | OperationState: ULONG, 45 | PreviousServerState: DSROLE_SERVER_STATE, 46 | }} 47 | pub type PDSROLE_UPGRADE_STATUS_INFO = *mut DSROLE_UPGRADE_STATUS_INFO; 48 | ENUM!{enum DSROLE_OPERATION_STATE { 49 | DsRoleOperationIdle = 0, 50 | DsRoleOperationActive, 51 | DsRoleOperationNeedReboot, 52 | }} 53 | STRUCT!{struct DSROLE_OPERATION_STATE_INFO { 54 | OperationState: DSROLE_OPERATION_STATE, 55 | }} 56 | pub type PDSROLE_OPERATION_STATE_INFO = *mut DSROLE_OPERATION_STATE_INFO; 57 | extern "system" { 58 | pub fn DsRoleGetPrimaryDomainInformation( 59 | lpServer: LPCWSTR, 60 | InfoLevel: DSROLE_PRIMARY_DOMAIN_INFO_LEVEL, 61 | Buffer: *mut PBYTE, 62 | ) -> DWORD; 63 | pub fn DsRoleFreeMemory( 64 | Buffer: PVOID, 65 | ); 66 | } 67 | -------------------------------------------------------------------------------- /src/um/dvp.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_IDDVideoPortContainer, 7 | 0x6c142760, 0xa733, 0x11ce, 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60} 8 | DEFINE_GUID!{IID_IDirectDrawVideoPort, 9 | 0xb36d93e0, 0x2b43, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56} 10 | DEFINE_GUID!{IID_IDirectDrawVideoPortNotify, 11 | 0xa655fb94, 0x0589, 0x4e57, 0xb3, 0x33, 0x56, 0x7a, 0x89, 0x46, 0x8c, 0x88} 12 | DEFINE_GUID!{DDVPTYPE_E_HREFH_VREFH, 13 | 0x54f39980, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 14 | DEFINE_GUID!{DDVPTYPE_E_HREFH_VREFL, 15 | 0x92783220, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 16 | DEFINE_GUID!{DDVPTYPE_E_HREFL_VREFH, 17 | 0xa07a02e0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 18 | DEFINE_GUID!{DDVPTYPE_E_HREFL_VREFL, 19 | 0xe09c77e0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 20 | DEFINE_GUID!{DDVPTYPE_CCIR656, 21 | 0xfca326a0, 0xda60, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 22 | DEFINE_GUID!{DDVPTYPE_BROOKTREE, 23 | 0x1352a560, 0xda61, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 24 | DEFINE_GUID!{DDVPTYPE_PHILIPS, 25 | 0x332cf160, 0xda61, 0x11cf, 0x9b, 0x06, 0x00, 0xa0, 0xc9, 0x03, 0xa3, 0xb8} 26 | -------------------------------------------------------------------------------- /src/um/dxdiag.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{CLSID_DxDiagProvider, 7 | 0xa65b8071, 0x3bfe, 0x4213, 0x9a, 0x5b, 0x49, 0x1d, 0xa4, 0x46, 0x1c, 0xa7} 8 | DEFINE_GUID!{IID_IDxDiagProvider, 9 | 0x9c6b4cb0, 0x23f8, 0x49cc, 0xa3, 0xed, 0x45, 0xa5, 0x50, 0x00, 0xa6, 0xd2} 10 | DEFINE_GUID!{IID_IDxDiagContainer, 11 | 0x7d0f462f, 0x4064, 0x4862, 0xbc, 0x7f, 0x93, 0x3e, 0x50, 0x58, 0xc1, 0x0f} 12 | -------------------------------------------------------------------------------- /src/um/dxfile.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{CLSID_CDirectXFile, 7 | 0x4516ec43, 0x8f20, 0x11d0, 0x9b, 0x6d, 0x00, 0x00, 0xc0, 0x78, 0x1b, 0xc3} 8 | DEFINE_GUID!{IID_IDirectXFile, 9 | 0x3d82ab40, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 10 | DEFINE_GUID!{IID_IDirectXFileEnumObject, 11 | 0x3d82ab41, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 12 | DEFINE_GUID!{IID_IDirectXFileSaveObject, 13 | 0x3d82ab42, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 14 | DEFINE_GUID!{IID_IDirectXFileObject, 15 | 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 16 | DEFINE_GUID!{IID_IDirectXFileData, 17 | 0x3d82ab44, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 18 | DEFINE_GUID!{IID_IDirectXFileDataReference, 19 | 0x3d82ab45, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 20 | DEFINE_GUID!{IID_IDirectXFileBinary, 21 | 0x3d82ab46, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 22 | DEFINE_GUID!{TID_DXFILEHeader, 23 | 0x3d82ab43, 0x62da, 0x11cf, 0xab, 0x39, 0x00, 0x20, 0xaf, 0x71, 0xe4, 0x33} 24 | -------------------------------------------------------------------------------- /src/um/enclaveapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::{PSIZE_T, SIZE_T}; 7 | use shared::minwindef::{BOOL, DWORD, LPCVOID, LPDWORD, LPVOID}; 8 | use shared::ntdef::{HANDLE}; 9 | use um::minwinbase::LPENCLAVE_ROUTINE; 10 | use um::winnt::{LPCSTR, LPCWSTR}; 11 | extern "system" { 12 | pub fn IsEnclaveTypeSupported( 13 | flEnclaveType: DWORD, 14 | ) -> BOOL; 15 | pub fn CreateEnclave( 16 | hProcess: HANDLE, 17 | lpAddress: LPVOID, 18 | dwSize: SIZE_T, 19 | dwInitialCommitment: SIZE_T, 20 | flEnclaveType: DWORD, 21 | lpEnclaveInformation: LPCVOID, 22 | dwInfoLength: DWORD, 23 | lpEnclaveError: LPDWORD, 24 | ) -> LPVOID; 25 | pub fn LoadEnclaveData( 26 | hProcess: HANDLE, 27 | lpAddress: LPVOID, 28 | lpBuffer: LPCVOID, 29 | nSize: SIZE_T, 30 | flProtect: DWORD, 31 | lpPageInformation: LPCVOID, 32 | dwInfoLength: DWORD, 33 | lpNumberOfBytesWritten: PSIZE_T, 34 | lpEnclaveError: LPDWORD, 35 | ) -> BOOL; 36 | pub fn InitializeEnclave( 37 | hProcess: HANDLE, 38 | lpAddress: LPVOID, 39 | lpEnclaveInformation: LPCVOID, 40 | dwInfoLength: DWORD, 41 | lpEnclaveError: LPDWORD, 42 | ) -> BOOL; 43 | pub fn LoadEnclaveImageA( 44 | lpEnclaveAddress: LPVOID, 45 | lpImageName: LPCSTR, 46 | ) -> BOOL; 47 | pub fn LoadEnclaveImageW( 48 | lpEnclaveAddress: LPVOID, 49 | lpImageName: LPCWSTR, 50 | ) -> BOOL; 51 | pub fn CallEnclave( 52 | lpRoutine: LPENCLAVE_ROUTINE, 53 | lpParameter: LPVOID, 54 | fWaitForThread: BOOL, 55 | lpReturnValue: *mut LPVOID, 56 | ) -> BOOL; 57 | pub fn TerminateEnclave( 58 | lpAddress: LPVOID, 59 | fWait: BOOL, 60 | ) -> BOOL; 61 | pub fn DeleteEnclave( 62 | lpAddress: LPVOID, 63 | ) -> BOOL; 64 | } 65 | -------------------------------------------------------------------------------- /src/um/errhandlingapi.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_snake_case)] 2 | use winapi::shared::basetsd::ULONG_PTR; 3 | use winapi::shared::minwindef::{BOOL, DWORD, LPDWORD, UINT, ULONG}; 4 | use winapi::um::winnt::{ 5 | EXCEPTION_POINTERS, LONG, LPCSTR, LPCWSTR, PCONTEXT, PEXCEPTION_RECORD, 6 | PVECTORED_EXCEPTION_HANDLER, PVOID, 7 | }; 8 | use winapi::um::errhandlingapi::LPTOP_LEVEL_EXCEPTION_FILTER; 9 | 10 | use crate::get_k32_fn; 11 | 12 | pub fn RaiseException() -> Option { 18 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("RaiseException\0")) ) } ) 19 | } 20 | pub fn UnhandledExceptionFilter() -> Option LONG> { 23 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("UnhandledExceptionFilter\0")) ) } ) 24 | } 25 | pub fn SetUnhandledExceptionFilter() -> Option LPTOP_LEVEL_EXCEPTION_FILTER> { 28 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetUnhandledExceptionFilter\0")) ) } ) 29 | } 30 | pub fn GetLastError() -> Option DWORD> { 31 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("GetLastError\0")) ) } ) 32 | } 33 | pub fn SetLastError() -> Option { 36 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetLastError\0")) ) } ) 37 | } 38 | pub fn GetErrorMode() -> Option UINT> { 39 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("GetErrorMode\0")) ) } ) 40 | } 41 | pub fn SetErrorMode() -> Option UINT> { 44 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetErrorMode\0")) ) } ) 45 | } 46 | pub fn AddVectoredExceptionHandler() -> Option PVOID> { 50 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("AddVectoredExceptionHandler\0")) ) } ) 51 | } 52 | pub fn RemoveVectoredExceptionHandler() -> Option ULONG> { 55 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("RemoveVectoredExceptionHandler\0")) ) } ) 56 | } 57 | pub fn AddVectoredContinueHandler() -> Option PVOID> { 61 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("AddVectoredContinueHandler\0")) ) } ) 62 | } 63 | pub fn RemoveVectoredContinueHandler() -> Option ULONG> { 66 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("RemoveVectoredContinueHandler\0")) ) } ) 67 | } 68 | pub fn RaiseFailFastException() -> Option { 73 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("RaiseFailFastException\0")) ) } ) 74 | } 75 | pub fn FatalAppExitA() -> Option { 79 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("FatalAppExitA\0")) ) } ) 80 | } 81 | pub fn FatalAppExitW() -> Option { 85 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("FatalAppExitW\0")) ) } ) 86 | } 87 | pub fn GetThreadErrorMode() -> Option DWORD> { 88 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("GetThreadErrorMode\0")) ) } ) 89 | } 90 | pub fn SetThreadErrorMode() -> Option BOOL> { 94 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetThreadErrorMode\0")) ) } ) 95 | } 96 | -------------------------------------------------------------------------------- /src/um/fibersapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, DWORD}; 7 | use um::winnt::{PFLS_CALLBACK_FUNCTION, PVOID}; 8 | extern "system" { 9 | pub fn FlsAlloc( 10 | lpCallback: PFLS_CALLBACK_FUNCTION, 11 | ) -> DWORD; 12 | pub fn FlsGetValue( 13 | dwFlsIndex: DWORD, 14 | ) -> PVOID; 15 | pub fn FlsSetValue( 16 | dwFlsIndex: DWORD, 17 | lpFlsData: PVOID, 18 | ) -> BOOL; 19 | pub fn FlsFree( 20 | dwFlsIndex: DWORD, 21 | ) -> BOOL; 22 | pub fn IsThreadAFiber() -> BOOL; 23 | } 24 | -------------------------------------------------------------------------------- /src/um/handleapi.rs: -------------------------------------------------------------------------------- 1 | #![allow(non_snake_case)] 2 | use winapi::shared::minwindef::{BOOL, DWORD, LPDWORD, LPHANDLE}; 3 | use winapi::um::winnt::HANDLE; 4 | 5 | use crate::get_k32_fn; 6 | 7 | pub fn CloseHandle() -> Option BOOL> { 10 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("CloseHandle\0")) ) } ) 11 | } 12 | pub fn DuplicateHandle() -> Option BOOL> { 21 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("DuplicateHandle\0")) ) } ) 22 | } 23 | pub fn CompareObjectHandles() -> Option BOOL> { 27 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("CompareObjectHandles\0")) ) } ) 28 | } 29 | pub fn GetHandleInformation() -> Option BOOL> { 33 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("GetHandleInformation\0")) ) } ) 34 | } 35 | pub fn SetHandleInformation() -> Option BOOL> { 40 | Some( unsafe { std::mem::transmute( get_k32_fn(obfstr::obfstr!("SetHandleInformation\0")) ) } ) 41 | } 42 | -------------------------------------------------------------------------------- /src/um/imm.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_uint; 7 | use shared::minwindef::{BOOL, DWORD, UINT}; 8 | use shared::windef::{HWND, POINT, RECT}; 9 | pub type LPUINT = *mut c_uint; 10 | STRUCT!{struct COMPOSITIONFORM { 11 | dwStyle: DWORD, 12 | ptCurrentPos: POINT, 13 | rcArea: RECT, 14 | }} 15 | DECLARE_HANDLE!{HIMC, HIMC__} 16 | pub type LPCOMPOSITIONFORM = *mut COMPOSITIONFORM; 17 | extern "system" { 18 | pub fn ImmGetContext( 19 | hwnd: HWND, 20 | ) -> HIMC; 21 | pub fn ImmGetOpenStatus( 22 | himc: HIMC, 23 | ) -> BOOL; 24 | pub fn ImmSetOpenStatus( 25 | himc: HIMC, 26 | fopen: BOOL, 27 | ) -> BOOL; 28 | pub fn ImmSetCompositionWindow( 29 | himc: HIMC, 30 | lpCompForm: LPCOMPOSITIONFORM, 31 | ) -> BOOL; 32 | pub fn ImmReleaseContext( 33 | hwnd: HWND, 34 | himc: HIMC, 35 | ) -> BOOL; 36 | } 37 | pub const CFS_DEFAULT: UINT = 0x0000; 38 | pub const CFS_RECT: UINT = 0x0001; 39 | pub const CFS_POINT: UINT = 0x0002; 40 | pub const CFS_FORCE_POSITION: UINT = 0x0020; 41 | pub const CFS_CANDIDATEPOS: UINT = 0x0040; 42 | pub const CFS_EXCLUDE: UINT = 0x0080; 43 | -------------------------------------------------------------------------------- /src/um/interlockedapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{ULONG, USHORT}; 7 | use um::winnt::{PSLIST_ENTRY, PSLIST_HEADER}; 8 | extern "system" { 9 | pub fn InitializeSListHead( 10 | ListHead: PSLIST_HEADER, 11 | ); 12 | pub fn InterlockedPopEntrySList( 13 | ListHead: PSLIST_HEADER, 14 | ) -> PSLIST_ENTRY; 15 | pub fn InterlockedPushEntrySList( 16 | ListHead: PSLIST_HEADER, 17 | ListEntry: PSLIST_ENTRY, 18 | ) -> PSLIST_ENTRY; 19 | pub fn InterlockedPushListSListEx( 20 | ListHead: PSLIST_HEADER, 21 | List: PSLIST_ENTRY, 22 | ListEnd: PSLIST_ENTRY, 23 | Count: ULONG, 24 | ) -> PSLIST_ENTRY; 25 | pub fn InterlockedFlushSList( 26 | ListHead: PSLIST_HEADER, 27 | ) -> PSLIST_ENTRY; 28 | pub fn QueryDepthSList( 29 | ListHead: PSLIST_HEADER, 30 | ) -> USHORT; 31 | } 32 | -------------------------------------------------------------------------------- /src/um/ioapiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::{PULONG_PTR, ULONG_PTR}; 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, PULONG, ULONG}; 8 | use um::minwinbase::{LPOVERLAPPED, LPOVERLAPPED_ENTRY}; 9 | use um::winnt::HANDLE; 10 | extern "system" { 11 | pub fn CreateIoCompletionPort( 12 | FileHandle: HANDLE, 13 | ExistingCompletionPort: HANDLE, 14 | CompletionKey: ULONG_PTR, 15 | NumberOfConcurrentThreads: DWORD, 16 | ) -> HANDLE; 17 | pub fn GetQueuedCompletionStatus( 18 | CompletionPort: HANDLE, 19 | lpNumberOfBytesTransferred: LPDWORD, 20 | lpCompletionKey: PULONG_PTR, 21 | lpOverlapped: *mut LPOVERLAPPED, 22 | dwMilliseconds: DWORD, 23 | ) -> BOOL; 24 | pub fn GetQueuedCompletionStatusEx( 25 | CompletionPort: HANDLE, 26 | lpCompletionPortEntries: LPOVERLAPPED_ENTRY, 27 | ulCount: ULONG, 28 | ulNumEntriesRemoved: PULONG, 29 | dwMilliseconds: DWORD, 30 | fAlertable: BOOL, 31 | ) -> BOOL; 32 | pub fn PostQueuedCompletionStatus( 33 | CompletionPort: HANDLE, 34 | dwNumberOfBytesTransferred: DWORD, 35 | dwCompletionKey: ULONG_PTR, 36 | lpOverlapped: LPOVERLAPPED, 37 | ) -> BOOL; 38 | pub fn DeviceIoControl( 39 | hDevice: HANDLE, 40 | dwIoControlCode: DWORD, 41 | lpInBuffer: LPVOID, 42 | nInBufferSize: DWORD, 43 | lpOutBuffer: LPVOID, 44 | nOutBufferSize: DWORD, 45 | lpBytesReturned: LPDWORD, 46 | lpOverlapped: LPOVERLAPPED, 47 | ) -> BOOL; 48 | pub fn GetOverlappedResult( 49 | hFile: HANDLE, 50 | lpOverlapped: LPOVERLAPPED, 51 | lpNumberOfBytesTransferred: LPDWORD, 52 | bWait: BOOL, 53 | ) -> BOOL; 54 | pub fn CancelIoEx( 55 | hFile: HANDLE, 56 | lpOverlapped: LPOVERLAPPED, 57 | ) -> BOOL; 58 | pub fn CancelIo( 59 | hFile: HANDLE, 60 | ) -> BOOL; 61 | pub fn GetOverlappedResultEx( 62 | hFile: HANDLE, 63 | lpOverlapped: LPOVERLAPPED, 64 | lpNumberOfBytesTransferred: LPDWORD, 65 | dwMilliseconds: DWORD, 66 | bAlertable: BOOL, 67 | ) -> BOOL; 68 | pub fn CancelSynchronousIo( 69 | hThread: HANDLE, 70 | ) -> BOOL; 71 | } 72 | -------------------------------------------------------------------------------- /src/um/jobapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, PBOOL}; 7 | use um::winnt::HANDLE; 8 | extern "system" { 9 | pub fn IsProcessInJob( 10 | ProcessHandle: HANDLE, 11 | JobHandle: HANDLE, 12 | Result: PBOOL, 13 | ) -> BOOL; 14 | } 15 | -------------------------------------------------------------------------------- /src/um/jobapi2.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::LONG64; 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, UINT, ULONG}; 8 | use shared::ntdef::{HANDLE, LPCWSTR, PCWSTR, VOID}; 9 | use um::minwinbase::LPSECURITY_ATTRIBUTES; 10 | use um::winnt::JOBOBJECTINFOCLASS; 11 | STRUCT!{struct JOBOBJECT_IO_RATE_CONTROL_INFORMATION { 12 | MaxIops: LONG64, 13 | MaxBandwidth: LONG64, 14 | ReservationIops: LONG64, 15 | VolumeName: PCWSTR, 16 | BaseIoSize: ULONG, 17 | ControlFlags: ULONG, 18 | }} 19 | extern "system" { 20 | pub fn CreateJobObjectW( 21 | lpJobAttributes: LPSECURITY_ATTRIBUTES, 22 | lpName: LPCWSTR, 23 | ) -> HANDLE; 24 | pub fn FreeMemoryJobObject( 25 | Buffer: *mut VOID, 26 | ) -> (); 27 | pub fn OpenJobObjectW( 28 | dwDesiredAccess: DWORD, 29 | bInheritHandle: BOOL, 30 | lpName: LPCWSTR, 31 | ) -> HANDLE; 32 | pub fn AssignProcessToJobObject( 33 | hJob: HANDLE, 34 | hProcess: HANDLE, 35 | ) -> BOOL; 36 | pub fn TerminateJobObject( 37 | hJob: HANDLE, 38 | uExitCode: UINT, 39 | ) -> BOOL; 40 | pub fn SetInformationJobObject( 41 | hJob: HANDLE, 42 | JobObjectInformationClass: JOBOBJECTINFOCLASS, 43 | lpJobObjectInformation: LPVOID, 44 | cbJovObjectInformationLength: DWORD, 45 | ) -> BOOL; 46 | pub fn SetIoRateControlInformationJobObject( 47 | hJob: HANDLE, 48 | IoRateControlInfo: *mut JOBOBJECT_IO_RATE_CONTROL_INFORMATION, 49 | ) -> DWORD; 50 | pub fn QueryInformationJobObject( 51 | hJob: HANDLE, 52 | JobObjectInformationClass: JOBOBJECTINFOCLASS, 53 | lpJobObjectInformation: LPVOID, 54 | cbJovObjectInformationLength: DWORD, 55 | lpReturnLength: LPDWORD, 56 | ) -> BOOL; 57 | pub fn QueryIoRateControlInformationJobObject( 58 | hJob: HANDLE, 59 | VolumeName: PCWSTR, 60 | InfoBlocks: *mut *mut JOBOBJECT_IO_RATE_CONTROL_INFORMATION, 61 | InfoBlockCount: *mut ULONG, 62 | ) -> DWORD; 63 | } 64 | -------------------------------------------------------------------------------- /src/um/ktmw32.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! FFI bindings to ktmw32. 7 | use shared::guiddef::LPGUID; 8 | use shared::minwindef::{BOOL, DWORD}; 9 | use um::minwinbase::LPSECURITY_ATTRIBUTES; 10 | use um::winnt::{HANDLE, LPWSTR}; 11 | extern "system" { 12 | pub fn CreateTransaction( 13 | lpTransactionAttributes: LPSECURITY_ATTRIBUTES, 14 | UOW: LPGUID, 15 | CreateOptions: DWORD, 16 | IsolationLevel: DWORD, 17 | IsolationFlags: DWORD, 18 | Timeout: DWORD, 19 | Description: LPWSTR, 20 | ) -> HANDLE; 21 | // pub fn OpenTransaction(); 22 | pub fn CommitTransaction( 23 | TransactionHandle: HANDLE, 24 | ) -> BOOL; 25 | // pub fn CommitTransactionAsync(); 26 | pub fn RollbackTransaction( 27 | TransactionHandle: HANDLE, 28 | ) -> BOOL; 29 | // pub fn RollbackTransactionAsync(); 30 | // pub fn GetTransactionId(); 31 | // pub fn GetTransactionInformation(); 32 | // pub fn SetTransactionInformation(); 33 | // pub fn CreateTransactionManager(); 34 | // pub fn OpenTransactionManager(); 35 | // pub fn OpenTransactionManagerById(); 36 | // pub fn RenameTransactionManager(); 37 | // pub fn RollforwardTransactionManager(); 38 | // pub fn RecoverTransactionManager(); 39 | // pub fn GetCurrentClockTransactionManager(); 40 | // pub fn GetTransactionManagerId(); 41 | // pub fn CreateResourceManager(); 42 | // pub fn OpenResourceManager(); 43 | // pub fn RecoverResourceManager(); 44 | // pub fn GetNotificationResourceManager(); 45 | // pub fn GetNotificationResourceManagerAsync(); 46 | // pub fn SetResourceManagerCompletionPort(); 47 | // pub fn CreateEnlistment(); 48 | // pub fn OpenEnlistment(); 49 | // pub fn RecoverEnlistment(); 50 | // pub fn GetEnlistmentRecoveryInformation(); 51 | // pub fn GetEnlistmentId(); 52 | // pub fn SetEnlistmentRecoveryInformation(); 53 | // pub fn PrepareEnlistment(); 54 | // pub fn PrePrepareEnlistment(); 55 | // pub fn CommitEnlistment(); 56 | // pub fn RollbackEnlistment(); 57 | // pub fn PrePrepareComplete(); 58 | // pub fn PrepareComplete(); 59 | // pub fn ReadOnlyEnlistment(); 60 | // pub fn CommitComplete(); 61 | // pub fn RollbackComplete(); 62 | // pub fn SinglePhaseReject(); 63 | } 64 | -------------------------------------------------------------------------------- /src/um/l2cmn.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Definitions and data structures for common layer 2. 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::DWORD; 9 | use um::winnt::PVOID; 10 | pub const L2_PROFILE_MAX_NAME_LENGTH: usize = 256; 11 | pub const L2_NOTIFICATION_SOURCE_NONE: DWORD = 0; 12 | pub const L2_NOTIFICATION_SOURCE_DOT3_AUTO_CONFIG: DWORD = 0x00000001; 13 | pub const L2_NOTIFICATION_SOURCE_SECURITY: DWORD = 0x00000002; 14 | pub const L2_NOTIFICATION_SOURCE_ONEX: DWORD = 0x00000004; 15 | pub const L2_NOTIFICATION_SOURCE_WLAN_ACM: DWORD = 0x00000008; 16 | pub const L2_NOTIFICATION_SOURCE_WLAN_MSM: DWORD = 0x00000010; 17 | pub const L2_NOTIFICATION_SOURCE_WLAN_SECURITY: DWORD = 0x00000020; 18 | pub const L2_NOTIFICATION_SOURCE_WLAN_IHV: DWORD = 0x00000040; 19 | pub const L2_NOTIFICATION_SOURCE_WLAN_HNWK: DWORD = 0x00000080; 20 | pub const L2_NOTIFICATION_SOURCE_WCM: DWORD = 0x00000100; 21 | pub const L2_NOTIFICATION_SOURCE_WCM_CSP: DWORD = 0x00000200; 22 | pub const L2_NOTIFICATION_SOURCE_WFD: DWORD = 0x00000400; 23 | pub const L2_NOTIFICATION_SOURCE_ALL: DWORD = 0x0000ffff; 24 | pub const L2_NOTIFICATION_CODE_PUBLIC_BEGIN: DWORD = 0x00000000; 25 | pub const L2_NOTIFICATION_CODE_GROUP_SIZE: DWORD = 0x00001000; 26 | pub const L2_NOTIFICATION_CODE_V2_BEGIN: DWORD = L2_NOTIFICATION_CODE_PUBLIC_BEGIN 27 | + L2_NOTIFICATION_CODE_GROUP_SIZE; 28 | pub const L2_REASON_CODE_GROUP_SIZE: u32 = 0x10000; 29 | pub const L2_REASON_CODE_GEN_BASE: u32 = 0x10000; 30 | pub const L2_REASON_CODE_DOT11_AC_BASE: u32 = L2_REASON_CODE_GEN_BASE + L2_REASON_CODE_GROUP_SIZE; 31 | pub const L2_REASON_CODE_DOT11_MSM_BASE: u32 = L2_REASON_CODE_DOT11_AC_BASE 32 | + L2_REASON_CODE_GROUP_SIZE; 33 | pub const L2_REASON_CODE_DOT11_SECURITY_BASE: u32 = L2_REASON_CODE_DOT11_MSM_BASE 34 | + L2_REASON_CODE_GROUP_SIZE; 35 | pub const L2_REASON_CODE_ONEX_BASE: u32 = L2_REASON_CODE_DOT11_SECURITY_BASE 36 | + L2_REASON_CODE_GROUP_SIZE; 37 | pub const L2_REASON_CODE_DOT3_AC_BASE: u32 = L2_REASON_CODE_ONEX_BASE 38 | + L2_REASON_CODE_GROUP_SIZE; 39 | pub const L2_REASON_CODE_DOT3_MSM_BASE: u32 = L2_REASON_CODE_DOT3_AC_BASE 40 | + L2_REASON_CODE_GROUP_SIZE; 41 | pub const L2_REASON_CODE_PROFILE_BASE: u32 = L2_REASON_CODE_DOT3_MSM_BASE 42 | + L2_REASON_CODE_GROUP_SIZE; 43 | pub const L2_REASON_CODE_IHV_BASE: u32 = L2_REASON_CODE_PROFILE_BASE + L2_REASON_CODE_GROUP_SIZE; 44 | pub const L2_REASON_CODE_WIMAX_BASE: u32 = L2_REASON_CODE_IHV_BASE + L2_REASON_CODE_GROUP_SIZE; 45 | pub const L2_REASON_CODE_SUCCESS: u32 = 0; 46 | pub const L2_REASON_CODE_UNKNOWN: u32 = L2_REASON_CODE_GEN_BASE + 1; 47 | pub const L2_REASON_CODE_PROFILE_MISSING: u32 = 0x00000001; 48 | STRUCT!{struct L2_NOTIFICATION_DATA { 49 | NotificationSource: DWORD, 50 | NotificationCode: DWORD, 51 | InterfaceGuid: GUID, 52 | dwDataSize: DWORD, 53 | pData: PVOID, 54 | }} 55 | pub type PL2_NOTIFICATION_DATA = *mut L2_NOTIFICATION_DATA; 56 | -------------------------------------------------------------------------------- /src/um/lmalert.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! This file contains structures for communication with the Alerter service 7 | use shared::lmcons::{EVLEN, NET_API_STATUS, SNLEN}; 8 | use shared::minwindef::{DWORD, LPVOID}; 9 | use um::winnt::{LPCWSTR, WCHAR}; 10 | extern "system" { 11 | pub fn NetAlertRaise( 12 | AlertType: LPCWSTR, 13 | Buffer: LPVOID, 14 | BufferSize: DWORD, 15 | ) -> NET_API_STATUS; 16 | pub fn NetAlertRaiseEx( 17 | AlertType: LPCWSTR, 18 | VariableInfo: LPVOID, 19 | VariableInfoSize: DWORD, 20 | ServiceName: LPCWSTR, 21 | ) -> NET_API_STATUS; 22 | } 23 | STRUCT!{struct STD_ALERT { 24 | alrt_timestamp: DWORD, 25 | alrt_eventname: [WCHAR; EVLEN + 1], 26 | alrt_servicename: [WCHAR; SNLEN + 1], 27 | }} 28 | pub type PSTD_ALERT = *mut STD_ALERT; 29 | pub type LPSTD_ALERT = *mut STD_ALERT; 30 | STRUCT!{struct ADMIN_OTHER_INFO { 31 | alrtad_errcode: DWORD, 32 | alrtad_numstrings: DWORD, 33 | }} 34 | pub type PADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; 35 | pub type LPADMIN_OTHER_INFO = *mut ADMIN_OTHER_INFO; 36 | STRUCT!{struct ERRLOG_OTHER_INFO { 37 | alrter_errcode: DWORD, 38 | alrter_offset: DWORD, 39 | }} 40 | pub type PERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; 41 | pub type LPERRLOG_OTHER_INFO = *mut ERRLOG_OTHER_INFO; 42 | STRUCT!{struct PRINT_OTHER_INFO { 43 | alrtpr_jobid: DWORD, 44 | alrtpr_status: DWORD, 45 | alrtpr_submitted: DWORD, 46 | alrtpr_size: DWORD, 47 | }} 48 | pub type PPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; 49 | pub type LPPRINT_OTHER_INFO = *mut PRINT_OTHER_INFO; 50 | STRUCT!{struct USER_OTHER_INFO { 51 | alrtus_errcode: DWORD, 52 | alrtus_numstrings: DWORD, 53 | }} 54 | pub type PUSER_OTHER_INFO = *mut USER_OTHER_INFO; 55 | pub type LPUSER_OTHER_INFO = *mut USER_OTHER_INFO; 56 | pub const ALERTER_MAILSLOT: &'static str = "\\\\.\\MAILSLOT\\Alerter"; 57 | pub const ALERT_PRINT_EVENT: &'static str = "PRINTING"; 58 | pub const ALERT_MESSAGE_EVENT: &'static str = "MESSAGE"; 59 | pub const ALERT_ERRORLOG_EVENT: &'static str = "ERRORLOG"; 60 | pub const ALERT_ADMIN_EVENT: &'static str = "ADMIN"; 61 | pub const ALERT_USER_EVENT: &'static str = "USER"; 62 | pub const PRJOB_QSTATUS: DWORD = 0x3; 63 | pub const PRJOB_DEVSTATUS: DWORD = 0x1fc; 64 | pub const PRJOB_COMPLETE: DWORD = 0x4; 65 | pub const PRJOB_INTERV: DWORD = 0x8; 66 | pub const PRJOB_ERROR: DWORD = 0x10; 67 | pub const PRJOB_DESTOFFLINE: DWORD = 0x20; 68 | pub const PRJOB_DESTPAUSED: DWORD = 0x40; 69 | pub const PRJOB_NOTIFY: DWORD = 0x80; 70 | pub const PRJOB_DESTNOPAPER: DWORD = 0x100; 71 | pub const PRJOB_DELETED: DWORD = 0x8000; 72 | pub const PRJOB_QS_QUEUED: DWORD = 0; 73 | pub const PRJOB_QS_PAUSED: DWORD = 1; 74 | pub const PRJOB_QS_SPOOLING: DWORD = 2; 75 | pub const PRJOB_QS_PRINTING: DWORD = 3; 76 | -------------------------------------------------------------------------------- /src/um/lmapibuf.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! This file contains information about NetApiBuffer APIs 7 | use shared::lmcons::NET_API_STATUS; 8 | use shared::minwindef::{DWORD, LPDWORD, LPVOID}; 9 | extern "system" { 10 | pub fn NetApiBufferAllocate( 11 | ByteCount: DWORD, 12 | Buffer: *mut LPVOID, 13 | ) -> NET_API_STATUS; 14 | pub fn NetApiBufferFree( 15 | Buffer: LPVOID, 16 | ) -> NET_API_STATUS; 17 | pub fn NetApiBufferReallocate( 18 | OldBuffer: LPVOID, 19 | NewByteCount: DWORD, 20 | NewBuffer: *mut LPVOID, 21 | ) -> NET_API_STATUS; 22 | pub fn NetApiBufferSize( 23 | Buffer: LPVOID, 24 | ByteCount: LPDWORD, 25 | ) -> NET_API_STATUS; 26 | pub fn NetapipBufferAllocate( 27 | ByteCount: DWORD, 28 | Buffer: *mut LPVOID, 29 | ) -> NET_API_STATUS; 30 | } 31 | -------------------------------------------------------------------------------- /src/um/lmat.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::DWORD_PTR; 7 | use shared::lmcons::NET_API_STATUS; 8 | use shared::minwindef::{DWORD, LPBYTE, LPDWORD, UCHAR}; 9 | use um::winnt::{LPCWSTR, LPWSTR}; 10 | pub const JOB_RUN_PERIODICALLY: UCHAR = 0x01; 11 | pub const JOB_EXEC_ERROR: UCHAR = 0x02; 12 | pub const JOB_RUNS_TODAY: UCHAR = 0x04; 13 | pub const JOB_ADD_CURRENT_DATE: UCHAR = 0x08; 14 | pub const JOB_NONINTERACTIVE: UCHAR = 0x10; 15 | pub const JOB_INPUT_FLAGS: UCHAR = JOB_RUN_PERIODICALLY | JOB_ADD_CURRENT_DATE 16 | | JOB_NONINTERACTIVE; 17 | pub const JOB_OUTPUT_FLAGS: UCHAR = JOB_RUN_PERIODICALLY | JOB_EXEC_ERROR | JOB_RUNS_TODAY 18 | | JOB_NONINTERACTIVE; 19 | STRUCT!{struct AT_INFO { 20 | JobTime: DWORD_PTR, 21 | DaysOfMonth: DWORD, 22 | DaysOfWeek: UCHAR, 23 | Flags: UCHAR, 24 | Command: LPWSTR, 25 | }} 26 | pub type PAT_INFO = *mut AT_INFO; 27 | pub type LPAT_INFO = *mut AT_INFO; 28 | STRUCT!{struct AT_ENUM { 29 | JobId: DWORD, 30 | JobTime: DWORD_PTR, 31 | DaysOfMonth: DWORD, 32 | DaysOfWeek: UCHAR, 33 | Flags: UCHAR, 34 | Command: LPWSTR, 35 | }} 36 | pub type PAT_ENUM = *mut AT_ENUM; 37 | pub type LPAT_ENUM = *mut AT_ENUM; 38 | extern "system" { 39 | pub fn NetScheduleJobAdd( 40 | Servername: LPCWSTR, 41 | Buffer: LPBYTE, 42 | JobId: LPDWORD, 43 | ) -> NET_API_STATUS; 44 | pub fn NetScheduleJobDel( 45 | Servername: LPCWSTR, 46 | MinJobId: DWORD, 47 | MaxJobId: DWORD, 48 | ) -> NET_API_STATUS; 49 | pub fn NetScheduleJobEnum( 50 | Servername: LPCWSTR, 51 | PointerToBuffer: *mut LPBYTE, 52 | PointerToBuffer: DWORD, 53 | EntriesRead: LPDWORD, 54 | TotalEntries: LPDWORD, 55 | ResumeHandle: LPDWORD, 56 | ) -> NET_API_STATUS; 57 | pub fn NetScheduleJobGetInfo( 58 | Servername: LPCWSTR, 59 | JobId: DWORD, 60 | PointerToBuffer: *mut LPBYTE, 61 | ) -> NET_API_STATUS; 62 | } 63 | -------------------------------------------------------------------------------- /src/um/lmmsg.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! This file contains structures, function prototypes, and definitions for the NetMessage API 7 | use shared::lmcons::NET_API_STATUS; 8 | use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; 9 | use um::winnt::{LPCWSTR, LPWSTR}; 10 | extern "system" { 11 | pub fn NetMessageNameAdd( 12 | servername: LPCWSTR, 13 | msgname: LPCWSTR, 14 | ) -> NET_API_STATUS; 15 | pub fn NetMessageNameEnum( 16 | servername: LPCWSTR, 17 | level: DWORD, 18 | bufptr: *mut LPBYTE, 19 | prefmaxlen: DWORD, 20 | entriesread: LPDWORD, 21 | totalentries: LPDWORD, 22 | resumehandle: LPDWORD, 23 | ) -> NET_API_STATUS; 24 | pub fn NetMessageNameGetInfo( 25 | servername: LPCWSTR, 26 | msgname: LPCWSTR, 27 | level: DWORD, 28 | bufptr: *mut LPBYTE, 29 | ) -> NET_API_STATUS; 30 | pub fn NetMessageNameDel( 31 | servername: LPCWSTR, 32 | msgname: LPCWSTR, 33 | ) -> NET_API_STATUS; 34 | pub fn NetMessageBufferSend( 35 | servername: LPCWSTR, 36 | msgname: LPCWSTR, 37 | fromname: LPCWSTR, 38 | buf: LPBYTE, 39 | buflen: DWORD, 40 | ) -> NET_API_STATUS; 41 | } 42 | STRUCT!{struct MSG_INFO_0 { 43 | msgi0_name: LPWSTR, 44 | }} 45 | pub type PMSG_INFO_0 = *mut MSG_INFO_0; 46 | pub type LPMSG_INFO_0 = *mut MSG_INFO_0; 47 | STRUCT!{struct MSG_INFO_1 { 48 | msgi1_name: LPWSTR, 49 | msgi1_forward_flag: DWORD, 50 | msgi1_forward: LPWSTR, 51 | }} 52 | pub type PMSG_INFO_1 = *mut MSG_INFO_1; 53 | pub type LPMSG_INFO_1 = *mut MSG_INFO_1; 54 | pub const MSGNAME_NOT_FORWARDED: DWORD = 0; 55 | pub const MSGNAME_FORWARDED_TO: DWORD = 0x04; 56 | pub const MSGNAME_FORWARDED_FROM: DWORD = 0x10; 57 | -------------------------------------------------------------------------------- /src/um/lmremutl.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! This file contains structures, function prototypes, and definitions for the NetRemote API 7 | use shared::lmcons::NET_API_STATUS; 8 | use shared::minwindef::{DWORD, LPBYTE, LPDWORD}; 9 | use um::winnt::{CHAR, LONG, LPCWSTR, LPSTR}; 10 | pub type DESC_CHAR = CHAR; 11 | pub type LPDESC = LPSTR; 12 | extern "system" { 13 | pub fn NetRemoteTOD( 14 | UncServerName: LPCWSTR, 15 | BufferPtr: *mut LPBYTE, 16 | ) -> NET_API_STATUS; 17 | pub fn NetRemoteComputerSupports( 18 | UncServerName: LPCWSTR, 19 | OptionsWanted: DWORD, 20 | OptionsSupported: LPDWORD, 21 | ) -> NET_API_STATUS; 22 | } 23 | extern "C" { 24 | pub fn RxRemoteApi( 25 | ApiNumber: DWORD, 26 | UncServerName: LPCWSTR, 27 | ParmDescString: LPDESC, 28 | DataDesc16: LPDESC, 29 | DataDesc32: LPDESC, 30 | DataDescSmb: LPDESC, 31 | AuxDesc16: LPDESC, 32 | AuxDesc32: LPDESC, 33 | AuxDescSmb: LPDESC, 34 | Flags: DWORD, 35 | ) -> NET_API_STATUS; 36 | } 37 | STRUCT!{struct TIME_OF_DAY_INFO { 38 | tod_elapsedt: DWORD, 39 | tod_msecs: DWORD, 40 | tod_hours: DWORD, 41 | tod_mins: DWORD, 42 | tod_secs: DWORD, 43 | tod_hunds: DWORD, 44 | tod_timezone: LONG, 45 | tod_tinterval: DWORD, 46 | tod_day: DWORD, 47 | tod_month: DWORD, 48 | tod_year: DWORD, 49 | tod_weekday: DWORD, 50 | }} 51 | pub type PTIME_OF_DAY_INFO = *mut TIME_OF_DAY_INFO; 52 | pub type LPTIME_OF_DAY_INFO = *mut TIME_OF_DAY_INFO; 53 | pub const SUPPORTS_REMOTE_ADMIN_PROTOCOL: DWORD = 0x00000002; 54 | pub const SUPPORTS_RPC: DWORD = 0x00000004; 55 | pub const SUPPORTS_SAM_PROTOCOL: DWORD = 0x00000008; 56 | pub const SUPPORTS_UNICODE: DWORD = 0x00000010; 57 | pub const SUPPORTS_LOCAL: DWORD = 0x00000020; 58 | pub const SUPPORTS_ANY: DWORD = 0xFFFFFFFF; 59 | pub const NO_PERMISSION_REQUIRED: DWORD = 0x00000001; 60 | pub const ALLOCATE_RESPONSE: DWORD = 0x00000002; 61 | pub const USE_SPECIFIC_TRANSPORT: DWORD = 0x80000000; 62 | -------------------------------------------------------------------------------- /src/um/lmstats.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | use shared::lmcons::NET_API_STATUS; 7 | use shared::minwindef::{DWORD, LPBYTE}; 8 | use um::winnt::{LARGE_INTEGER, LPCWSTR}; 9 | extern "system" { 10 | pub fn NetStatisticsGet( 11 | ServerName: LPCWSTR, 12 | Service: LPCWSTR, 13 | Level: DWORD, 14 | Options: DWORD, 15 | Buffer: *mut LPBYTE, 16 | ) -> NET_API_STATUS; 17 | } 18 | STRUCT!{struct STAT_WORKSTATION_0 { 19 | StatisticsStartTime: LARGE_INTEGER, 20 | BytesReceived: LARGE_INTEGER, 21 | SmbsReceived: LARGE_INTEGER, 22 | PagingReadBytesRequested: LARGE_INTEGER, 23 | NonPagingReadBytesRequested: LARGE_INTEGER, 24 | CacheReadBytesRequested: LARGE_INTEGER, 25 | NetworkReadBytesRequested: LARGE_INTEGER, 26 | BytesTransmitted: LARGE_INTEGER, 27 | SmbsTransmitted: LARGE_INTEGER, 28 | PagingWriteBytesRequested: LARGE_INTEGER, 29 | NonPagingWriteBytesRequested: LARGE_INTEGER, 30 | CacheWriteBytesRequested: LARGE_INTEGER, 31 | NetworkWriteBytesRequested: LARGE_INTEGER, 32 | InitiallyFailedOperations: DWORD, 33 | FailedCompletionOperations: DWORD, 34 | ReadOperations: DWORD, 35 | RandomReadOperations: DWORD, 36 | ReadSmbs: DWORD, 37 | LargeReadSmbs: DWORD, 38 | SmallReadSmbs: DWORD, 39 | WriteOperations: DWORD, 40 | RandomWriteOperations: DWORD, 41 | WriteSmbs: DWORD, 42 | LargeWriteSmbs: DWORD, 43 | SmallWriteSmbs: DWORD, 44 | RawReadsDenied: DWORD, 45 | RawWritesDenied: DWORD, 46 | NetworkErrors: DWORD, 47 | Sessions: DWORD, 48 | FailedSessions: DWORD, 49 | Reconnects: DWORD, 50 | CoreConnects: DWORD, 51 | Lanman20Connects: DWORD, 52 | Lanman21Connects: DWORD, 53 | LanmanNtConnects: DWORD, 54 | ServerDisconnects: DWORD, 55 | HungSessions: DWORD, 56 | UseCount: DWORD, 57 | FailedUseCount: DWORD, 58 | CurrentCommands: DWORD, 59 | }} 60 | pub type PSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; 61 | pub type LPSTAT_WORKSTATION_0 = *mut STAT_WORKSTATION_0; 62 | STRUCT!{struct STAT_SERVER_0 { 63 | sts0_start: DWORD, 64 | sts0_fopens: DWORD, 65 | sts0_devopens: DWORD, 66 | sts0_jobsqueued: DWORD, 67 | sts0_sopens: DWORD, 68 | sts0_stimedout: DWORD, 69 | sts0_serrorout: DWORD, 70 | sts0_pwerrors: DWORD, 71 | sts0_permerrors: DWORD, 72 | sts0_syserrors: DWORD, 73 | sts0_bytessent_low: DWORD, 74 | sts0_bytessent_high: DWORD, 75 | sts0_bytesrcvd_low: DWORD, 76 | sts0_bytesrcvd_high: DWORD, 77 | sts0_avresponse: DWORD, 78 | sts0_reqbufneed: DWORD, 79 | sts0_bigbufneed: DWORD, 80 | }} 81 | pub type PSTAT_SERVER_0 = *mut STAT_SERVER_0; 82 | pub type LPSTAT_SERVER_0 = *mut STAT_SERVER_0; 83 | pub const STATSOPT_CLR: DWORD = 1; 84 | pub const STATS_NO_VALUE: DWORD = -1i32 as u32; 85 | pub const STATS_OVERFLOW: DWORD = -2i32 as u32; 86 | -------------------------------------------------------------------------------- /src/um/lmuse.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! This file contains structures, function prototypes, and definitions for the NetUse API 7 | use shared::lmcons::{LMSTR, NET_API_STATUS}; 8 | use shared::minwindef::{DWORD, LPBYTE, LPDWORD, PBYTE, ULONG}; 9 | use um::winnt::LPWSTR; 10 | extern "system" { 11 | pub fn NetUseAdd( 12 | servername: LPWSTR, 13 | level: DWORD, 14 | buf: LPBYTE, 15 | parm_err: LPDWORD, 16 | ) -> NET_API_STATUS; 17 | pub fn NetUseDel( 18 | UncServerName: LMSTR, 19 | UseName: LMSTR, 20 | ForceCond: DWORD, 21 | ) -> NET_API_STATUS; 22 | pub fn NetUseEnum( 23 | UncServerName: LMSTR, 24 | Level: DWORD, 25 | BufPtr: *mut LPBYTE, 26 | PreferedMaximumSize: DWORD, 27 | EntriesRead: LPDWORD, 28 | TotalEntries: LPDWORD, 29 | ResumeHandle: LPDWORD, 30 | ) -> NET_API_STATUS; 31 | pub fn NetUseGetInfo( 32 | UncServerName: LMSTR, 33 | UseName: LMSTR, 34 | level: DWORD, 35 | bufptr: *mut LPBYTE, 36 | ) -> NET_API_STATUS; 37 | } 38 | STRUCT!{struct USE_INFO_0 { 39 | ui0_local: LMSTR, 40 | ui0_remote: LMSTR, 41 | }} 42 | pub type PUSE_INFO_0 = *mut USE_INFO_0; 43 | pub type LPUSE_INFO_0 = *mut USE_INFO_0; 44 | STRUCT!{struct USE_INFO_1 { 45 | ui1_local: LMSTR, 46 | ui1_remote: LMSTR, 47 | ui1_password: LMSTR, 48 | ui1_status: DWORD, 49 | ui1_asg_type: DWORD, 50 | ui1_refcount: DWORD, 51 | ui1_usecount: DWORD, 52 | }} 53 | pub type PUSE_INFO_1 = *mut USE_INFO_1; 54 | pub type LPUSE_INFO_1 = *mut USE_INFO_1; 55 | STRUCT!{struct USE_INFO_2 { 56 | ui2_local: LMSTR, 57 | ui2_remote: LMSTR, 58 | ui2_password: LMSTR, 59 | ui2_status: DWORD, 60 | ui2_asg_type: DWORD, 61 | ui2_refcount: DWORD, 62 | ui2_usecount: DWORD, 63 | ui2_username: LMSTR, 64 | ui2_domainname: LMSTR, 65 | }} 66 | pub type PUSE_INFO_2 = *mut USE_INFO_2; 67 | pub type LPUSE_INFO_2 = *mut USE_INFO_2; 68 | STRUCT!{struct USE_INFO_3 { 69 | ui3_ui2: USE_INFO_2, 70 | ui3_flags: ULONG, 71 | }} 72 | pub type PUSE_INFO_3 = *mut USE_INFO_3; 73 | STRUCT!{struct USE_INFO_4 { 74 | ui4_ui3: USE_INFO_3, 75 | ui4_auth_identity_length: DWORD, 76 | ui4_auth_identity: PBYTE, 77 | }} 78 | pub type PUSE_INFO_4 = *mut USE_INFO_4; 79 | pub type LPUSE_INFO_4 = *mut USE_INFO_4; 80 | pub const USE_LOCAL_PARMNUM: DWORD = 1; 81 | pub const USE_REMOTE_PARMNUM: DWORD = 2; 82 | pub const USE_PASSWORD_PARMNUM: DWORD = 3; 83 | pub const USE_ASGTYPE_PARMNUM: DWORD = 4; 84 | pub const USE_USERNAME_PARMNUM: DWORD = 5; 85 | pub const USE_DOMAINNAME_PARMNUM: DWORD = 6; 86 | pub const USE_OK: DWORD = 0; 87 | pub const USE_PAUSED: DWORD = 1; 88 | pub const USE_SESSLOST: DWORD = 2; 89 | pub const USE_DISCONN: DWORD = 2; 90 | pub const USE_NETERR: DWORD = 3; 91 | pub const USE_CONN: DWORD = 4; 92 | pub const USE_RECONN: DWORD = 5; 93 | pub const USE_WILDCARD: DWORD = -1i32 as u32; 94 | pub const USE_DISKDEV: DWORD = 0; 95 | pub const USE_SPOOLDEV: DWORD = 1; 96 | pub const USE_CHARDEV: DWORD = 2; 97 | pub const USE_IPC: DWORD = 3; 98 | pub const CREATE_NO_CONNECT: ULONG = 0x1; 99 | pub const CREATE_BYPASS_CSC: ULONG = 0x2; 100 | pub const CREATE_CRED_RESET: ULONG = 0x4; 101 | pub const USE_DEFAULT_CREDENTIALS: ULONG = 0x4; 102 | -------------------------------------------------------------------------------- /src/um/lowlevelmonitorconfigurationapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BYTE, DWORD, LPDWORD}; 7 | use um::physicalmonitorenumerationapi::_BOOL; 8 | use um::winnt::{HANDLE, LPSTR}; 9 | STRUCT!{#[repr(packed)] struct MC_TIMING_REPORT { 10 | dwHorizontalFrequencyInHZ: DWORD, 11 | dwVerticalFrequencyInHZ: DWORD, 12 | bTimingStatusByte: BYTE, 13 | }} 14 | pub type LPMC_TIMING_REPORT = *mut MC_TIMING_REPORT; 15 | ENUM!{enum MC_VCP_CODE_TYPE { 16 | MC_MOMENTARY, 17 | MC_SET_PARAMETER, 18 | }} 19 | pub type LPMC_VCP_CODE_TYPE = *mut MC_VCP_CODE_TYPE; 20 | extern "system" { 21 | pub fn GetVCPFeatureAndVCPFeatureReply( 22 | hMonitor: HANDLE, 23 | bVCPCode: BYTE, 24 | pvct: LPMC_VCP_CODE_TYPE, 25 | pdwCurrentValue: LPDWORD, 26 | pdwMaximumValue: LPDWORD, 27 | ) -> _BOOL; 28 | pub fn SetVCPFeature( 29 | hMonitor: HANDLE, 30 | bVCPCode: BYTE, 31 | dwNewValue: DWORD, 32 | ) -> _BOOL; 33 | pub fn SaveCurrentSettings( 34 | hMonitor: HANDLE, 35 | ) -> _BOOL; 36 | pub fn GetCapabilitiesStringLength( 37 | hMonitor: HANDLE, 38 | pdwCapabilitiesStringLengthInCharacters: LPDWORD, 39 | ) -> _BOOL; 40 | pub fn CapabilitiesRequestAndCapabilitiesReply( 41 | hMonitor: HANDLE, 42 | pszASCIICapabilitiesString: LPSTR, 43 | dwCapabilitiesStringLengthInCharacters: DWORD, 44 | ) -> _BOOL; 45 | pub fn GetTimingReport( 46 | hMonitor: HANDLE, 47 | pmtrMonitorTimingReport: LPMC_TIMING_REPORT, 48 | ) -> _BOOL; 49 | } 50 | -------------------------------------------------------------------------------- /src/um/minschannel.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Public Definitions for MIN SCHANNEL Security Provider 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::{BOOL, DWORD}; 9 | use um::wincrypt::ALG_ID; 10 | use um::winnt::LPWSTR; 11 | pub const SECPKG_ATTR_ISSUER_LIST: DWORD = 0x50; 12 | pub const SECPKG_ATTR_REMOTE_CRED: DWORD = 0x51; 13 | pub const SECPKG_ATTR_LOCAL_CRED: DWORD = 0x52; 14 | pub const SECPKG_ATTR_REMOTE_CERT_CONTEXT: DWORD = 0x53; 15 | pub const SECPKG_ATTR_LOCAL_CERT_CONTEXT: DWORD = 0x54; 16 | pub const SECPKG_ATTR_ROOT_STORE: DWORD = 0x55; 17 | pub const SECPKG_ATTR_SUPPORTED_ALGS: DWORD = 0x56; 18 | pub const SECPKG_ATTR_CIPHER_STRENGTHS: DWORD = 0x57; 19 | pub const SECPKG_ATTR_SUPPORTED_PROTOCOLS: DWORD = 0x58; 20 | pub const SECPKG_ATTR_ISSUER_LIST_EX: DWORD = 0x59; 21 | pub const SECPKG_ATTR_CONNECTION_INFO: DWORD = 0x5a; 22 | pub const SECPKG_ATTR_EAP_KEY_BLOCK: DWORD = 0x5b; 23 | pub const SECPKG_ATTR_MAPPED_CRED_ATTR: DWORD = 0x5c; 24 | pub const SECPKG_ATTR_SESSION_INFO: DWORD = 0x5d; 25 | pub const SECPKG_ATTR_APP_DATA: DWORD = 0x5e; 26 | pub const SECPKG_ATTR_REMOTE_CERTIFICATES: DWORD = 0x5F; 27 | pub const SECPKG_ATTR_CLIENT_CERT_POLICY: DWORD = 0x60; 28 | pub const SECPKG_ATTR_CC_POLICY_RESULT: DWORD = 0x61; 29 | pub const SECPKG_ATTR_USE_NCRYPT: DWORD = 0x62; 30 | pub const SECPKG_ATTR_LOCAL_CERT_INFO: DWORD = 0x63; 31 | pub const SECPKG_ATTR_CIPHER_INFO: DWORD = 0x64; 32 | pub const SECPKG_ATTR_EAP_PRF_INFO: DWORD = 0x65; 33 | pub const SECPKG_ATTR_SUPPORTED_SIGNATURES: DWORD = 0x66; 34 | pub const SECPKG_ATTR_REMOTE_CERT_CHAIN: DWORD = 0x67; 35 | pub const SECPKG_ATTR_UI_INFO: DWORD = 0x68; 36 | pub const SECPKG_ATTR_EARLY_START: DWORD = 0x69; 37 | STRUCT!{struct SecPkgCred_SupportedAlgs { 38 | cSupportedAlgs: DWORD, 39 | palgSupportedAlgs: *mut ALG_ID, 40 | }} 41 | STRUCT!{struct SecPkgCred_CipherStrengths { 42 | dwMinimumCipherStrength: DWORD, 43 | dwMaximumCipherStrength: DWORD, 44 | }} 45 | STRUCT!{struct SecPkgCred_SupportedProtocols { 46 | grbitProtocol: DWORD, 47 | }} 48 | STRUCT!{struct SecPkgCred_ClientCertPolicy { 49 | dwFlags: DWORD, 50 | guidPolicyId: GUID, 51 | dwCertFlags: DWORD, 52 | dwUrlRetrievalTimeout: DWORD, 53 | fCheckRevocationFreshnessTime: BOOL, 54 | dwRevocationFreshnessTime: DWORD, 55 | fOmitUsageCheck: BOOL, 56 | pwszSslCtlStoreName: LPWSTR, 57 | pwszSslCtlIdentifier: LPWSTR, 58 | }} 59 | -------------------------------------------------------------------------------- /src/um/msaatext.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{IID_ITfMSAAControl, 7 | 0xb5f8fb3b, 0x393f, 0x4f7c, 0x84, 0xcb, 0x50, 0x49, 0x24, 0xc2, 0x70, 0x5a} 8 | DEFINE_GUID!{IID_IInternalDocWrap, 9 | 0xe1aa6466, 0x9db4, 0x40ba, 0xbe, 0x03, 0x77, 0xc3, 0x8e, 0x8e, 0x60, 0xb2} 10 | DEFINE_GUID!{IID_ITextStoreACPEx, 11 | 0xa2de3bc2, 0x3d8e, 0x11d3, 0x81, 0xa9, 0xf7, 0x53, 0xfb, 0xe6, 0x1a, 0x00} 12 | DEFINE_GUID!{IID_ITextStoreAnchorEx, 13 | 0xa2de3bc1, 0x3d8e, 0x11d3, 0x81, 0xa9, 0xf7, 0x53, 0xfb, 0xe6, 0x1a, 0x00} 14 | DEFINE_GUID!{IID_ITextStoreACPSinkEx, 15 | 0x2bdf9464, 0x41e2, 0x43e3, 0x95, 0x0c, 0xa6, 0x86, 0x5b, 0xa2, 0x5c, 0xd4} 16 | DEFINE_GUID!{IID_ITextStoreSinkAnchorEx, 17 | 0x25642426, 0x028d, 0x4474, 0x97, 0x7b, 0x11, 0x1b, 0xb1, 0x14, 0xfe, 0x3e} 18 | DEFINE_GUID!{IID_IAccDictionary, 19 | 0x1dc4cb5f, 0xd737, 0x474d, 0xad, 0xe9, 0x5c, 0xcf, 0xc9, 0xbc, 0x1c, 0xc9} 20 | DEFINE_GUID!{IID_IVersionInfo, 21 | 0x401518ec, 0xdb00, 0x4611, 0x9b, 0x29, 0x2a, 0x0e, 0x4b, 0x9a, 0xfa, 0x85} 22 | DEFINE_GUID!{IID_ICoCreateLocally, 23 | 0x03de00aa, 0xf272, 0x41e3, 0x99, 0xcb, 0x03, 0xc5, 0xe8, 0x11, 0x4e, 0xa0} 24 | DEFINE_GUID!{IID_ICoCreatedLocally, 25 | 0x0a53eb6c, 0x1908, 0x4742, 0x8c, 0xff, 0x2c, 0xee, 0x2e, 0x93, 0xf9, 0x4c} 26 | DEFINE_GUID!{IID_IAccStore, 27 | 0xe2cd4a63, 0x2b72, 0x4d48, 0xb7, 0x39, 0x95, 0xe4, 0x76, 0x51, 0x95, 0xba} 28 | DEFINE_GUID!{IID_IAccServerDocMgr, 29 | 0xad7c73cf, 0x6dd5, 0x4855, 0xab, 0xc2, 0xb0, 0x4b, 0xad, 0x5b, 0x91, 0x53} 30 | DEFINE_GUID!{IID_IAccClientDocMgr, 31 | 0x4c896039, 0x7b6d, 0x49e6, 0xa8, 0xc1, 0x45, 0x11, 0x6a, 0x98, 0x29, 0x2b} 32 | DEFINE_GUID!{IID_IDocWrap, 33 | 0xdcd285fe, 0x0be0, 0x43bd, 0x99, 0xc9, 0xaa, 0xae, 0xc5, 0x13, 0xc5, 0x55} 34 | DEFINE_GUID!{IID_IClonableWrapper, 35 | 0xb33e75ff, 0xe84c, 0x4dca, 0xa2, 0x5c, 0x33, 0xb8, 0xdc, 0x00, 0x33, 0x74} 36 | DEFINE_GUID!{LIBID_MSAATEXTLib, 37 | 0x150e2d7a, 0xdac1, 0x4582, 0x94, 0x7d, 0x2a, 0x8f, 0xd7, 0x8b, 0x82, 0xcd} 38 | DEFINE_GUID!{CLSID_MSAAControl, 39 | 0x08cd963f, 0x7a3e, 0x4f5c, 0x9b, 0xd8, 0xd6, 0x92, 0xbb, 0x04, 0x3c, 0x5b} 40 | DEFINE_GUID!{CLSID_AccStore, 41 | 0x5440837f, 0x4bff, 0x4ae5, 0xa1, 0xb1, 0x77, 0x22, 0xec, 0xc6, 0x33, 0x2a} 42 | DEFINE_GUID!{CLSID_AccDictionary, 43 | 0x6572ee16, 0x5fe5, 0x4331, 0xbb, 0x6d, 0x76, 0xa4, 0x9c, 0x56, 0xe4, 0x23} 44 | DEFINE_GUID!{CLSID_AccServerDocMgr, 45 | 0x6089a37e, 0xeb8a, 0x482d, 0xbd, 0x6f, 0xf9, 0xf4, 0x69, 0x04, 0xd1, 0x6d} 46 | DEFINE_GUID!{CLSID_AccClientDocMgr, 47 | 0xfc48cc30, 0x4f3e, 0x4fa1, 0x80, 0x3b, 0xad, 0x0e, 0x19, 0x6a, 0x83, 0xb1} 48 | DEFINE_GUID!{CLSID_DocWrap, 49 | 0xbf426f7e, 0x7a5e, 0x44d6, 0x83, 0x0c, 0xa3, 0x90, 0xea, 0x94, 0x62, 0xa3} 50 | DEFINE_GUID!{IID_ITextStoreACP, 51 | 0x28888fe3, 0xc2a0, 0x483a, 0xa3, 0xea, 0x8c, 0xb1, 0xce, 0x51, 0xff, 0x3d} 52 | DEFINE_GUID!{IID_ITextStoreAnchor, 53 | 0x9b2077b0, 0x5f18, 0x4dec, 0xbe, 0xe9, 0x3c, 0xc7, 0x22, 0xf5, 0xdf, 0xe0} 54 | DEFINE_GUID!{IID_IAnchor, 55 | 0x0feb7e34, 0x5a60, 0x4356, 0x8e, 0xf7, 0xab, 0xde, 0xc2, 0xff, 0x7c, 0xf8} 56 | DEFINE_GUID!{IID_ITextStoreAnchorSink, 57 | 0xaa80e905, 0x2021, 0x11d2, 0x93, 0xe0, 0x00, 0x60, 0xb0, 0x67, 0xb8, 0x6e} 58 | DEFINE_GUID!{IID_ITextStoreACPSink, 59 | 0x22d44c94, 0xa419, 0x4542, 0xa2, 0x72, 0xae, 0x26, 0x09, 0x3e, 0xce, 0xcf} 60 | -------------------------------------------------------------------------------- /src/um/mscat.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Microsoft Internet Security Catalog API Prototypes and Definitions 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::DWORD; 9 | use um::mssip::SIP_INDIRECT_DATA; 10 | use um::wincrypt::{CRYPT_ATTR_BLOB, HCRYPTMSG, HCRYPTPROV}; 11 | use um::winnt::{HANDLE, LPWSTR}; 12 | STRUCT!{struct CRYPTCATSTORE { 13 | cbStruct: DWORD, 14 | dwPublicVersion: DWORD, 15 | pwszP7File: LPWSTR, 16 | hProv: HCRYPTPROV, 17 | dwEncodingType: DWORD, 18 | fdwStoreFlags: DWORD, 19 | hReserved: HANDLE, 20 | hAttrs: HANDLE, 21 | hCryptMsg: HCRYPTMSG, 22 | hSorted: HANDLE, 23 | }} 24 | STRUCT!{struct CRYPTCATMEMBER { 25 | cbStruct: DWORD, 26 | pwszReferenceTag: LPWSTR, 27 | pwszFileName: LPWSTR, 28 | gSubjectType: GUID, 29 | fdwMemberFlags: DWORD, 30 | pIndirectData: *mut SIP_INDIRECT_DATA, 31 | dwCertVersion: DWORD, 32 | dwReserved: DWORD, 33 | hReserved: HANDLE, 34 | sEncodedIndirectData: CRYPT_ATTR_BLOB, 35 | sEncodedMemberInfo: CRYPT_ATTR_BLOB, 36 | }} 37 | -------------------------------------------------------------------------------- /src/um/mschapp.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::SIZE_T; 7 | use shared::minwindef::{DWORD, UCHAR}; 8 | use um::winnt::{BOOLEAN, CHAR, PWSTR}; 9 | pub const CYPHER_BLOCK_LENGTH: SIZE_T = 8; 10 | STRUCT!{struct CYPHER_BLOCK { 11 | data: [CHAR; CYPHER_BLOCK_LENGTH], 12 | }} 13 | STRUCT!{struct LM_OWF_PASSWORD { 14 | data: [CYPHER_BLOCK; 2], 15 | }} 16 | pub type PLM_OWF_PASSWORD = *mut LM_OWF_PASSWORD; 17 | pub type NT_OWF_PASSWORD = LM_OWF_PASSWORD; 18 | pub type PNT_OWF_PASSWORD = *mut NT_OWF_PASSWORD; 19 | STRUCT!{struct SAMPR_ENCRYPTED_USER_PASSWORD { 20 | Buffer: [UCHAR; (256 * 2) + 4], 21 | }} 22 | pub type PSAMPR_ENCRYPTED_USER_PASSWORD = *mut SAMPR_ENCRYPTED_USER_PASSWORD; 23 | STRUCT!{struct ENCRYPTED_LM_OWF_PASSWORD { 24 | data: [CYPHER_BLOCK; 2], 25 | }} 26 | pub type PENCRYPTED_LM_OWF_PASSWORD = *mut ENCRYPTED_LM_OWF_PASSWORD; 27 | pub type ENCRYPTED_NT_OWF_PASSWORD = ENCRYPTED_LM_OWF_PASSWORD; 28 | pub type PENCRYPTED_NT_OWF_PASSWORD = *mut ENCRYPTED_NT_OWF_PASSWORD; 29 | extern "system" { 30 | pub fn MSChapSrvChangePassword( 31 | ServerName: PWSTR, 32 | UserName: PWSTR, 33 | LmOldPresent: BOOLEAN, 34 | LmOldOwfPassword: PLM_OWF_PASSWORD, 35 | LmNewOwfPassword: PLM_OWF_PASSWORD, 36 | NtOldOwfPassword: PNT_OWF_PASSWORD, 37 | NtNewOwfPassword: PNT_OWF_PASSWORD, 38 | ) -> DWORD; 39 | pub fn MSChapSrvChangePassword2( 40 | ServerName: PWSTR, 41 | UserName: PWSTR, 42 | NewPasswordEncryptedWithOldNt: PSAMPR_ENCRYPTED_USER_PASSWORD, 43 | OldNtOwfPasswordEncryptedWithNewNt: PENCRYPTED_NT_OWF_PASSWORD, 44 | LmPresent: BOOLEAN, 45 | NewPasswordEncryptedWithOldLm: PSAMPR_ENCRYPTED_USER_PASSWORD, 46 | OldLmOwfPasswordEncryptedWithNewLmOrNt: PENCRYPTED_LM_OWF_PASSWORD, 47 | ) -> DWORD; 48 | } 49 | -------------------------------------------------------------------------------- /src/um/namespaceapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | use shared::minwindef::{BOOL, LPVOID, ULONG}; 7 | use shared::ntdef::{BOOLEAN, HANDLE, LPCWSTR}; 8 | use um::minwinbase::LPSECURITY_ATTRIBUTES; 9 | use um::winnt::PSID; 10 | pub const PRIVATE_NAMESPACE_FLAG_DESTROY: ULONG = 0x00000001; 11 | extern "system" { 12 | pub fn CreatePrivateNamespaceW( 13 | lpPrivateNamespaceAttributes: LPSECURITY_ATTRIBUTES, 14 | lpBoundaryDescriptor: LPVOID, 15 | lpAliasPrefix: LPCWSTR, 16 | ) -> HANDLE; 17 | pub fn OpenPrivateNamespaceW( 18 | lpBoundaryDescriptor: LPVOID, 19 | lpAliasPrefix: LPCWSTR, 20 | ) -> HANDLE; 21 | pub fn ClosePrivateNamespace( 22 | Handle: HANDLE, 23 | Flags: ULONG, 24 | ) -> BOOLEAN; 25 | pub fn CreateBoundaryDescriptorW( 26 | Name: LPCWSTR, 27 | Flags: ULONG, 28 | ) -> HANDLE; 29 | pub fn AddSIDToBoundaryDescriptor( 30 | BoundaryDescriptor: *mut HANDLE, 31 | RequiredSid: PSID, 32 | ) -> BOOL; 33 | pub fn DeleteBoundaryDescriptor( 34 | BoundaryDescriptor: HANDLE, 35 | ) -> (); 36 | } 37 | -------------------------------------------------------------------------------- /src/um/ncrypt.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::{SIZE_T, ULONG_PTR}; 7 | use shared::bcrypt::{BCRYPT_NO_KEY_VALIDATION, BCryptBufferDesc}; 8 | use shared::minwindef::{DWORD, LPVOID, PBYTE}; 9 | use um::winnt::{LONG, LPCWSTR, VOID}; 10 | pub type SECURITY_STATUS = LONG; 11 | pub type HCRYPTPROV = ULONG_PTR; 12 | pub type HCRYPTKEY = ULONG_PTR; 13 | pub type HCRYPTHASH = ULONG_PTR; 14 | FN!{stdcall PFN_NCRYPT_ALLOC( 15 | cbSize: SIZE_T, 16 | ) -> LPVOID} 17 | FN!{stdcall PFN_NCRYPT_FREE( 18 | pv: LPVOID, 19 | ) -> VOID} 20 | STRUCT!{struct NCRYPT_ALLOC_PARA { 21 | cbSize: DWORD, 22 | pfnAlloc: PFN_NCRYPT_ALLOC, 23 | pfnFree: PFN_NCRYPT_FREE, 24 | }} 25 | pub type NCryptBufferDesc = BCryptBufferDesc; 26 | pub type NCRYPT_HANDLE = ULONG_PTR; 27 | pub type NCRYPT_PROV_HANDLE = ULONG_PTR; 28 | pub type NCRYPT_KEY_HANDLE = ULONG_PTR; 29 | pub type NCRYPT_HASH_HANDLE = ULONG_PTR; 30 | pub type NCRYPT_SECRET_HANDLE = ULONG_PTR; 31 | pub const NCRYPT_NO_PADDING_FLAG: DWORD = 0x00000001; 32 | pub const NCRYPT_PAD_PKCS1_FLAG: DWORD = 0x00000002; 33 | pub const NCRYPT_PAD_OAEP_FLAG: DWORD = 0x00000004; 34 | pub const NCRYPT_PAD_PSS_FLAG: DWORD = 0x00000008; 35 | pub const NCRYPT_PAD_CIPHER_FLAG: DWORD = 0x00000010; 36 | pub const NCRYPT_ATTESTATION_FLAG: DWORD = 0x00000020; 37 | pub const NCRYPT_SEALING_FLAG: DWORD = 0x00000100; 38 | pub const NCRYPT_REGISTER_NOTIFY_FLAG: DWORD = 0x00000001; 39 | pub const NCRYPT_UNREGISTER_NOTIFY_FLAG: DWORD = 0x00000002; 40 | pub const NCRYPT_NO_KEY_VALIDATION: DWORD = BCRYPT_NO_KEY_VALIDATION; 41 | pub const NCRYPT_MACHINE_KEY_FLAG: DWORD = 0x00000020; 42 | pub const NCRYPT_SILENT_FLAG: DWORD = 0x00000040; 43 | pub const NCRYPT_OVERWRITE_KEY_FLAG: DWORD = 0x00000080; 44 | pub const NCRYPT_WRITE_KEY_TO_LEGACY_STORE_FLAG: DWORD = 0x00000200; 45 | pub const NCRYPT_DO_NOT_FINALIZE_FLAG: DWORD = 0x00000400; 46 | pub const NCRYPT_EXPORT_LEGACY_FLAG: DWORD = 0x00000800; 47 | pub const NCRYPT_IGNORE_DEVICE_STATE_FLAG: DWORD = 0x00001000; 48 | pub const NCRYPT_TREAT_NIST_AS_GENERIC_ECC_FLAG: DWORD = 0x00002000; 49 | pub const NCRYPT_NO_CACHED_PASSWORD: DWORD = 0x00004000; 50 | pub const NCRYPT_PROTECT_TO_LOCAL_SYSTEM: DWORD = 0x00008000; 51 | pub const NCRYPT_PERSIST_ONLY_FLAG: DWORD = 0x40000000; 52 | pub const NCRYPT_PERSIST_FLAG: DWORD = 0x80000000; 53 | pub const NCRYPT_PREFER_VIRTUAL_ISOLATION_FLAG: DWORD = 0x00010000; 54 | pub const NCRYPT_USE_VIRTUAL_ISOLATION_FLAG: DWORD = 0x00020000; 55 | pub const NCRYPT_USE_PER_BOOT_KEY_FLAG: DWORD = 0x00040000; 56 | extern "system" { 57 | pub fn NCryptOpenStorageProvider( 58 | phProvider: *mut NCRYPT_PROV_HANDLE, 59 | pszProviderName: LPCWSTR, 60 | dwFlags: DWORD, 61 | ) -> SECURITY_STATUS; 62 | } 63 | pub const NCRYPT_ALLOW_EXPORT_FLAG: DWORD = 0x00000001; 64 | pub const NCRYPT_ALLOW_PLAINTEXT_EXPORT_FLAG: DWORD = 0x00000002; 65 | pub const NCRYPT_ALLOW_ARCHIVING_FLAG: DWORD = 0x00000004; 66 | pub const NCRYPT_ALLOW_PLAINTEXT_ARCHIVING_FLAG: DWORD = 0x00000008; 67 | extern "system" { 68 | pub fn NCryptSetProperty( 69 | hObject: NCRYPT_HANDLE, 70 | pszProperty: LPCWSTR, 71 | pbInput: PBYTE, 72 | cbInput: DWORD, 73 | dwFlags: DWORD, 74 | ) -> SECURITY_STATUS; 75 | pub fn NCryptImportKey( 76 | hProvider: NCRYPT_PROV_HANDLE, 77 | hImportKey: NCRYPT_KEY_HANDLE, 78 | pszBlobType: LPCWSTR, 79 | pParameterList: *const NCryptBufferDesc, 80 | phKey: *mut NCRYPT_KEY_HANDLE, 81 | pbData: PBYTE, 82 | cbData: DWORD, 83 | dwFlags: DWORD, 84 | ) -> SECURITY_STATUS; 85 | pub fn NCryptFreeObject( 86 | hObject: NCRYPT_HANDLE, 87 | ) -> SECURITY_STATUS; 88 | } 89 | -------------------------------------------------------------------------------- /src/um/objbase.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Component object model defintions 7 | use shared::minwindef::LPVOID; 8 | use um::combaseapi::COINITBASE_MULTITHREADED; 9 | use um::winnt::HRESULT; 10 | ENUM!{enum COINIT { 11 | COINIT_APARTMENTTHREADED = 0x2, 12 | COINIT_MULTITHREADED = COINITBASE_MULTITHREADED, 13 | COINIT_DISABLE_OLE1DDE = 0x4, 14 | COINIT_SPEED_OVER_MEMORY = 0x8, 15 | }} 16 | // pub fn CoBuildVersion(); 17 | extern "system" { 18 | pub fn CoInitialize( 19 | pvReserved: LPVOID, 20 | ) -> HRESULT; 21 | } 22 | // pub fn CoRegisterMallocSpy(); 23 | // pub fn CoRevokeMallocSpy(); 24 | // pub fn CoRegisterInitializeSpy(); 25 | // pub fn CoRevokeInitializeSpy(); 26 | // pub fn CoGetSystemSecurityPermissions(); 27 | // pub fn CoLoadLibrary(); 28 | // pub fn CoFreeLibrary(); 29 | // pub fn CoFreeAllLibraries(); 30 | // pub fn CoGetInstanceFromFile(); 31 | // pub fn CoGetInstanceFromIStorage(); 32 | // pub fn CoAllowSetForegroundWindow(); 33 | // pub fn DcomChannelSetHResult(); 34 | // pub fn CoIsOle1Class(); 35 | // pub fn CLSIDFromProgIDEx(); 36 | // pub fn CoFileTimeToDosDateTime(); 37 | // pub fn CoDosDateTimeToFileTime(); 38 | // pub fn CoFileTimeNow(); 39 | // pub fn CoRegisterMessageFilter(); 40 | // pub fn CoRegisterChannelHook(); 41 | // pub fn CoTreatAsClass(); 42 | // pub fn CreateDataAdviseHolder(); 43 | // pub fn CreateDataCache(); 44 | // pub fn StgOpenAsyncDocfileOnIFillLockBytes(); 45 | // pub fn StgGetIFillLockBytesOnILockBytes(); 46 | // pub fn StgGetIFillLockBytesOnFile(); 47 | // pub fn StgOpenLayoutDocfile(); 48 | // pub fn CoInstall(); 49 | // pub fn BindMoniker(); 50 | // pub fn CoGetObject(); 51 | // pub fn MkParseDisplayName(); 52 | // pub fn MonikerRelativePathTo(); 53 | // pub fn MonikerCommonPrefixWith(); 54 | // pub fn CreateBindCtx(); 55 | // pub fn CreateGenericComposite(); 56 | // pub fn GetClassFile(); 57 | // pub fn CreateClassMoniker(); 58 | // pub fn CreateFileMoniker(); 59 | // pub fn CreateItemMoniker(); 60 | // pub fn CreateAntiMoniker(); 61 | // pub fn CreatePointerMoniker(); 62 | // pub fn CreateObjrefMoniker(); 63 | // pub fn GetRunningObjectTable(); 64 | // pub fn CreateStdProgressIndicator(); 65 | -------------------------------------------------------------------------------- /src/um/ocidl.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | // TODO:It is a minimal implementation. 7 | use shared::guiddef::CLSID; 8 | use shared::minwindef::{DWORD, ULONG}; 9 | use shared::ntdef::HRESULT; 10 | use shared::wtypes::{CLIPFORMAT, VARTYPE}; 11 | use shared::wtypesbase::{LPCOLESTR, LPOLESTR}; 12 | use um::oaidl::{IErrorLog, VARIANT}; 13 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 14 | ENUM!{enum READYSTATE { 15 | READYSTATE_UNINITIALIZED = 0, 16 | READYSTATE_LOADING = 1, 17 | READYSTATE_LOADED = 2, 18 | READYSTATE_INTERACTIVE = 3, 19 | READYSTATE_COMPLETE = 4, 20 | }} 21 | ENUM!{enum PROPBAG2_TYPE { 22 | PROPBAG2_TYPE_UNDEFINED = 0, 23 | PROPBAG2_TYPE_DATA = 1, 24 | PROPBAG2_TYPE_URL = 2, 25 | PROPBAG2_TYPE_OBJECT = 3, 26 | PROPBAG2_TYPE_STREAM = 4, 27 | PROPBAG2_TYPE_STORAGE = 5, 28 | PROPBAG2_TYPE_MONIKER = 6, 29 | }} 30 | STRUCT!{struct PROPBAG2 { 31 | dwType: DWORD, 32 | vt: VARTYPE, 33 | cfType: CLIPFORMAT, 34 | dwHint: DWORD, 35 | pstrName: LPOLESTR, 36 | clsid: CLSID, 37 | }} 38 | RIDL!{#[uuid(0x22f55882, 0x280b, 0x11d0, 0xa8, 0xa9, 0x00, 0xa0, 0xc9, 0x0c, 0x20, 0x04)] 39 | interface IPropertyBag2(IPropertyBag2Vtbl): IUnknown(IUnknownVtbl) { 40 | fn Read( 41 | cProperties: ULONG, 42 | pPropBag: *const PROPBAG2, 43 | pErrLog: *const IErrorLog, 44 | pvarValue: *mut VARIANT, 45 | phrError: *mut HRESULT, 46 | ) -> HRESULT, 47 | fn Write( 48 | cProperties: ULONG, 49 | pPropBag: *const PROPBAG2, 50 | pvarValue: *const VARIANT, 51 | ) -> HRESULT, 52 | fn CountProperties( 53 | pcProperties: *mut ULONG, 54 | ) -> HRESULT, 55 | fn GetPropertyInfo( 56 | iProperty: ULONG, 57 | cProperties: ULONG, 58 | pPropBag: *mut PROPBAG2, 59 | pcProperties: *mut ULONG, 60 | ) -> HRESULT, 61 | fn LoadObject( 62 | pstrName: LPCOLESTR, 63 | dwHint: DWORD, 64 | pUnkObject: *const IUnknown, 65 | pErrLog: *const IErrorLog, 66 | ) -> HRESULT, 67 | }} 68 | pub type LPPROPERTYBAG2 = *mut IPropertyBag2; 69 | -------------------------------------------------------------------------------- /src/um/ole2.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::LPVOID; 7 | use shared::windef::HWND; 8 | use um::oleidl::LPDROPTARGET; 9 | use um::winnt::HRESULT; 10 | extern "system" { 11 | pub fn OleInitialize( 12 | pvReserved: LPVOID, 13 | ) -> HRESULT; 14 | pub fn RegisterDragDrop( 15 | hwnd: HWND, 16 | pDropTarget: LPDROPTARGET, 17 | ) -> HRESULT; 18 | pub fn RevokeDragDrop( 19 | hwnd: HWND, 20 | ) -> HRESULT; 21 | } 22 | -------------------------------------------------------------------------------- /src/um/olectl.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! OLE Control interfaces 7 | use shared::winerror::{FACILITY_ITF, SEVERITY_ERROR, SEVERITY_SUCCESS}; 8 | use um::winnt::HRESULT; 9 | pub const SELFREG_E_FIRST: HRESULT = MAKE_SCODE!(SEVERITY_ERROR, FACILITY_ITF, 0x0200); 10 | pub const SELFREG_E_LAST: HRESULT = MAKE_SCODE!(SEVERITY_ERROR, FACILITY_ITF, 0x020F); 11 | pub const SELFREG_S_FIRST: HRESULT = MAKE_SCODE!(SEVERITY_SUCCESS, FACILITY_ITF, 0x0200); 12 | pub const SELFREG_S_LAST: HRESULT = MAKE_SCODE!(SEVERITY_SUCCESS, FACILITY_ITF, 0x020F); 13 | pub const SELFREG_E_TYPELIB: HRESULT = SELFREG_E_FIRST + 0; 14 | pub const SELFREG_E_CLASS: HRESULT = SELFREG_E_FIRST + 1; 15 | -------------------------------------------------------------------------------- /src/um/oleidl.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::DWORD; 7 | use shared::ntdef::HRESULT; 8 | use shared::windef::POINTL; 9 | use um::objidl::IDataObject; 10 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 11 | pub const MK_ALT: DWORD = 20; 12 | pub const DROPEFFECT_NONE: DWORD = 0; 13 | pub const DROPEFFECT_COPY: DWORD = 1; 14 | pub const DROPEFFECT_MOVE: DWORD = 2; 15 | pub const DROPEFFECT_LINK: DWORD = 4; 16 | pub const DROPEFFECT_SCROLL: DWORD = 0x80000000; 17 | pub const DD_DEFSCROLLINSET: DWORD = 11; 18 | pub const DD_DEFSCROLLDELAY: DWORD = 50; 19 | pub const DD_DEFSCROLLINTERVAL: DWORD = 50; 20 | pub const DD_DEFDRAGDELAY: DWORD = 200; 21 | pub const DD_DEFDRAGMINDIST: DWORD = 2; 22 | pub type LPDROPTARGET = *mut IDropTarget; 23 | RIDL!{#[uuid(0x00000122, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] 24 | interface IDropTarget(IDropTargetVtbl): IUnknown(IUnknownVtbl) { 25 | fn DragEnter( 26 | pDataObj: *const IDataObject, 27 | grfKeyState: DWORD, 28 | pt: *const POINTL, 29 | pdwEffect: *mut DWORD, 30 | ) -> HRESULT, 31 | fn DragOver( 32 | grfKeyState: DWORD, 33 | pt: *const POINTL, 34 | pdwEffect: *mut DWORD, 35 | ) -> HRESULT, 36 | fn DragLeave() -> HRESULT, 37 | fn Drop( 38 | pDataObj: *const IDataObject, 39 | grfKeyState: DWORD, 40 | pt: *const POINTL, 41 | pdwEffect: *mut DWORD, 42 | ) -> HRESULT, 43 | }} 44 | -------------------------------------------------------------------------------- /src/um/physicalmonitorenumerationapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::d3d9::IDirect3DDevice9; 7 | use shared::minwindef::{BOOL, DWORD, LPDWORD}; 8 | use shared::windef::HMONITOR; 9 | use um::winnt::{HANDLE, HRESULT, WCHAR}; 10 | pub type _BOOL = BOOL; 11 | pub const PHYSICAL_MONITOR_DESCRIPTION_SIZE: usize = 128; 12 | STRUCT!{#[repr(packed)] struct PHYSICAL_MONITOR { 13 | hPhysicalMonitor: HANDLE, 14 | szPhysicalMonitorDescription: [WCHAR; PHYSICAL_MONITOR_DESCRIPTION_SIZE], 15 | }} 16 | pub type LPPHYSICAL_MONITOR = *mut PHYSICAL_MONITOR; 17 | extern "system" { 18 | pub fn GetNumberOfPhysicalMonitorsFromHMONITOR( 19 | hMonitor: HMONITOR, 20 | pdwNumberOfPhysicalMonitor: LPDWORD, 21 | ) -> _BOOL; 22 | pub fn GetNumberOfPhysicalMonitorsFromIDirect3DDevice9( 23 | pDirect3DDevice9: *mut IDirect3DDevice9, 24 | pdwNumberOfPhysicalMonitor: LPDWORD, 25 | ) -> HRESULT; 26 | pub fn GetPhysicalMonitorsFromHMONITOR( 27 | hMonitor: HMONITOR, 28 | dwPhysicalMonitorArraySize: DWORD, 29 | pPhysicalMonitorArray: LPPHYSICAL_MONITOR, 30 | ) -> _BOOL; 31 | pub fn GetPhysicalMonitorsFromIDirect3DDevice9( 32 | pDirect3DDevice9: IDirect3DDevice9, 33 | dwPhysicalMonitorArraySize: DWORD, 34 | pPhysicalMonitorArray: LPPHYSICAL_MONITOR, 35 | ) -> HRESULT; 36 | pub fn DestroyPhysicalMonitor( 37 | hMonitor: HANDLE, 38 | ) -> _BOOL; 39 | pub fn DestroyPhysicalMonitors( 40 | dwPhysicalMonitorArraySize: DWORD, 41 | pPhysicalMonitorArray: LPPHYSICAL_MONITOR, 42 | ) -> _BOOL; 43 | } 44 | -------------------------------------------------------------------------------- /src/um/playsoundapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! ApiSet Contract for api-ms-win-mm-playsound-l1-1-0 7 | use shared::minwindef::{BOOL, DWORD, HMODULE, UINT}; 8 | use um::winnt::{LPCSTR, LPCWSTR}; 9 | extern "system" { 10 | pub fn sndPlaySoundA( 11 | pszSound: LPCSTR, 12 | fuSound: UINT, 13 | ) -> BOOL; 14 | pub fn sndPlaySoundW( 15 | pszSound: LPCWSTR, 16 | fuSound: UINT, 17 | ) -> BOOL; 18 | } 19 | pub const SND_SYNC: DWORD = 0x0000; 20 | pub const SND_ASYNC: DWORD = 0x0001; 21 | pub const SND_NODEFAULT: DWORD = 0x0002; 22 | pub const SND_MEMORY: DWORD = 0x0004; 23 | pub const SND_LOOP: DWORD = 0x0008; 24 | pub const SND_NOSTOP: DWORD = 0x0010; 25 | pub const SND_NOWAIT: DWORD = 0x00002000; 26 | pub const SND_ALIAS: DWORD = 0x00010000; 27 | pub const SND_ALIAS_ID: DWORD = 0x00110000; 28 | pub const SND_FILENAME: DWORD = 0x00020000; 29 | pub const SND_RESOURCE: DWORD = 0x00040004; 30 | pub const SND_PURGE: DWORD = 0x0040; 31 | pub const SND_APPLICATION: DWORD = 0x0080; 32 | pub const SND_SENTRY: DWORD = 0x00080000; 33 | pub const SND_RING: DWORD = 0x00100000; 34 | pub const SND_SYSTEM: DWORD = 0x00200000; 35 | extern "system" { 36 | pub fn PlaySoundA( 37 | pszSound: LPCSTR, 38 | hmod: HMODULE, 39 | fdwSound: DWORD, 40 | ) -> BOOL; 41 | pub fn PlaySoundW( 42 | pszSound: LPCWSTR, 43 | hmod: HMODULE, 44 | fdwSound: DWORD, 45 | ) -> BOOL; 46 | } 47 | -------------------------------------------------------------------------------- /src/um/powerbase.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{DWORD, ULONG}; 7 | use um::winnt::{ 8 | BOOLEAN, HANDLE, LONG, POWER_INFORMATION_LEVEL, POWER_PLATFORM_ROLE, 9 | PSYSTEM_POWER_CAPABILITIES, PVOID, 10 | }; 11 | use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; 12 | pub type NTSTATUS = LONG; 13 | extern "system" { 14 | pub fn CallNtPowerInformation( 15 | InformationLevel: POWER_INFORMATION_LEVEL, 16 | InputBuffer: PVOID, 17 | InputBufferLength: ULONG, 18 | OutputBuffer: PVOID, 19 | OutputBufferLength: ULONG, 20 | ) -> NTSTATUS; 21 | pub fn GetPwrCapabilities( 22 | lpspc: PSYSTEM_POWER_CAPABILITIES, 23 | ) -> BOOLEAN; 24 | pub fn PowerDeterminePlatformRoleEx( 25 | Version: ULONG, 26 | ) -> POWER_PLATFORM_ROLE; 27 | pub fn PowerRegisterSuspendResumeNotification( 28 | Flags: DWORD, 29 | Recipient: HANDLE, 30 | RegistrationHandle: PHPOWERNOTIFY, 31 | ) -> DWORD; 32 | pub fn PowerUnregisterSuspendResumeNotification( 33 | RegistrationHandle: HPOWERNOTIFY, 34 | ) -> DWORD; 35 | } 36 | -------------------------------------------------------------------------------- /src/um/powersetting.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::guiddef::{GUID, LPCGUID}; 7 | use shared::minwindef::{DWORD, HKEY, LPBYTE, LPDWORD, PUCHAR, PULONG}; 8 | use um::winnt::HANDLE; 9 | use um::winuser::{HPOWERNOTIFY, PHPOWERNOTIFY}; 10 | extern "system" { 11 | pub fn PowerReadACValue( 12 | RootPowerKey: HKEY, 13 | SchemeGuid: *const GUID, 14 | SubGroupOfPowerSettingsGuid: *const GUID, 15 | PowerSettingGuid: *const GUID, 16 | Type: PULONG, 17 | Buffer: LPBYTE, 18 | BufferSize: LPDWORD, 19 | ) -> DWORD; 20 | pub fn PowerReadDCValue( 21 | RootPowerKey: HKEY, 22 | SchemeGuid: *const GUID, 23 | SubGroupOfPowerSettingsGuid: *const GUID, 24 | PowerSettingGuid: *const GUID, 25 | Type: PULONG, 26 | Buffer: PUCHAR, 27 | BufferSize: LPDWORD, 28 | ) -> DWORD; 29 | pub fn PowerWriteACValueIndex( 30 | RootPowerKey: HKEY, 31 | SchemeGuid: *const GUID, 32 | SubGroupOfPowerSettingsGuid: *const GUID, 33 | PowerSettingGuid: *const GUID, 34 | AcValueIndex: DWORD, 35 | ) -> DWORD; 36 | pub fn PowerWriteDCValueIndex( 37 | RootPowerKey: HKEY, 38 | SchemeGuid: *const GUID, 39 | SubGroupOfPowerSettingsGuid: *const GUID, 40 | PowerSettingGuid: *const GUID, 41 | DcValueIndex: DWORD, 42 | ) -> DWORD; 43 | pub fn PowerGetActiveScheme( 44 | UserRootPowerKey: HKEY, 45 | ActivePolicyGuid: *mut *mut GUID, 46 | ) -> DWORD; 47 | pub fn PowerSetActiveScheme( 48 | UserRootPowerKey: HKEY, 49 | SchemeGuid: *const GUID, 50 | ) -> DWORD; 51 | pub fn PowerSettingRegisterNotification( 52 | SettingGuid: LPCGUID, 53 | Flags: DWORD, 54 | Recipient: HANDLE, 55 | RegistrationHandle: PHPOWERNOTIFY, 56 | ) -> DWORD; 57 | pub fn PowerSettingUnregisterNotification( 58 | RegistrationHandle: HPOWERNOTIFY, 59 | ) -> DWORD; 60 | } 61 | -------------------------------------------------------------------------------- /src/um/processenv.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, DWORD}; 7 | use um::winnt::{HANDLE, LPCH, LPCSTR, LPCWSTR, LPSTR, LPWCH, LPWSTR, PHANDLE}; 8 | extern "system" { 9 | pub fn GetEnvironmentStrings() -> LPCH; 10 | pub fn GetEnvironmentStringsW() -> LPWCH; 11 | pub fn SetEnvironmentStringsW( 12 | NewEnvironment: LPWCH, 13 | ) -> BOOL; 14 | pub fn FreeEnvironmentStringsA( 15 | penv: LPCH, 16 | ) -> BOOL; 17 | pub fn FreeEnvironmentStringsW( 18 | penv: LPWCH, 19 | ) -> BOOL; 20 | pub fn GetStdHandle( 21 | nStdHandle: DWORD, 22 | ) -> HANDLE; 23 | pub fn SetStdHandle( 24 | nStdHandle: DWORD, 25 | hHandle: HANDLE, 26 | ) -> BOOL; 27 | pub fn SetStdHandleEx( 28 | nStdHandle: DWORD, 29 | hHandle: HANDLE, 30 | phPrevValue: PHANDLE, 31 | ) -> BOOL; 32 | pub fn GetCommandLineA() -> LPSTR; 33 | pub fn GetCommandLineW() -> LPWSTR; 34 | pub fn GetEnvironmentVariableA( 35 | lpName: LPCSTR, 36 | lpBuffer: LPSTR, 37 | nSize: DWORD, 38 | ) -> DWORD; 39 | pub fn GetEnvironmentVariableW( 40 | lpName: LPCWSTR, 41 | lpBuffer: LPWSTR, 42 | nSize: DWORD, 43 | ) -> DWORD; 44 | pub fn SetEnvironmentVariableA( 45 | lpName: LPCSTR, 46 | lpValue: LPCSTR, 47 | ) -> BOOL; 48 | pub fn SetEnvironmentVariableW( 49 | lpName: LPCWSTR, 50 | lpValue: LPCWSTR, 51 | ) -> BOOL; 52 | pub fn ExpandEnvironmentStringsA( 53 | lpSrc: LPCSTR, 54 | lpDst: LPSTR, 55 | nSize: DWORD, 56 | ) -> DWORD; 57 | pub fn ExpandEnvironmentStringsW( 58 | lpSrc: LPCWSTR, 59 | lpDst: LPWSTR, 60 | nSize: DWORD, 61 | ) -> DWORD; 62 | pub fn SetCurrentDirectoryA( 63 | lpPathName: LPCSTR, 64 | ) -> BOOL; 65 | pub fn SetCurrentDirectoryW( 66 | lpPathName: LPCWSTR, 67 | ) -> BOOL; 68 | pub fn GetCurrentDirectoryA( 69 | nBufferLength: DWORD, 70 | lpBuffer: LPSTR, 71 | ) -> DWORD; 72 | pub fn GetCurrentDirectoryW( 73 | nBufferLength: DWORD, 74 | lpBuffer: LPWSTR, 75 | ) -> DWORD; 76 | pub fn SearchPathW( 77 | lpPath: LPCWSTR, 78 | lpFileName: LPCWSTR, 79 | lpExtension: LPCWSTR, 80 | nBufferLength: DWORD, 81 | lpBuffer: LPWSTR, 82 | lpFilePart: *mut LPWSTR, 83 | ) -> DWORD; 84 | pub fn SearchPathA( 85 | lpPath: LPCSTR, 86 | lpFileName: LPCSTR, 87 | lpExtension: LPCSTR, 88 | nBufferLength: DWORD, 89 | lpBuffer: LPSTR, 90 | lpFilePart: *mut LPSTR, 91 | ) -> DWORD; 92 | pub fn NeedCurrentDirectoryForExePathA( 93 | ExeName: LPCSTR, 94 | ) -> BOOL; 95 | pub fn NeedCurrentDirectoryForExePathW( 96 | ExeName: LPCWSTR, 97 | ) -> BOOL; 98 | } 99 | -------------------------------------------------------------------------------- /src/um/processtopologyapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, PUSHORT}; 7 | use um::winnt::{GROUP_AFFINITY, HANDLE, PGROUP_AFFINITY}; 8 | extern "system" { 9 | pub fn GetProcessGroupAffinity( 10 | hProcess: HANDLE, 11 | GroupCount: PUSHORT, 12 | GroupArray: PUSHORT, 13 | ) -> BOOL; 14 | pub fn GetThreadGroupAffinity( 15 | hThread: HANDLE, 16 | GroupAffinity: PGROUP_AFFINITY, 17 | ) -> BOOL; 18 | pub fn SetThreadGroupAffinity( 19 | hThread: HANDLE, 20 | GroupAffinity: *const GROUP_AFFINITY, 21 | PreviousGroupAffinity: PGROUP_AFFINITY, 22 | ) -> BOOL; 23 | } 24 | -------------------------------------------------------------------------------- /src/um/profileapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::BOOL; 7 | use um::winnt::LARGE_INTEGER; 8 | extern "system" { 9 | pub fn QueryPerformanceCounter( 10 | lpPerformanceCount: *mut LARGE_INTEGER, 11 | ) -> BOOL; 12 | pub fn QueryPerformanceFrequency( 13 | lpFrequency: *mut LARGE_INTEGER, 14 | ) -> BOOL; 15 | } 16 | -------------------------------------------------------------------------------- /src/um/propkeydef.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | use shared::guiddef::IsEqualIID; 7 | use shared::wtypes::{PROPERTYKEY, PROPID}; 8 | pub const PID_FIRST_USABLE: PROPID = 2; 9 | pub type REFPROPERTYKEY = *const PROPERTYKEY; 10 | #[inline] 11 | pub fn IsEqualPropertyKey(a: &PROPERTYKEY, b: &PROPERTYKEY) -> bool { 12 | (a.pid == b.pid) && IsEqualIID(&a.fmtid, &b.fmtid) 13 | } 14 | -------------------------------------------------------------------------------- /src/um/propsys.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::DWORD; 7 | use shared::wtypes::PROPERTYKEY; 8 | use um::propidl::{PROPVARIANT, REFPROPVARIANT}; 9 | use um::propkeydef::REFPROPERTYKEY; 10 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 11 | use um::winnt::HRESULT; 12 | pub type IPropertyDescriptionList = IUnknown; // TODO 13 | RIDL!{#[uuid(0x886d8eeb, 0x8cf2, 0x4446, 0x8d, 0x02, 0xcd, 0xba, 0x1d, 0xbd, 0xcf, 0x99)] 14 | interface IPropertyStore(IPropertyStoreVtbl): IUnknown(IUnknownVtbl) { 15 | fn GetCount( 16 | cProps: *mut DWORD, 17 | ) -> HRESULT, 18 | fn GetAt( 19 | iProp: DWORD, 20 | pkey: *mut PROPERTYKEY, 21 | ) -> HRESULT, 22 | fn GetValue( 23 | key: REFPROPERTYKEY, 24 | pv: *mut PROPVARIANT, 25 | ) -> HRESULT, 26 | fn SetValue( 27 | key: REFPROPERTYKEY, 28 | propvar: REFPROPVARIANT, 29 | ) -> HRESULT, 30 | fn Commit() -> HRESULT, 31 | }} 32 | ENUM!{enum GETPROPERTYSTOREFLAGS { 33 | GPS_DEFAULT = 0, 34 | GPS_HANDLERPROPERTIESONLY = 0x1, 35 | GPS_READWRITE = 0x2, 36 | GPS_TEMPORARY = 0x4, 37 | GPS_FASTPROPERTIESONLY = 0x8, 38 | GPS_OPENSLOWITEM = 0x10, 39 | GPS_DELAYCREATION = 0x20, 40 | GPS_BESTEFFORT = 0x40, 41 | GPS_NO_OPLOCK = 0x80, 42 | GPS_PREFERQUERYPROPERTIES = 0x100, 43 | GPS_EXTRINSICPROPERTIES = 0x200, 44 | GPS_EXTRINSICPROPERTIESONLY = 0x400, 45 | GPS_MASK_VALID = 0x7ff, 46 | }} 47 | -------------------------------------------------------------------------------- /src/um/realtimeapiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::PULONG64; 7 | use shared::minwindef::{BOOL, PULONG, USHORT}; 8 | use um::winnt::{HANDLE, PULONGLONG}; 9 | extern "system" { 10 | pub fn QueryThreadCycleTime( 11 | ThreadHandle: HANDLE, 12 | CycleTime: PULONG64, 13 | ) -> BOOL; 14 | pub fn QueryProcessCycleTime( 15 | ProcessHandle: HANDLE, 16 | CycleTime: PULONG64, 17 | ) -> BOOL; 18 | pub fn QueryIdleProcessorCycleTime( 19 | BufferLength: PULONG, 20 | ProcessorIdleCycleTime: PULONG64, 21 | ) -> BOOL; 22 | pub fn QueryIdleProcessorCycleTimeEx( 23 | Group: USHORT, 24 | BufferLength: PULONG, 25 | ProcessorIdleCycleTime: PULONG64, 26 | ) -> BOOL; 27 | pub fn QueryUnbiasedInterruptTime( 28 | UnbiasedTime: PULONGLONG, 29 | ) -> BOOL; 30 | } 31 | -------------------------------------------------------------------------------- /src/um/reason.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::DWORD; 7 | pub const SHTDN_REASON_FLAG_COMMENT_REQUIRED: DWORD = 0x01000000; 8 | pub const SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED: DWORD = 0x02000000; 9 | pub const SHTDN_REASON_FLAG_CLEAN_UI: DWORD = 0x04000000; 10 | pub const SHTDN_REASON_FLAG_DIRTY_UI: DWORD = 0x08000000; 11 | pub const SHTDN_REASON_FLAG_USER_DEFINED: DWORD = 0x40000000; 12 | pub const SHTDN_REASON_FLAG_PLANNED: DWORD = 0x80000000; 13 | pub const SHTDN_REASON_MAJOR_OTHER: DWORD = 0x00000000; 14 | pub const SHTDN_REASON_MAJOR_NONE: DWORD = 0x00000000; 15 | pub const SHTDN_REASON_MAJOR_HARDWARE: DWORD = 0x00010000; 16 | pub const SHTDN_REASON_MAJOR_OPERATINGSYSTEM: DWORD = 0x00020000; 17 | pub const SHTDN_REASON_MAJOR_SOFTWARE: DWORD = 0x00030000; 18 | pub const SHTDN_REASON_MAJOR_APPLICATION: DWORD = 0x00040000; 19 | pub const SHTDN_REASON_MAJOR_SYSTEM: DWORD = 0x00050000; 20 | pub const SHTDN_REASON_MAJOR_POWER: DWORD = 0x00060000; 21 | pub const SHTDN_REASON_MAJOR_LEGACY_API: DWORD = 0x00070000; 22 | pub const SHTDN_REASON_MINOR_OTHER: DWORD = 0x00000000; 23 | pub const SHTDN_REASON_MINOR_NONE: DWORD = 0x000000ff; 24 | pub const SHTDN_REASON_MINOR_MAINTENANCE: DWORD = 0x00000001; 25 | pub const SHTDN_REASON_MINOR_INSTALLATION: DWORD = 0x00000002; 26 | pub const SHTDN_REASON_MINOR_UPGRADE: DWORD = 0x00000003; 27 | pub const SHTDN_REASON_MINOR_RECONFIG: DWORD = 0x00000004; 28 | pub const SHTDN_REASON_MINOR_HUNG: DWORD = 0x00000005; 29 | pub const SHTDN_REASON_MINOR_UNSTABLE: DWORD = 0x00000006; 30 | pub const SHTDN_REASON_MINOR_DISK: DWORD = 0x00000007; 31 | pub const SHTDN_REASON_MINOR_PROCESSOR: DWORD = 0x00000008; 32 | pub const SHTDN_REASON_MINOR_NETWORKCARD: DWORD = 0x00000009; 33 | pub const SHTDN_REASON_MINOR_POWER_SUPPLY: DWORD = 0x0000000a; 34 | pub const SHTDN_REASON_MINOR_CORDUNPLUGGED: DWORD = 0x0000000b; 35 | pub const SHTDN_REASON_MINOR_ENVIRONMENT: DWORD = 0x0000000c; 36 | pub const SHTDN_REASON_MINOR_HARDWARE_DRIVER: DWORD = 0x0000000d; 37 | pub const SHTDN_REASON_MINOR_OTHERDRIVER: DWORD = 0x0000000e; 38 | pub const SHTDN_REASON_MINOR_BLUESCREEN: DWORD = 0x0000000F; 39 | pub const SHTDN_REASON_MINOR_SERVICEPACK: DWORD = 0x00000010; 40 | pub const SHTDN_REASON_MINOR_HOTFIX: DWORD = 0x00000011; 41 | pub const SHTDN_REASON_MINOR_SECURITYFIX: DWORD = 0x00000012; 42 | pub const SHTDN_REASON_MINOR_SECURITY: DWORD = 0x00000013; 43 | pub const SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY: DWORD = 0x00000014; 44 | pub const SHTDN_REASON_MINOR_WMI: DWORD = 0x00000015; 45 | pub const SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL: DWORD = 0x00000016; 46 | pub const SHTDN_REASON_MINOR_HOTFIX_UNINSTALL: DWORD = 0x00000017; 47 | pub const SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL: DWORD = 0x00000018; 48 | pub const SHTDN_REASON_MINOR_MMC: DWORD = 0x00000019; 49 | pub const SHTDN_REASON_MINOR_SYSTEMRESTORE: DWORD = 0x0000001a; 50 | pub const SHTDN_REASON_MINOR_TERMSRV: DWORD = 0x00000020; 51 | pub const SHTDN_REASON_MINOR_DC_PROMOTION: DWORD = 0x00000021; 52 | pub const SHTDN_REASON_MINOR_DC_DEMOTION: DWORD = 0x00000022; 53 | pub const SHTDN_REASON_UNKNOWN: DWORD = SHTDN_REASON_MINOR_NONE; 54 | pub const SHTDN_REASON_LEGACY_API: DWORD = SHTDN_REASON_MAJOR_LEGACY_API 55 | | SHTDN_REASON_FLAG_PLANNED; 56 | pub const SHTDN_REASON_VALID_BIT_MASK: DWORD = 0xc0ffffff; 57 | pub const PCLEANUI: DWORD = SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_CLEAN_UI; 58 | pub const UCLEANUI: DWORD = SHTDN_REASON_FLAG_CLEAN_UI; 59 | pub const PDIRTYUI: DWORD = SHTDN_REASON_FLAG_PLANNED | SHTDN_REASON_FLAG_DIRTY_UI; 60 | pub const UDIRTYUI: DWORD = SHTDN_REASON_FLAG_DIRTY_UI; 61 | -------------------------------------------------------------------------------- /src/um/restrictederrorinfo.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::wtypes::BSTR; 7 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 8 | use um::winnt::HRESULT; 9 | RIDL!{#[uuid(0x82ba7092, 0x4c88, 0x427d, 0xa7, 0xbc, 0x16, 0xdd, 0x93, 0xfe, 0xb6, 0x7e)] 10 | interface IRestrictedErrorInfo(IRestrictedErrorInfoVtbl): IUnknown(IUnknownVtbl) { 11 | fn GetErrorDetails( 12 | description: *mut BSTR, 13 | error: *mut HRESULT, 14 | restrictedDescription: *mut BSTR, 15 | capabilitySid: *mut BSTR, 16 | ) -> HRESULT, 17 | fn GetReference( 18 | reference: *mut BSTR, 19 | ) -> HRESULT, 20 | }} 21 | -------------------------------------------------------------------------------- /src/um/rtinfo.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::basetsd::DWORD_PTR; 7 | pub const ALIGN_SIZE: DWORD_PTR = 0x00000008; 8 | -------------------------------------------------------------------------------- /src/um/securityappcontainer.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, PULONG, ULONG}; 7 | use um::winnt::{HANDLE, LPWSTR, PSID}; 8 | extern "system" { 9 | pub fn GetAppContainerNamedObjectPath( 10 | Token: HANDLE, 11 | AppContainerSid: PSID, 12 | ObjectPathLength: ULONG, 13 | ObjectPath: LPWSTR, 14 | ReturnLength: PULONG, 15 | ) -> BOOL; 16 | } 17 | -------------------------------------------------------------------------------- /src/um/servprov.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_void; 7 | use shared::guiddef::{REFGUID, REFIID}; 8 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 9 | use um::winnt::HRESULT; 10 | pub type LPSERVICEPROVIDER = *mut IServiceProvider; 11 | RIDL!{#[uuid(0x6d5140c1, 0x7436, 0x11ce, 0x80, 0x34, 0x00, 0xaa, 0x00, 0x60, 0x09, 0xfa)] 12 | interface IServiceProvider(IServiceProviderVtbl): IUnknown(IUnknownVtbl) { 13 | fn QueryService( 14 | guidService: REFGUID, 15 | riid: REFIID, 16 | ppvObject: *mut *mut c_void, 17 | ) -> HRESULT, 18 | fn RemoteQueryService( 19 | guidService: REFGUID, 20 | riid: REFIID, 21 | ppvObject: *mut *mut IUnknown, 22 | ) -> HRESULT, 23 | }} 24 | -------------------------------------------------------------------------------- /src/um/shellscalingapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::UINT; 7 | use shared::windef::HMONITOR; 8 | use um::winnt::{HANDLE, HRESULT}; 9 | ENUM!{enum PROCESS_DPI_AWARENESS { 10 | PROCESS_DPI_UNAWARE = 0, 11 | PROCESS_SYSTEM_DPI_AWARE = 1, 12 | PROCESS_PER_MONITOR_DPI_AWARE = 2, 13 | }} 14 | ENUM!{enum MONITOR_DPI_TYPE { 15 | MDT_EFFECTIVE_DPI = 0, 16 | MDT_ANGULAR_DPI = 1, 17 | MDT_RAW_DPI = 2, 18 | MDT_DEFAULT = MDT_EFFECTIVE_DPI, 19 | }} 20 | extern "system" { 21 | pub fn SetProcessDpiAwareness( 22 | value: PROCESS_DPI_AWARENESS, 23 | ) -> HRESULT; 24 | pub fn GetProcessDpiAwareness( 25 | hProcess: HANDLE, 26 | value: *mut PROCESS_DPI_AWARENESS, 27 | ) -> HRESULT; 28 | pub fn GetDpiForMonitor( 29 | hmonitor: HMONITOR, 30 | dpiType: MONITOR_DPI_TYPE, 31 | dpiX: *mut UINT, 32 | dpiY: *mut UINT, 33 | ) -> HRESULT; 34 | } 35 | ENUM!{enum SHELL_UI_COMPONENT { 36 | SHELL_UI_COMPONENT_TASKBARS = 0, 37 | SHELL_UI_COMPONENT_NOTIFICATIONAREA = 1, 38 | SHELL_UI_COMPONENT_DESKBAND = 2, 39 | }} 40 | extern "system" { 41 | pub fn GetDpiForShellUIComponent( 42 | component: SHELL_UI_COMPONENT, 43 | ) -> UINT; 44 | } 45 | -------------------------------------------------------------------------------- /src/um/shtypes.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! this ALWAYS GENERATED file contains the definitions for the interfaces 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::{BYTE, USHORT}; 9 | use um::winnt::LPCWSTR; 10 | STRUCT!{#[repr(packed)] struct SHITEMID { 11 | cb: USHORT, 12 | abID: [BYTE; 1], 13 | }} 14 | pub type LPSHITEMID = *mut SHITEMID; 15 | pub type LPCSHITEMID = *const SHITEMID; 16 | STRUCT!{#[repr(packed)] struct ITEMIDLIST { 17 | mkid: SHITEMID, 18 | }} 19 | pub type ITEMIDLIST_RELATIVE = ITEMIDLIST; 20 | pub type ITEMID_CHILD = ITEMIDLIST; 21 | pub type ITEMIDLIST_ABSOLUTE = ITEMIDLIST; 22 | pub type LPITEMIDLIST = *mut ITEMIDLIST; 23 | pub type LPCITEMIDLIST = *const ITEMIDLIST; 24 | pub type PIDLIST_ABSOLUTE = *mut ITEMIDLIST_ABSOLUTE; 25 | pub type PCIDLIST_ABSOLUTE = *const ITEMIDLIST_ABSOLUTE; 26 | pub type PCUIDLIST_ABSOLUTE = *const ITEMIDLIST_ABSOLUTE; 27 | pub type PIDLIST_RELATIVE = *mut ITEMIDLIST_RELATIVE; 28 | pub type PCIDLIST_RELATIVE = *const ITEMIDLIST_RELATIVE; 29 | pub type PUIDLIST_RELATIVE = *mut ITEMIDLIST_RELATIVE; 30 | pub type PCUIDLIST_RELATIVE = *const ITEMIDLIST_RELATIVE; 31 | pub type PITEMID_CHILD = *mut ITEMID_CHILD; 32 | pub type PCITEMID_CHILD = *const ITEMID_CHILD; 33 | pub type PUITEMID_CHILD = *mut ITEMID_CHILD; 34 | pub type PCUITEMID_CHILD = *const ITEMID_CHILD; 35 | pub type PCUITEMID_CHILD_ARRAY = *const PCUITEMID_CHILD; 36 | pub type PCUIDLIST_RELATIVE_ARRAY = *const PCUIDLIST_RELATIVE; 37 | pub type PCIDLIST_ABSOLUTE_ARRAY = *const PCIDLIST_ABSOLUTE; 38 | pub type PCUIDLIST_ABSOLUTE_ARRAY = *const PCUIDLIST_ABSOLUTE; 39 | STRUCT!{struct COMDLG_FILTERSPEC { 40 | pszName: LPCWSTR, 41 | pszSpec: LPCWSTR, 42 | }} 43 | pub type KNOWNFOLDERID = GUID; 44 | pub type REFKNOWNFOLDERID = *const KNOWNFOLDERID; 45 | -------------------------------------------------------------------------------- /src/um/softpub.rs: -------------------------------------------------------------------------------- 1 | //50 2 | DEFINE_GUID!{WINTRUST_ACTION_GENERIC_VERIFY_V2, 3 | 0xaac56b, 0xcd44, 0x11d0, 0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee} 4 | -------------------------------------------------------------------------------- /src/um/spapidef.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Public header file for Windows NT Setup and Device Installer services Dlls 7 | use shared::minwindef::DWORD; 8 | use um::winnt::DWORDLONG; 9 | pub type SP_LOG_TOKEN = DWORDLONG; 10 | pub type PSP_LOG_TOKEN = *mut DWORDLONG; 11 | pub const LOGTOKEN_TYPE_MASK: SP_LOG_TOKEN = 3; 12 | pub const LOGTOKEN_UNSPECIFIED: SP_LOG_TOKEN = 0; 13 | pub const LOGTOKEN_NO_LOG: SP_LOG_TOKEN = 1; 14 | pub const LOGTOKEN_SETUPAPI_APPLOG: SP_LOG_TOKEN = 2; 15 | pub const LOGTOKEN_SETUPAPI_DEVLOG: SP_LOG_TOKEN = 3; 16 | pub const TXTLOG_SETUPAPI_DEVLOG: DWORD = 0x00000001; 17 | pub const TXTLOG_SETUPAPI_CMDLINE: DWORD = 0x00000002; 18 | pub const TXTLOG_SETUPAPI_BITS: DWORD = 0x00000003; 19 | pub const TXTLOG_ERROR: DWORD = 0x1; 20 | pub const TXTLOG_WARNING: DWORD = 0x2; 21 | pub const TXTLOG_SYSTEM_STATE_CHANGE: DWORD = 0x3; 22 | pub const TXTLOG_SUMMARY: DWORD = 0x4; 23 | pub const TXTLOG_DETAILS: DWORD = 0x5; 24 | pub const TXTLOG_VERBOSE: DWORD = 0x6; 25 | pub const TXTLOG_VERY_VERBOSE: DWORD = 0x7; 26 | pub const TXTLOG_RESERVED_FLAGS: DWORD = 0x0000FFF0; 27 | pub const TXTLOG_TIMESTAMP: DWORD = 0x00010000; 28 | pub const TXTLOG_DEPTH_INCR: DWORD = 0x00020000; 29 | pub const TXTLOG_DEPTH_DECR: DWORD = 0x00040000; 30 | pub const TXTLOG_TAB_1: DWORD = 0x00080000; 31 | pub const TXTLOG_FLUSH_FILE: DWORD = 0x00100000; 32 | #[inline] 33 | pub fn TXTLOG_LEVEL(flags: DWORD) -> DWORD { 34 | flags & 0xf 35 | } 36 | pub const TXTLOG_DEVINST: DWORD = 0x00000001; 37 | pub const TXTLOG_INF: DWORD = 0x00000002; 38 | pub const TXTLOG_FILEQ: DWORD = 0x00000004; 39 | pub const TXTLOG_COPYFILES: DWORD = 0x00000008; 40 | pub const TXTLOG_SIGVERIF: DWORD = 0x00000020; 41 | pub const TXTLOG_BACKUP: DWORD = 0x00000080; 42 | pub const TXTLOG_UI: DWORD = 0x00000100; 43 | pub const TXTLOG_UTIL: DWORD = 0x00000200; 44 | pub const TXTLOG_INFDB: DWORD = 0x00000400; 45 | pub const TXTLOG_POLICY: DWORD = 0x00800000; 46 | pub const TXTLOG_NEWDEV: DWORD = 0x01000000; 47 | pub const TXTLOG_UMPNPMGR: DWORD = 0x02000000; 48 | pub const TXTLOG_DRIVER_STORE: DWORD = 0x04000000; 49 | pub const TXTLOG_SETUP: DWORD = 0x08000000; 50 | pub const TXTLOG_CMI: DWORD = 0x10000000; 51 | pub const TXTLOG_DEVMGR: DWORD = 0x20000000; 52 | pub const TXTLOG_INSTALLER: DWORD = 0x40000000; 53 | pub const TXTLOG_VENDOR: DWORD = 0x80000000; 54 | -------------------------------------------------------------------------------- /src/um/sporder.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! Service Provider Order 7 | use ctypes::c_int; 8 | use shared::guiddef::LPGUID; 9 | use shared::minwindef::{DWORD, LPDWORD}; 10 | extern "system" { 11 | pub fn WSCWriteProviderOrder( 12 | lpwdCatalogEntryId: LPDWORD, 13 | dwNumberOfEntries: DWORD, 14 | ) -> c_int; 15 | } 16 | FN!{stdcall LPWSCWRITEPROVIDERORDER( 17 | lpwdCatalogEntryId: LPDWORD, 18 | dwNumberOfEntries: DWORD, 19 | ) -> c_int} 20 | #[cfg(target_pointer_width = "64")] 21 | extern "system" { 22 | pub fn WSCWriteProviderOrder32( 23 | lpwdCatalogEntryId: LPDWORD, 24 | dwNumberOfEntries: DWORD, 25 | ) -> c_int; 26 | pub fn WSCWriteNameSpaceOrder( 27 | lpProviderId: LPGUID, 28 | dwNumberOfEntries: DWORD, 29 | ) -> c_int; 30 | } 31 | FN!{stdcall LPWSCWRITENAMESPACEORDER( 32 | lpProviderId: LPGUID, 33 | dwNumberOfEntries: DWORD, 34 | ) -> c_int} 35 | #[cfg(target_pointer_width = "64")] 36 | extern "system" { 37 | pub fn WSCWriteNameSpaceOrder32( 38 | lpProviderId: LPGUID, 39 | dwNumberOfEntries: DWORD, 40 | ) -> c_int; 41 | } 42 | -------------------------------------------------------------------------------- /src/um/sspi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Security Support Provider Interface Prototypes and structure definitions 7 | pub use shared::sspi::*; 8 | -------------------------------------------------------------------------------- /src/um/stringapiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_int; 7 | use shared::minwindef::{BOOL, DWORD, LPARAM, LPBOOL, LPVOID, LPWORD, UINT}; 8 | use um::winnls::LPNLSVERSIONINFO; 9 | use um::winnt::{LCID, LPCSTR, LPCWCH, LPCWSTR, LPSTR, LPWSTR, PCNZWCH}; 10 | extern "system" { 11 | pub fn CompareStringEx( 12 | lpLocaleName: LPCWSTR, 13 | dwCmpFlags: DWORD, 14 | lpString1: LPCWCH, 15 | cchCount1: c_int, 16 | lpString2: LPCWCH, 17 | cchCount2: c_int, 18 | lpVersionInformation: LPNLSVERSIONINFO, 19 | lpReserved: LPVOID, 20 | lParam: LPARAM, 21 | ) -> c_int; 22 | pub fn CompareStringOrdinal( 23 | lpString1: LPCWCH, 24 | cchCount1: c_int, 25 | lpString2: LPCWCH, 26 | cchCount2: c_int, 27 | bIgnoreCase: BOOL, 28 | ) -> c_int; 29 | pub fn CompareStringW( 30 | Locale: LCID, 31 | dwCmpFlags: DWORD, 32 | lpString1: PCNZWCH, 33 | cchCount1: c_int, 34 | lpString2: PCNZWCH, 35 | cchCount2: c_int, 36 | ) -> c_int; 37 | pub fn FoldStringW( 38 | dwMapFlags: DWORD, 39 | lpSrcStr: LPCWCH, 40 | cchSrc: c_int, 41 | lpDestStr: LPWSTR, 42 | cchDest: c_int, 43 | ) -> c_int; 44 | pub fn GetStringTypeExW( 45 | Locale: LCID, 46 | dwInfoType: DWORD, 47 | lpSrcStr: LPCWCH, 48 | cchSrc: c_int, 49 | lpCharType: LPWORD, 50 | ) -> BOOL; 51 | pub fn GetStringTypeW( 52 | dwInfoType: DWORD, 53 | lpSrcStr: LPCWCH, 54 | cchSrc: c_int, 55 | lpCharType: LPWORD, 56 | ) -> BOOL; 57 | pub fn MultiByteToWideChar( 58 | CodePage: UINT, 59 | dwFlags: DWORD, 60 | lpMultiByteStr: LPCSTR, 61 | cbMultiByte: c_int, 62 | lpWideCharStr: LPWSTR, 63 | cchWideChar: c_int, 64 | ) -> c_int; 65 | pub fn WideCharToMultiByte( 66 | CodePage: UINT, 67 | dwFlags: DWORD, 68 | lpWideCharStr: LPCWSTR, 69 | cchWideChar: c_int, 70 | lpMultiByteStr: LPSTR, 71 | cbMultiByte: c_int, 72 | lpDefaultChar: LPCSTR, 73 | lpUsedDefaultChar: LPBOOL, 74 | ) -> c_int; 75 | } 76 | -------------------------------------------------------------------------------- /src/um/strmif.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use um::winnt::LONGLONG; 7 | pub type REFERENCE_TIME = LONGLONG; 8 | -------------------------------------------------------------------------------- /src/um/systemtopologyapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, PULONG, PUSHORT, ULONG, USHORT}; 7 | use um::winnt::PGROUP_AFFINITY; 8 | extern "system" { 9 | pub fn GetNumaHighestNodeNumber( 10 | HighestNodeNumber: PULONG, 11 | ) -> BOOL; 12 | pub fn GetNumaNodeProcessorMaskEx( 13 | Node: USHORT, 14 | ProcessorMask: PGROUP_AFFINITY, 15 | ) -> BOOL; 16 | pub fn GetNumaProximityNodeEx( 17 | ProximityId: ULONG, 18 | NodeNumber: PUSHORT, 19 | ) -> BOOL; 20 | } 21 | -------------------------------------------------------------------------------- /src/um/textstor.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | DEFINE_GUID!{GUID_TS_SERVICE_DATAOBJECT, 7 | 0x6086fbb5, 0xe225, 0x46ce, 0xa7, 0x70, 0xc1, 0xbb, 0xd3, 0xe0, 0x5d, 0x7b} 8 | DEFINE_GUID!{GUID_TS_SERVICE_ACCESSIBLE, 9 | 0xf9786200, 0xa5bf, 0x4a0f, 0x8c, 0x24, 0xfb, 0x16, 0xf5, 0xd1, 0xaa, 0xbb} 10 | DEFINE_GUID!{GUID_TS_SERVICE_ACTIVEX, 11 | 0xea937a50, 0xc9a6, 0x4b7d, 0x89, 0x4a, 0x49, 0xd9, 0x9b, 0x78, 0x48, 0x34} 12 | -------------------------------------------------------------------------------- /src/um/threadpoollegacyapiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, DWORD, ULONG}; 7 | use um::minwinbase::LPTHREAD_START_ROUTINE; 8 | use um::winnt::{HANDLE, PHANDLE, PVOID, WAITORTIMERCALLBACK}; 9 | extern "system" { 10 | pub fn QueueUserWorkItem( 11 | Function: LPTHREAD_START_ROUTINE, 12 | Context: PVOID, 13 | Flags: ULONG, 14 | ) -> BOOL; 15 | pub fn UnregisterWaitEx( 16 | WaitHandle: HANDLE, 17 | CompletionEvent: HANDLE, 18 | ) -> BOOL; 19 | pub fn CreateTimerQueue() -> HANDLE; 20 | pub fn CreateTimerQueueTimer( 21 | phNewTimer: PHANDLE, 22 | TimerQueue: HANDLE, 23 | Callback: WAITORTIMERCALLBACK, 24 | Parameter: PVOID, 25 | DueTime: DWORD, 26 | Period: DWORD, 27 | Flags: ULONG, 28 | ) -> BOOL; 29 | pub fn ChangeTimerQueueTimer( 30 | TimerQueue: HANDLE, 31 | Timer: HANDLE, 32 | DueTime: ULONG, 33 | Period: ULONG, 34 | ) -> BOOL; 35 | pub fn DeleteTimerQueueTimer( 36 | TimerQueue: HANDLE, 37 | Timer: HANDLE, 38 | CompletionEvent: HANDLE, 39 | ) -> BOOL; 40 | pub fn DeleteTimerQueueEx( 41 | TimerQueue: HANDLE, 42 | CompletionEvent: HANDLE, 43 | ) -> BOOL; 44 | } 45 | -------------------------------------------------------------------------------- /src/um/timeapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{DWORD, UINT}; 7 | use um::mmsystem::{LPTIMECAPS, MMRESULT}; 8 | extern "system" { 9 | pub fn timeGetTime() -> DWORD; 10 | pub fn timeGetDevCaps( 11 | ptc: LPTIMECAPS, 12 | cbtc: UINT, 13 | ) -> MMRESULT; 14 | pub fn timeBeginPeriod( 15 | uPeriod: UINT, 16 | ) -> MMRESULT; 17 | pub fn timeEndPeriod( 18 | uPeriod: UINT, 19 | ) -> MMRESULT; 20 | } 21 | -------------------------------------------------------------------------------- /src/um/timezoneapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! ApiSet Contract for api-ms-win-core-timezone-l1 7 | use shared::minwindef::{BOOL, DWORD, FILETIME, LPDWORD, LPFILETIME, USHORT}; 8 | use um::minwinbase::{LPSYSTEMTIME, SYSTEMTIME}; 9 | use um::winnt::{BOOLEAN, LONG, WCHAR}; 10 | pub const TIME_ZONE_ID_INVALID: DWORD = 0xFFFFFFFF; 11 | STRUCT!{struct TIME_ZONE_INFORMATION { 12 | Bias: LONG, 13 | StandardName: [WCHAR; 32], 14 | StandardDate: SYSTEMTIME, 15 | StandardBias: LONG, 16 | DaylightName: [WCHAR; 32], 17 | DaylightDate: SYSTEMTIME, 18 | DaylightBias: LONG, 19 | }} 20 | pub type PTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION; 21 | pub type LPTIME_ZONE_INFORMATION = *mut TIME_ZONE_INFORMATION; 22 | STRUCT!{struct DYNAMIC_TIME_ZONE_INFORMATION { 23 | Bias: LONG, 24 | StandardName: [WCHAR; 32], 25 | StandardDate: SYSTEMTIME, 26 | StandardBias: LONG, 27 | DaylightName: [WCHAR; 32], 28 | DaylightDate: SYSTEMTIME, 29 | DaylightBias: LONG, 30 | TimeZoneKeyName: [WCHAR; 128], 31 | DynamicDaylightTimeDisabled: BOOLEAN, 32 | }} 33 | pub type PDYNAMIC_TIME_ZONE_INFORMATION = *mut DYNAMIC_TIME_ZONE_INFORMATION; 34 | extern "system" { 35 | pub fn SystemTimeToTzSpecificLocalTime( 36 | lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, 37 | lpUniversalTime: *const SYSTEMTIME, 38 | lpLocalTime: LPSYSTEMTIME, 39 | ) -> BOOL; 40 | pub fn TzSpecificLocalTimeToSystemTime( 41 | lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, 42 | lpLocalTime: *const SYSTEMTIME, 43 | lpUniversalTime: LPSYSTEMTIME, 44 | ) -> BOOL; 45 | pub fn FileTimeToSystemTime( 46 | lpFileTime: *const FILETIME, 47 | lpSystemTime: LPSYSTEMTIME, 48 | ) -> BOOL; 49 | pub fn SystemTimeToFileTime( 50 | lpSystemTime: *const SYSTEMTIME, 51 | lpFileTime: LPFILETIME, 52 | ) -> BOOL; 53 | pub fn GetTimeZoneInformation( 54 | lpTimeZoneInformation: LPTIME_ZONE_INFORMATION, 55 | ) -> DWORD; 56 | pub fn SetTimeZoneInformation( 57 | lpTimeZoneInformation: *const TIME_ZONE_INFORMATION, 58 | ) -> BOOL; 59 | pub fn SetDynamicTimeZoneInformation( 60 | lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, 61 | ) -> BOOL; 62 | pub fn GetDynamicTimeZoneInformation( 63 | pTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, 64 | ) -> DWORD; 65 | pub fn GetTimeZoneInformationForYear( 66 | wYear: USHORT, 67 | pdtzi: PDYNAMIC_TIME_ZONE_INFORMATION, 68 | ptzi: LPTIME_ZONE_INFORMATION, 69 | ) -> BOOL; 70 | pub fn EnumDynamicTimeZoneInformation( 71 | dwIndex: DWORD, 72 | lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, 73 | ) -> DWORD; 74 | pub fn GetDynamicTimeZoneInformationEffectiveYears( 75 | lpTimeZoneInformation: PDYNAMIC_TIME_ZONE_INFORMATION, 76 | FirstYear: LPDWORD, 77 | LastYear: LPDWORD, 78 | ) -> DWORD; 79 | pub fn SystemTimeToTzSpecificLocalTimeEx( 80 | lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, 81 | lpUniversalTime: *const SYSTEMTIME, 82 | lpLocalTime: LPSYSTEMTIME, 83 | ) -> BOOL; 84 | pub fn TzSpecificLocalTimeToSystemTimeEx( 85 | lpTimeZoneInformation: *const DYNAMIC_TIME_ZONE_INFORMATION, 86 | lpLocalTime: *const SYSTEMTIME, 87 | lpUniversalTime: LPSYSTEMTIME, 88 | ) -> BOOL; 89 | } 90 | -------------------------------------------------------------------------------- /src/um/unknwnbase.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_void; 7 | use shared::guiddef::REFIID; 8 | use shared::minwindef::{BOOL, ULONG}; 9 | use um::winnt::HRESULT; 10 | RIDL!{#[uuid(0x00000000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] 11 | interface IUnknown(IUnknownVtbl) { 12 | fn QueryInterface( 13 | riid: REFIID, 14 | ppvObject: *mut *mut c_void, 15 | ) -> HRESULT, 16 | fn AddRef() -> ULONG, 17 | fn Release() -> ULONG, 18 | }} 19 | pub type LPUNKNOWN = *mut IUnknown; 20 | RIDL!{#[uuid(0x000e0000, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] 21 | interface AsyncIUnknown(AsyncIUnknownVtbl): IUnknown(IUnknownVtbl) { 22 | fn Begin_QueryInterface( 23 | riid: REFIID, 24 | ) -> HRESULT, 25 | fn Finish_QueryInterface( 26 | ppvObject: *mut *mut c_void, 27 | ) -> HRESULT, 28 | fn Begin_AddRef() -> HRESULT, 29 | fn Finish_AddRef() -> ULONG, 30 | fn Begin_Release() -> HRESULT, 31 | fn Finish_Release() -> ULONG, 32 | }} 33 | RIDL!{#[uuid(0x00000001, 0x0000, 0x0000, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46)] 34 | interface IClassFactory(IClassFactoryVtbl): IUnknown(IUnknownVtbl) { 35 | fn CreateInstance( 36 | pUnkOuter: *mut IUnknown, 37 | riid: REFIID, 38 | ppvObject: *mut *mut c_void, 39 | ) -> HRESULT, 40 | fn LockServer( 41 | fLock: BOOL, 42 | ) -> HRESULT, 43 | }} 44 | -------------------------------------------------------------------------------- /src/um/urlhist.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Url History Interfaces 7 | use ctypes::c_void; 8 | use shared::guiddef::REFIID; 9 | use shared::minwindef::{BOOL, DWORD, FILETIME, ULONG}; 10 | use shared::wtypesbase::LPCOLESTR; 11 | use um::docobj::{IOleCommandTarget, IOleCommandTargetVtbl}; 12 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 13 | use um::winnt::{HRESULT, LPWSTR}; 14 | pub const STATURL_QUERYFLAG_ISCACHED: DWORD = 0x00010000; 15 | pub const STATURL_QUERYFLAG_NOURL: DWORD = 0x00020000; 16 | pub const STATURL_QUERYFLAG_NOTITLE: DWORD = 0x00040000; 17 | pub const STATURL_QUERYFLAG_TOPLEVEL: DWORD = 0x00080000; 18 | pub const STATURLFLAG_ISCACHED: DWORD = 0x00000001; 19 | pub const STATURLFLAG_ISTOPLEVEL: DWORD = 0x00000002; 20 | ENUM!{enum ADDURL_FLAG { 21 | ADDURL_FIRST = 0, 22 | ADDURL_ADDTOHISTORYANDCACHE = 0, 23 | ADDURL_ADDTOCACHE = 1, 24 | ADDURL_Max = 2147483647, 25 | }} 26 | pub type LPENUMSTATURL = *mut IEnumSTATURL; 27 | STRUCT!{struct STATURL { 28 | cbSize: DWORD, 29 | pwcsUrl: LPWSTR, 30 | pwcsTitle: LPWSTR, 31 | ftLastVisited: FILETIME, 32 | ftLastUpdated: FILETIME, 33 | ftExpires: FILETIME, 34 | dwFlags: DWORD, 35 | }} 36 | pub type LPSTATURL = *mut STATURL; 37 | RIDL!{#[uuid(0x3c374a42, 0xbae4, 0x11cf, 0xbf, 0x7d, 0x00, 0xaa, 0x00, 0x69, 0x46, 0xee)] 38 | interface IEnumSTATURL(IEnumSTATURLVtbl): IUnknown(IUnknownVtbl) { 39 | fn Next( 40 | celt: ULONG, 41 | rgelt: LPSTATURL, 42 | pceltFetched: *mut ULONG, 43 | ) -> HRESULT, 44 | fn Skip( 45 | celt: ULONG, 46 | ) -> HRESULT, 47 | fn Reset() -> HRESULT, 48 | fn Clone( 49 | ppenum: *mut *mut IEnumSTATURL, 50 | ) -> HRESULT, 51 | fn SetFilter( 52 | poszFilter: LPCOLESTR, 53 | dwFlags: DWORD, 54 | ) -> HRESULT, 55 | }} 56 | pub type LPURLHISTORYSTG = *mut IUrlHistoryStg; 57 | RIDL!{#[uuid(0x3c374a41, 0xbae4, 0x11cf, 0xbf, 0x7d, 0x00, 0xaa, 0x00, 0x69, 0x46, 0xee)] 58 | interface IUrlHistoryStg(IUrlHistoryStgVtbl): IUnknown(IUnknownVtbl) { 59 | fn AddUrl( 60 | pocsUrl: LPCOLESTR, 61 | ) -> HRESULT, 62 | fn DeleteUrl( 63 | pocsUrl: LPCOLESTR, 64 | dwFlags: DWORD, 65 | ) -> HRESULT, 66 | fn QueryUrl( 67 | pocsUrl: LPCOLESTR, 68 | dwFlags: DWORD, 69 | lpSTATURL: LPSTATURL, 70 | ) -> HRESULT, 71 | fn BindToObject( 72 | pocsUrl: LPCOLESTR, 73 | riid: REFIID, 74 | ppvOut: *mut *mut c_void, 75 | ) -> HRESULT, 76 | fn EnumUrls( 77 | ppEnum: *mut *mut IEnumSTATURL, 78 | ) -> HRESULT, 79 | }} 80 | pub type LPURLHISTORYSTG2 = *mut IUrlHistoryStg2; 81 | RIDL!{#[uuid(0xafa0dc11, 0xc313, 0x11d0, 0x83, 0x1a, 0x00, 0xc0, 0x4f, 0xd5, 0xae, 0x38)] 82 | interface IUrlHistoryStg2(IUrlHistoryStg2Vtbl): IUrlHistoryStg(IUrlHistoryStgVtbl) { 83 | fn AddUrlAndNotify( 84 | pocsUrl: LPCOLESTR, 85 | pocsTitle: LPCOLESTR, 86 | dwFlags: DWORD, 87 | fWriteHistory: BOOL, 88 | poctNotify: *mut IOleCommandTarget, 89 | punkISFolder: *mut IUnknown, 90 | ) -> HRESULT, 91 | fn ClearHistory() -> HRESULT, 92 | }} 93 | pub type LPURLHISTORYNOTIFY = *mut IUrlHistoryNotify; 94 | RIDL!{#[uuid(0xbc40bec1, 0xc493, 0x11d0, 0x83, 0x1b, 0x00, 0xc0, 0x4f, 0xd5, 0xae, 0x38)] 95 | interface IUrlHistoryNotify(IUrlHistoryNotifyVtbl): 96 | IOleCommandTarget(IOleCommandTargetVtbl) {} 97 | } 98 | -------------------------------------------------------------------------------- /src/um/urlmon.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! URL Moniker interfaces 7 | use shared::minwindef::DWORD; 8 | use um::unknwnbase::{IUnknown, IUnknownVtbl}; 9 | use um::winnt::{HRESULT, LPCWSTR}; 10 | RIDL!{#[uuid(0x79eac9ee, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00, 0xaa, 0x00, 0x4b, 0xa9, 0x0b)] 11 | interface IInternetSecurityManager(IInternetSecurityManagerVtbl): IUnknown(IUnknownVtbl) { 12 | fn SetSecuritySite() -> HRESULT, 13 | fn GetSecuritySite() -> HRESULT, 14 | fn MapUrlToZone( 15 | pwszUrl: LPCWSTR, 16 | pdwZone: *mut DWORD, 17 | dwFlags: DWORD, 18 | ) -> HRESULT, 19 | // TODO: the rest 20 | }} 21 | // TODO: the rest 22 | -------------------------------------------------------------------------------- /src/um/utilapiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, DWORD}; 7 | use shared::ntdef::PVOID; 8 | extern "system" { 9 | pub fn EncodePointer( 10 | Ptr: PVOID, 11 | ) -> PVOID; 12 | pub fn DecodePointer( 13 | Ptr: PVOID, 14 | ) -> PVOID; 15 | pub fn EncodeSystemPointer( 16 | Ptr: PVOID, 17 | ) -> PVOID; 18 | pub fn DecodeSystemPointer( 19 | Ptr: PVOID, 20 | ) -> PVOID; 21 | pub fn Beep( 22 | dwFreq: DWORD, 23 | dwDuration: DWORD, 24 | ) -> BOOL; 25 | } 26 | -------------------------------------------------------------------------------- /src/um/wbemads.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::winerror::HRESULT; 7 | use shared::wtypes::BSTR; 8 | use um::oaidl::{IDispatch, IDispatchVtbl}; 9 | use um::wbemdisp::{ISWbemObject, ISWbemServices}; 10 | // extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0000_v0_0_c_ifspec; 11 | // extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0000_v0_0_s_ifspec; 12 | // EXTERN_C const IID LIBID_WMIEXTENSIONLib; 13 | // EXTERN_C const IID IID_IWMIExtension; 14 | DEFINE_GUID!{IID_IWMIExtension, 15 | 0xadc1f06e, 0x5c7e, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41} 16 | RIDL!{#[uuid(0xadc1f06e, 0x5c7e, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41)] 17 | interface IWMIExtension(IWMIExtensionVtbl): IDispatch(IDispatchVtbl) { 18 | fn get_WMIObjectPath( 19 | strWMIObjectPath: *mut BSTR, 20 | ) -> HRESULT, 21 | fn GetWMIObject( 22 | objWMIObject: *mut *mut ISWbemObject, 23 | ) -> HRESULT, 24 | fn GetWMIServices( 25 | objWMIServices: *mut *mut ISWbemServices, 26 | ) -> HRESULT, 27 | }} 28 | DEFINE_GUID!{CLSID_WMIExtension, 29 | 0xf0975afe, 0x5c7f, 0x11d2, 0x8b, 0x74, 0x00, 0x10, 0x4b, 0x2a, 0xfb, 0x41} 30 | // class DECLSPEC_UUID("f0975afe-5c7f-11d2-8b74-00104b2afb41") 31 | // WMIExtension; 32 | // extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0002_v0_0_c_ifspec; 33 | // extern RPC_IF_HANDLE __MIDL_itf_wbemads_0000_0002_v0_0_s_ifspec; 34 | // unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); 35 | // unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); 36 | // unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); 37 | // void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); 38 | // unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); 39 | // unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); 40 | // unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); 41 | // void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); 42 | -------------------------------------------------------------------------------- /src/um/wct.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use ctypes::c_int; 7 | use shared::basetsd::{DWORD_PTR, SIZE_T}; 8 | use shared::guiddef::GUID; 9 | use shared::minwindef::{BOOL, DWORD, LPBOOL, LPDWORD, PULONG}; 10 | use um::winnt::{HRESULT, LARGE_INTEGER, WCHAR}; 11 | ENUM!{enum WCT_OBJECT_TYPE { 12 | WctCriticalSectionType = 1, 13 | WctSendMessageType, 14 | WctMutexType, 15 | WctAlpcType, 16 | WctComType, 17 | WctThreadWaitType, 18 | WctProcessWaitType, 19 | WctThreadType, 20 | WctComActivationType, 21 | WctUnknownType, 22 | WctSocketIoType, 23 | WctSmbIoType, 24 | WctMaxType, 25 | }} 26 | ENUM!{enum WCT_OBJECT_STATUS { 27 | WctStatusNoAccess = 1, 28 | WctStatusRunning, 29 | WctStatusBlocked, 30 | WctStatusPidOnly, 31 | WctStatusPidOnlyRpcss, 32 | WctStatusOwned, 33 | WctStatusNotOwned, 34 | WctStatusAbandoned, 35 | WctStatusUnknown, 36 | WctStatusError, 37 | WctStatusMax, 38 | }} 39 | pub const WCT_MAX_NODE_COUNT: SIZE_T = 16; 40 | pub const WCT_OBJNAME_LENGTH: SIZE_T = 128; 41 | STRUCT!{struct WAITCHAIN_NODE_INFO_LOCK_OBJECT { 42 | ObjectName: [WCHAR; WCT_OBJNAME_LENGTH], 43 | Timeout: LARGE_INTEGER, 44 | Alertable: BOOL, 45 | }} 46 | STRUCT!{struct WAITCHAIN_NODE_INFO_THREAD_OBJECT { 47 | ProcessId: DWORD, 48 | ThreadId: DWORD, 49 | WaitTime: DWORD, 50 | ContextSwitches: DWORD, 51 | }} 52 | UNION!{union WAITCHAIN_NODE_INFO_u { 53 | [u64; 34], 54 | LockObject LockObject_mut: WAITCHAIN_NODE_INFO_LOCK_OBJECT, 55 | ThreadObject ThreadObject_mut: WAITCHAIN_NODE_INFO_THREAD_OBJECT, 56 | }} 57 | STRUCT!{struct WAITCHAIN_NODE_INFO { 58 | ObjectType: WCT_OBJECT_TYPE, 59 | ObjectStatus: WCT_OBJECT_STATUS, 60 | u: WAITCHAIN_NODE_INFO_u, 61 | }} 62 | pub type PWAITCHAIN_NODE_INFO = *mut WAITCHAIN_NODE_INFO; 63 | DECLARE_HANDLE!{HWCT, HWCT__} 64 | FN!{cdecl PWAITCHAINCALLBACK( 65 | WctHandle: HWCT, 66 | Context: DWORD_PTR, 67 | CallbackStatus: DWORD, 68 | NodeCount: LPDWORD, 69 | NodeInfoArray: PWAITCHAIN_NODE_INFO, 70 | IsCycle: LPBOOL, 71 | ) -> ()} 72 | pub const WCT_ASYNC_OPEN_FLAG: DWORD = 1; 73 | pub const WCTP_OPEN_ALL_FLAGS: DWORD = WCT_ASYNC_OPEN_FLAG; 74 | extern "system" { 75 | pub fn OpenThreadWaitChainSession( 76 | Flags: DWORD, 77 | callback: PWAITCHAINCALLBACK, 78 | ) -> HWCT; 79 | pub fn CloseThreadWaitChainSession( 80 | WctHandle: HWCT, 81 | ); 82 | } 83 | pub const WCT_OUT_OF_PROC_FLAG: DWORD = 0x1; 84 | pub const WCT_OUT_OF_PROC_COM_FLAG: DWORD = 0x2; 85 | pub const WCT_OUT_OF_PROC_CS_FLAG: DWORD = 0x4; 86 | pub const WCT_NETWORK_IO_FLAG: DWORD = 0x8; 87 | pub const WCTP_GETINFO_ALL_FLAGS: DWORD = WCT_OUT_OF_PROC_FLAG | WCT_OUT_OF_PROC_COM_FLAG 88 | | WCT_OUT_OF_PROC_CS_FLAG; 89 | extern "system" { 90 | pub fn GetThreadWaitChain( 91 | WctHandle: HWCT, 92 | Context: DWORD_PTR, 93 | Flags: DWORD, 94 | ThreadId: DWORD, 95 | NodeCount: LPDWORD, 96 | NodeInfoArray: PWAITCHAIN_NODE_INFO, 97 | IsCycle: LPBOOL, 98 | ) -> BOOL; 99 | } 100 | FN!{cdecl PCOGETCALLSTATE( 101 | c_int, 102 | PULONG, 103 | ) -> HRESULT} 104 | FN!{cdecl PCOGETACTIVATIONSTATE( 105 | GUID, 106 | DWORD, 107 | *mut DWORD, 108 | ) -> HRESULT} 109 | extern "system" { 110 | pub fn RegisterWaitChainCOMCallback( 111 | CallStateCallback: PCOGETCALLSTATE, 112 | ActivationStateCallback: PCOGETACTIVATIONSTATE, 113 | ); 114 | } 115 | -------------------------------------------------------------------------------- /src/um/werapi.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Function prototypes for Windows Error Reporting (WER) 7 | use shared::minwindef::{BOOL, DWORD, PDWORD}; 8 | use um::winnt::{HANDLE, HRESULT, PCWSTR, PVOID}; 9 | pub const WER_FAULT_REPORTING_FLAG_NOHEAP: DWORD = 1; 10 | pub const WER_FAULT_REPORTING_FLAG_QUEUE: DWORD = 2; 11 | pub const WER_FAULT_REPORTING_FLAG_DISABLE_THREAD_SUSPENSION: DWORD = 4; 12 | pub const WER_FAULT_REPORTING_FLAG_QUEUE_UPLOAD: DWORD = 8; 13 | pub const WER_FAULT_REPORTING_ALWAYS_SHOW_UI: DWORD = 16; 14 | pub const WER_FAULT_REPORTING_NO_UI: DWORD = 32; 15 | pub const WER_FAULT_REPORTING_FLAG_NO_HEAP_ON_QUEUE: DWORD = 64; 16 | pub const WER_FAULT_REPORTING_DISABLE_SNAPSHOT_CRASH: DWORD = 128; 17 | pub const WER_FAULT_REPORTING_DISABLE_SNAPSHOT_HANG: DWORD = 256; 18 | pub const WER_FAULT_REPORTING_CRITICAL: DWORD = 512; 19 | pub const WER_FAULT_REPORTING_DURABLE: DWORD = 1024; 20 | ENUM!{enum WER_REGISTER_FILE_TYPE { 21 | WerRegFileTypeUserDocument = 1, 22 | WerRegFileTypeOther = 2, 23 | WerRegFileTypeMax, 24 | }} 25 | extern "system" { 26 | pub fn WerRegisterFile( 27 | pwzFile: PCWSTR, 28 | regFileType: WER_REGISTER_FILE_TYPE, 29 | dwFlags: DWORD, 30 | ) -> HRESULT; 31 | pub fn WerUnregisterFile( 32 | pwzFilePath: PCWSTR, 33 | ) -> HRESULT; 34 | pub fn WerRegisterMemoryBlock( 35 | pvAddress: PVOID, 36 | dwSize: DWORD, 37 | ) -> HRESULT; 38 | pub fn WerUnregisterMemoryBlock( 39 | pvAddress: PVOID, 40 | ) -> HRESULT; 41 | pub fn WerSetFlags( 42 | dwFlags: DWORD, 43 | ) -> HRESULT; 44 | pub fn WerGetFlags( 45 | hProcess: HANDLE, 46 | pdwFlags: PDWORD, 47 | ) -> HRESULT; 48 | pub fn WerAddExcludedApplication( 49 | pwzExeName: PCWSTR, 50 | bAllUsers: BOOL, 51 | ) -> HRESULT; 52 | pub fn WerRemoveExcludedApplication( 53 | pwzExeName: PCWSTR, 54 | bAllUsers: BOOL, 55 | ) -> HRESULT; 56 | pub fn WerRegisterRuntimeExceptionModule( 57 | pwszOutOfProcessCallbackDll: PCWSTR, 58 | pContext: PVOID, 59 | ) -> HRESULT; 60 | pub fn WerUnregisterRuntimeExceptionModule( 61 | pwszOutOfProcessCallbackDll: PCWSTR, 62 | pContext: PVOID, 63 | ) -> HRESULT; 64 | } 65 | -------------------------------------------------------------------------------- /src/um/windowsceip.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::BOOL; 7 | extern "system" { 8 | pub fn CeipIsOptedIn() -> BOOL; 9 | } 10 | -------------------------------------------------------------------------------- /src/um/winver.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms 6 | //! Version management functions, types, and definitions 7 | use ctypes::c_void; 8 | use shared::minwindef::{BOOL, DWORD, LPCVOID, LPVOID, PUINT}; 9 | use um::winnt::{LPCSTR, LPCWSTR, LPSTR, LPWSTR}; 10 | extern "system" { 11 | pub fn GetFileVersionInfoSizeA( 12 | lptstrFilename: LPCSTR, 13 | lpdwHandle: *mut DWORD, 14 | ) -> DWORD; 15 | pub fn GetFileVersionInfoSizeW( 16 | lptstrFilename: LPCWSTR, 17 | lpdwHandle: *mut DWORD, 18 | ) -> DWORD; 19 | pub fn GetFileVersionInfoA( 20 | lptstrFilename: LPCSTR, 21 | dwHandle: DWORD, 22 | dwLen: DWORD, 23 | lpData: *mut c_void, 24 | ) -> BOOL; 25 | pub fn GetFileVersionInfoW( 26 | lptstrFilename: LPCWSTR, 27 | dwHandle: DWORD, 28 | dwLen: DWORD, 29 | lpData: *mut c_void, 30 | ) -> BOOL; 31 | pub fn VerQueryValueA( 32 | pBlock: LPCVOID, 33 | lpSubBlock: LPCSTR, 34 | lplpBuffer: &mut LPVOID, 35 | puLen: PUINT, 36 | ) -> BOOL; 37 | pub fn VerQueryValueW( 38 | pBlock: LPCVOID, 39 | lpSubBlock: LPCWSTR, 40 | lplpBuffer: &mut LPVOID, 41 | puLen: PUINT, 42 | ) -> BOOL; 43 | pub fn VerLanguageNameA( 44 | wLang: DWORD, 45 | szLang: LPSTR, 46 | cchLang: DWORD, 47 | ) -> DWORD; 48 | pub fn VerLanguageNameW( 49 | wLang: DWORD, 50 | szLang: LPWSTR, 51 | cchLang: DWORD, 52 | ) -> DWORD; 53 | } 54 | -------------------------------------------------------------------------------- /src/um/wlanihvtypes.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | //! Structures used to hold information for IHV. 7 | use shared::guiddef::GUID; 8 | use shared::minwindef::{BOOL, BYTE, DWORD, ULONG}; 9 | use shared::wlantypes::{DOT11_AUTH_ALGORITHM, DOT11_BSS_TYPE, DOT11_CIPHER_ALGORITHM, DOT11_SSID}; 10 | use um::eaptypes::EAP_METHOD_TYPE; 11 | use um::winnt::WCHAR; 12 | STRUCT!{struct DOT11_MSSECURITY_SETTINGS { 13 | dot11AuthAlgorithm: DOT11_AUTH_ALGORITHM, 14 | dot11CipherAlgorithm: DOT11_CIPHER_ALGORITHM, 15 | fOneXEnabled: BOOL, 16 | eapMethodType: EAP_METHOD_TYPE, 17 | dwEapConnectionDataLen: DWORD, 18 | pEapConnectionData: *mut BYTE, 19 | }} 20 | pub type PDOT11_MSSECURITY_SETTINGS = *mut DOT11_MSSECURITY_SETTINGS; 21 | STRUCT!{struct DOT11EXT_IHV_SSID_LIST { 22 | ulCount: ULONG, 23 | SSIDs: [DOT11_SSID; 1], 24 | }} 25 | pub type PDOT11EXT_IHV_SSID_LIST = *mut DOT11EXT_IHV_SSID_LIST; 26 | STRUCT!{struct DOT11EXT_IHV_PROFILE_PARAMS { 27 | pSsidList: PDOT11EXT_IHV_SSID_LIST, 28 | BssType: DOT11_BSS_TYPE, 29 | pMSSecuritySettings: PDOT11_MSSECURITY_SETTINGS, 30 | }} 31 | pub type PDOT11EXT_IHV_PROFILE_PARAMS = *mut DOT11EXT_IHV_PROFILE_PARAMS; 32 | pub const MS_MAX_PROFILE_NAME_LENGTH: usize = 256; 33 | pub const MS_PROFILE_GROUP_POLICY: DWORD = 0x00000001; 34 | pub const MS_PROFILE_USER: DWORD = 0x00000002; 35 | STRUCT!{struct DOT11EXT_IHV_PARAMS { 36 | dot11ExtIhvProfileParams: DOT11EXT_IHV_PROFILE_PARAMS, 37 | wstrProfileName: [WCHAR; MS_MAX_PROFILE_NAME_LENGTH], 38 | dwProfileTypeFlags: DWORD, 39 | interfaceGuid: GUID, 40 | }} 41 | pub type PDOT11EXT_IHV_PARAMS = *mut DOT11EXT_IHV_PARAMS; 42 | -------------------------------------------------------------------------------- /src/um/wlclient.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::guiddef::GUID; 7 | use shared::minwindef::{BOOL, PUCHAR, UCHAR, ULONG, USHORT}; 8 | use shared::windot11::{DOT11_CURRENT_OPERATION_MODE, DOT11_MAC_ADDRESS}; 9 | use um::winnt::LPWSTR; 10 | STRUCT!{struct DOT11_ADAPTER { 11 | gAdapterId: GUID, 12 | pszDescription: LPWSTR, 13 | Dot11CurrentOpMode: DOT11_CURRENT_OPERATION_MODE, 14 | }} 15 | pub type PDOT11_ADAPTER = *mut DOT11_ADAPTER; 16 | STRUCT!{struct DOT11_BSS_LIST { 17 | uNumOfBytes: ULONG, 18 | pucBuffer: PUCHAR, 19 | }} 20 | pub type PDOT11_BSS_LIST = *mut DOT11_BSS_LIST; 21 | STRUCT!{struct DOT11_PORT_STATE { 22 | PeerMacAddress: DOT11_MAC_ADDRESS, 23 | uSessionId: ULONG, 24 | bPortControlled: BOOL, 25 | bPortAuthorized: BOOL, 26 | }} 27 | pub type PDOT11_PORT_STATE = *mut DOT11_PORT_STATE; 28 | STRUCT!{#[repr(packed)] struct DOT11_SECURITY_PACKET_HEADER { 29 | PeerMac: DOT11_MAC_ADDRESS, 30 | usEtherType: USHORT, 31 | Data: [UCHAR; 1], 32 | }} 33 | pub type PDOT11_SECURITY_PACKET_HEADER = *mut DOT11_SECURITY_PACKET_HEADER; 34 | -------------------------------------------------------------------------------- /src/um/wow64apiset.rs: -------------------------------------------------------------------------------- 1 | // Licensed under the Apache License, Version 2.0 2 | // or the MIT license 3 | // , at your option. 4 | // All files in the project carrying such notice may not be copied, modified, or distributed 5 | // except according to those terms. 6 | use shared::minwindef::{BOOL, PBOOL, PUSHORT, UINT}; 7 | use um::winnt::{HANDLE, LPSTR, LPWSTR, PVOID}; 8 | extern "system" { 9 | pub fn Wow64DisableWow64FsRedirection( 10 | OldValue: *mut PVOID, 11 | ) -> BOOL; 12 | pub fn Wow64RevertWow64FsRedirection( 13 | OlValue: PVOID, 14 | ) -> BOOL; 15 | pub fn IsWow64Process( 16 | hProcess: HANDLE, 17 | Wow64Process: PBOOL, 18 | ) -> BOOL; 19 | pub fn GetSystemWow64DirectoryA( 20 | lpBuffer: LPSTR, 21 | uSize: UINT, 22 | ) -> UINT; 23 | pub fn GetSystemWow64DirectoryW( 24 | lpBuffer: LPWSTR, 25 | uSize: UINT, 26 | ) -> UINT; 27 | pub fn IsWow64Process2( 28 | hProcess: HANDLE, 29 | pProcessMachine: PUSHORT, 30 | pNativeMachine: PUSHORT, 31 | ) -> BOOL; 32 | } 33 | -------------------------------------------------------------------------------- /src/um/wtsapi32.rs: -------------------------------------------------------------------------------- 1 | use shared::minwindef::BOOL; 2 | use shared::ntdef::{PHANDLE, ULONG}; 3 | //1286 4 | extern "system" { 5 | pub fn WTSQueryUserToken(SessionId: ULONG, phToken: PHANDLE) -> BOOL; 6 | } 7 | --------------------------------------------------------------------------------