Backed out changeset 62f7af8fe549 (bug 1843981) for causing valgrind bustage. CLOSED...
[gecko.git] / gfx / thebes / d3dkmtQueryStatistics.h
blob58ce2cd155d8499dfb16ed99ae17e63fb85cb8df
1 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 /* This file is based on a header file that was briefly seen in the
6 * Windows 8 RC SDK. The work for this file itself was based on the one in
7 * ProcessHacker at
8 * http://processhacker.svn.sourceforge.net/viewvc/processhacker/2.x/trunk/plugins/ExtendedTools/d3dkmt.h?revision=4758&view=markup
9 * For more details see Mozilla Bug 689870.
10 * [Bug 917496 indicates that some of these structs may not match reality, and
11 * therefore should not be trusted. See the reference to bug 917496 in
12 * gfxWindowsPlatform.cpp.]
15 typedef struct _D3DKMTQS_COUNTER {
16 ULONG Count;
17 ULONGLONG Bytes;
18 } D3DKMTQS_COUNTER;
20 typedef struct _D3DKMTQS_ADAPTER_INFO {
21 ULONG NbSegments;
22 ULONG NodeCount;
24 ULONG Filler[3];
25 ULONGLONG Filler2[2]; // Assumed sizeof(LONGLONG) = sizeof(ULONGLONG)
26 struct {
27 ULONG Filler[14];
28 } Filler_RDMAB;
29 struct {
30 ULONG Filler[9];
31 } Filler_R;
32 struct {
33 ULONG Filler[4];
34 D3DKMTQS_COUNTER Filler2;
35 } Filler_P;
36 struct {
37 D3DKMTQS_COUNTER Filler[16];
38 ULONG Filler2[2];
39 } Filler_PF;
40 struct {
41 ULONGLONG Filler[8];
42 } Filler_PT;
43 struct {
44 ULONG Filler[2];
45 } Filler_SR;
46 struct {
47 ULONG Filler[7];
48 } Filler_L;
49 struct {
50 D3DKMTQS_COUNTER Filler[7];
51 } Filler_A;
52 struct {
53 D3DKMTQS_COUNTER Filler[4];
54 } Filler_T;
55 ULONG64 Reserved[8];
56 } D3DKMTQS_ADAPTER_INFO;
58 typedef struct _D3DKMTQS_SEGMENT_INFO {
59 ULONGLONG Filler[3];
60 struct {
61 ULONGLONG Filler;
62 ULONG Filler2[2];
63 } Filler_M;
65 ULONG Aperture;
67 ULONGLONG Filler3[5];
68 ULONG64 Filler4[8];
69 } D3DKMTQS_SEGMENT_INFO;
71 typedef struct _D3DKMTQS_SYSTEM_MEMORY {
72 ULONGLONG BytesAllocated;
73 ULONG Filler[2];
74 ULONGLONG Filler2[7];
75 } D3DKMTQS_SYSTEM_MEMORY;
77 typedef struct _D3DKMTQS_PROCESS_INFO {
78 ULONG Filler[2];
79 struct {
80 ULONGLONG BytesAllocated;
82 ULONG Filler[2];
83 ULONGLONG Filler2[7];
84 } SystemMemory;
85 ULONG64 Reserved[8];
86 } D3DKMTQS_PROCESS_INFO;
88 typedef struct _D3DKMTQS_PROCESS_SEGMENT_INFO {
89 ULONGLONG BytesCommitted;
90 ULONGLONG Filler[2];
91 ULONG Filler2;
92 struct {
93 ULONG Filler;
94 D3DKMTQS_COUNTER Filler2[6];
95 ULONGLONG Filler3;
96 } Filler3;
97 struct {
98 ULONGLONG Filler;
99 } Filler4;
100 ULONG64 Reserved[8];
101 } D3DKMTQS_PROCESS_SEGMENT_INFO;
103 typedef struct _D3DKMTQS_PROCESS_NODE_INFO {
104 LARGE_INTEGER RunningTime; // 100ns
105 ULONG ContextSwitch;
106 ULONG PreemptionStatistics[16];
107 ULONG PacketStatistics[32];
108 ULONG64 Reserved[8];
109 } D3DKMTQS_PROCESS_NODE_INFO;
111 typedef enum _D3DKMTQS_TYPE {
112 D3DKMTQS_ADAPTER = 0,
113 D3DKMTQS_PROCESS = 1,
114 D3DKMTQS_SEGMENT = 3,
115 D3DKMTQS_PROCESS_SEGMENT = 4,
116 D3DKMTQS_PROCESS_NODE = 6,
117 } D3DKMTQS_TYPE;
119 typedef union _D3DKMTQS_RESULT {
120 D3DKMTQS_ADAPTER_INFO AdapterInfo;
121 D3DKMTQS_SEGMENT_INFO SegmentInfo;
122 D3DKMTQS_PROCESS_INFO ProcessInfo;
123 D3DKMTQS_PROCESS_SEGMENT_INFO ProcessSegmentInfo;
124 D3DKMTQS_PROCESS_NODE_INFO ProcessNodeInformation;
125 } D3DKMTQS_RESULT;
127 typedef struct _D3DKMTQS_QUERY_SEGMENT {
128 ULONG SegmentId;
129 } D3DKMTQS_QUERY_SEGMENT;
131 typedef struct _D3DKMTQS_QUERY_NODE {
132 ULONG NodeId;
133 } D3DKMTQS_QUERY_NODE;
135 typedef struct _D3DKMTQS {
136 D3DKMTQS_TYPE Type;
137 LUID AdapterLuid;
138 HANDLE hProcess;
139 D3DKMTQS_RESULT QueryResult;
141 union {
142 D3DKMTQS_QUERY_SEGMENT QuerySegment;
143 D3DKMTQS_QUERY_SEGMENT QueryProcessSegment;
144 D3DKMTQS_QUERY_NODE QueryProcessNode;
146 } D3DKMTQS;
148 extern "C" {
149 typedef __checkReturn NTSTATUS(APIENTRY* PFND3DKMTQS)(const D3DKMTQS*);