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" {
AvSetMmThreadCharacteristicsA( TaskName: LPCSTR, TaskIndex: LPDWORD, ) -> HANDLE19     pub fn AvSetMmThreadCharacteristicsA(
20         TaskName: LPCSTR,
21         TaskIndex: LPDWORD,
22     ) -> HANDLE;
AvSetMmThreadCharacteristicsW( TaskName: LPCWSTR, TaskIndex: LPDWORD, ) -> HANDLE23     pub fn AvSetMmThreadCharacteristicsW(
24         TaskName: LPCWSTR,
25         TaskIndex: LPDWORD,
26     ) -> HANDLE;
AvSetMmMaxThreadCharacteristicsA( FirstTask: LPCSTR, SecondTask: LPCSTR, TaskIndex: LPDWORD, ) -> HANDLE27     pub fn AvSetMmMaxThreadCharacteristicsA(
28         FirstTask: LPCSTR,
29         SecondTask: LPCSTR,
30         TaskIndex: LPDWORD,
31     ) -> HANDLE;
AvSetMmMaxThreadCharacteristicsW( FirstTask: LPCWSTR, SecondTask: LPCWSTR, TaskIndex: LPDWORD, ) -> HANDLE32     pub fn AvSetMmMaxThreadCharacteristicsW(
33         FirstTask: LPCWSTR,
34         SecondTask: LPCWSTR,
35         TaskIndex: LPDWORD,
36     ) -> HANDLE;
AvRevertMmThreadCharacteristics( avrt_handle: HANDLE, ) -> BOOL37     pub fn AvRevertMmThreadCharacteristics(
38         avrt_handle: HANDLE,
39     ) -> BOOL;
AvSetMmThreadPriority( AvrtHandle: HANDLE, Priority: AVRT_PRIORITY, ) -> BOOL40     pub fn AvSetMmThreadPriority(
41         AvrtHandle: HANDLE,
42         Priority: AVRT_PRIORITY,
43     ) -> BOOL;
AvRtCreateThreadOrderingGroup( Context: PHANDLE, Period: PLARGE_INTEGER, ThreadOrderingGuid: *mut GUID, Timeout: PLARGE_INTEGER, ) -> BOOL44     pub fn AvRtCreateThreadOrderingGroup(
45         Context: PHANDLE,
46         Period: PLARGE_INTEGER,
47         ThreadOrderingGuid: *mut GUID,
48         Timeout: PLARGE_INTEGER,
49     ) -> BOOL;
AvRtCreateThreadOrderingGroupExA( Context: PHANDLE, Period: PLARGE_INTEGER, ThreadOrderingGuid: *mut GUID, Timeout: PLARGE_INTEGER, TaskName: LPCSTR, )-> BOOL50     pub fn AvRtCreateThreadOrderingGroupExA(
51         Context: PHANDLE,
52         Period: PLARGE_INTEGER,
53         ThreadOrderingGuid: *mut GUID,
54         Timeout: PLARGE_INTEGER,
55         TaskName: LPCSTR,
56     )-> BOOL;
AvRtCreateThreadOrderingGroupExW( Context: PHANDLE, Period: PLARGE_INTEGER, ThreadOrderingGuid: *mut GUID, Timeout: PLARGE_INTEGER, TaskName: LPCWSTR, ) -> BOOL57     pub fn AvRtCreateThreadOrderingGroupExW(
58         Context: PHANDLE,
59         Period: PLARGE_INTEGER,
60         ThreadOrderingGuid: *mut GUID,
61         Timeout: PLARGE_INTEGER,
62         TaskName: LPCWSTR,
63     ) -> BOOL;
AvRtJoinThreadOrderingGroup( Context: PHANDLE, ThreadOrderingGuid: *mut GUID, Before: BOOL, ) -> BOOL64     pub fn AvRtJoinThreadOrderingGroup(
65         Context: PHANDLE,
66         ThreadOrderingGuid: *mut GUID,
67         Before: BOOL,
68     ) -> BOOL;
AvRtWaitOnThreadOrderingGroup( Context: HANDLE, ) -> BOOL69     pub fn AvRtWaitOnThreadOrderingGroup(
70         Context: HANDLE,
71     ) -> BOOL;
AvRtLeaveThreadOrderingGroup( Context: HANDLE, ) -> BOOL72     pub fn AvRtLeaveThreadOrderingGroup(
73         Context: HANDLE,
74     ) -> BOOL;
AvRtDeleteThreadOrderingGroup( Context: HANDLE, ) -> BOOL75     pub fn AvRtDeleteThreadOrderingGroup(
76         Context: HANDLE,
77     ) -> BOOL;
AvQuerySystemResponsiveness( AvrtHandle: HANDLE, SystemResponsivenessValue: PULONG, ) -> BOOL78     pub fn AvQuerySystemResponsiveness(
79         AvrtHandle: HANDLE,
80         SystemResponsivenessValue: PULONG,
81     ) -> BOOL;
82 }
83