| 1 |
// Licensed under the Apache License, Version 2.0 |
| 2 |
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 3 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 |
} |