michael@0: /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: /* This file is based on a header file that was briefly seen in the michael@0: * Windows 8 RC SDK. The work for this file itself was based on the one in ProcessHacker at michael@0: * http://processhacker.svn.sourceforge.net/viewvc/processhacker/2.x/trunk/plugins/ExtendedTools/d3dkmt.h?revision=4758&view=markup michael@0: * For more details see Mozilla Bug 689870. michael@0: * [Bug 917496 indicates that some of these structs may not match reality, and michael@0: * therefore should not be trusted. See the reference to bug 917496 in michael@0: * gfxWindowsPlatform.cpp.] michael@0: */ michael@0: michael@0: typedef struct _D3DKMTQS_COUNTER michael@0: { michael@0: ULONG Count; michael@0: ULONGLONG Bytes; michael@0: } D3DKMTQS_COUNTER; michael@0: michael@0: typedef struct _D3DKMTQS_ADAPTER_INFO michael@0: { michael@0: ULONG NbSegments; michael@0: michael@0: ULONG Filler[4]; michael@0: ULONGLONG Filler2[2]; // Assumed sizeof(LONGLONG) = sizeof(ULONGLONG) michael@0: struct { michael@0: ULONG Filler[14]; michael@0: } Filler_RDMAB; michael@0: struct { michael@0: ULONG Filler[9]; michael@0: } Filler_R; michael@0: struct { michael@0: ULONG Filler[4]; michael@0: D3DKMTQS_COUNTER Filler2; michael@0: } Filler_P; michael@0: struct { michael@0: D3DKMTQS_COUNTER Filler[16]; michael@0: ULONG Filler2[2]; michael@0: } Filler_PF; michael@0: struct { michael@0: ULONGLONG Filler[8]; michael@0: } Filler_PT; michael@0: struct { michael@0: ULONG Filler[2]; michael@0: } Filler_SR; michael@0: struct { michael@0: ULONG Filler[7]; michael@0: } Filler_L; michael@0: struct { michael@0: D3DKMTQS_COUNTER Filler[7]; michael@0: } Filler_A; michael@0: struct { michael@0: D3DKMTQS_COUNTER Filler[4]; michael@0: } Filler_T; michael@0: ULONG64 Reserved[8]; michael@0: } D3DKMTQS_ADAPTER_INFO; michael@0: michael@0: typedef struct _D3DKMTQS_SEGMENT_INFO_WIN7 michael@0: { michael@0: ULONG Filler[3]; michael@0: struct { michael@0: ULONGLONG Filler; michael@0: ULONG Filler2[2]; michael@0: } Filler_M; michael@0: michael@0: ULONG Aperture; michael@0: michael@0: ULONGLONG Filler3[5]; michael@0: ULONG64 Filler4[8]; michael@0: } D3DKMTQS_SEGMENT_INFO_WIN7; michael@0: michael@0: typedef struct _D3DKMTQS_SEGMENT_INFO_WIN8 michael@0: { michael@0: ULONGLONG Filler[3]; michael@0: struct { michael@0: ULONGLONG Filler; michael@0: ULONG Filler2[2]; michael@0: } Filler_M; michael@0: michael@0: ULONG Aperture; michael@0: michael@0: ULONGLONG Filler3[5]; michael@0: ULONG64 Filler4[8]; michael@0: } D3DKMTQS_SEGMENT_INFO_WIN8; michael@0: michael@0: typedef struct _D3DKMTQS_SYSTEM_MEMORY michael@0: { michael@0: ULONGLONG BytesAllocated; michael@0: ULONG Filler[2]; michael@0: ULONGLONG Filler2[7]; michael@0: } D3DKMTQS_SYSTEM_MEMORY; michael@0: michael@0: typedef struct _D3DKMTQS_PROCESS_INFO michael@0: { michael@0: ULONG Filler[2]; michael@0: struct { michael@0: ULONGLONG BytesAllocated; michael@0: michael@0: ULONG Filler[2]; michael@0: ULONGLONG Filler2[7]; michael@0: } SystemMemory; michael@0: ULONG64 Reserved[8]; michael@0: } D3DKMTQS_PROCESS_INFO; michael@0: michael@0: typedef struct _D3DKMTQS_PROCESS_SEGMENT_INFO michael@0: { michael@0: union { michael@0: struct { michael@0: ULONGLONG BytesCommitted; michael@0: } Win8; michael@0: struct { michael@0: ULONG BytesCommitted; michael@0: ULONG UnknownRandomness; michael@0: } Win7; michael@0: }; michael@0: michael@0: ULONGLONG Filler[2]; michael@0: ULONG Filler2; michael@0: struct { michael@0: ULONG Filler; michael@0: D3DKMTQS_COUNTER Filler2[6]; michael@0: ULONGLONG Filler3; michael@0: } Filler3; michael@0: struct { michael@0: ULONGLONG Filler; michael@0: } Filler4; michael@0: ULONG64 Reserved[8]; michael@0: } D3DKMTQS_PROCESS_SEGMENT_INFO; michael@0: michael@0: typedef enum _D3DKMTQS_TYPE michael@0: { michael@0: D3DKMTQS_ADAPTER = 0, michael@0: D3DKMTQS_PROCESS = 1, michael@0: D3DKMTQS_SEGMENT = 3, michael@0: D3DKMTQS_PROCESS_SEGMENT = 4, michael@0: } D3DKMTQS_TYPE; michael@0: michael@0: typedef union _D3DKMTQS_RESULT michael@0: { michael@0: D3DKMTQS_ADAPTER_INFO AdapterInfo; michael@0: D3DKMTQS_SEGMENT_INFO_WIN7 SegmentInfoWin7; michael@0: D3DKMTQS_SEGMENT_INFO_WIN8 SegmentInfoWin8; michael@0: D3DKMTQS_PROCESS_INFO ProcessInfo; michael@0: D3DKMTQS_PROCESS_SEGMENT_INFO ProcessSegmentInfo; michael@0: } D3DKMTQS_RESULT; michael@0: michael@0: typedef struct _D3DKMTQS_QUERY_SEGMENT michael@0: { michael@0: ULONG SegmentId; michael@0: } D3DKMTQS_QUERY_SEGMENT; michael@0: michael@0: typedef struct _D3DKMTQS michael@0: { michael@0: D3DKMTQS_TYPE Type; michael@0: LUID AdapterLuid; michael@0: HANDLE hProcess; michael@0: D3DKMTQS_RESULT QueryResult; michael@0: michael@0: union michael@0: { michael@0: D3DKMTQS_QUERY_SEGMENT QuerySegment; michael@0: D3DKMTQS_QUERY_SEGMENT QueryProcessSegment; michael@0: }; michael@0: } D3DKMTQS; michael@0: michael@0: extern "C" { michael@0: typedef __checkReturn NTSTATUS (APIENTRY *PFND3DKMTQS)(const D3DKMTQS *); michael@0: }