winapi_ui_automation/um/
dxgidebug.rs

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.
6use ctypes::{c_char, c_int, c_void};
7use shared::basetsd::{SIZE_T, UINT64};
8use shared::guiddef::{GUID, REFIID};
9use shared::minwindef::{BOOL, DWORD, UINT};
10use um::unknwnbase::{IUnknown, IUnknownVtbl};
11use um::winnt::{HRESULT, LPCSTR};
12pub const DXGI_DEBUG_BINARY_VERSION: DWORD = 1;
13ENUM!{enum DXGI_DEBUG_RLO_FLAGS {
14    DXGI_DEBUG_RLO_SUMMARY = 0x1,
15    DXGI_DEBUG_RLO_DETAIL = 0x2,
16    DXGI_DEBUG_RLO_IGNORE_INTERNAL = 0x4,
17    DXGI_DEBUG_RLO_ALL = 0x7,
18}}
19pub type DXGI_DEBUG_ID = GUID;
20DEFINE_GUID!{DXGI_DEBUG_ALL,
21    0xe48ae283, 0xda80, 0x490b, 0x87, 0xe6, 0x43, 0xe9, 0xa9, 0xcf, 0xda, 0x08}
22DEFINE_GUID!{DXGI_DEBUG_DX,
23    0x35cdd7fc, 0x13b2, 0x421d, 0xa5, 0xd7, 0x7e, 0x44, 0x51, 0x28, 0x7d, 0x64}
24DEFINE_GUID!{DXGI_DEBUG_DXGI,
25    0x25cddaa4, 0xb1c6, 0x47e1, 0xac, 0x3e, 0x98, 0x87, 0x5b, 0x5a, 0x2e, 0x2a}
26DEFINE_GUID!{DXGI_DEBUG_APP,
27    0x06cd6e01, 0x4219, 0x4ebd, 0x87, 0x09, 0x27, 0xed, 0x23, 0x36, 0x0c, 0x62}
28ENUM!{enum DXGI_INFO_QUEUE_MESSAGE_CATEGORY {
29    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_UNKNOWN = 0,
30    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_MISCELLANEOUS = 1,
31    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_INITIALIZATION = 2,
32    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_CLEANUP = 3,
33    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_COMPILATION = 4,
34    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_CREATION = 5,
35    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_SETTING = 6,
36    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_STATE_GETTING = 7,
37    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = 8,
38    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_EXECUTION = 9,
39    DXGI_INFO_QUEUE_MESSAGE_CATEGORY_SHADER = 10,
40}}
41ENUM!{enum DXGI_INFO_QUEUE_MESSAGE_SEVERITY {
42    DXGI_INFO_QUEUE_MESSAGE_SEVERITY_CORRUPTION = 0,
43    DXGI_INFO_QUEUE_MESSAGE_SEVERITY_ERROR = 1,
44    DXGI_INFO_QUEUE_MESSAGE_SEVERITY_WARNING = 2,
45    DXGI_INFO_QUEUE_MESSAGE_SEVERITY_INFO = 3,
46    DXGI_INFO_QUEUE_MESSAGE_SEVERITY_MESSAGE = 4,
47}}
48pub type DXGI_INFO_QUEUE_MESSAGE_ID = c_int;
49STRUCT!{struct DXGI_INFO_QUEUE_MESSAGE {
50    Producer: DXGI_DEBUG_ID,
51    Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
52    Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
53    ID: DXGI_INFO_QUEUE_MESSAGE_ID,
54    pDescription: *const c_char,
55    DescriptionByteLength: SIZE_T,
56}}
57STRUCT!{struct DXGI_INFO_QUEUE_FILTER_DESC {
58    NumCategories: UINT,
59    pCategoryList: *mut DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
60    NumSeverities: UINT,
61    pSeverityList: *mut DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
62    NumIDs: UINT,
63    pIDList: *mut DXGI_INFO_QUEUE_MESSAGE_ID,
64}}
65STRUCT!{struct DXGI_INFO_QUEUE_FILTER {
66    AllowList: DXGI_INFO_QUEUE_FILTER_DESC,
67    DenyList: DXGI_INFO_QUEUE_FILTER_DESC,
68}}
69pub const DXGI_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT: DWORD = 1024;
70extern "system" {
71    pub fn DXGIGetDebugInterface(
72        riid: REFIID,
73        ppDebug: *mut *mut c_void,
74    ) -> HRESULT;
75}
76RIDL!{#[uuid(0xd67441c7, 0x672a, 0x476f, 0x9e, 0x82, 0xcd, 0x55, 0xb4, 0x49, 0x49, 0xce)]
77interface IDXGIInfoQueue(IDXGIInfoQueueVtbl): IUnknown(IUnknownVtbl) {
78    fn SetMessageCountLimit(
79        Producer: DXGI_DEBUG_ID,
80        MessageCountLimit: UINT64,
81    ) -> HRESULT,
82    fn ClearStoredMessages(
83        Producer: DXGI_DEBUG_ID,
84    ) -> (),
85    fn GetMessage(
86        Producer: DXGI_DEBUG_ID,
87        MessageIndex: UINT64,
88        pMessage: *mut DXGI_INFO_QUEUE_MESSAGE,
89        pMessageByteLength: *mut SIZE_T,
90    ) -> HRESULT,
91    fn GetNumStoredMessagesAllowedByRetrievalFilters(
92        Producer: DXGI_DEBUG_ID,
93    ) -> UINT64,
94    fn GetNumStoredMessages(
95        Producer: DXGI_DEBUG_ID,
96    ) -> UINT64,
97    fn GetNumMessagesDiscardedByMessageCountLimit(
98        Producer: DXGI_DEBUG_ID,
99    ) -> UINT64,
100    fn GetMessageCountLimit(
101        Producer: DXGI_DEBUG_ID,
102    ) -> UINT64,
103    fn GetNumMessagesAllowedByStorageFilter(
104        Producer: DXGI_DEBUG_ID,
105    ) -> UINT64,
106    fn GetNumMessagesDeniedByStorageFilter(
107        Producer: DXGI_DEBUG_ID,
108    ) -> UINT64,
109    fn AddStorageFilterEntries(
110        Producer: DXGI_DEBUG_ID,
111        pFilter: *const DXGI_INFO_QUEUE_FILTER,
112    ) -> HRESULT,
113    fn GetStorageFilter(
114        Producer: DXGI_DEBUG_ID,
115        pFilter: *mut DXGI_INFO_QUEUE_FILTER,
116        pFilterByteLength: *mut SIZE_T,
117    ) -> HRESULT,
118    fn ClearStorageFilter(
119        Producer: DXGI_DEBUG_ID,
120    ) -> (),
121    fn PushEmptyStorageFilter(
122        Producer: DXGI_DEBUG_ID,
123    ) -> HRESULT,
124    fn PushDenyAllStorageFilter(
125        Producer: DXGI_DEBUG_ID,
126    ) -> HRESULT,
127    fn PushCopyOfStorageFilter(
128        Producer: DXGI_DEBUG_ID,
129    ) -> HRESULT,
130    fn PushStorageFilter(
131        Producer: DXGI_DEBUG_ID,
132        pFilter: *const DXGI_INFO_QUEUE_FILTER,
133    ) -> HRESULT,
134    fn PopStorageFilter(
135        Producer: DXGI_DEBUG_ID,
136    ) -> (),
137    fn GetStorageFilterStackSize(
138        Producer: DXGI_DEBUG_ID,
139    ) -> UINT,
140    fn AddRetrievalFilterEntries(
141        Producer: DXGI_DEBUG_ID,
142        pFilter: *const DXGI_INFO_QUEUE_FILTER,
143    ) -> HRESULT,
144    fn GetRetrievalFilter(
145        Producer: DXGI_DEBUG_ID,
146        pFilter: *mut DXGI_INFO_QUEUE_FILTER,
147        pFilterByteLength: *mut SIZE_T,
148    ) -> HRESULT,
149    fn ClearRetrievalFilter(
150        Producer: DXGI_DEBUG_ID,
151    ) -> (),
152    fn PushEmptyRetrievalFilter(
153        Producer: DXGI_DEBUG_ID,
154    ) -> HRESULT,
155    fn PushDenyAllRetrievalFilter(
156        Producer: DXGI_DEBUG_ID,
157    ) -> HRESULT,
158    fn PushCopyOfRetrievalFilter(
159        Producer: DXGI_DEBUG_ID,
160    ) -> HRESULT,
161    fn PushRetrievalFilter(
162        Producer: DXGI_DEBUG_ID,
163        pFilter: *const DXGI_INFO_QUEUE_FILTER,
164    ) -> HRESULT,
165    fn PopRetrievalFilter(
166        Producer: DXGI_DEBUG_ID,
167    ) -> (),
168    fn GetRetrievalFilterStackSize(
169        Producer: DXGI_DEBUG_ID,
170    ) -> UINT,
171    fn AddMessage(
172        Producer: DXGI_DEBUG_ID,
173        Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
174        Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
175        ID: DXGI_INFO_QUEUE_MESSAGE_ID,
176        pDescription: LPCSTR,
177    ) -> HRESULT,
178    fn AddApplicationMessage(
179        Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
180        pDescription: LPCSTR,
181    ) -> HRESULT,
182    fn SetBreakOnCategory(
183        Producer: DXGI_DEBUG_ID,
184        Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
185        bEnable: BOOL,
186    ) -> HRESULT,
187    fn SetBreakOnSeverity(
188        Producer: DXGI_DEBUG_ID,
189        Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
190        bEnable: BOOL,
191    ) -> HRESULT,
192    fn SetBreakOnID(
193        Producer: DXGI_DEBUG_ID,
194        ID: DXGI_INFO_QUEUE_MESSAGE_ID,
195        bEnable: BOOL,
196    ) -> HRESULT,
197    fn GetBreakOnCategory(
198        Producer: DXGI_DEBUG_ID,
199        Category: DXGI_INFO_QUEUE_MESSAGE_CATEGORY,
200    ) -> BOOL,
201    fn GetBreakOnSeverity(
202        Producer: DXGI_DEBUG_ID,
203        Severity: DXGI_INFO_QUEUE_MESSAGE_SEVERITY,
204    ) -> BOOL,
205    fn GetBreakOnID(
206        Producer: DXGI_DEBUG_ID,
207        ID: DXGI_INFO_QUEUE_MESSAGE_ID,
208    ) -> BOOL,
209    fn SetMuteDebugOutput(
210        Producer: DXGI_DEBUG_ID,
211        bMute: BOOL,
212    ) -> (),
213    fn GetMuteDebugOutput(
214        Producer: DXGI_DEBUG_ID,
215    ) -> BOOL,
216}}
217RIDL!{#[uuid(0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41)]
218interface IDXGIDebug(IDXGIDebugVtbl): IUnknown(IUnknownVtbl) {
219    fn ReportLiveObjects(
220        apiid: GUID,
221        flags: DXGI_DEBUG_RLO_FLAGS,
222    ) -> HRESULT,
223}}
224RIDL!{#[uuid(0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41)]
225interface IDXGIDebug1(IDXGIDebug1Vtbl): IDXGIDebug(IDXGIDebugVtbl) {
226    fn EnableLeakTrackingForThread() -> (),
227    fn DisableLeakTrackingForThread() -> (),
228    fn IsLeakTrackingEnabledForThread() -> BOOL,
229}}
230DEFINE_GUID!{IID_IDXGIInfoQueue,
231    0xd67441c7, 0x672a, 0x476f, 0x9e, 0x82, 0xcd, 0x55, 0xb4, 0x49, 0x49, 0xce}
232DEFINE_GUID!{IID_IDXGIDebug,
233    0x119e7452, 0xde9e, 0x40fe, 0x88, 0x06, 0x88, 0xf9, 0x0c, 0x12, 0xb4, 0x41}
234DEFINE_GUID!{IID_IDXGIDebug1,
235    0xc5a05f0c, 0x16f2, 0x4adf, 0x9f, 0x4d, 0xa8, 0xc4, 0xd5, 0x8a, 0xc5, 0x50}